/* chai-e-lofi — Cinematic Indian night tapri */

:root {
  --night-deep: #060d14;
  --night: #0a1520;
  --night-mid: #122033;
  --blue-haze: #1a3350;
  --amber: #e8a54b;
  --amber-dim: #c4782a;
  --amber-glow: rgba(232, 165, 75, 0.45);
  --chai: #8b4513;
  --chai-light: #c17a3a;
  --steel: #b8c0c8;
  --wood: #5c3a21;
  --wood-light: #8b5a2b;
  --fog: rgba(180, 200, 220, 0.08);
  --text: #f2e8d5;
  --text-muted: #a89880;
  --danger-soft: #c45c4a;
  --panel: rgba(8, 14, 22, 0.88);
  --panel-border: rgba(232, 165, 75, 0.22);
  --focus: #f0c878;
  --radius: 10px;
  --font-display: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif;
  --font-body: "Segoe UI", "Helvetica Neue", Candara, Calibri, sans-serif;
  --ease-slow: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rain-canvas {
    opacity: 0.15 !important;
  }
  .steam {
    animation: none !important;
    opacity: 0.35;
  }
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--night-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: var(--night-deep);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

button,
input {
  font: inherit;
}

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

/* ——— Atmosphere layers ——— */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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");
  mix-blend-mode: overlay;
}

.rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease-slow);
}

.rain-canvas.is-on {
  opacity: 0.85;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--night-deep);
  background-image: url("../images/tapri-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 13, 20, 0.4) 0%, rgba(6, 13, 20, 0.1) 35%, rgba(6, 13, 20, 0.55) 100%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(6, 13, 20, 0.35), transparent 70%);
  pointer-events: none;
}

body[data-rain="heavy"] .sky::before,
body[data-rain="light"] .sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(80, 120, 160, 0.08), rgba(40, 70, 100, 0.18));
  pointer-events: none;
  transition: opacity 1.2s var(--ease-slow);
}

.buildings {
  position: absolute;
  bottom: 28%;
  left: 0;
  right: 0;
  height: 32%;
  background:
    linear-gradient(90deg, transparent 0%, transparent 8%, #0c1828 8%, #0c1828 14%, transparent 14%),
    linear-gradient(90deg, transparent 18%, #0e1a2a 18%, #0e1a2a 28%, transparent 28%),
    linear-gradient(90deg, transparent 35%, #0a1624 35%, #0a1624 42%, transparent 42%),
    linear-gradient(90deg, transparent 48%, #101c2c 48%, #101c2c 62%, transparent 62%),
    linear-gradient(90deg, transparent 68%, #0c1826 68%, #0c1826 78%, transparent 78%),
    linear-gradient(90deg, transparent 84%, #0e1a28 84%, #0e1a28 96%, transparent 96%);
  opacity: 0.9;
  mask-image: linear-gradient(180deg, transparent, #000 30%);
}

.buildings::after {
  content: "";
  position: absolute;
  inset: 20% 0 0;
  background-image: radial-gradient(circle, rgba(255, 200, 100, 0.35) 0 1px, transparent 2px);
  background-size: 28px 36px;
  background-position: 12px 8px;
  opacity: 0.45;
}

.street-lights {
  position: absolute;
  bottom: 30%;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.street-light {
  width: 4px;
  height: 70px;
  background: linear-gradient(#2a3545, #1a2430);
  position: relative;
}

.street-light::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.35), transparent 70%);
}

.street-light[data-flicker].is-flickering::after {
  animation: flicker 0.4s steps(2) 3;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

.road {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, #121820 0%, #0a0e14 100%);
  overflow: hidden;
}

.road-reflection {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 200, 120, 0.06) 50%, transparent 52%),
    linear-gradient(180deg, rgba(100, 140, 180, 0.08), transparent 40%);
  opacity: 0.5;
}

body[data-rain="heavy"] .road-reflection,
body[data-rain="light"] .road-reflection {
  opacity: 0.85;
  background:
    linear-gradient(90deg, transparent 47%, rgba(180, 210, 240, 0.12) 50%, transparent 53%),
    linear-gradient(180deg, rgba(120, 160, 200, 0.15), transparent 50%),
    repeating-linear-gradient(
      95deg,
      transparent,
      transparent 40px,
      rgba(200, 220, 255, 0.03) 40px,
      rgba(200, 220, 255, 0.03) 42px
    );
}

.vehicle {
  position: absolute;
  bottom: 35%;
  width: 48px;
  height: 18px;
  border-radius: 4px 10px 4px 4px;
  background: #1a222c;
  opacity: 0;
  transform: translateX(-80px);
}

.vehicle::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 4px;
  width: 16px;
  height: 10px;
  background: rgba(255, 220, 150, 0.5);
  border-radius: 2px;
  filter: blur(2px);
}

.vehicle.passing {
  animation: pass-right 4.5s var(--ease-slow) forwards;
}

.vehicle.auto {
  width: 56px;
  height: 22px;
  border-radius: 8px 12px 4px 4px;
}

@keyframes pass-right {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  10% {
    opacity: 0.9;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(100vw + 100px));
  }
}

.walker {
  position: absolute;
  bottom: 42%;
  width: 10px;
  height: 28px;
  background: #151c24;
  border-radius: 3px;
  opacity: 0;
}

.walker.passing {
  animation: walk-by 8s linear forwards;
}

@keyframes walk-by {
  0% {
    opacity: 0;
    transform: translateX(100vw);
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateX(-40px);
  }
}

/* ——— Scene / Intro ——— */
.scene {
  position: relative;
  z-index: 5;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 6rem;
  transition: transform 2.4s var(--ease-slow), filter 2.4s var(--ease-slow);
}

.scene[data-phase="seated"] {
  transform: none;
  filter: brightness(1.05);
}

.experience {
  width: min(420px, 100%);
  margin: 0 auto;
  animation: fade-up 1.2s var(--ease-slow) both;
}

.experience[hidden] {
  display: none !important;
}

.intro {
  text-align: center;
  max-width: 28rem;
  padding: 1.5rem 1.25rem;
  border-radius: 16px;
  background: rgba(6, 13, 20, 0.55);
  border: 1px solid rgba(232, 165, 75, 0.15);
  backdrop-filter: blur(8px);
  animation: fade-up 1.4s var(--ease-slow) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.time-whisper {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--text);
  text-shadow:
    0 0 40px var(--amber-glow),
    0 2px 0 rgba(0, 0, 0, 0.5);
}

.tagline {
  margin: 1.25rem 0 2.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-style: italic;
  color: var(--amber);
  line-height: 1.45;
  text-shadow: 0 0 24px var(--amber-glow);
}

.btn-sit {
  display: inline-block;
  padding: 0.95rem 2.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--night-deep);
  background: linear-gradient(160deg, #f0c878, var(--amber) 45%, var(--amber-dim));
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255, 220, 150, 0.3),
    0 8px 32px rgba(232, 165, 75, 0.35);
  transition: transform 0.25s var(--ease-slow), box-shadow 0.25s;
}

.btn-sit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 220, 150, 0.45),
    0 12px 40px rgba(232, 165, 75, 0.45);
}

.btn-sit:active {
  transform: translateY(0);
}

.hint {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.intro.is-leaving {
  animation: fade-out 1.2s var(--ease-slow) forwards;
  pointer-events: none;
}

@keyframes fade-out {
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
}

/* ——— Tapri ——— */
.tapri {
  width: min(920px, 100%);
  margin: 0 auto;
}

.tapri[hidden] {
  display: none !important;
}

.tapri.is-entering .tapri-stage {
  animation: approach 2.6s var(--ease-slow) both;
}

@keyframes approach {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(40px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.tapri-stage {
  position: relative;
  min-height: min(70vh, 640px);
  padding: 2rem 1rem 1rem;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 20%, var(--amber-glow), transparent 55%),
    linear-gradient(180deg, rgba(20, 28, 38, 0.4), rgba(8, 12, 18, 0.75));
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.45);
}

.bulb-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 100, 0.35), transparent 70%);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.75;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.06);
  }
}

.hanging-bulb {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.cord {
  display: block;
  width: 2px;
  height: 36px;
  margin: 0 auto;
  background: #3a4048;
}

.bulb {
  display: block;
  width: 22px;
  height: 28px;
  margin: 0 auto;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 40% 35%, #fff6d0, var(--amber) 55%, var(--amber-dim));
  box-shadow: 0 0 30px 8px var(--amber-glow);
}

.stall-roof {
  position: absolute;
  top: 6%;
  left: 8%;
  right: 8%;
  height: 28px;
  background: linear-gradient(180deg, #2a2018, #1a1410);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.stall-roof::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -10px;
  height: 10px;
  background: repeating-linear-gradient(90deg, #3a2a1c 0 12px, #2a1e14 12px 24px);
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}

.stall-counter {
  position: absolute;
  top: 18%;
  left: 10%;
  right: 10%;
  height: 12px;
  background: linear-gradient(180deg, #4a3828, #2e2218);
  border-radius: 2px;
}

/* Radio */
.radio-wrap {
  position: absolute;
  top: 24%;
  left: 6%;
  z-index: 6;
  max-width: 140px;
}

.radio {
  display: block;
  width: 112px;
  padding: 0.65rem 0.55rem 0.5rem;
  background: linear-gradient(160deg, #3a322c, #1e1a16);
  border: 1px solid rgba(180, 160, 130, 0.25);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.radio:hover,
.radio[aria-pressed="true"] {
  box-shadow: 0 0 20px rgba(232, 165, 75, 0.25);
}

.radio[aria-pressed="true"] {
  transform: scale(1.03);
}

.radio-speaker {
  display: block;
  height: 36px;
  margin-bottom: 0.35rem;
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 40%, #2a2622 2px, transparent 3px),
    radial-gradient(circle at 50% 60%, #2a2622 2px, transparent 3px),
    radial-gradient(circle at 70% 35%, #2a2622 2px, transparent 3px),
    #151210;
  background-size: 8px 8px, 8px 8px, 8px 8px, auto;
}

.radio-dial {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #8a7a68;
  background: conic-gradient(from 40deg, #c4a882, #5a4a38, #c4a882);
  vertical-align: middle;
}

.radio-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: #3a2020;
  vertical-align: middle;
  transition: background 0.3s, box-shadow 0.3s;
}

.radio[aria-pressed="true"] .radio-led {
  background: #e06040;
  box-shadow: 0 0 8px #e06040;
}

.radio-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.radio-message {
  margin: 0.5rem 0 0;
  min-height: 2.5em;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--amber);
  line-height: 1.35;
  text-shadow: 0 0 12px var(--amber-glow);
}

/* Table & chai */
.table-area {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: min(320px, 80%);
  height: 200px;
  z-index: 5;
}

.wooden-table {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border-radius: 4px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.wooden-table::before,
.wooden-table::after {
  content: "";
  position: absolute;
  bottom: -36px;
  width: 10px;
  height: 36px;
  background: #3a2414;
}

.wooden-table::before {
  left: 18%;
}
.wooden-table::after {
  right: 18%;
}

.stool {
  position: absolute;
  bottom: 0;
  right: -10%;
  width: 48px;
  height: 52px;
  background: #1a4a6e;
  border-radius: 4px 4px 2px 2px;
  opacity: 0.85;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.08);
}

.biscuits {
  position: absolute;
  bottom: 72px;
  left: 12%;
  width: 36px;
  height: 44px;
  background: linear-gradient(160deg, #d4a06a, #a06838);
  border-radius: 3px;
  box-shadow: 2px 0 0 #8b5530;
}

.kettle {
  position: absolute;
  bottom: 70px;
  right: 14%;
  width: 42px;
  height: 36px;
  background: linear-gradient(135deg, #d0d8e0, #8a949e);
  border-radius: 40% 40% 30% 30%;
  box-shadow: 0 0 12px rgba(200, 220, 240, 0.15);
}

.kettle::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 10px;
  background: #a0a8b0;
  border-radius: 4px 4px 0 0;
}

.chai-glass {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  padding: 0;
  z-index: 7;
  transition: transform 0.35s var(--ease-slow);
}

.chai-glass:hover {
  transform: translateX(-50%) translateY(-2px);
}

.chai-glass.is-sipping {
  animation: sip 0.55s var(--ease-slow);
}

@keyframes sip {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  40% {
    transform: translateX(-50%) rotate(-8deg) translateY(-4px);
  }
}

.glass-body {
  position: relative;
  display: block;
  width: 44px;
  height: 58px;
  margin: 0 auto;
  border: 2px solid rgba(200, 210, 220, 0.7);
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent 40%, rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 -4px 12px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(232, 165, 75, 0.2);
  overflow: hidden;
}

.chai-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72%;
  background: linear-gradient(180deg, var(--chai-light), var(--chai));
  transition: background 0.6s, height 0.4s;
}

body[data-chai="adrak"] .chai-liquid {
  background: linear-gradient(180deg, #c48a3a, #7a3e12);
}
body[data-chai="masala"] .chai-liquid {
  background: linear-gradient(180deg, #b86a2e, #5c2808);
}
body[data-chai="irani"] .chai-liquid {
  background: linear-gradient(180deg, #d4a060, #8b5420);
  height: 78%;
}

.steam {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 8px;
  height: 28px;
  border-radius: 50%;
  background: rgba(220, 230, 240, 0.35);
  filter: blur(3px);
  animation: steam-rise 2.8s ease-in-out infinite;
  opacity: 0;
}

.steam-1 {
  margin-left: -10px;
  animation-delay: 0s;
}
.steam-2 {
  margin-left: 0;
  height: 36px;
  animation-delay: 0.7s;
}
.steam-3 {
  margin-left: 8px;
  animation-delay: 1.4s;
}

.chai-glass.is-steaming .steam,
.scene[data-phase="seated"] .steam {
  opacity: 1;
}

@keyframes steam-rise {
  0% {
    transform: translateY(8px) scaleX(1);
    opacity: 0;
  }
  30% {
    opacity: 0.55;
  }
  100% {
    transform: translateY(-40px) scaleX(1.6);
    opacity: 0;
  }
}

.chai-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* City tint */
body[data-city="delhi"] .sky {
  filter: hue-rotate(-8deg) brightness(0.95);
}
body[data-city="pune"] .sky {
  filter: saturate(0.9) brightness(1.05);
}
body[data-city="bangalore"] .sky {
  filter: hue-rotate(6deg) saturate(0.85);
}
body[data-city="kolkata"] .sky {
  filter: hue-rotate(-14deg) contrast(1.05);
}
body[data-city="mumbai"] .sky {
  filter: none;
}

body[data-chai="masala"] .bulb-glow {
  background: radial-gradient(circle, rgba(255, 160, 80, 0.4), transparent 70%);
}
body[data-chai="irani"] .bulb-glow {
  background: radial-gradient(circle, rgba(255, 210, 140, 0.4), transparent 70%);
}
body[data-chai="adrak"] .bulb-glow {
  background: radial-gradient(circle, rgba(220, 180, 100, 0.38), transparent 70%);
}

/* Spotify cassette dock */
.player-dock {
  position: relative;
  z-index: 8;
  margin: 0 auto;
  max-width: 420px;
  padding: 0 0.5rem 1rem;
  animation: fade-up 1s 0.3s var(--ease-slow) both;
}

.player-dock[hidden] {
  display: none !important;
}

.now-playing {
  text-align: center;
  margin-bottom: 0.75rem;
}

.now-playing-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
}

.experience-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text);
  text-shadow: 0 0 40px var(--amber-glow);
  transition: font-size 0.8s var(--ease-slow);
}

.experience-tagline {
  margin: 0.65rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  font-style: italic;
  color: var(--amber);
  line-height: 1.45;
  text-shadow: 0 0 24px var(--amber-glow);
  transition: font-size 0.8s var(--ease-slow);
}

.scene[data-phase="seated"] .experience-brand {
  font-size: clamp(2.8rem, 10vw, 4.2rem);
}

.scene[data-phase="seated"] .experience-tagline {
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
}

.now-playing-title {
  margin: 0.25rem 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.spotify-attr {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cassette-frame {
  padding: 0.85rem 0.75rem 0.65rem;
  background: linear-gradient(165deg, #3a322c 0%, #1c1814 50%, #2a241e 100%);
  border: 1px solid rgba(180, 160, 130, 0.3);
  border-radius: 12px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cassette-top {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 0.55rem;
}

.reel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #6a5a48;
  background: radial-gradient(circle, #2a2218 40%, #4a3a2c 41%);
  animation: spin-reel 8s linear infinite;
  animation-play-state: paused;
}

.player-dock.is-active .reel {
  animation-play-state: running;
}

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

.spotify-mount {
  border-radius: 8px;
  overflow: hidden;
  background: #121212;
  min-height: 152px;
}

.spotify-mount iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
}

.playlist-powered {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.spotify-error {
  padding: 1.25rem;
  text-align: center;
  color: var(--danger-soft);
  font-size: 0.9rem;
}

/* ——— Controls panel ——— */
.controls {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));
  transform: translateY(110%);
  transition: transform 0.4s var(--ease-slow);
}

.controls.is-open {
  transform: translateY(0);
}

.controls[hidden] {
  display: none !important;
}

/* ——— Rain bar (bottom) ——— */
.controls-rain {
  transform: none;
  max-height: none;
  overflow: visible;
  padding: 0.85rem 1.25rem calc(0.85rem + var(--safe-bottom));
}

.controls-rain .controls-inner {
  max-width: 420px;
  margin: 0 auto;
}

.controls-rain[hidden] {
  display: none !important;
}

@media (min-width: 900px) {
  .controls-rain {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 899px) {
  .controls:not(.is-open) {
    pointer-events: none;
    visibility: hidden;
  }

  .controls.is-open {
    visibility: visible;
    pointer-events: auto;
  }
}

.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.controls-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.btn-text {
  font-size: 0.8rem;
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sliders {
  display: grid;
  gap: 0.55rem;
}

.slider-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.slider-name {
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.slider-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.75rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber-glow);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.preset {
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 165, 75, 0.35);
  color: var(--text);
  background: rgba(232, 165, 75, 0.08);
  min-height: 36px;
}

.preset:hover,
.preset.is-active {
  background: rgba(232, 165, 75, 0.22);
  border-color: var(--amber);
}

.option-groups {
  display: grid;
  gap: 0.85rem;
}

.opt-set {
  margin: 0;
  padding: 0;
  border: none;
}

.opt-set legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.45rem 0.75rem;
  min-height: 40px;
  font-size: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.chip.active,
.chip[aria-pressed="true"] {
  border-color: var(--amber);
  background: rgba(232, 165, 75, 0.18);
  color: var(--amber);
}

.btn-night {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  min-height: 48px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--night-deep);
  background: linear-gradient(160deg, #f0c878, var(--amber));
  border-radius: var(--radius);
}

.fab-controls {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(1rem + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 0.75rem 1.4rem;
  min-height: 48px;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--night-deep);
  background: var(--amber);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.fab-controls[hidden] {
  display: none !important;
}

@media (max-width: 899px) {
  .fab-controls:not([hidden]) {
    display: block;
  }

  .controls.is-open ~ .fab-controls,
  body.controls-open .fab-controls {
    bottom: auto;
    top: auto;
  }

  body.controls-open .fab-controls {
    bottom: calc(min(72vh, 560px) + 0.5rem);
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  max-height: 90dvh;
  overflow: auto;
  padding: 1.25rem;
  background: var(--night-mid);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.modal-card h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  text-align: center;
}

#share-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--night);
}

.share-text {
  margin: 0.85rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-actions button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(232, 165, 75, 0.2);
  border: 1px solid rgba(232, 165, 75, 0.4);
}

.modal-actions .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Seated layout tweak: room for player + rain bar */
.scene[data-phase="seated"] {
  place-items: center;
  padding-top: 2rem;
  padding-bottom: 5.5rem;
}

@media (min-width: 900px) {
  .scene[data-phase="seated"] {
    padding-bottom: 5rem;
    padding-right: 1.25rem;
  }
}

@media (max-width: 600px) {
  .player-dock {
    margin-top: 0;
  }
}

.yt-player-ui {
  margin-top: 1rem;
  font-family: var(--font-base, sans-serif);
}

.yt-info-container {
  margin-bottom: 1.25rem;
}

.yt-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-author {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted, #a0a0a0);
}

.yt-progress-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted, #a0a0a0);
}

.yt-progress-container input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  background: transparent;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.yt-progress-container input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
.yt-progress-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #f4ecd8;
  margin-top: -5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.yt-controls-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: background-color 0.2s, opacity 0.2s;
  padding: 0;
}

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

.ctrl-btn::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-color: #f4ecd8;
}

.prev-btn::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h2v12H6zm3.5 6l8.5 6V6z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6h2v12H6zm3.5 6l8.5 6V6z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.next-btn::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.vol-btn::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.vol-btn.is-muted::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.custom-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #f4ecd8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s, background-color 0.2s;
}

.custom-play-btn:hover {
  transform: scale(1.05);
  background-color: #fff8e8;
}

.custom-play-btn::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-color: #1c1814;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center / contain;
  margin-left: 4px; /* Optical center adjustment for triangle */
}

.custom-play-btn.is-playing::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E") no-repeat center / contain;
  margin-left: 0;
}
