:root {
  --ink: #090d18;
  --paper: #eef1ef;
  --paper-muted: #a9b3b7;
  --panel: #151c2c;
  --panel-2: #1c2437;
  --blue: #6de2ff;
  --blue-deep: #2caed3;
  --orange: #ff875e;
  --yellow: #ffe27a;
  --purple: #b08cff;
  --line: rgba(238, 241, 239, 0.18);
  --display: 'Bebas Neue', Impact, sans-serif;
  --body: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--body); overflow-x: hidden; }
button { font: inherit; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .07; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); mix-blend-mode: screen; }
.page-frame { width: min(1500px, calc(100% - 44px)); margin: 0 auto; padding: 28px 0 34px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: var(--orange); border: 2px solid var(--orange); border-radius: 50%; font-size: 15px; transform: rotate(14deg); box-shadow: 3px 3px 0 rgba(255,135,94,.2); }
.eyebrow, .kicker, .side-kicker, .arena-tag, .fighter-label, .bar-caption, .intent-kicker, .combat-hints, .menu-card-head, .menu-foot, .control-strip span, .mode-stamp, .mode-stat-label, .result-stats span, .side-footer, .status-dot { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.eyebrow { margin: 0 0 3px; color: var(--paper-muted); font-size: 9px; }
.brand-name { margin: 0; font: 28px/0.9 var(--display); letter-spacing: .08em; color: var(--paper); }
.brand-name span { color: var(--blue); }
.topbar-tools { display: flex; align-items: center; gap: 14px; }
.status-dot { color: var(--paper-muted); font-size: 9px; display: inline-flex; align-items: center; gap: 7px; }
.status-dot i { display: block; width: 7px; height: 7px; background: var(--blue); border-radius: 50%; box-shadow: 0 0 0 4px rgba(109,226,255,.13); }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--paper); cursor: pointer; transition: border-color .2s, color .2s; }
.icon-button:hover, .icon-button[aria-pressed="false"] { border-color: var(--orange); color: var(--orange); }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 204px; gap: 30px; align-items: stretch; }
.arena-shell { position: relative; min-width: 0; filter: drop-shadow(0 24px 42px rgba(0,0,0,.35)); }
.arena-shell::before, .arena-shell::after { content: ''; position: absolute; z-index: 2; pointer-events: none; }
.arena-shell::before { left: 14px; top: 14px; width: 34px; height: 34px; border-top: 2px solid var(--orange); border-left: 2px solid var(--orange); }
.arena-shell::after { right: 14px; bottom: 14px; width: 34px; height: 34px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); }
.arena-tag { position: absolute; z-index: 4; top: 16px; right: 22px; display: flex; gap: 8px; font-size: 9px; color: rgba(238,241,239,.7); text-shadow: 1px 1px 0 var(--ink); }
.arena-tag b { color: var(--orange); }
#gameCanvas { display: block; width: 100%; height: auto; min-height: 420px; max-height: 76vh; aspect-ratio: 16/9; background: #111a2d; border: 2px solid #050711; outline: 1px solid rgba(238,241,239,.22); outline-offset: -8px; image-rendering: auto; cursor: crosshair; }
.side-note { padding: 36px 2px 0; display: flex; flex-direction: column; min-height: 100%; }
.side-rule { width: 100%; height: 2px; background: var(--orange); margin-bottom: 18px; }
.side-kicker { margin: 0 0 14px; color: var(--orange); font-size: 9px; display: flex; justify-content: space-between; }
.side-kicker span { color: var(--paper-muted); }
.side-note h2 { margin: 0; font: 34px/.87 var(--display); letter-spacing: .04em; color: var(--paper); }
.side-copy { color: var(--paper-muted); font-size: 11px; line-height: 1.65; margin: 16px 0 22px; }
.side-tip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.tip-mark { display: grid; place-items: center; width: 22px; height: 22px; color: var(--ink); background: var(--yellow); font: 17px/1 var(--display); transform: rotate(-7deg); }
.side-tip b { font: 13px/1 var(--display); letter-spacing: .08em; color: var(--yellow); }
.side-tip p { font-size: 10px; line-height: 1.45; color: var(--paper-muted); margin: 7px 0 0; }
.side-footer { display: flex; justify-content: space-between; gap: 10px; color: rgba(169,179,183,.6); font-size: 8px; margin-top: auto; padding-top: 18px; }

/* Menu / result screens */
.screen-overlay { position: absolute; inset: 0; z-index: 5; display: flex; }
.screen-overlay[hidden], .hud[hidden], .touch-controls[hidden] { display: none; }
.menu-overlay { align-items: stretch; padding: clamp(32px, 5vw, 74px) clamp(28px, 6vw, 90px) 36px; background: linear-gradient(100deg, rgba(8,12,25,.96) 0%, rgba(13,22,43,.91) 42%, rgba(21,20,38,.88) 100%); overflow: hidden; }
.menu-overlay::before { content: 'KAI / 01'; position: absolute; left: 34px; top: 36px; color: rgba(109,226,255,.56); font: 9px var(--mono); letter-spacing: .2em; transform: rotate(-90deg) translateX(-100%); transform-origin: left top; }
.menu-overlay::after { content: ''; position: absolute; width: 50vw; height: 50vw; max-width: 650px; max-height: 650px; border-radius: 50%; right: -20%; top: -34%; background: radial-gradient(circle, rgba(176,140,255,.22), transparent 67%); pointer-events: none; }
.menu-copy { width: 38%; min-width: 210px; align-self: center; position: relative; z-index: 1; padding-bottom: 48px; }
.kicker { margin: 0 0 12px; color: var(--orange); font-size: 9px; }
.menu-copy h1 { margin: 0; font: clamp(54px, 6.4vw, 92px)/.78 var(--display); letter-spacing: .02em; color: var(--paper); transform: skew(-4deg); text-shadow: 4px 4px 0 rgba(109,226,255,.18); }
.menu-copy h1 em { color: var(--blue); font-style: normal; text-shadow: 4px 4px 0 rgba(255,135,94,.16); }
.lede { max-width: 285px; color: var(--paper-muted); font-size: 11px; line-height: 1.6; margin: 25px 0 0; }
.menu-card { position: relative; z-index: 1; margin-left: auto; width: min(56%, 500px); align-self: center; background: rgba(18,25,44,.84); border: 1px solid rgba(238,241,239,.24); box-shadow: 9px 9px 0 rgba(4,7,15,.54); padding: 20px; transform: rotate(.7deg); }
.menu-card::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(238,241,239,.08); pointer-events: none; }
.menu-card-head { display: flex; justify-content: space-between; color: var(--paper); font-size: 9px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.page-no { color: var(--orange); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.mode-card { appearance: none; text-align: left; cursor: pointer; min-height: 165px; padding: 13px 12px 11px; position: relative; background: rgba(238,241,239,.045); border: 1px solid rgba(238,241,239,.17); color: var(--paper); transition: transform .2s, border-color .2s, background .2s; }
.mode-card:hover { transform: translateY(-3px); border-color: rgba(109,226,255,.65); }
.mode-card.active { background: rgba(109,226,255,.11); border: 1px solid var(--blue); box-shadow: inset 3px 0 0 var(--orange); }
.mode-stamp { display: inline-block; font-size: 8px; color: var(--blue); border: 1px solid rgba(109,226,255,.45); padding: 3px 5px; margin-bottom: 8px; }
.mode-stamp.heavy { color: var(--yellow); border-color: rgba(255,226,122,.45); }
.mode-avatar { display: block; position: absolute; right: 12px; top: 7px; font-size: 36px; line-height: 1; opacity: .72; }
.avatar-ghost { color: var(--blue); transform: rotate(-20deg); }.avatar-vow { color: var(--orange); }
.mode-name { display: block; font: 20px/1 var(--display); letter-spacing: .06em; margin-bottom: 6px; }
.mode-desc { display: block; color: var(--paper-muted); font-size: 9px; line-height: 1.35; max-width: 185px; min-height: 38px; }
.mode-stats { display: flex; gap: 3px; margin-top: 10px; }.mode-stats i { display: block; height: 4px; background: var(--blue); }.mode-stats i:nth-child(2) { background: var(--orange); }.mode-stats i:nth-child(3) { background: var(--purple); }
.mode-stat-label { display: block; color: rgba(169,179,183,.75); font-size: 6px; margin-top: 4px; }
.primary-button { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 15px; padding: 14px 16px; cursor: pointer; border: 2px solid var(--orange); color: var(--paper); background: var(--orange); box-shadow: 4px 4px 0 var(--ink); font: 20px/1 var(--display); letter-spacing: .08em; transition: transform .16s, box-shadow .16s, background .16s; }.primary-button b { font: 24px/1 var(--body); }.primary-button:hover { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); background: #ff9b73; }.primary-button:active { transform: translate(4px,4px); box-shadow: none; }
.menu-foot { display: flex; justify-content: space-between; gap: 10px; color: rgba(169,179,183,.6); font-size: 7px; margin-top: 15px; position: relative; z-index: 1; }
.control-strip { position: absolute; left: 30px; right: 30px; bottom: 17px; display: flex; align-items: center; gap: 16px; z-index: 2; }.control-strip div { display: inline-flex; align-items: center; gap: 6px; }.control-strip span { font-size: 7px; color: var(--paper-muted); }.control-strip kbd { min-width: 22px; padding: 5px 5px 4px; border: 1px solid rgba(238,241,239,.36); color: var(--paper); font: 8px var(--mono); text-align: center; }

/* HUD */
.hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; padding: 42px 28px 20px; display: flex; flex-direction: column; justify-content: space-between; }
.hud-row { display: grid; grid-template-columns: 1fr 105px 1fr; gap: 22px; align-items: start; }.fighter-hud { min-width: 0; }.enemy-hud { text-align: right; }.fighter-label { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; font-size: 9px; }.hud-name { color: var(--paper); font-weight: 500; }.hud-role { color: var(--orange); font-size: 8px; }.enemy-hud .hud-role { color: var(--blue); }
.bar-track { height: 10px; background: rgba(5,7,17,.7); border: 1px solid rgba(238,241,239,.38); padding: 2px; overflow: hidden; }.bar-track + .bar-track { margin-top: 4px; height: 6px; }.bar-fill { display: block; height: 100%; width: 100%; transition: width .12s; }.health-fill { background: var(--orange); }.enemy-health-fill { background: var(--blue); }.stamina-fill { background: var(--yellow); }.enemy-stamina-fill { background: var(--purple); }.enemy-hud .bar-fill { margin-left: auto; }.bar-caption { display: flex; justify-content: space-between; font-size: 6px; color: rgba(238,241,239,.55); margin-top: 4px; }
.round-readout { text-align: center; padding-top: 1px; }.round-label { color: var(--paper-muted); font: 8px var(--mono); letter-spacing: .14em; }.round-label span { color: var(--orange); }.round-timer { font: 35px/.84 var(--display); color: var(--paper); margin-top: 5px; }.round-state { color: var(--blue); font: 8px var(--mono); letter-spacing: .12em; margin-top: 7px; }
.hud-bottom { display: flex; align-items: end; justify-content: space-between; gap: 18px; }.intent-wrap { width: 185px; }.intent-kicker { display: block; font-size: 7px; color: var(--paper-muted); margin-bottom: 5px; }.intent-label { display: block; font: 12px/1 var(--display); color: var(--orange); letter-spacing: .07em; min-height: 14px; }.intent-meter { height: 4px; background: rgba(5,7,17,.7); margin-top: 6px; border: 1px solid rgba(238,241,239,.25); }.intent-meter i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .08s; }.combo-readout { color: var(--yellow); font: 31px/.8 var(--display); letter-spacing: .09em; text-shadow: 2px 2px 0 var(--ink); min-height: 31px; }.combat-hints { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; max-width: 340px; color: rgba(238,241,239,.74); font-size: 7px; }.combat-hints kbd { color: var(--paper); border-bottom: 1px solid var(--orange); font: 8px var(--mono); padding-bottom: 2px; }

/* Pause / result */
.pause-overlay, .result-overlay { align-items: center; justify-content: center; flex-direction: column; text-align: center; background: rgba(8,12,25,.9); backdrop-filter: blur(4px); padding: 30px; }.pause-glyph { font: 45px/1 var(--display); color: var(--blue); letter-spacing: -.2em; margin-left: -.2em; }.pause-overlay h2, .result-overlay h2 { font: 56px/.82 var(--display); margin: 10px 0 12px; letter-spacing: .05em; }.pause-overlay p:not(.kicker), .result-overlay p:not(.kicker) { max-width: 330px; margin: 0 auto; color: var(--paper-muted); font-size: 11px; line-height: 1.5; }.compact { width: min(260px,100%); margin-top: 24px; }.text-button { border: 0; background: transparent; color: var(--paper-muted); cursor: pointer; font: 10px var(--mono); letter-spacing: .08em; margin-top: 15px; transition: color .2s; }.text-button:hover { color: var(--paper); }.text-button span { border: 1px solid rgba(238,241,239,.32); padding: 3px 5px; margin-left: 7px; color: var(--paper); }
.result-stamp { color: var(--blue); border: 2px solid var(--blue); padding: 8px 12px 5px; font: 22px/1 var(--display); letter-spacing: .12em; transform: rotate(-3deg); box-shadow: 4px 4px 0 rgba(109,226,255,.18); }.result-overlay.defeat .result-stamp { color: var(--orange); border-color: var(--orange); box-shadow: 4px 4px 0 rgba(255,135,94,.18); }.result-overlay.defeat h2 { color: var(--orange); }.result-overlay h2 { color: var(--paper); }.result-stats { display: flex; gap: 24px; margin: 27px 0 3px; }.result-stats div { display: flex; flex-direction: column; gap: 5px; }.result-stats b { font: 32px/.8 var(--display); color: var(--yellow); }.result-stats span { color: var(--paper-muted); font-size: 7px; }.result-actions { width: min(260px,100%); }.result-actions .primary-button { margin-top: 0; }
.touch-controls { display: none; position: absolute; inset: auto 0 12px; z-index: 7; justify-content: space-between; align-items: end; padding: 0 18px; pointer-events: none; }.touch-dpad, .touch-actions { pointer-events: auto; display: flex; gap: 4px; align-items: center; }.touch-dpad > div { display: flex; gap: 4px; }.touch-controls button { width: 40px; height: 38px; border: 1px solid rgba(238,241,239,.45); background: rgba(7,12,25,.68); color: var(--paper); font: 10px var(--mono); touch-action: none; }.touch-controls button:active, .touch-controls button.held { background: var(--orange); color: var(--ink); }.touch-actions button { width: 56px; height: 44px; line-height: 1; }.touch-actions small { font: 6px var(--mono); }.touch-actions .touch-attack { width: 68px; height: 55px; background: var(--orange); color: var(--ink); border-color: var(--orange); }
.focus-note { position: absolute; z-index: 4; left: 50%; bottom: 23%; transform: translateX(-50%); color: var(--paper); background: rgba(7,12,25,.8); border: 1px solid rgba(238,241,239,.3); padding: 8px 11px; font: 8px var(--mono); letter-spacing: .1em; }.focus-note span { color: var(--orange); margin-left: 5px; }

@media (max-width: 1050px) { .page-frame { width: min(100% - 28px, 940px); }.game-layout { display: block; }.side-note { display: none; }.arena-shell { width: 100%; }.menu-copy { width: 37%; }.menu-card { width: 58%; } }
@media (max-width: 700px) { .page-frame { width: calc(100% - 18px); padding-top: 15px; }.topbar { margin-bottom: 13px; }.brand-name { font-size: 24px; }.status-dot { display: none; } #gameCanvas { min-height: 0; height: 300px; aspect-ratio: auto; outline-offset: -5px; }.arena-tag { top: 10px; right: 13px; font-size: 7px; }.in-menu .arena-shell { min-height: 760px; }.menu-overlay { display: block; min-height: 760px; padding: 34px 24px 70px; overflow-y: auto; }.menu-copy { width: 100%; padding-bottom: 18px; }.menu-copy h1 { font-size: clamp(53px, 16vw, 78px); }.lede { margin-top: 13px; font-size: 10px; max-width: 330px; }.menu-card { width: 100%; margin: 0; transform: none; padding: 15px; }.mode-card { min-height: 140px; }.mode-name { font-size: 17px; }.mode-desc { font-size: 8px; }.menu-foot { font-size: 6px; }.control-strip { display: none; }.hud { padding: 30px 13px 11px; }.hud-row { grid-template-columns: 1fr 58px 1fr; gap: 7px; }.fighter-label { font-size: 7px; }.hud-role { font-size: 6px; }.round-timer { font-size: 27px; }.round-label { font-size: 6px; }.round-state { font-size: 6px; }.combat-hints { display: none; }.hud-bottom { align-items: end; }.intent-wrap { width: 130px; }.intent-label { font-size: 10px; }.combo-readout { font-size: 23px; }.touch-controls { display: flex; }.screen-overlay.pause-overlay, .screen-overlay.result-overlay { padding: 22px; }.pause-overlay h2, .result-overlay h2 { font-size: 44px; }.result-stats { gap: 14px; }.result-stats b { font-size: 26px; } }
@media (pointer: coarse) { .touch-controls { display: flex; } }

button:focus-visible, canvas:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
