:root {
  color-scheme: dark;
  --ink: #f8f4ff;
  --muted: #b9aecb;
  --paper: #ffe77a;
  --paper-deep: #e7bd2b;
  --gold-foil: #ffdf6d;
  --gold-bright: #fff29a;
  --cinnabar: #ff455b;
  --cinnabar-seal: #c43b42;
  --cinnabar-bg: #fff3db;
  --violet: #8d5cff;
  --violet-bright: #bd9cff;
  --red: #ff535f;
  --cyan: #55e9ff;
  --cyan-bright: #9bf3ff;
  --jade-glow: #38efbd;
  --green: #76ff9f;
  --night: #080614;
  --night-deep: #04050d;
  --panel: rgba(22, 14, 46, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: #06040d; color: var(--ink); overscroll-behavior: none; }
body { min-height: 100dvh; overflow-x: hidden; }
button, canvas { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.audio-toggle {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(155, 243, 255, .55);
  border-radius: 999px;
  background: rgba(7, 11, 38, .82);
  box-shadow: 0 0 16px rgba(85, 233, 255, .14);
  color: var(--cyan-bright);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  cursor: pointer;
}
.audio-toggle[aria-pressed="false"] {
  border-color: rgba(185, 174, 203, .38);
  box-shadow: none;
  color: var(--muted);
}
.audio-toggle:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.hidden { display: none !important; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(112, 43, 178, 0.24), transparent 34%),
    radial-gradient(circle at 82% 90%, rgba(255, 62, 88, 0.16), transparent 36%),
    linear-gradient(135deg, #040612, #0d1544 50%, #080510);
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--night);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
}

.screen {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  animation: screenFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-screen {
  animation: gameFadeIn 0.2s ease-out both;
}

@keyframes gameFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .game-screen {
    animation: none !important;
  }
}
