:root{--paper:#f4f3eb;--ink:#1b2a2b;--muted:#788078;--line:#d9ddd2;--red:#d75938;--blue:#347e99;--green:#526d4d;color-scheme:light;--surface:#fafaf5;--input:#fffefa;--soft:#eaf0e4;--hover:#e8ecdf;--key-hover:#dee8d7;--key-active:#cdddc4;--arena:#eef0e6;--arena-grid:#dce1d4;--arena-axis:#b3c0aa;--arena-label:#899780;--obstacle:#c7d0bc;--obstacle-edge:#aebca2;--primary-bg:#1b2a2b;--primary-ink:#ffffff;--primary-hover:#314845;--arena-heading:#1b2a2b;--arena-heading-ink:#f4f3eb;--hero:#edf0e5;}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:Arial,Helvetica,sans-serif;font-size:14px}header,main,footer{max-width:1320px;margin:auto}header{height:90px;display:flex;align-items:center;gap:25px;border-bottom:1px solid var(--line);padding:0 36px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-family:Georgia,serif;font-size:38px;font-style:italic}.brand span{font-family:Arial,sans-serif;font-size:16px;letter-spacing:2px;font-weight:bold;font-style:normal}.tag,.eyebrow,.status,.count,.graph-caption,.live-dot{font-family:monospace;font-size:11px;letter-spacing:1px}.tag{border-left:1px solid var(--line);padding-left:25px;color:var(--muted)}.status{margin-left:auto;color:var(--green)}main{padding:0 36px 60px}.hero{display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:center;padding:64px 0}.eyebrow{color:var(--green);font-weight:600;margin:0 0 18px}h1{font-size:66px;letter-spacing:-3px;line-height:1.04;margin:0 0 24px;font-weight:500}h1 em{font-family:Georgia,serif;color:var(--red);font-weight:400}h2{font-size:25px;letter-spacing:-.7px;margin:0 0 26px;font-weight:500}h3{font-size:15px;font-weight:600}.intro{font-size:16px;line-height:1.8;max-width:410px;color:var(--muted)}.chips{display:flex;gap:10px;margin-top:25px}.chips span{border:1px solid var(--line);border-radius:20px;padding:7px 11px;font-size:11px;color:var(--muted)}.hero-graph{border:1px solid var(--line);background:var(--hero);transform:rotate(-2deg);padding:15px 15px 0}.hero-graph svg{width:100%;display:block}.graph-caption{display:block;text-align:center;padding:20px;color:var(--muted)}.home-grid{display:grid;grid-template-columns: 1fr 1.6fr;gap:24px}.panel{padding:26px;background:var(--surface);border:1px solid var(--line);border-radius:5px}label{display:block;font-size:12px;font-weight:600;margin:17px 0 8px}input{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:4px;background:var(--input);font:inherit;color:var(--ink);outline:none}input:focus{border-color:var(--green);box-shadow:0 0 0 2px #526d4d18}button{border:1px solid var(--line);border-radius:4px;background:transparent;padding:11px 16px;color:var(--ink);font:inherit;font-size:12px;cursor:pointer}button:hover{background:var(--hover)}button:disabled{opacity:.45;cursor:default}.primary{background:var(--primary-bg);color:var(--primary-ink);border-color:var(--primary-bg)}.primary:hover{background:var(--primary-hover)}.primary span{float:right}#entry-form .primary{width:100%;margin-top:24px;text-align:left;padding:15px}.quiet{border-color:transparent;color:var(--muted)}.small{font-size:11px;line-height:1.6}.muted{color:var(--muted)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.count{font-size:11px;color:var(--muted);letter-spacing:0;margin-left:10px}.empty{padding:48px 15px;text-align:center;color:var(--muted);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.empty strong{display:block;font-family:Georgia,serif;font-size:24px;font-weight:400;color:var(--muted);margin-bottom:10px}.room-card{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:18px 0;gap:15px}.room-card h3{margin:0 0 7px}.room-card p{margin:0;color:var(--muted);font-size:11px}footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:20px 36px;font-size:10px;letter-spacing:1px;color:var(--muted)}footer>span:first-child{font-weight:bold}.room-heading{display:flex;justify-content:space-between;align-items:center;padding:35px 0 25px}.room-heading h1{font-size:34px;letter-spacing:-1px;margin:0}.room-heading .eyebrow{margin-bottom:10px}.actions{display:flex;gap:10px;align-items:center}.game-layout{display:block}.arena-heading{display:flex;justify-content:space-between;background:var(--arena-heading);color:var(--arena-heading-ink);padding:13px 18px;border-radius:5px 5px 0 0;font-family:monospace;font-size:11px;text-transform:uppercase;letter-spacing:.6px}.canvas-wrap{position:relative;background:var(--arena);border:1px solid var(--line)}canvas{width:100%;aspect-ratio:5/3;display:block}#arena-note{position:absolute;bottom:12px;left:15px;color:var(--muted);font-size:11px;pointer-events:none}.equation-bar{display:flex;align-items:center;gap:9px;padding:14px;background:var(--surface);border:1px solid var(--line);border-top:0}.equation-bar label{white-space:nowrap;font-family:Georgia,serif;font-size:22px;font-style:italic;margin:0}.equation-bar input{font-family:monospace;min-width:0}.equation-bar button{white-space:nowrap}.shot-meta{display:flex;justify-content:space-between;gap:12px;margin:11px 2px 22px;color:var(--muted);font-family:monospace;font-size:10px}.instructions{font-size:12px;line-height:1.8}.instructions h3{margin-top:0}.instructions code{font-size:11px}aside .panel{padding:20px}.team{border-top:1px solid var(--line);padding:15px 0}.team-heading{display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:bold}.team-heading button{padding:5px 9px;font-size:10px}.red{color:var(--red)}.blue{color:var(--blue)}.team-members{padding:10px 0 0;font-size:12px;line-height:1.9;color:var(--muted)}.player-name{display:flex;justify-content:space-between}.roster>.primary{width:100%;margin-top:10px}.comms{margin-top:18px}.comms h3{margin:0}.live-dot{color:var(--green);font-size:9px}#feed{height:230px;overflow-y:auto;padding:14px 0;font-size:11px;line-height:1.7;overflow-wrap:anywhere}#feed p{margin:0 0 10px}#feed strong{font-size:10px}#chat-form{display:flex;gap:5px}#chat-form input{min-width:0;font-size:11px;padding:10px}#chat-form button{padding:8px 12px}dialog{border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);padding:30px;width:420px;max-width:90vw;line-height:1.7}dialog::backdrop{background:#14232188;backdrop-filter:blur(3px)}dialog .actions{margin-top:24px;justify-content:flex-end}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);padding:14px 22px;max-width:90vw;background:var(--primary-bg);color:var(--primary-ink);border-radius:5px;z-index:10;box-shadow:0 5px 25px #0002;font-size:13px}button:focus-visible,a:focus-visible{outline:2px solid var(--red);outline-offset:3px}[hidden]{display:none!important}@media(max-width:950px){.hero{gap:25px}h1{font-size:52px}.tag{display:none}.equation-bar{flex-wrap:wrap}.equation-bar input{flex:1}.shot-meta{flex-direction:column;gap:5px}}@media(max-width:700px){header{height:72px;padding:0 20px}.brand span{font-size:13px}.status{font-size:9px}main{padding:0 18px 35px}.hero{padding:38px 0;grid-template-columns:1fr;gap:25px}.hero-graph{max-width:430px}.hero h1{font-size:54px}.home-grid,.game-layout{grid-template-columns:1fr}.panel{padding:22px}.room-heading{align-items:flex-start;gap:20px}.room-heading h1{font-size:27px}.room-heading .actions{flex-direction:column;gap:2px;align-items:flex-end}.arena-heading{font-size:10px}aside{display:grid;grid-template-columns:1fr 1fr;gap:12px}.comms{margin-top:0}.equation-bar{padding:10px}.equation-bar input{width:50%}.shot-meta{font-size:9px}footer{padding:16px 20px}footer>span:nth-child(2){display:none}}@media(max-width:450px){aside{grid-template-columns:1fr}.hero-graph{display:none}.chips{gap:5px}.chips span{font-size:10px}.section-heading{gap:5px}.count{margin-left:3px}.equation-bar button{padding:10px}.room-heading .eyebrow{font-size:9px}.status{letter-spacing:0}}

.training-button{width:100%;margin-top:12px;text-align:left;padding:14px}#room-view.practice .roster,#room-view.practice #chat-form{display:none}#room-view.practice .game-layout{grid-template-columns:minmax(0,1fr)}
#room-view.practice aside{display:none}

.game-main{min-width:0}.equation-keyboard{padding:18px}.equation-keyboard h3{margin:0;font-size:14px}.equation-keyboard fieldset{border:0;padding:0;margin:12px 0 0;min-width:0}.function-keys,.number-keys{display:grid;gap:7px}.function-keys{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:10px}.number-keys{grid-template-columns:repeat(6,minmax(0,1fr))}.equation-keyboard [data-key]{min-height:46px;padding:8px 4px;font:15px monospace;background:var(--input);touch-action:manipulation;user-select:none}.function-keys [data-key]{background:var(--soft);font-size:13px}.equation-keyboard [data-key]:hover{background:var(--key-hover)}.equation-keyboard [data-key]:active{background:var(--key-active)}.equation-keyboard fieldset:disabled{opacity:.5}.keyboard-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}.keyboard-bottom span{color:var(--muted);font-size:10px;line-height:1.5}.keyboard-bottom [data-key]{min-height:40px;font:11px Arial,sans-serif;padding:8px 12px;white-space:nowrap}.game-main>.comms,.game-main>.instructions{margin-top:18px}.instructions summary{font-weight:600;cursor:pointer;min-height:24px;display:list-item}.instructions[open] summary{margin-bottom:15px}#feed{font-size:12px;height:200px}#feed strong{font-size:11px}#chat-form input{font-size:16px}.equation-bar input{font-size:16px}#fire{min-height:46px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:700px){.game-layout{display:block}.game-main{order:1}aside{order:0;display:block}#room-view.in-match aside{order:2}.equation-keyboard{padding:14px}.game-main>.instructions{padding:18px}.shot-meta{margin-bottom:14px}.equation-bar{flex-wrap:nowrap;gap:7px}.equation-bar input{width:0;flex:1;padding:12px 9px}.equation-bar label{font-size:20px}.equation-bar button{padding:10px 12px}.equation-keyboard .quiet{font-size:11px;padding:8px}.keyboard-bottom span{max-width:60%}#chat-form button{min-width:44px}#feed{height:180px}.room-heading{padding-top:24px}.game-main>.comms{padding:18px}}@media(max-width:380px){.function-keys,.number-keys{gap:5px}.equation-keyboard{padding:10px}.equation-keyboard [data-key]{min-height:44px}.keyboard-bottom{gap:5px}.keyboard-bottom span{font-size:9px}}

.keyboard-bottom{display:grid;grid-template-columns:1fr 2fr;gap:10px}.keyboard-bottom [data-key]{min-height:48px;font-size:14px}.keyboard-hint{margin:10px 0 0;font-size:10px;color:var(--muted);line-height:1.5}.equation-keyboard #native-keyboard{min-height:44px}.equation-keyboard .section-heading #fire{min-width:100px;min-height:46px;font-weight:600;font-size:15px}@media(max-width:700px){input{font-size:16px}.keyboard-hint{font-size:10px}.equation-bar input{width:0;flex:1}}

.roster{padding:16px 20px;margin-bottom:18px}.roster .eyebrow{margin:0}.roster #start{width:auto;margin:0}.roster #teams{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:12px}.roster .team{padding:10px 0 0}.roster .team-members{display:flex;flex-wrap:wrap;gap:4px 12px;line-height:1.5;font-size:11px}.roster .player-name{display:inline-flex;gap:6px;overflow-wrap:anywhere;max-width:100%}.roster .team-heading{gap:8px}.roster #host-note{margin:12px 0 0}.in-match .roster [data-team],.in-match .roster #host-note{display:none}.in-match .roster{padding:12px 20px}.in-match .roster #teams{margin-top:8px}.in-match .roster .team{padding-top:8px}@media(max-width:600px){.roster,.in-match .roster{padding:12px 14px}.roster #teams{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}.roster .team:last-child{grid-column:1/-1}.roster .team:last-child .team-members{padding-top:6px}.roster .team-heading button{min-height:36px;padding:6px 10px}.roster .team-heading{font-size:11px}.roster #start{padding:10px 12px}}

.equation-bar{--equation-input-padding:14px;display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:9px;row-gap:5px}.equation-bar label{grid-column:1;grid-row:1}.equation-bar #equation{grid-column:2;grid-row:1;width:100%;min-width:0;padding-left:var(--equation-input-padding)}.constant-bar{grid-column:2;grid-row:2;padding-right:calc(var(--equation-input-padding) + 1px);text-align:right}.constant-bar output{font:14px/1.4 monospace;color:var(--ink)}@media(max-width:700px){.equation-bar{--equation-input-padding:9px;column-gap:7px}}

@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark;--paper:#101812;--ink:#e4ebe4;--muted:#a0b0a3;--line:#34483c;--red:#ff997f;--blue:#7fc8eb;--green:#accca0;--surface:#19251f;--input:#101b15;--soft:#26382a;--hover:#293b2e;--key-hover:#314935;--key-active:#3b5840;--arena:#131e17;--arena-grid:#26362a;--arena-axis:#48604e;--arena-label:#96ac9b;--obstacle:#3e5541;--obstacle-edge:#6c896c;--primary-bg:#b9d6ad;--primary-ink:#162112;--primary-hover:#cbe3c1;--arena-heading:#26382a;--arena-heading-ink:#e4ebe4;--hero:#182b25;}}
:root[data-theme="dark"]{color-scheme:dark;--paper:#101812;--ink:#e4ebe4;--muted:#a0b0a3;--line:#34483c;--red:#ff997f;--blue:#7fc8eb;--green:#accca0;--surface:#19251f;--input:#101b15;--soft:#26382a;--hover:#293b2e;--key-hover:#314935;--key-active:#3b5840;--arena:#131e17;--arena-grid:#26362a;--arena-axis:#48604e;--arena-label:#96ac9b;--obstacle:#3e5541;--obstacle-edge:#6c896c;--primary-bg:#b9d6ad;--primary-ink:#162112;--primary-hover:#cbe3c1;--arena-heading:#26382a;--arena-heading-ink:#e4ebe4;--hero:#182b25;}
#theme-select{font:12px Arial,sans-serif;min-height:38px;padding:8px 10px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--ink);cursor:pointer}#theme-select:focus-visible{outline:2px solid var(--green);outline-offset:2px}@media(max-width:500px){header{height:auto;min-height:72px;flex-wrap:wrap;gap:6px 12px;padding:12px 18px}#theme-select{margin-left:auto;min-height:40px}.status{order:3;flex-basis:100%;margin-left:0;font-size:9px}}
