:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #09090d;
  color: #f7f2ea;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #09090d; }
body { user-select: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

.game-shell, #fallback-canvas, #game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#fallback-canvas, #game-canvas { display: block; }
#game-canvas { opacity: 0; pointer-events: none; }
#app[data-renderer="gpu"] #game-canvas { opacity: .32; mix-blend-mode: screen; }
#app[data-renderer="gpu"] #fallback-canvas { opacity: 1; }

.screen-panel {
  position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px; text-align: center;
  background:
    linear-gradient(115deg, rgba(255,74,91,.08), transparent 42%),
    radial-gradient(circle at 65% 44%, rgba(46,210,255,.11), transparent 38%),
    rgba(9,9,13,.95);
}
.game-panel { backdrop-filter: blur(8px); }
.brand-mark {
  display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 18px;
  border: 1px solid rgba(255,237,208,.42); transform: rotate(45deg); color: #ffd18b;
  box-shadow: 0 0 34px rgba(255,166,77,.15), inset 0 0 18px rgba(255,220,151,.08);
}
.brand-mark::first-line { transform: rotate(-45deg); }
.eyebrow, .microcopy, .adaptive-trace, .renderer-label, .hud span, .hud small {
  font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.eyebrow { margin: 0 0 12px; color: #e0a95e; }
h1, h2 { margin: 0; line-height: .84; letter-spacing: -.065em; }
h1 { font-size: clamp(62px, 9vw, 112px); }
h2 { font-size: clamp(58px, 8vw, 94px); }
.screen-panel > p:not(.eyebrow,.microcopy,.url) { max-width: 510px; color: #bbb4aa; line-height: 1.55; }
.url { color: #d9a45c; letter-spacing: .09em; }

.controls-card { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px 18px; max-width: 680px; margin: 18px 0 4px; color: #aaa49d; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
kbd { display: inline-grid; place-items: center; min-width: 29px; height: 28px; margin-right: 4px; padding: 0 7px; border: 1px solid #494650; border-bottom-width: 3px; border-radius: 5px; color: #fff6e8; background: #201f25; font: 700 12px/1 ui-monospace, monospace; }

.primary-button, .mode-button { border: 1px solid rgba(255,211,141,.32); color: #fff8ec; background: rgba(31,28,29,.9); }
.primary-button { min-width: 310px; min-height: 58px; margin-top: 18px; border-radius: 4px; font-weight: 850; letter-spacing: .13em; background: linear-gradient(110deg, #9d3f3d, #c9793f); box-shadow: 0 12px 34px rgba(145,46,45,.22); }
.primary-button:hover { filter: brightness(1.12); }
.mode-button { min-height: 40px; margin-top: 14px; padding: 0 22px; border-radius: 999px; color: #efbe77; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.microcopy { margin-top: 16px; color: #716d6b; }

.hud { position: absolute; z-index: 8; top: 18px; left: 28px; right: 28px; display: grid; grid-template-columns: 1fr 90px 1fr; gap: 26px; pointer-events: none; }
.fighter-hud { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.rival-hud { direction: rtl; }
.rival-hud > * { direction: ltr; }
.health { grid-column: 1 / 3; height: 9px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.07); transform: skewX(-12deg); }
.health b { display: block; width: 100%; height: 100%; transform-origin: left; background: linear-gradient(90deg,#ff9c55,#ff525f); transition: transform 120ms linear; }
.rival-hud .health b { transform-origin: right; background: linear-gradient(90deg,#48bfe3,#89e6ff); }
.fighter-hud small { color: #aaa19a; }
.timer { display: flex; flex-direction: column; align-items: center; }
.timer strong { font-size: 34px; line-height: .9; font-variant-numeric: tabular-nums; }
.timer small { margin-top: 6px; color: #938d88; }

.fight-callout { position: absolute; z-index: 9; left: 0; right: 0; top: 34%; text-align: center; font-size: clamp(44px,7vw,90px); font-weight: 900; letter-spacing: -.04em; color: #fff4e2; text-shadow: 0 0 45px rgba(255,140,73,.45); pointer-events: none; }
.adaptive-trace { position: absolute; z-index: 8; left: 24px; bottom: 18px; color: rgba(225,192,143,.60); pointer-events: none; }
.renderer-label { position: absolute; z-index: 8; right: 18px; bottom: 18px; color: rgba(164,157,151,.40); pointer-events: none; }

@media (max-width: 900px), (any-pointer: coarse) {
  .hud { left: 12px; right: 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .game-panel { backdrop-filter: none; } }
