:root {
  --color-bg: #070910;
  --color-fg: #ebe7f4;
  --color-muted: #c5cbe0;
  --color-moon: #9bb4ff;
  --color-candle: #e4c79a;
  --color-line: rgba(155, 180, 255, 0.2);
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --radius: 1.35rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-weight: 380;
  line-height: 1.5;
}

body { min-height: 100dvh; overflow-x: hidden; }

button, [role="button"] { cursor: pointer; font: inherit; }

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

.night-sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  animation: stars 12s ease-in-out infinite;
}
.night-sky span {
  position: absolute; border-radius: 50%;
}
@keyframes stars {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

.glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: min(78vw, 640px); height: min(78vw, 640px);
  right: -18vw; top: -16vw;
  background: radial-gradient(circle, rgba(185, 166, 232, 0.2), rgba(155, 180, 255, 0.08) 42%, transparent 70%);
  animation: breathe 16s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

.shell {
  position: relative; z-index: 1;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0 0 6px; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.78rem; color: var(--color-candle);
}

h1, h2, .display {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15;
}

h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 3rem); }

.pin {
  position: sticky; top: 0; z-index: 30;
  margin: 14px -18px 0; padding: 8px 18px 10px;
  background: rgba(7, 9, 16, 0.94);
  border-bottom: 1px solid var(--color-line);
}
.menu-row-single { grid-template-columns: 1fr; }
.stage {
  position: relative; margin: 0 0 14px; border-radius: 18px; overflow: hidden;
  background: #05070d; aspect-ratio: 9 / 13; max-height: 48vh;
}
.stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage:fullscreen, .stage:-webkit-full-screen {
  max-height: none; aspect-ratio: auto; border-radius: 0; background: #000;
}
.stage:fullscreen video, .stage:-webkit-full-screen video { width: 100%; height: 100%; object-fit: cover; }
.full-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  min-height: 40px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(7,9,16,0.55); color: #fff; font: inherit; font-size: 0.78rem;
}
.stage-time {
  position: absolute; left: 12px; bottom: 10px; margin: 0; z-index: 2;
  font-variant-numeric: tabular-nums; font-size: 1.15rem; color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.clock { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 0; font-variant-numeric: tabular-nums; }
.clock-now { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 3.4rem); letter-spacing: -0.03em; line-height: 1; }
.clock-of, .clock-dur { color: var(--color-muted); font-size: 1.15rem; }
.meter { height: 4px; margin-top: 12px; border-radius: 999px; background: rgba(155,180,255,0.22); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--color-candle); }

.lede { margin: 12px 0 0; max-width: 38rem; color: var(--color-muted); font-size: 1.05rem; }

.safety {
  margin: 18px 0 0; padding: 12px 14px; border-left: 2px solid var(--color-candle);
  color: var(--color-muted); font-size: 0.95rem;
}

.layout { display: block; margin-top: 22px; }

.panel {
  background: rgba(18, 24, 42, 0.86);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.kicker {
  margin: 0; color: var(--color-moon); font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase;
}

.now h2 { margin: 8px 0 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }

.sub, .hint, .fine, .voice-note { color: var(--color-muted); }
.sub { margin: 8px 0 0; }

.times {
  display: flex; justify-content: space-between; margin-top: 18px;
  font-variant-numeric: tabular-nums;
}

.transport {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-top: 12px;
}

.transport button, .text-btn, .choice, .order-btn {
  color: var(--color-fg);
  background: rgba(7, 9, 16, 0.45);
  border: 1px solid var(--color-line);
  border-radius: 14px;
  min-height: 48px;
}

.transport button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px; font-size: 0.78rem;
}

.transport button.play {
  grid-column: 1 / -1; min-height: 72px; background: var(--color-candle); color: #1a140c;
  border-color: transparent; font-size: 1.05rem; flex-direction: row; gap: 10px;
}

.transport button.repeat-on {
  background: rgba(155, 180, 255, 0.18); border-color: rgba(155, 180, 255, 0.7);
}

.menu-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-top: 12px;
}
.menu-row button {
  color: var(--color-fg);
  background: rgba(7, 9, 16, 0.45);
  border: 1px solid var(--color-line);
  border-radius: 14px;
  min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 2px; font-size: 0.68rem; line-height: 1.15;
}
.menu-row button small {
  color: var(--color-candle); font-size: 0.72rem; font-variant-numeric: tabular-nums;
}
.menu-row button[aria-expanded="true"] {
  background: rgba(155, 180, 255, 0.18); border-color: rgba(155, 180, 255, 0.7);
}
.drawer { margin-top: 12px; display: grid; gap: 12px; }
.drawer[hidden] { display: none !important; }
.drop-list { gap: 8px; }
.drop-item {
  color: var(--color-fg); background: rgba(7, 9, 16, 0.45);
  border: 1px solid var(--color-line); border-radius: 12px;
  min-height: 48px; text-align: left; padding: 10px 14px; font-size: 1rem;
}
.drop-item.on { border-color: rgba(155, 180, 255, 0.7); background: rgba(155, 180, 255, 0.18); }

.transport button:disabled, .order-btn:disabled { opacity: 0.35; }

.continue { margin-top: 12px; width: 100%; }

.stack { display: grid; gap: 14px; }
.section-title { margin: 0 0 4px; font-size: 1.45rem; }
.hint { margin: 0 0 8px; font-size: 0.92rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.card {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 10px; border-radius: 16px; border: 1px solid transparent; background: rgba(7, 9, 16, 0.35);
  touch-action: pan-y; user-select: none;
}

.card.dragging { opacity: 0.72; border-color: rgba(155, 180, 255, 0.8); touch-action: none; }
.cards.dragging-list { touch-action: none; }

.card.active { border-color: rgba(228, 199, 154, 0.55); background: rgba(228, 199, 154, 0.06); }

.card-main {
  text-align: left; background: transparent; border: 0; color: inherit;
  min-height: 48px; padding: 4px 2px; width: 100%;
}

.card-main strong { display: block; font-weight: 580; }
.card-main span, .card-index { color: var(--color-muted); font-size: 0.88rem; }
.card-index { width: 4.6rem; text-align: left; color: var(--color-candle); font-size: 0.82rem; letter-spacing: 0.04em; }

.orders { display: grid; gap: 6px; }
.order-btn {
  width: 44px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center;
}

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 8px 12px; border-radius: 999px; }
.choice[aria-pressed="true"] {
  background: rgba(155, 180, 255, 0.18);
  border-color: rgba(155, 180, 255, 0.7);
}

.field { display: grid; gap: 4px; }
.field span, .group-label { font-size: 0.92rem; }
.field em, .sleep-left { font-style: normal; color: var(--color-candle); font-variant-numeric: tabular-nums; }

.warn, .alert {
  margin: 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(228, 199, 154, 0.1); color: var(--color-fg); font-size: 0.92rem;
}
.alert { margin-top: 14px; border: 1px solid rgba(228, 199, 154, 0.4); }

.below { display: grid; gap: 16px; margin-top: 16px; }
.transcript p { margin: 0 0 0.7rem; }
.transcript .rest { margin-bottom: 1.4rem; }

.text-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 14px;
}

details.panel summary {
  cursor: pointer; font-family: var(--font-display); font-size: 1.35rem;
  min-height: 48px; display: flex; align-items: center;
}

.footer { margin-top: 18px; color: var(--color-muted); font-size: 0.88rem; }

.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;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 48px;
  background: transparent; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: rgba(155, 180, 255, 0.32); border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11px;
  border-radius: 50%; background: var(--color-candle); border: 2px solid #070910;
}
input[type="range"]::-moz-range-track {
  height: 4px; background: rgba(155, 180, 255, 0.32); border-radius: 999px; border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--color-candle); border: 2px solid #070910;
}

@media (prefers-reduced-motion: reduce) {
  .glow, .night-sky { animation: none; }
}
