/* Tablet & Small Laptop */
@media (max-width: 900px) {
  .hud-layer {
    flex-direction: column;
    align-items: stretch;
  }
  .hud-right {
    justify-content: flex-end;
  }
  .magic-actions {
    right: 14px;
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile Phones (Portrait & Narrow Screens) */
@media (max-width: 640px) {
  .hud-layer {
    left: 10px;
    right: 10px;
    top: calc(10px + env(safe-area-inset-top, 0px));
    gap: 8px;
  }
  body.is-browser .hud-layer {
    top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .hud-left {
    justify-content: space-between;
    width: 100%;
  }
  .hud-right {
    justify-content: center;
    width: 100%;
    gap: 6px;
  }

  .countdown-pill {
    padding: 6px 10px;
    flex: 1;
    min-width: 0;
  }
  .countdown-label {
    font-size: 8.5px;
  }
  .countdown-clock {
    font-size: 11px;
  }
  .secrets-pill {
    padding: 7px 11px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .icon-pill .btn-label {
    display: none;
  }
  .icon-pill {
    min-width: 40px;
    min-height: 36px;
    justify-content: center;
    padding: 7px 10px;
  }

  .toast-stack {
    top: calc(108px + env(safe-area-inset-top, 0px));
    width: calc(100vw - 24px);
  }
  .toast-msg {
    font-size: 12px;
    padding: 8px 14px;
    text-align: center;
  }

  .magic-actions {
    left: 10px;
    right: 10px;
    bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }
  .magic-cta {
    flex: 1;
    padding: 10px 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .music-player {
    left: 10px;
    right: 10px;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    width: auto;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 16px;
  }
  .player-art-wrap {
    width: 40px;
    height: 40px;
  }
  .track-title {
    font-size: 12px;
  }
  .track-artist {
    font-size: 10px;
  }
  .volume-wrap {
    display: none;
  }
  .ctrl-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .ctrl-play {
    width: 38px;
    height: 38px;
  }
  .playlist-drawer {
    max-height: 45dvh;
  }

  .final-card {
    padding: 22px 18px 18px;
    max-height: 76dvh;
    overflow-y: auto;
  }
  .secret-card {
    padding: 22px 16px;
    max-height: 82dvh;
    overflow-y: auto;
  }

  .creator-watermark {
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    font-size: 9.5px;
    padding: 4px 12px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
}

/* Landscape Mobile Phones */
@media (max-height: 500px) and (orientation: landscape) {
  .intro-content {
    gap: 6px;
  }
  .switch-stage {
    margin-top: 6px;
  }
  .switch-plate {
    transform: scale(0.84);
  }
  .magic-actions {
    bottom: 92px;
    right: 12px;
  }
  .music-player {
    bottom: 34px;
    left: 12px;
    width: 360px;
    padding: 6px 10px;
  }
  .final-card {
    padding: 16px 20px;
    max-height: 84dvh;
    overflow-y: auto;
  }
}
