/* ═══════════════════════════════════════════════════
   highwayy.app — cinematic long-drive companion
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0c;
  --fg: #f4f1ea;
  --fg-dim: rgba(244, 241, 234, 0.55);
  --fg-mute: rgba(244, 241, 234, 0.35);
  --glass: rgba(12, 12, 16, 0.45);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent: #4a7c9b;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

/* ─── Scenes (moving backgrounds) ────────────────── */

.scenes {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 1.5s var(--ease);
  pointer-events: none;
  overflow: hidden;
}

.scene.active {
  opacity: 1;
  z-index: 1;
}

/* Continuous slow pan — feels like the road is moving */
.scene-motion {
  position: absolute;
  inset: -8%;
  will-change: transform;
}

.scene.active .scene-motion {
  animation: drive-pan 42s ease-in-out infinite alternate;
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Bias slightly downward so road surface stays in frame */
  object-position: center 55%;
  display: block;
  filter: saturate(1.06) contrast(1.03);
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

/* Per-mode framing — keep the road / vanishing point visible */
.scene[data-mode="rain"] .scene-img,
.scene[data-mode="foggy"] .scene-img {
  object-position: center 58%;
}
.scene[data-mode="coastal"] .scene-img {
  object-position: 42% 52%;
}
.scene[data-mode="desert"] .scene-img {
  object-position: center 50%;
}
.scene[data-mode="mountain"] .scene-img {
  object-position: center 62%;
}
.scene[data-mode="midnight"] .scene-img {
  object-position: center 55%;
}
.scene[data-mode="snowy"] .scene-img {
  object-position: center 60%;
}

.scene.active .scene-img {
  animation: drive-zoom 55s ease-in-out infinite alternate;
}

/* Slight forward “drive” drift */
@keyframes drive-pan {
  0%   { transform: translate3d(0%, 0%, 0) scale(1); }
  33%  { transform: translate3d(-1.6%, -0.5%, 0) scale(1.02); }
  66%  { transform: translate3d(1%, -0.9%, 0) scale(1.035); }
  100% { transform: translate3d(-1.2%, 0.4%, 0) scale(1.05); }
}

@keyframes drive-zoom {
  0%   { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1.06) translate3d(-0.5%, -0.3%, 0); }
}

/* Soft motion streaks (speed feel) */
.scene-streak {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    105deg,
    transparent 0,
    transparent 48px,
    rgba(255, 255, 255, 0.012) 48px,
    rgba(255, 255, 255, 0.012) 50px
  );
  mix-blend-mode: soft-light;
}

.scene.active .scene-streak {
  opacity: 1;
  animation: streak-drift 18s linear infinite;
}

@keyframes streak-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50px, 12px, 0); }
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 48%, transparent 35%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.28) 16%, transparent 38%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0%, transparent 22%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  animation: grain 0.5s steps(4) infinite;
  mix-blend-mode: overlay;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, 2%); }
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.yt-host {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  bottom: 0;
  left: 0;
}

/* ─── Top bar ────────────────────────────────────── */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(20px + var(--safe-t)) 28px 0;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
}

.logo {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.logo-dot {
  color: var(--accent);
  transition: color 0.8s var(--ease);
}

.tagline {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
  max-width: 280px;
  transition: opacity 0.5s;
}

.status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5dce8a;
  box-shadow: 0 0 8px #5dce8a;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.status-label {
  color: var(--fg-mute);
  font-weight: 400;
}

.clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: var(--fg-mute);
}

/* ─── Mode announce ──────────────────────────────── */

.mode-announce {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  text-align: center;
}

.mode-announce.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mode-announce-label {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
}

/* ─── Bottom dock (modes + player, no overlap) ───── */

.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 25;
  width: min(680px, calc(100vw - 16px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 0 calc(14px + var(--safe-b));
  pointer-events: none;
}

.bottom-dock > * {
  pointer-events: auto;
}

/* ─── Mode nav ───────────────────────────────────── */

.mode-nav {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 1;
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.mode-nav::-webkit-scrollbar {
  display: none;
}

/* ─── Player foot: install + credit (below player card) ─ */

.player-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  pointer-events: auto;
}

/* Secondary install cue — in flow under player, never over modes */
.install-btn {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(280px, 92%);
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(244, 241, 234, 0.42);
  font-size: 0.64rem;
  font-weight: 450;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
  opacity: 1;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.install-btn:hover {
  color: rgba(244, 241, 234, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.install-btn:active {
  transform: scale(0.98);
}

.install-btn[hidden] {
  display: none !important;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 11px;
  border-radius: 999px;
  min-width: 58px;
  color: var(--fg-dim);
  transition: background 0.35s var(--ease), color 0.35s, transform 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mode-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mode-btn:active {
  transform: scale(0.96);
}

.mode-icon {
  font-size: 0.95rem;
  line-height: 1;
  filter: grayscale(0.2);
}

.mode-btn.active .mode-icon {
  filter: none;
}

.mode-name {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ─── Player ─────────────────────────────────────── */

.player {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 2;
  width: 100%;
  flex-shrink: 0;
}

.player-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 14px 10px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.player-art-wrap {
  grid-row: 1 / 3;
  align-self: center;
}

.player-art {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.12),
    0 4px 20px rgba(0, 0, 0, 0.4);
  background: #1a1a1e;
}

.player-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s;
}

.player-art-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.player-art.spinning {
  animation: spin 12s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.player-meta {
  grid-column: 2;
  min-width: 0;
  padding-top: 2px;
}

.player-title {
  font-size: 0.9rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.player-artist {
  font-size: 0.72rem;
  color: var(--fg-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-progress-wrap {
  margin-top: 8px;
}

.player-progress {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  overflow: hidden;
  transition: height 0.2s;
}

.player-progress:hover {
  height: 5px;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #fff);
  transition: width 0.2s linear;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.player-times {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.player-controls {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  justify-self: end;
  align-self: center;
}

.ctrl-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  color: var(--fg-dim);
  line-height: 0;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

.ctrl-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ctrl-btn:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}

.ctrl-btn:active {
  transform: scale(0.92);
}

.ctrl-play {
  width: 44px;
  height: 44px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ctrl-play svg {
  width: 22px;
  height: 22px;
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
}

/* Default: show play, hide pause */
.ctrl-play .icon-play {
  display: block;
  /* optical center for triangle */
  transform: translateX(1px);
}

.ctrl-play .icon-pause {
  display: none;
}

/* Playing: show pause, hide play */
.ctrl-play.is-playing .icon-play {
  display: none;
}

.ctrl-play.is-playing .icon-pause {
  display: block;
  transform: none;
}

.ctrl-play:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ctrl-sm {
  width: 30px;
  height: 30px;
}

.ctrl-sm svg {
  width: 16px;
  height: 16px;
}

.player-extras {
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 2px;
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 64px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.credit {
  text-align: center;
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.2);
  text-transform: lowercase;
}

/* ─── Intro ──────────────────────────────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(6, 6, 8, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.intro.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-card {
  text-align: center;
  padding: 40px 36px;
  border-radius: 28px;
  background: rgba(14, 14, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  animation: introIn 1s var(--ease) both;
}

@keyframes introIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.intro-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 12px;
}

.intro-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.intro-sub {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

.intro-btn {
  margin-top: 28px;
  padding: 14px 36px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: #0a0a0c;
  background: var(--fg);
  box-shadow: 0 4px 24px rgba(255, 255, 255, 0.15);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.intro-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 32px rgba(255, 255, 255, 0.22);
}

.intro-btn:active {
  transform: scale(0.98);
}

/* ─── Toast ──────────────────────────────────────── */

.toast {
  position: fixed;
  top: calc(24px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  background: rgba(20, 20, 24, 0.85);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 900px) {
  /*
   * Portrait phones crop landscape art heavily with object-fit: cover.
   * Prefer the lower-center (road + vanishing point) and ease motion
   * so less of the road is pan-cropped away.
   */
  .scene-motion {
    inset: -4% -6% -2% -6%;
  }

  .scene-img {
    /* “cover” still fills the screen; position keeps asphalt in view */
    object-fit: cover;
    object-position: center 68%;
  }

  .scene[data-mode="rain"] .scene-img,
  .scene[data-mode="foggy"] .scene-img {
    object-position: center 72%;
  }
  .scene[data-mode="coastal"] .scene-img {
    object-position: 38% 65%;
  }
  .scene[data-mode="desert"] .scene-img {
    object-position: center 58%;
  }
  .scene[data-mode="mountain"] .scene-img {
    object-position: center 70%;
  }
  .scene[data-mode="midnight"] .scene-img {
    object-position: center 66%;
  }
  .scene[data-mode="snowy"] .scene-img {
    object-position: center 70%;
  }

  .scene.active .scene-motion {
    animation: drive-pan-mobile 50s ease-in-out infinite alternate;
  }

  .scene.active .scene-img {
    animation: drive-zoom-mobile 60s ease-in-out infinite alternate;
  }

  @keyframes drive-pan-mobile {
    0%   { transform: translate3d(0%, 0%, 0) scale(1); }
    50%  { transform: translate3d(-0.8%, -0.4%, 0) scale(1.015); }
    100% { transform: translate3d(0.6%, 0.3%, 0) scale(1.03); }
  }

  @keyframes drive-zoom-mobile {
    0%   { transform: scale(1); }
    100% { transform: scale(1.04) translate3d(0, -0.4%, 0); }
  }

  /* Lighter bottom vignette so the road isn’t crushed into darkness under the UI */
  .vignette {
    background:
      radial-gradient(ellipse 90% 75% at 50% 42%, transparent 38%, rgba(0, 0, 0, 0.42) 100%),
      linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.22) 14%, transparent 34%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0%, transparent 18%);
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: calc(14px + var(--safe-t)) 16px 0;
  }

  .tagline {
    max-width: 180px;
    font-size: 0.7rem;
  }

  .bottom-dock {
    width: calc(100vw - 12px);
    gap: 8px;
    padding-bottom: calc(10px + var(--safe-b));
  }

  .mode-nav {
    gap: 2px;
    padding: 4px;
    max-width: 100%;
    justify-content: flex-start;
  }

  .mode-btn {
    min-width: 48px;
    padding: 6px 8px;
  }

  .mode-name {
    font-size: 0.52rem;
  }

  .player-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px 10px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .player-art-wrap {
    grid-row: 1;
  }

  .player-art {
    width: 46px;
    height: 46px;
  }

  .player-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .player-controls {
    grid-column: 1 / 3;
    grid-row: 2;
    justify-self: center;
    gap: 14px;
  }

  .player-extras {
    grid-column: 1 / 3;
    grid-row: 3;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .vol-slider {
    width: 48px;
  }

  .credit {
    display: none;
  }

  .player-foot {
    margin-top: 8px;
    gap: 0;
  }

  .install-btn {
    font-size: 0.6rem;
    padding: 8px 14px;
    max-width: 94%;
    white-space: normal;
  }

  .player-title {
    font-size: 0.84rem;
  }
}

@media (max-width: 380px) {
  .mode-name {
    display: none;
  }

  .mode-btn {
    min-width: 40px;
    padding: 8px 7px;
  }
}

@media (min-width: 900px) {
  .player-art {
    width: 64px;
    height: 64px;
  }

  .bottom-dock {
    gap: 12px;
    padding-bottom: calc(18px + var(--safe-b));
  }
}

/* Short viewports (landscape phones, small laptops) */
@media (max-height: 560px) {
  .bottom-dock {
    gap: 6px;
    padding-bottom: calc(8px + var(--safe-b));
  }

  .mode-btn {
    flex-direction: row;
    gap: 5px;
    min-width: auto;
    padding: 6px 10px;
  }

  .credit {
    display: none;
  }

  .player-extras {
    display: none;
  }
}

/* Landscape phones / short height: keep more horizontal road width */
@media (max-height: 480px) and (orientation: landscape) {
  .scene-img {
    object-position: center 48%;
  }
  .scene-motion {
    inset: -3%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scene.active .scene-motion,
  .scene.active .scene-img,
  .scene.active .scene-streak {
    animation: none;
  }
  .player-art.spinning {
    animation: none;
  }
  .grain {
    animation: none;
  }
  .scene {
    transition-duration: 0.4s;
  }
  .scene-motion {
    inset: -2%;
  }
}
