:root {
  --bg: #020303;
  --panel: rgba(8, 9, 9, .86);
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #e5f5eb;
  --muted: #678276;
  --accent: #65ff9a;
  --accent-rgb: 101, 255, 154;
  --gold: #ffe475;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
}

button { font: inherit; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#scene:active { cursor: grabbing; }

.santa-flight {
  position: fixed;
  z-index: 4;
  top: clamp(78px, 11vh, 125px);
  left: 0;
  width: clamp(320px, 34vw, 560px);
  pointer-events: none;
  will-change: transform;
  animation: santa-crossing 24s linear infinite;
}

.santa-flight img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 9px 15px rgba(0, 0, 0, .48));
  animation: santa-bob 3.2s ease-in-out infinite alternate;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .23;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(160,255,194,.025) 4px);
  mix-blend-mode: screen;
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  min-height: 80px;
  padding: max(16px, env(safe-area-inset-top)) 28px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(2,3,3,.92), rgba(2,3,3,.32));
  backdrop-filter: blur(10px);
}

.identity,
.clock,
.now-playing { display: flex; align-items: center; }

.identity { gap: 12px; justify-self: start; }
.identity-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb), .07);
  box-shadow: inset 0 0 18px rgba(var(--accent-rgb), .06), 0 0 28px rgba(var(--accent-rgb), .06);
  font: 700 .78rem var(--mono);
}
.identity > span:last-child,
.clock { display: grid; gap: 3px; }
.identity b { font: 800 .92rem var(--mono); letter-spacing: .16em; }
.identity small, .clock small { color: var(--muted); font: .6rem var(--mono); letter-spacing: .13em; }

.now-playing {
  justify-self: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: rgba(5,18,14,.46);
  color: var(--muted);
  font-size: .76rem;
}
.now-playing strong { color: var(--accent); font: 700 .72rem var(--mono); letter-spacing: .08em; }
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .7);
  animation: live 1.8s infinite;
}

.clock { justify-self: end; text-align: right; }
.clock span { color: var(--accent); font: 700 .85rem var(--mono); letter-spacing: .12em; }

.hero-copy {
  position: fixed;
  z-index: 5;
  top: 18%;
  right: clamp(24px, 5vw, 78px);
  max-width: 380px;
  pointer-events: none;
}
.kicker { margin: 0 0 17px; color: var(--accent); font: .68rem var(--mono); letter-spacing: .13em; }
.hero-copy h1 { margin: 0; font-size: clamp(2rem, 3.8vw, 4.2rem); line-height: 1.06; letter-spacing: -.055em; }
.hero-copy h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--accent-rgb), .78);
  text-shadow: 0 0 30px rgba(var(--accent-rgb), .09);
}
#wishLine {
  display: inline-block;
  margin: 22px 0 0;
  padding: 9px 11px;
  border-right: 2px solid var(--accent);
  color: #a4b9ad;
  background: rgba(3,12,9,.56);
  font: .76rem var(--mono);
}

.telemetry {
  position: fixed;
  z-index: 5;
  top: 19%;
  left: clamp(22px, 4vw, 64px);
  width: 142px;
  pointer-events: none;
}
.telemetry::before { content: "LIVE_TELEMETRY"; display: block; margin-bottom: 12px; color: var(--accent); font: .61rem var(--mono); letter-spacing: .12em; }
.telemetry p { margin: 0; padding: 9px 0; display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); }
.telemetry span { color: var(--muted); font: .58rem var(--mono); }
.telemetry b { color: #b8cdc0; font: 400 .66rem var(--mono); }

.interaction-hint {
  position: fixed;
  z-index: 5;
  left: clamp(22px, 4vw, 64px);
  bottom: 160px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.7;
  pointer-events: none;
}
.interaction-hint b { color: #afc5b7; font-weight: 600; }
.mouse-icon { width: 20px; height: 30px; border: 1px solid var(--line-strong); border-radius: 11px; position: relative; }
.mouse-icon::before { content: ""; width: 2px; height: 6px; background: var(--accent); position: absolute; top: 5px; left: 8px; animation: mouse 1.7s ease-in-out infinite; }

.command-chip {
  position: fixed;
  z-index: 6;
  right: clamp(22px, 4vw, 64px);
  bottom: 159px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 270px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: rgba(2, 10, 7, .68);
  color: var(--muted);
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.command-chip span { color: var(--accent); font: 700 .72rem var(--mono); }
.command-chip code { color: #acc0b4; font: .68rem var(--mono); }
.command-chip i { width: 6px; height: 13px; margin-left: auto; background: var(--accent); animation: blink .9s steps(1) infinite; }

.control-dock {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(920px, calc(100% - 40px));
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.52), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(17px);
}

.dock-head {
  height: 29px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font: .57rem var(--mono);
  letter-spacing: .11em;
  direction: ltr;
}
.keyboard-help { color: var(--muted); }

.languages { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.lang {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #7f978a;
  background: transparent;
  cursor: pointer;
  transition: .18s ease;
}
.lang:last-child { border-right: 0; }
.lang:hover { color: var(--text); background: rgba(var(--accent-rgb), .05); }
.lang.active { color: var(--accent); background: rgba(var(--accent-rgb), .09); box-shadow: inset 0 -2px var(--accent); }
.lang i { min-width: 27px; color: inherit; font: 700 .62rem var(--mono); font-style: normal; }
.lang span { font-size: .72rem; font-weight: 650; }
.lang:focus-visible, .mini-toggle:focus-visible, .burst-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.dock-actions { min-height: 46px; display: flex; align-items: stretch; }
.mini-toggle,
.burst-button {
  border: 0;
  border-right: 1px solid var(--line);
  color: #768c80;
  background: transparent;
  padding: 0 14px;
  font: .6rem var(--mono);
  cursor: pointer;
  white-space: nowrap;
}
.mini-toggle { display: flex; gap: 7px; align-items: center; }
.mini-toggle i { width: 5px; height: 5px; border-radius: 50%; background: #3a4b42; }
.mini-toggle.active { color: #b0c5b8; }
.mini-toggle.active i { background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), .6); }
.mini-toggle:hover { background: rgba(var(--accent-rgb), .04); }
.burst-button { margin-left: auto; min-width: 160px; border-right: 0; color: #07110c; background: var(--accent); font-weight: 800; }
.burst-button:hover { color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px var(--accent); }
.burst-button span { margin-left: 6px; }

.mobile-hint { display: none; }

@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
@keyframes mouse { 0%, 100% { transform: translateY(0); opacity: 1; } 65% { transform: translateY(8px); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes santa-crossing {
  from { transform: translate3d(-112%, 0, 0); }
  to { transform: translate3d(calc(100vw + 12%), 0, 0); }
}
@keyframes santa-bob {
  from { transform: translateY(-4px) rotate(-.35deg); }
  to { transform: translateY(7px) rotate(.45deg); }
}

@media (max-width: 850px) {
  .hero-copy, .telemetry { display: none; }
  .interaction-hint, .command-chip { display: none; }
  .topbar { backdrop-filter: none; background: rgba(2, 3, 3, .96); }
  .control-dock { backdrop-filter: none; background: rgba(8, 9, 9, .96); }
  .dock-actions { overflow-x: auto; }
  .mini-toggle, .burst-button { min-height: 44px; }
  .burst-button { min-width: 150px; }
}

@media (max-width: 620px) {
  .scanlines { display: none; }
  .santa-flight {
    top: 72px;
    width: clamp(260px, 68vw, 420px);
    animation-duration: 18s;
  }
  .santa-flight img { filter: none; animation: none; }
  .topbar { min-height: 66px; padding: max(11px, env(safe-area-inset-top)) 13px 10px; grid-template-columns: 1fr auto; }
  .identity-mark { width: 35px; height: 35px; }
  .identity b { font-size: .75rem; }
  .identity small, .clock small { display: none; }
  .now-playing { display: none; }
  .clock span { font-size: .69rem; }
  .control-dock { width: calc(100% - 18px); bottom: max(9px, env(safe-area-inset-bottom)); }
  .dock-head { height: 25px; }
  .languages { overflow-x: auto; grid-template-columns: repeat(5, minmax(85px, 1fr)); }
  .lang { min-height: 42px; gap: 4px; }
  .lang span { font-size: .62rem; }
  .dock-actions { min-height: 40px; }
  .mini-toggle { padding: 0 11px; font-size: .52rem; }
  .burst-button { font-size: .54rem; min-width: 130px; }
  .mobile-hint { display: block; position: fixed; z-index: 6; bottom: 126px; left: 0; right: 0; color: var(--muted); text-align: center; font-size: .63rem; pointer-events: none; }
}

.low-power .scanlines { display: none; }
.low-power .santa-flight img { filter: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .santa-flight { transform: translate3d(8vw, 0, 0); }
}
