@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("../../assets/fonts/Fraunces144ptSoft-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../../assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
:root { color-scheme: dark; --ink:#2a1408; --dusk:#3b1d10; --panel:#5a2e16; --line:#c58a4a; --paper:#f6e6c8; --muted:#e2c59a; --sun:#ffb45d; --brass:#e6c36a; --shade:#1a2744; --sky:#7a3b22; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { background: radial-gradient(circle at 50% -10%, #c45a28, #3b1d10 58%); color: var(--paper); font-family: "IBM Plex Sans", Arial, sans-serif; margin: 0; min-width: 320px; }
button { font: inherit; }
button:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.game-shell { margin: 0 auto; max-width: 1120px; padding: clamp(1rem, 3vw, 2rem) clamp(14px, 3vw, 2rem) 2.4rem; }
.game-header { align-items: end; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.eyebrow { color: var(--sun); font-size: .7rem; font-weight: 700; letter-spacing: .14em; margin: 0 0 .35rem; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.04em; line-height: .95; }
.tagline { color: var(--brass); font-size: .98rem; margin: 10px 0 0; }
.scoreboard { display: flex; gap: clamp(.7rem, 3vw, 2rem); text-align: right; }
.scoreboard div { display: grid; gap: .15rem; min-width: 64px; }
.scoreboard span { color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.scoreboard strong { color: var(--paper); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.play-wrap { display: grid; place-items: center; }
.stage-frame { aspect-ratio: 960 / 620; background: var(--ink); border: 2px solid var(--brass); box-shadow: 8px 8px 0 #1a0c06; max-width: 960px; overflow: hidden; position: relative; width: 100%; }
#sundial-canvas { display: block; height: 100%; image-rendering: auto; touch-action: none; width: 100%; }
.start-card, .status-card { background: rgba(42, 20, 8, .94); border: 2px solid var(--sun); border-radius: 14px; left: 50%; max-width: 31rem; padding: clamp(1.25rem, 4vw, 2.4rem); position: absolute; text-align: center; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 2rem); }
.start-card h2, .status-card h2 { color: var(--paper); font-size: clamp(1.7rem, 5vw, 2.6rem); margin-bottom: .75rem; }
.start-card p:not(.eyebrow), .status-card p:not(.eyebrow) { color: var(--muted); line-height: 1.55; margin: 0 auto 1.5rem; max-width: 38ch; }
[hidden] { display: none !important; }
.primary-button, .restart-control { background: var(--sun); border: 2px solid var(--sun); border-radius: 999px; color: var(--ink); cursor: pointer; font-weight: 700; padding: .7rem 1.15rem; }
.primary-button:hover, .restart-control:hover, .touch-controls button:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.touch-controls { align-items: center; display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center; margin: 1.4rem 0 1.5rem; }
.phase-hint { color: var(--muted); flex: 1 1 100%; margin: 0; text-align: center; }
.touch-controls button { background: var(--panel); border: 2px solid var(--brass); color: var(--paper); cursor: pointer; min-height: 3.2rem; min-width: 5.4rem; padding: .5rem .85rem; }
.touch-controls .burst-button { background: var(--sun); border-color: var(--sun); color: var(--ink); font-weight: 700; }
.instructions { border-top: 1px solid var(--line); display: grid; gap: 1.25rem; grid-template-columns: 1fr 1.5fr; padding: 1.5rem 0; }
.instructions h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.control-list { display: grid; gap: .75rem; margin: 0; }
.control-list div { align-items: center; display: grid; gap: 1rem; grid-template-columns: 7.5rem 1fr; }
.control-list dt, .control-list dd { margin: 0; }
.control-list dd, .instruction-note, .footer-note { color: var(--muted); }
kbd { background: #5a2e16; border: 1px solid var(--brass); border-radius: 4px; color: var(--paper); display: inline-block; font-family: inherit; font-size: .8rem; min-width: 1.55em; padding: .12rem .36rem; text-align: center; }
.instruction-note { grid-column: 1 / -1; line-height: 1.5; }
.footer-note { font-size: .85rem; margin: 0 0 1rem; text-align: center; }
@media (max-width: 650px) {
  .game-shell { padding: 20px 14px 30px; }
  .game-header { align-items: start; flex-direction: column; }
  .scoreboard { text-align: left; }
  .touch-controls button { flex: 1 1 calc(50% - .65rem); min-width: 0; }
  .touch-controls .burst-button, .restart-control { flex: 1 1 100%; }
  .instructions { grid-template-columns: 1fr; }
  .control-list div { grid-template-columns: 6.7rem 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-frame { box-shadow: 4px 4px 0 #1a0c06; }
}
