/* HYPERDRIVE simulator — interface styles */
:root {
  color-scheme: dark;
  --bg: #07080b;
  /* liquid glass: a dark-tinted pane that keeps text legible over the 3D field, a top specular edge, deep blur */
  --glass: rgba(18, 22, 30, 0.5);
  --glass-strong: rgba(16, 19, 26, 0.64);
  --glass-solid: rgba(14, 17, 23, 0.9);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.025) 42%, rgba(255, 255, 255, 0) 70%);
  --spec: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  --blur: blur(26px) saturate(175%) brightness(1.04);
  --edge: rgba(255, 255, 255, 0.10);
  --edge-hi: rgba(255, 255, 255, 0.22);
  --surface: var(--glass);
  --surface-solid: #0f1218;
  --surface-2: rgba(30, 35, 46, 0.62);
  --surface-3: #181c25;
  --stroke: var(--edge);
  --stroke-2: rgba(255, 255, 255, 0.15);
  --text: #f1f3f7;
  --muted: #9198a6;
  --faint: #5f6674;
  --red: #f0434f;
  --red-2: #ff8f98;
  --red-soft: rgba(255, 71, 89, 0.16);
  --blue: #4677f2;
  --blue-2: #9bb7ff;
  --blue-soft: rgba(70, 119, 242, 0.18);
  --gold: #ffc23d;
  --gold-soft: rgba(255, 194, 61, 0.16);
  --green: #3ee6a4;
  --warn: #ffb02e;
  --danger: #ff5a5f;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42), 0 2px 10px rgba(0, 0, 0, 0.25);
  --font: 'Instrument Sans', ui-sans-serif, sans-serif;
  --display: 'Bricolage Grotesque', 'Instrument Sans', ui-sans-serif, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
  --accent: #f4f6fa;
  --accent-soft: rgba(255, 255, 255, 0.1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
input, select, textarea { user-select: text; -webkit-user-select: text; }
#view { position: fixed; inset: 0; }
#view canvas { display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; font: 600 10.5px/1 var(--mono); color: #cfd6e2; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); border-bottom-width: 2px; border-radius: 5px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--stroke-2); background: rgba(255, 255, 255, 0.05); color: var(--text); font-weight: 600; letter-spacing: 0.01em; transition: background 0.15s, border-color 0.15s, transform 0.12s var(--ease), box-shadow 0.2s; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: #f4f6fa; color: #07090c; border-color: transparent; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.btn.primary:hover { background: #ffffff; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.btn.danger { color: #ffb4b7; border-color: rgba(255, 90, 95, 0.35); background: rgba(255, 90, 95, 0.08); }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 13px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--text); transition: background 0.15s, border-color 0.15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--stroke-2); }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; height: 40px; padding: 0 14px 0 12px; border-radius: 11px; border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); font-weight: 600; font-size: 13px; transition: background 0.15s, border-color 0.15s; }
.pill-btn:hover { background: var(--surface-2); border-color: var(--stroke-2); }
.pill-btn .sub { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ loading */
#loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% 120%, rgba(63, 125, 255, 0.12), transparent 60%), radial-gradient(900px 500px at 50% -20%, rgba(255, 71, 89, 0.10), transparent 60%), var(--bg); transition: opacity 0.5s var(--ease); }
#loading.done { opacity: 0; pointer-events: none; }
.load-box { width: min(360px, 82vw); text-align: center; }
.load-box .logo { font-size: 44px; }
.load-bar { margin: 26px auto 12px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 8%; border-radius: inherit; background: #f4f6fa; transition: width 0.5s var(--ease); }
#loading-status { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ logo */
.logo { font: 800 64px/0.92 var(--display); letter-spacing: -0.02em; margin: 0; color: #fff; text-shadow: 0 8px 50px rgba(0, 0, 0, 0.5); }
.logo span { font-weight: 200; }
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.mark { display: inline-flex; align-items: center; gap: 10px; font: 800 15px/1 var(--display); letter-spacing: 0.08em; }
.mark svg { width: 26px; height: 26px; }
.mark-by { white-space: nowrap; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--stroke-2); font: 300 12.5px/1 var(--display); letter-spacing: 0.14em; color: #aab3c2; text-transform: uppercase; }
.mark-by b { font-weight: 700; color: #fff; }
.load-team { margin: -4px 0 18px; font: 300 13px/1 var(--display); letter-spacing: 0.22em; color: #aab3c2; text-transform: uppercase; }
.load-team b { font-weight: 700; color: #fff; }
.menu-foot .team-name { color: #fff; font-weight: 700; letter-spacing: 0.06em; }

/* ------------------------------------------------------------------ main menu */
#menu { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; overflow-y: auto; overflow-x: hidden; pointer-events: none; animation: fadeIn 0.6s var(--ease); }
#menu > * { pointer-events: auto; }
#menu::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.82) 30%, rgba(6, 8, 12, 0.2) 62%, rgba(6, 8, 12, 0.55) 100%), linear-gradient(0deg, rgba(6, 8, 12, 0.85), transparent 30%); }
.menu-top { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 22px 32px; }
.menu-main { position: relative; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: center; padding: 0 32px; }
.menu-nav { display: flex; align-items: center; gap: 2px; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; transition: color 0.15s, background 0.15s; }
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-btn svg.i { width: 17px; height: 17px; }
#menu-user { margin-left: 10px; }
.hero .kicker { font: 600 12px/1 var(--font); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.hero .logo { font-size: clamp(54px, 7.4vw, 104px); margin: 16px 0 14px; }
.hero p.tagline { margin: 0; max-width: 430px; color: #b7bfcc; font-size: 16.5px; line-height: 1.55; }
.modes { display: grid; gap: 10px; max-width: 440px; margin-top: 34px; }
.mode { display: grid; grid-template-columns: 44px 1fr 18px; align-items: center; gap: 14px; padding: 13px 16px 13px 13px; border-radius: 16px; border: 1px solid var(--stroke); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.18s var(--ease); }
.mode:hover { border-color: var(--stroke-2); background: var(--surface-2); transform: translateX(3px); }
.mode:active { transform: translateX(3px) scale(0.995); }
.mode .mi { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #e6ebf2; }
.mode .mi svg.i { width: 20px; height: 20px; }
.mode .mt b { display: block; font: 700 16.5px/1.2 var(--display); letter-spacing: 0; }
.mode .mt small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.mode .go { color: var(--faint); transition: color 0.15s, transform 0.18s var(--ease); }
.mode:hover .go { color: var(--text); transform: translateX(2px); }
.mode.primary { border-color: rgba(255, 255, 255, 0.22); background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), var(--glass); }
.mode.primary:hover { border-color: rgba(255, 255, 255, 0.4); }
.mode.primary .mi { background: #f4f6fa; color: #07090c; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.lnk.learn { display: inline-block; margin-top: 16px; font-size: 13.5px; }
#coach { position: absolute; left: 16px; top: 66px; width: 320px; padding: 14px 16px 15px; border-radius: 14px; background: var(--glass-strong); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); animation: popIn 0.3s var(--ease); }
#coach .co-top { display: flex; justify-content: space-between; align-items: center; font: 700 10px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
#coach h3 { margin: 10px 0 6px; font: 700 19px/1.2 var(--display); }
#coach p { margin: 0; color: #c9d0da; font-size: 13px; line-height: 1.5; }
#coach p b.ok { color: #7dffc0; }
#coach .co-bar { display: flex; gap: 4px; margin-top: 12px; }
#coach .co-bar i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
#coach .co-bar i.done { background: #7dffc0; } #coach .co-bar i.now { background: #f4f6fa; }
#coach .co-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.acct-line { max-width: 440px; margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.acct-line svg.i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.acct-line .lnk { margin-right: 5px; white-space: nowrap; }
.acct-line b { color: var(--text); font-weight: 600; }
.acct-line .lnk { border: none; background: none; padding: 0; color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
.acct-line .lnk:hover { text-decoration: underline; }
.acct-line .sep { margin: 0 7px; color: var(--faint); }

.card { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--radius); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.card-h h3 { margin: 0; font: 700 12px/1 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card-b { padding: 4px 18px 18px; }

.field-in, .field-sel { height: 32px; width: 100%; padding: 0 9px; border-radius: 8px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.3); color: var(--text); font: 600 13px var(--mono); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field-sel { font: 500 12.5px var(--font); appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b94a5 50%), linear-gradient(135deg, #8b94a5 50%, transparent 50%); background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px; background-size: 4px 4px; background-repeat: no-repeat; padding-right: 22px; }
.field-in:focus, .field-sel:focus { border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1); }
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font: 700 16px var(--display); color: #07090c; background: #e9edf3; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 4px; border-radius: 13px; border: 1px solid var(--stroke); background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); font-weight: 600; }
.user-chip .avatar { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
.user-chip:hover { background: var(--surface-2); }
.menu-foot { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 18px 32px 22px; color: #a3abb8; font-size: 12.5px; }
.menu-foot .lnk { color: #d7dce4; }
.lnk { border: none; background: none; padding: 0; font: inherit; color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; cursor: pointer; }
.kgrp { font: 700 9px/1 var(--font); letter-spacing: 0.06em; color: var(--muted); margin-right: 3px; text-transform: uppercase; }
:focus-visible { outline: 2px solid #f4f6fa; outline-offset: 2px; }
#scorebar:focus-visible { outline-offset: 3px; }

/* ------------------------------------------------------------------ online lobby */
.ol-intro { display: grid; gap: 14px; }
.ol-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ol-choice { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.ol-choice h4 { margin: 0 !important; }
.ol-choice p { margin: 0 !important; font-size: 13px; color: var(--muted) !important; }
.code-in { width: 100%; height: 48px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.32); color: var(--text); font: 700 22px var(--mono); letter-spacing: 0.4em; text-transform: uppercase; text-align: center; outline: none; }
.code-in:focus { border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); }
.ol-code { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12); }
.ol-code .lbl { font: 700 10.5px/1 var(--font); letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.ol-code .cd { font: 700 34px/1.1 var(--mono); letter-spacing: 0.22em; color: #fff; }
.ol-code .acts { margin-left: auto; display: flex; gap: 8px; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.seat { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px 10px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); overflow: hidden; }
.seat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.seat.red::before { background: var(--red); } .seat.blue::before { background: var(--blue); }
.seat .who { flex: 1; min-width: 0; }
.seat .who b { display: block; font-size: 13.5px; }
.seat .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.seat .who span.open { color: var(--faint); font-style: italic; }
.seat.mine { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.07); }
.seat.mine .who span { color: #fff; }
.players { display: grid; gap: 6px; }
.pl { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); font-size: 13px; }
.pl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pl .nm small { margin-left: 6px; color: var(--faint); font-weight: 500; }
.pl svg.i { width: 16px; height: 16px; }
.link-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 10.5px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.link-tag.p2p, .link-tag.host { color: #9ff5cf; background: rgba(46, 229, 157, 0.12); }
.link-tag.relay { color: var(--gold); background: var(--gold-soft); }
.ol-note { margin-top: 12px !important; font-size: 12.5px; color: var(--faint) !important; }
.ol-wait { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--muted); font-size: 13px; }
.ol-wait .spinner { margin: 0; width: 16px; height: 16px; }
.net-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.net-pill .dot.relay { background: var(--gold); }
.net-pill .dot.connecting { background: var(--faint); box-shadow: none; }
.net-pill .cd { font: 700 13px var(--mono); letter-spacing: 0.12em; }

/* ------------------------------------------------------------------ in-game HUD (broadcast style, minimal) */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud > :not(#banner):not(#center):not(#details):not(#touch) { transition: opacity 0.35s var(--ease); }
#hud.off > :not(#banner):not(#center):not(#details):not(#touch) { opacity: 0; pointer-events: none; }
.hud-tl { position: absolute; top: 16px; left: 16px; display: flex; gap: 6px; }
.hud-tr { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.hud-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-width: 38px; padding: 0 11px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: #e3e8ef; font-weight: 600; font-size: 12.5px; transition: background 0.15s, border-color 0.15s; }
.hud-btn:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.15); }
.hud-btn svg.i { width: 17px; height: 17px; }
.hud-btn .lbl { color: #a6afbd; font-weight: 500; }
.hud-btn .sub { color: var(--muted); font-weight: 500; }

/* scoreboard */
#scorebar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: 1fr auto 1fr; height: 56px; border-radius: 16px; overflow: hidden; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38); cursor: help; }
.sb-side { position: relative; display: flex; align-items: center; gap: 14px; min-width: 146px; padding: 0 18px; }
.sb-side.red { justify-content: flex-end; background: linear-gradient(90deg, rgba(255, 71, 89, 0), rgba(255, 71, 89, 0.2)); }
.sb-side.blue { background: linear-gradient(270deg, rgba(63, 125, 255, 0), rgba(63, 125, 255, 0.22)); }
.sb-name { font: 700 10.5px/1 var(--display); letter-spacing: 0.26em; }
.sb-side.red .sb-name { color: #ff98a2; } .sb-side.blue .sb-name { color: #a6c1ff; }
.sb-score { min-width: 42px; font: 700 34px/1 var(--display); font-variant-numeric: tabular-nums; text-align: center; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); }
.sb-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.05); }
.sb-prog b { position: absolute; top: 0; bottom: 0; width: 0; transition: width 0.45s var(--ease); }
.sb-side.red .sb-prog b { right: 0; background: var(--red); } .sb-side.blue .sb-prog b { left: 0; background: var(--blue); }
.sb-side.burst .sb-prog b { width: 100% !important; background: var(--gold); }
.sb-side.burst .sb-name { color: var(--gold); }
.sb-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 112px; border-left: 1px solid rgba(255, 255, 255, 0.06); border-right: 1px solid rgba(255, 255, 255, 0.06); }
#clock { font: 700 23px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#phase { font: 700 8.5px/1 var(--font); letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
#phase.levelup { color: var(--gold); } #phase.practice { color: var(--green); }
#scorebar.levelup .sb-mid { background: linear-gradient(180deg, rgba(255, 191, 47, 0.15), rgba(255, 191, 47, 0)); }
#scorebar.levelup #clock { color: var(--gold); }
.sb-map { display: flex; gap: 3px; }
.sb-map i { width: 11px; height: 3px; border-radius: 2px; }
.sb-map i.G { background: var(--gold); }
.sb-map i.C { background: linear-gradient(90deg, var(--red) 50%, var(--blue) 50%); }
.starmap { display: flex; align-items: center; justify-content: center; gap: 6px; }
.starmap .lbl { font: 700 9.5px/1 var(--font); letter-spacing: 0.16em; color: var(--muted); margin-right: 2px; }
.sm-pill { width: 22px; height: 8px; border-radius: 3px; }
.sm-pill.G { background: var(--gold); }
.sm-pill.C { background: linear-gradient(90deg, var(--red) 50%, var(--blue) 50%); }

/* event feed: a few quiet lines, top right */
#feed { position: absolute; top: 64px; right: 16px; width: 264px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.fi { display: flex; gap: 9px; align-items: flex-start; padding: 7px 11px; border-radius: 10px; background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.06); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: #d4dae3; font-size: 11.5px; line-height: 1.35; animation: slideIn 0.35s var(--ease); transition: opacity 0.6s, transform 0.6s; }
.fi.out { opacity: 0; transform: translateX(16px); }
.fi .t { flex: none; font: 600 10px/1.65 var(--mono); color: var(--faint); }
.fi .bul { flex: none; width: 2px; align-self: stretch; border-radius: 2px; background: var(--faint); }
.fi.red .bul { background: var(--red); } .fi.blue .bul { background: var(--blue); }
.fi.foul { background: rgba(60, 12, 18, 0.8); border-color: rgba(255, 90, 95, 0.28); }
.fi.phase .bul { background: var(--gold); } .fi.phase { font-weight: 600; color: #fff; }
.fi.warn .bul { background: var(--warn); }

/* squad docks: Human Player actions + one compact chip per robot */
.dock { position: absolute; bottom: 16px; display: flex; flex-direction: column; gap: 7px; }
.dock.red { left: 16px; align-items: flex-start; } .dock.blue { right: 16px; align-items: flex-end; }
.hp { display: flex; gap: 6px; }
.dock.blue .hp { flex-direction: row-reverse; }
.hp-btn { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; min-width: 52px; height: 46px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: #cfd6e0; transition: background 0.15s, border-color 0.15s, transform 0.12s var(--ease); }
.hp-btn:hover { background: var(--surface-2); }
.dock.red .hp-btn:hover { border-color: rgba(255, 71, 89, 0.55); } .dock.blue .hp-btn:hover { border-color: rgba(63, 125, 255, 0.6); }
.hp-btn:active { transform: scale(0.95); }
.hp-btn svg.i { width: 18px; height: 18px; }
.hp-btn kbd { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9px; border-radius: 5px; background: #0b0e13; border-color: rgba(255, 255, 255, 0.16); color: #9aa3b2; }
.hp-btn .cap { font: 700 8.5px/1 var(--font); letter-spacing: 0.06em; color: #aab2bf; white-space: nowrap; }
.hp-btn .cap b { font-family: var(--mono); color: #fff; }
.hp-btn.sbt .cap { color: var(--gold); } .hp-btn.sbt.lit .cap { color: #1d1300; }
.hp-btn .st { position: absolute; left: 6px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.hp-btn .st.on { background: var(--green); } .hp-btn .st.bay { background: var(--gold); }
.hp-btn.lift svg.i { margin-top: -7px; }
.hp-btn.sbt { color: var(--gold); }
.hp-btn.sbt.ready { border-color: rgba(255, 191, 47, 0.65); animation: pulse 1.2s ease-in-out infinite; }
.hp-btn.sbt.lit { background: var(--gold); border-color: transparent; color: #1d1300; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 191, 47, 0.18); } }
.rcards { display: flex; gap: 6px; }
.dock.blue .rcards { flex-direction: row-reverse; }
.rc { position: relative; width: 172px; padding: 8px 11px 9px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); overflow: hidden; }
.rc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.rc.red::before { background: var(--red); } .rc.blue::before { background: var(--blue); }
.rc-top { display: flex; align-items: center; gap: 6px; height: 18px; }
.rc-top b { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.rc-top .num { color: var(--faint); font: 600 10px var(--mono); }
.rc-st { margin-left: auto; display: flex; gap: 4px; }
.rc-arm { display: grid; grid-template-columns: 1fr 30px; align-items: center; gap: 8px; margin-top: 7px; }
.rc-arm em { font: 600 10.5px/1 var(--mono); font-style: normal; color: #c3cad5; text-align: right; }
.gauge { position: relative; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.gauge i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; background: linear-gradient(90deg, #8d99ae, #eef2f7); transition: width 0.12s linear; }
.gauge .mk { position: absolute; top: -3px; bottom: -3px; width: 1.5px; border-radius: 1px; background: rgba(255, 191, 47, 0.8); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: #aeb6c3; font: 700 9px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.chip svg.i { width: 11px; height: 11px; }
.chip .ring { width: 8px; height: 8px; border-radius: 50%; border: 2.5px solid currentColor; }
.chip.hold-red { color: var(--red-2); background: var(--red-soft); } .chip.hold-blue { color: var(--blue-2); background: var(--blue-soft); } .chip.hold-gold { color: var(--gold); background: var(--gold-soft); }
.chip.ok { color: #9ff5cf; background: rgba(46, 229, 157, 0.13); }
.chip.gold { color: var(--gold); background: var(--gold-soft); }
.chip.bad { color: #ffb4b7; background: rgba(255, 90, 95, 0.16); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); color: #aeb6c3; font: 600 10.5px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.tag.dim { color: var(--faint); }

/* center call-to-action / banners */
.center-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 26px 26px 22px; text-align: center; border-radius: 22px; background: var(--glass-strong); border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); animation: popIn 0.4s var(--ease); }
.center-card h2 { margin: 0 0 6px; font: 700 25px/1.15 var(--display); letter-spacing: 0.02em; }
.center-card p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.center-card .starmap { margin: 0 0 18px; }
.center-card .sm-pill { width: 34px; height: 10px; border-radius: 4px; }
.center-card .hint { margin-top: 12px; color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.keys-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0 0 18px; text-align: left; }
.keys-mini div { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); font-size: 11.5px; font-weight: 600; color: #c9d0da; }
.keys-mini i { width: 3px; height: 14px; border-radius: 2px; } .keys-mini .red i { background: var(--red); } .keys-mini .blue i { background: var(--blue); }
.keys-mini span { margin-left: auto; display: inline-flex; gap: 2px; }
#banner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; }
#banner .bn { font: 700 clamp(34px, 6vw, 66px)/1 var(--display); letter-spacing: 0.1em; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6); animation: bannerIn 2.4s var(--ease) forwards; }
#banner .bn small { display: block; margin-top: 10px; font: 600 13px/1.2 var(--font); letter-spacing: 0.24em; color: rgba(255, 255, 255, 0.8); text-transform: uppercase; }
#banner .bn.gold { color: var(--gold); } #banner .bn.red { color: var(--red-2); } #banner .bn.blue { color: var(--blue-2); }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.2); filter: blur(8px); } 14% { opacity: 1; transform: scale(1); filter: blur(0); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(0.97); } }

/* score details (Tab) */
#details { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 14px 18px 16px; }
.bd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bd-table th { font: 700 10.5px/1 var(--font); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; padding: 6px 4px 10px; text-align: left; }
.bd-table th.r, .bd-table td.r { text-align: right; } .bd-table th.red { color: var(--red-2); } .bd-table th.blue { color: var(--blue-2); }
.bd-table td { padding: 6px 4px; border-top: 1px solid var(--stroke); }
.bd-table td.n { font: 600 13px var(--mono); }
.bd-table td small { color: var(--faint); margin-left: 6px; }
.bd-table tr.tot td { font-weight: 700; font-size: 14.5px; border-top: 1px solid var(--stroke-2); }

/* ------------------------------------------------------------------ modals */
#modal-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(4, 6, 10, 0.5); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); pointer-events: auto; display: grid; justify-items: center; align-items: start; padding: max(16px, min(9vh, 88px)) 16px 16px; animation: fadeIn 0.25s var(--ease); }
.modal { position: relative; width: min(var(--w, 560px), 100%); max-height: calc(100vh - max(32px, min(18vh, 176px))); display: flex; flex-direction: column; background: var(--glass-strong); border: 1px solid var(--stroke-2); border-radius: 20px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); animation: popIn 0.35s var(--ease); overflow: hidden; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; }
.modal-h h2 { margin: 0; flex: 1; font: 700 20px/1.2 var(--display); letter-spacing: -0.005em; }
.modal-h .x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--stroke); background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-h .x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.modal-b { padding: 4px 22px 22px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.015); }
.tabs { display: flex; gap: 4px; padding: 4px; margin: 0 22px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke); }
.tabs button { flex: 1; height: 34px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; transition: background 0.15s, color 0.15s; }
.tabs button.on { background: rgba(255, 255, 255, 0.09); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset; }
.modal p { color: #b9c1cd; margin: 0 0 12px; }
.modal h4 { margin: 18px 0 8px; font: 700 11px/1 var(--font); letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.modal h4:first-child { margin-top: 4px; }

/* forms */
.form { display: grid; gap: 14px; }
.fld label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #c3cad5; }
.fld input { width: 100%; height: 44px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.32); color: var(--text); font: 500 14.5px var(--font); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.fld input:focus { border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1); }
.fld .help { margin-top: 6px; font-size: 12px; color: var(--faint); }
.fld .help.ok { color: var(--green); } .fld .help.bad { color: #ff9a9e; }
.form-err { padding: 10px 12px; border-radius: 10px; background: rgba(255, 90, 95, 0.1); border: 1px solid rgba(255, 90, 95, 0.3); color: #ffc2c4; font-size: 13px; }
.form-ok { padding: 10px 12px; border-radius: 10px; background: rgba(46, 229, 157, 0.1); border: 1px solid rgba(46, 229, 157, 0.3); color: #b6f7da; font-size: 13px; }
.switchline { text-align: center; color: var(--muted); font-size: 13px; }
.switchline button { border: none; background: none; color: #fff; font-weight: 600; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.35); }

/* settings rows */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--stroke); }
.set-row:first-of-type { border-top: none; }
.set-row .l b { display: block; font-size: 14px; font-weight: 600; }
.set-row .l span { color: var(--muted); font-size: 12.5px; }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.12); transition: background 0.2s; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.22s var(--ease); }
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(18px); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); }
.seg button { height: 30px; padding: 0 12px; border: none; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.on { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.keybtn { min-width: 96px; font-family: var(--mono); }
.keybtn.listening { border-color: #f4f6fa; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.seg-lg { display: flex; margin-bottom: 14px; } .seg-lg button { flex: 1; height: 40px; font-size: 15px; font-family: var(--display); }
.lseats { display: grid; gap: 6px; }
.lseat { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); font-size: 13px; }
.lseat i { width: 3px; height: 16px; border-radius: 2px; } .lseat.red i { background: var(--red); } .lseat.blue i { background: var(--blue); }
.lseat span { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.note { margin: 10px 2px 0 !important; color: var(--muted) !important; font-size: 12.5px; }
.warn-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 176, 46, 0.08); border: 1px solid rgba(255, 176, 46, 0.3); color: #ffe2ae; font-size: 12.5px; line-height: 1.45; }
.warn-note svg.i { flex: none; margin-top: 1px; }

/* key table */
.keys { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
.keys th { font: 700 10.5px/1 var(--font); letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; text-align: left; padding: 0 8px 2px; }
.keys td { padding: 9px 8px; background: rgba(255, 255, 255, 0.03); }
.keys td:first-child { border-radius: 10px 0 0 10px; font-weight: 600; white-space: nowrap; }
.keys td:last-child { border-radius: 0 10px 10px 0; }
.keys tr.red td:first-child { box-shadow: inset 3px 0 0 var(--red); } .keys tr.blue td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.keys kbd { margin: 1px; }
.steps { display: grid; gap: 10px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { position: relative; padding: 12px 14px 12px 50px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); color: #c3cad5; font-size: 13.5px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font: 700 12px var(--display); }
.steps li b { color: var(--text); }
.pts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pt { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.pt b { display: block; font: 700 24px/1 var(--display); color: var(--gold); }
.pt span { display: block; margin-top: 6px; color: #b9c1cd; font-size: 12.5px; }

/* results */
.res-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px; margin-bottom: 16px; border-radius: 16px; background: linear-gradient(90deg, rgba(255, 71, 89, 0.2), transparent 40%, transparent 60%, rgba(63, 125, 255, 0.2)), rgba(255, 255, 255, 0.02); border: 1px solid var(--stroke); }
.res-side { text-align: center; }
.res-side .s { font: 700 56px/1 var(--display); }
.res-side.red .s { color: var(--red-2); } .res-side.blue .s { color: var(--blue-2); }
.res-side .n { margin-top: 6px; font: 700 11px/1 var(--font); letter-spacing: 0.16em; color: var(--muted); }
.res-side .rp { display: inline-flex; margin-top: 10px; height: 24px; padding: 0 10px; align-items: center; border-radius: 99px; background: rgba(255, 255, 255, 0.06); font: 600 12px var(--font); }
.res-vs { text-align: center; }
.res-vs .w { font: 700 15px/1.2 var(--display); letter-spacing: 0.1em; }
.res-vs .w.red { color: var(--red-2); } .res-vs .w.blue { color: var(--blue-2); } .res-vs .w.tie { color: var(--gold); }
.res-vs small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; letter-spacing: 0.1em; }
.save-note { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); color: var(--muted); font-size: 13px; }
.save-note.ok { color: #b6f7da; border-color: rgba(46, 229, 157, 0.3); background: rgba(46, 229, 157, 0.07); }

/* profile + leaderboard */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.prof-head b { display: block; font: 700 20px/1.2 var(--display); }
.prof-head span { color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.stat strong { display: block; font: 700 24px/1 var(--display); }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }
.list { display: grid; gap: 6px; }
.li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); font-size: 13px; }
.li .sc { font: 700 14px var(--mono); }
.li .sc .r { color: var(--red-2); } .li .sc .b { color: var(--blue-2); }
.li small { color: var(--faint); }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.lb-row.me { border-color: rgba(255, 191, 47, 0.5); background: var(--gold-soft); }
.lb-rank { font: 700 15px var(--display); color: var(--muted); text-align: center; }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); } .lb-row:nth-child(2) .lb-rank { color: #d9e0ea; } .lb-row:nth-child(3) .lb-rank { color: #e7a674; }
.lb-name b { display: block; font-size: 14px; } .lb-name small { color: var(--faint); font-size: 12px; }
.lb-score { font: 700 20px var(--display); }
.sq { display: inline-flex; height: 20px; padding: 0 7px; align-items: center; border-radius: 6px; font: 700 10px var(--font); letter-spacing: 0.1em; }
.sq.red { background: var(--red-soft); color: var(--red-2); } .sq.blue { background: var(--blue-soft); color: var(--blue-2); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--stroke-2); border-radius: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.15); border-top-color: #f4f6fa; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* menu dropdown */
.dropdown { position: absolute; z-index: 60; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--stroke-2); box-shadow: var(--shadow); animation: popIn 0.18s var(--ease); }
.dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: none; border-radius: 9px; background: transparent; font-size: 13.5px; font-weight: 500; color: #d6dce6; text-align: left; }
.dropdown button:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.dropdown button.on { color: #fff; font-weight: 600; }
.dropdown hr { border: none; border-top: 1px solid var(--stroke); margin: 5px 4px; }
.dropdown .dd-h { padding: 8px 10px 6px; font: 700 10px/1 var(--font); letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; }

/* toast */
#toast { position: fixed; z-index: 70; left: 50%; bottom: 150px; transform: translate(-50%, 10px); max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--glass-strong); border: 1px solid rgba(255, 176, 46, 0.4); color: #ffe2ae; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease); display: flex; align-items: center; gap: 10px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: rgba(46, 229, 157, 0.4); color: #c6f8e2; }

/* ------------------------------------------------------------------ touch controls */
#touch { position: absolute; inset: 0; pointer-events: none; }
#touch > * { pointer-events: auto; }
.joy { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 148px; height: 148px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1px solid var(--stroke-2); touch-action: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
.tbtns { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 64px 64px; gap: 10px; }
.tbtn { width: 64px; height: 64px; border-radius: 18px; border: 1px solid var(--stroke-2); background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); font: 700 11px/1.1 var(--font); letter-spacing: 0.06em; color: #e6ebf2; display: grid; place-items: center; touch-action: none; }
.tbtn.on, .tbtn:active { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
.tbtn svg.i { width: 22px; height: 22px; }
.t-top { position: absolute; left: 50%; transform: translateX(-50%); top: 160px; display: flex; gap: 6px; }
.t-top .pill-btn { height: 36px; padding: 0 11px; font-size: 12px; }
.t-top .pill-btn svg.i { width: 16px; height: 16px; }
@media (min-width: 861px) { .t-top { top: auto; bottom: 230px; } }

/* ------------------------------------------------------------------ animation */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.center-card { animation-name: popInC; }
@keyframes popInC { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(0.98); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .menu-nav .nav-btn .lbl { display: none; }
  .menu-nav .nav-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 1100px) {
  .rc { width: 150px; }
  #feed { width: 240px; }
}
@media (max-width: 860px) {
  .dock { display: none; }
  .sb-side { min-width: 0; padding: 0 12px; gap: 10px; }
  .sb-name { display: none; }
  .sb-score { font-size: 28px; min-width: 36px; }
  .sb-mid { width: 96px; }
  #clock { font-size: 20px; }
  #feed { top: auto; bottom: 200px; right: 12px; left: 12px; width: auto; align-items: center; }
  #feed .fi:nth-child(n+3) { display: none; }
  .menu-main { grid-template-columns: minmax(0, 1fr); padding: 0 20px; }
  .hero .logo { font-size: clamp(40px, 12.4vw, 84px); margin: 12px 0 10px; }
  .hero .kicker { font-size: 10.5px; }
  .modes { margin-top: 22px; max-width: none; }
  .seats, .ol-choices { grid-template-columns: 1fr; }
  .ol-code .cd { font-size: 28px; }
  .menu-top, .menu-foot { padding-left: 20px; padding-right: 20px; }
  #menu::before { background: linear-gradient(0deg, rgba(6, 8, 12, 0.96) 15%, rgba(6, 8, 12, 0.7) 55%, rgba(6, 8, 12, 0.25)); }
  .menu-main { align-items: end; padding-bottom: 8px; }
  .hero p.tagline { font-size: 15px; }
  .menu-foot { flex-direction: column; gap: 4px; padding-top: 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-tl { top: 10px; left: 10px; } .hud-tr { top: 10px; right: 10px; }
  .hud-btn .sub, .hud-btn .lbl { display: none; }
  #scorebar { top: 58px; height: 50px; }
  #details { top: 116px; }
}
@media (max-width: 520px) {
  .menu-top .mark-name { display: none; }
  .menu-top .mark-by { margin-left: 0; padding-left: 0; border-left: 0; font-size: 12px; }
  #menu-user [data-act="signup"] { display: none; }
  .menu-top .mark { font-size: 13px; }
  .mode { padding: 11px 14px 11px 11px; }
  .mode .mi { width: 40px; height: 40px; }
  #menu-user { margin-left: 4px; }
  .ol-code { flex-wrap: wrap; }
  .ol-code .acts { margin-left: 0; width: 100%; }
  .ol-code .acts .btn { flex: 1; }
}
@media (max-width: 400px) {
  .menu-top { padding: 14px 14px; gap: 8px; }
  .menu-main, .menu-foot { padding-left: 14px; padding-right: 14px; }
  .mark { gap: 8px; } .mark svg { width: 22px; height: 22px; }
  .menu-top .mark-by { font-size: 11px; letter-spacing: 0.08em; }
  .menu-nav .nav-btn { width: 34px; height: 36px; }
  #menu-user [data-act="signin"] { display: none; }
  .user-chip .uname, .user-chip svg.i { display: none; }
  .user-chip { padding: 0 4px; }
  .hero .logo { font-size: clamp(38px, 13vw, 84px); }
  .mode { grid-template-columns: 38px 1fr 14px; gap: 10px; }
  .mode .mi { width: 38px; height: 38px; }
}
@media (max-width: 420px) {
  .sb-side { padding: 0 10px; }
  .res-side .s { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.rc-tags:empty { display: none; }

/* ---------------------------------------------------------------- robot code (imported OpModes) */
.rc-setup h3 { margin: 18px 0 8px; font: 700 10.5px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rc-setup h4 { margin: 12px 0 6px; font: 600 12px var(--font); color: #c3cad5; }
.rc-setup code, .rc-panel code, .center-card code { font: 500 12px var(--mono); color: #d9dee8; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 5px; }
.rc-lead { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.rc-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px dashed var(--stroke-2); border-radius: var(--radius-sm); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.rc-drop:hover, .rc-drop.over, .rc-drop:focus-visible { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.03); outline: none; }
.rc-drop svg.i { width: 26px; height: 26px; color: var(--muted); flex: none; }
.rc-drop b { display: block; font-size: 14px; } .rc-drop span { color: var(--muted); font-size: 12.5px; }
.rc-files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.rc-files li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 9px; background: rgba(255, 255, 255, 0.035); min-width: 0; }
.rc-files li code { background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rc-files li span { color: var(--faint); font-size: 12px; margin-left: auto; white-space: nowrap; }
.x.sm { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--stroke); background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.x.sm svg.i { width: 14px; height: 14px; }
.rc-paste-row { margin-top: 8px; font-size: 12.5px; color: var(--faint); }
.rc-err { margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: rgba(255, 90, 95, 0.1); border: 1px solid rgba(255, 90, 95, 0.3); display: grid; gap: 3px; font-size: 13px; }
.rc-err b { color: #ffb4b7; font-weight: 600; } .rc-err span { color: #f1d4d5; }
.rc-err pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 7px; background: rgba(0, 0, 0, 0.35); font: 12px/1.4 var(--mono); color: #e6e9ef; white-space: pre-wrap; word-break: break-all; }
.rc-err.sm { margin: 6px 0; font-size: 12px; padding: 8px 10px; }
.rc-warn { margin-top: 8px; display: grid; gap: 2px; font-size: 12px; color: #ffd38a; }
.rc-ops { display: grid; gap: 6px; }
.rc-ops button { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--stroke-2); background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.rc-ops button b { font: 600 14px var(--mono); } .rc-ops button span { color: var(--muted); font-size: 12.5px; }
.rc-ops button.on { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.06); }
.rc-pose { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.rc-map { width: 200px; height: 200px; display: block; }
.rc-map .fld { fill: #11151c; stroke: rgba(255, 255, 255, 0.18); }
.rc-map .src.red, .rc-map .stn.red { fill: rgba(238, 62, 76, 0.22); } .rc-map .src.blue, .rc-map .stn.blue { fill: rgba(58, 112, 238, 0.22); }
.rc-map .stn { stroke: rgba(255, 255, 255, 0.25); stroke-width: 0.6; }
.rc-map .pole.red { fill: var(--red-2); } .rc-map .pole.blue { fill: var(--blue-2); } .rc-map .pole.apex { fill: var(--gold); }
.rc-map .bot { fill: rgba(255, 255, 255, 0.12); stroke-width: 1.6; } .rc-map .bot.red { stroke: var(--red-2); } .rc-map .bot.blue { stroke: var(--blue-2); }
.rc-map .arr { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rc-pose-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.rc-pose-f label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: #c3cad5; }
.rc-pose-f label small { font-weight: 400; color: var(--faint); }
.rc-pose-f label.chk, .rc-wiring label.chk { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.rc-setup select, .rc-setup input[type=number] { height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.32); color: var(--text); font: 500 13.5px var(--font); min-width: 0; width: 100%; }
.rc-setup select:focus, .rc-setup input:focus { outline: none; border-color: rgba(255, 255, 255, 0.45); }
.rc-wiring { margin-top: 18px; border-top: 1px solid var(--stroke); padding-top: 12px; }
.rc-wiring summary { cursor: pointer; font-weight: 600; color: #c3cad5; }
.rc-wiring .note { color: var(--muted); font-size: 12.5px; }
.rc-wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rc-wrow { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px 8px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.rc-wrow b { font: 600 11.5px var(--mono); color: #c3cad5; }
.rc-wrow label { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.rc-wrow input[type=number] { width: 76px; }
.rc-ta { width: 100%; min-height: 240px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.32); color: var(--text); font: 12.5px/1.45 var(--mono); resize: vertical; outline: none; }
.rc-code { margin: 0; max-height: 64vh; overflow: auto; font: 12px/1.5 var(--mono); color: #d9dee8; white-space: pre; user-select: text; }
.rc-code .ln { display: inline-block; width: 38px; color: var(--faint); user-select: none; }
#phase.code { color: var(--gold); }
.rc-panel { position: absolute; left: 16px; top: 64px; width: 284px; max-height: calc(100% - 200px); overflow: auto; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--stroke); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); font-size: 12.5px; }
.rc-panel .rc-h { display: flex; align-items: center; gap: 8px; }
.rc-panel .rc-h b { font: 600 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rc-panel .rc-h .x { margin-left: auto; transform: rotate(90deg); transition: transform 0.2s var(--ease); }
.rc-panel.min .rc-h .x { transform: rotate(0deg); }
.rc-panel.min .rc-b { display: none; }
.rc-st { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.rc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.rc-dot.running { background: var(--green); } .rc-dot.init { background: var(--gold); } .rc-dot.error { background: var(--danger); } .rc-dot.paused { background: var(--warn); }
.rc-led { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rc-sub { margin: 6px 0 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-tel { width: 100%; border-collapse: collapse; font: 12px var(--mono); }
.rc-tel td { padding: 4px 0; border-top: 1px solid var(--stroke); }
.rc-tel td:first-child { color: var(--muted); padding-right: 10px; }
.rc-tel td:last-child { text-align: right; color: #f1f3f7; font-variant-numeric: tabular-nums; }
.rc-empty { color: var(--faint); padding: 6px 0; }
.rc-log { margin-top: 8px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, 0.3); font: 11px/1.45 var(--mono); color: #c9cfda; max-height: 86px; overflow: auto; }
.rc-log div { white-space: pre-wrap; word-break: break-word; }
.rc-keys { margin-top: 8px; color: var(--muted); font-size: 11.5px; line-height: 1.9; }
.rc-keys kbd { min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 3px; }
.rc-act { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.rc-res .rc-big { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 12px; }
.rc-res .rc-big span { font: 800 44px/1 var(--display); } .rc-res .rc-big small { color: var(--muted); }
.rc-res h3 { margin: 16px 0 6px; font: 700 10.5px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.center-card .bad { color: #ffb4b7; }
@media (max-width: 640px) {
  .rc-pose { grid-template-columns: minmax(0, 1fr); }
  .rc-map { margin: 0 auto; }
  .rc-wgrid { grid-template-columns: minmax(0, 1fr); }
  .rc-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 40%; }
}
.rc-map .hpspot { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.rc-errs { margin: -2px 0 8px; font: 11px/1.4 var(--mono); color: #ffd38a; }
.rc-wrow label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-wrow input:disabled { opacity: 0.45; }

.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--bg); color: var(--muted); font: 15px/1.5 var(--font); }
#loading-retry { margin-top: 16px; }
.keys-mini div { white-space: nowrap; }
.keys-mini div:only-child { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ liquid glass (Apple style) */
/* Clear glass rather than a dark pane: a whisper of white fill, heavy blur with boosted saturation so the field's
   colour comes through, a luminous rim that is brightest where light would catch it (top-left, bottom-right),
   a soft specular bloom inside, and on Chromium the edges bend what is behind them (#lg-lens in index.html). */
:root {
  --lg-fill: rgba(255, 255, 255, 0.055);
  --lg-fill-strong: rgba(28, 30, 36, 0.52);
  --lg-fill-hover: rgba(255, 255, 255, 0.11);
  --lg-blur: blur(16px) saturate(190%) brightness(1.06);
  --lg-blur-strong: blur(30px) saturate(180%) brightness(0.92);
  --lg-bloom: radial-gradient(140% 90% at 18% -10%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.10) 28%, rgba(255, 255, 255, 0.03) 62%, rgba(255, 255, 255, 0.26));
  --lg-depth: inset 0 0 16px rgba(255, 255, 255, 0.045), 0 10px 34px rgba(0, 0, 0, 0.26), 0 1px 2px rgba(0, 0, 0, 0.22);
  --pill: 999px;
}
.lg, .hud-btn, #scorebar, .hp-btn, .rc, .fi, .mode, .card, .modal, .center-card, #coach, .icon-btn, .pill-btn, .user-chip, .tbtn,
.dropdown, #toast, .rc-panel, .joy, .nav-btn, .btn:not(.primary):not(.ghost):not(.danger) {
  background: var(--lg-bloom), var(--lg-fill);
  border: 0;
  box-shadow: var(--lg-depth);
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur);
  isolation: isolate;
}
/* (the SVG lens refraction was removed: too costly over the live canvas) */
/* panels you read text on sit on darker, denser glass */
.modal, .dropdown, #toast, .center-card, #coach, .rc-panel, #details {
  background: var(--lg-bloom), var(--lg-fill-strong);
  backdrop-filter: var(--lg-blur-strong); -webkit-backdrop-filter: var(--lg-blur-strong);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.035), 0 30px 80px rgba(0, 0, 0, 0.45);
}
/* the luminous rim: a 1 px gradient ring drawn with a mask so it follows any radius */
.lg::after, .hud-btn::after, #scorebar::after, .hp-btn::after, .rc::after, .fi::after, .mode::after, .card::after, .modal::after,
.center-card::after, #coach::after, .icon-btn::after, .pill-btn::after, .user-chip::after, .tbtn::after, .dropdown::after, #toast::after,
.rc-panel::after, .joy::after, .nav-btn::after, .btn:not(.primary):not(.ghost):not(.danger)::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.mode, .hud-btn, .btn, .icon-btn, .pill-btn, .user-chip, .tbtn, .fi, .card, .nav-btn { position: relative; }
.hud-btn:hover, .hp-btn:hover, .mode:hover, .icon-btn:hover, .pill-btn:hover, .user-chip:hover, .nav-btn:hover, .btn:not(.primary):not(.ghost):not(.danger):hover {
  background: var(--lg-bloom), var(--lg-fill-hover); color: #fff;
}
.mode, .hud-btn, .hp-btn, .btn, .nav-btn, .icon-btn, .tbtn { transition: background-color 0.25s var(--ease), transform 0.45s var(--spring), box-shadow 0.25s; }
.mode:active, .hud-btn:active, .hp-btn:active, .btn:active, .nav-btn:active, .icon-btn:active, .tbtn:active { transform: scale(0.96); }

/* capsules and concentric radii */
.btn, .hud-btn, .nav-btn, .pill-btn, .user-chip, .chip, .tag, .link-tag, .sq, kbd { border-radius: var(--pill); }
.btn { height: 42px; padding: 0 20px; font-weight: 600; letter-spacing: 0; }
.btn.sm { height: 32px; padding: 0 14px; }
.btn.lg { height: 52px; padding: 0 28px; }
.btn.primary { background: rgba(255, 255, 255, 0.94); color: #0a0b0e; box-shadow: inset 0 1px 0 #fff, 0 8px 24px rgba(0, 0, 0, 0.3); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.icon-btn, .nav-btn { width: 40px; height: 40px; padding: 0; justify-content: center; color: #e9ecf1; }
.hud-btn { height: 40px; min-width: 40px; padding: 0 12px; }
.hud-btn .lbl, .hud-btn .sub { display: none; }
.hp-btn { border-radius: 18px; min-width: 50px; height: 50px; }
.rc { border-radius: 20px; }
.card, .rc-panel { border-radius: 24px; }
.modal { border-radius: 30px; }
.modal-f { background: transparent; border-top: 0; }
.modal-h { padding: 22px 24px 12px; }
.dropdown { border-radius: 20px; }
.dropdown button { border-radius: 12px; }
.center-card { border-radius: 32px; padding: 30px 28px 24px; }
#coach { border-radius: 24px; }
#toast { border-radius: var(--pill); color: #f3f4f6; padding: 12px 20px; }
#toast.ok { color: #d6fbe9; }
.tabs, .seg { border-radius: var(--pill); padding: 3px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); border: 0; }
.tabs button, .seg button { border-radius: var(--pill); }
.tabs button.on, .seg button.on { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25); }
.fld input, .field-in, .field-sel, .code-in, .rc-ta, .rc-setup select, .rc-setup input[type=number] {
  border-radius: 14px; border: 0; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.fld input:focus, .field-in:focus, .field-sel:focus, .code-in:focus { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 0 4px rgba(255, 255, 255, 0.08); }
kbd { font-family: var(--mono); font-weight: 500; font-size: 9px; background: rgba(255, 255, 255, 0.1); border: 0; box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.35); min-width: 20px; }

/* type: quiet, few weights */
.logo { font-family: var(--display); font-weight: 700; letter-spacing: -0.05em; font-variation-settings: 'opsz' 96; text-shadow: none; }
.logo span { font-weight: 200; letter-spacing: -0.03em; opacity: 0.7; }
.mode .mt b, .modal-h h2, .center-card h2, #coach h3, .mark { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; }
.card-h h3, .modal h4, #phase, .sb-name, .chip, .tag, .link-tag, .kgrp, .dd-h, .ol-code .lbl, .rc-setup h3, .rc-res h3, .bd-table th, .keys th {
  font-family: var(--mono); font-weight: 500; letter-spacing: 0.1em;
}
.sb-score, #clock, .res-side .s, .stat strong, .pt b, .lb-score, .rc-res .rc-big span, .ol-code .cd { font-family: var(--mono); font-weight: 500; letter-spacing: -0.03em; }
.fi .t, .rc-arm em, .bd-table td.n, .li .sc { font-family: var(--mono); }

/* ---- menu: wordmark, one line, four capsules */
#menu::before { background: linear-gradient(90deg, rgba(7, 8, 11, 0.78) 0%, rgba(7, 8, 11, 0.5) 34%, rgba(7, 8, 11, 0) 62%), linear-gradient(0deg, rgba(7, 8, 11, 0.7), transparent 30%); }
.menu-top { padding: 20px 28px; }
.mark { gap: 8px; font: 600 13px/1 var(--display); letter-spacing: 0; color: #d9dde4; }
.mark svg { width: 22px; height: 22px; }
.menu-nav { gap: 8px; }
.hero .logo { font-size: clamp(52px, 7vw, 96px); margin: 0 0 12px; }
.hero p.tagline { font-size: 15px; color: rgba(235, 238, 243, 0.62); max-width: 360px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin-top: 30px; }
.mode { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 84px; padding: 10px; border-radius: 24px; text-align: center; color: #eef0f4; transform: none; }
.mode:hover { transform: translateY(-2px); }
.mode .mi { width: auto; height: auto; background: none; color: inherit; box-shadow: none; }
.mode .mi svg.i { width: 20px; height: 20px; }
.mode .mt b { font-size: 13.5px; font-weight: 500; }
.mode .mt small, .mode .go { display: none; }
.mode.primary { grid-column: 1 / -1; flex-direction: row; height: 60px; gap: 10px; border-radius: var(--pill); background: rgba(255, 255, 255, 0.92); color: #0a0b0e; box-shadow: inset 0 1px 0 #fff, 0 12px 34px rgba(0, 0, 0, 0.32); backdrop-filter: none; -webkit-backdrop-filter: none; }
.mode.primary::after { display: none; }
.mode.primary:hover { background: #fff; }
.mode.primary .mi { background: none; color: #0a0b0e; box-shadow: none; }
.mode.primary .mt b { font-size: 16px; font-weight: 600; }
.lnk.learn { margin-top: 18px; font-size: 13px; font-weight: 500; color: rgba(235, 238, 243, 0.7); text-decoration: none; }
.lnk.learn:hover { color: #fff; }
.acct-line { margin-top: 10px; font-size: 12.5px; color: rgba(235, 238, 243, 0.5); }
.acct-line .lnk { color: rgba(235, 238, 243, 0.85); text-decoration: none; font-weight: 500; }
.hero p.tagline { text-wrap: balance; }
.menu-foot { padding: 16px 28px 20px; justify-content: flex-start; font-size: 11.5px; color: rgba(235, 238, 243, 0.38); }
.menu-foot .lnk { color: rgba(235, 238, 243, 0.6); text-decoration: none; font-weight: 500; }

/* ---- HUD: fewer edges, more air */
.hud-tl, .hud-tr { top: 18px; }
.hud-tl { left: 18px; } .hud-tr { right: 18px; }
#scorebar { top: 16px; height: 54px; border-radius: var(--pill); overflow: hidden; }
.sb-side { min-width: 132px; padding: 0 20px; gap: 12px; }
.sb-side.red, .sb-side.blue { background: none; }
.sb-name { font-size: 0; display: inline-flex; }
.sb-name::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.sb-side.red .sb-name::before { background: var(--red); box-shadow: 0 0 10px rgba(240, 67, 79, 0.7); }
.sb-side.blue .sb-name::before { background: var(--blue); box-shadow: 0 0 10px rgba(70, 119, 242, 0.7); }
.sb-score { font-size: 26px; min-width: 38px; }
.sb-mid { width: 96px; border: 0; gap: 3px; }
#clock { font-size: 17px; }
#phase { font-size: 7px; color: rgba(235, 238, 243, 0.45); }
.sb-prog { left: 22px; right: 22px; bottom: 6px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
#scorebar.levelup .sb-mid { background: none; }
#feed { top: 70px; right: 18px; width: 248px; gap: 6px; }
#feed .fi:nth-child(n+4) { display: none; }
.fi { border-radius: 16px; padding: 8px 12px; font-size: 11.5px; }
.fi .bul { width: 6px; height: 6px; align-self: center; border-radius: 50%; }
.fi.foul { background: var(--lg-bloom), rgba(255, 70, 80, 0.16); }
.dock { bottom: 18px; gap: 8px; }
.dock.red { left: 18px; } .dock.blue { right: 18px; }
.hp-btn .cap { font-family: var(--mono); font-weight: 500; font-size: 8px; letter-spacing: 0.04em; }
.hp-btn kbd { top: -5px; right: -5px; }
.rc { width: 164px; padding: 9px 14px 10px 16px; }
.rc::before { left: 9px; top: 12px; bottom: auto; width: 6px; height: 6px; border-radius: 50%; }
.rc-top { padding-left: 4px; }
.gauge { height: 2px; }
.center-card p { color: rgba(235, 238, 243, 0.6); }
.keys-mini div { background: rgba(255, 255, 255, 0.05); border: 0; border-radius: 14px; }
.scrim { background: rgba(4, 5, 8, 0.35); }

@media (max-width: 860px) {
  #menu::before { background: linear-gradient(0deg, rgba(7, 8, 11, 0.92) 12%, rgba(7, 8, 11, 0.55) 52%, rgba(7, 8, 11, 0.1)); }
  .menu-top, .menu-foot { padding-left: 20px; padding-right: 20px; }
  .modes { max-width: none; }
  #scorebar { top: 64px; height: 48px; }
  #feed { top: auto; bottom: 120px; left: 12px; right: 12px; width: auto; align-items: center; }
  #feed .fi:nth-child(n+3) { display: none; }
  .sb-side { min-width: 0; padding: 0 14px; }
  .sb-name { display: inline-flex; }
}
@media (max-width: 400px) {
  .mode { height: 76px; }
  .mode .mt b { font-size: 12.5px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --lg-fill: rgba(30, 33, 40, 0.86); --lg-fill-strong: rgba(22, 24, 30, 0.95); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --lg-fill: rgba(30, 33, 40, 0.94); --lg-fill-strong: rgba(22, 24, 30, 0.97); --lg-blur: none; --lg-blur-strong: none; }
}
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* Center launch panels independently of the shared .card positioning rule. */
#hud > #center { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; }
#center > .center-card { position: relative; left: auto; top: auto; transform: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-width: 0; overflow: auto; pointer-events: auto; animation-name: popIn; }
#center .keys-mini { grid-template-columns: 1fr; }

/* Keep all launch actions visible on short laptop and landscape screens. */
@media (max-height: 540px) {
  .menu-top { padding-top: 8px; padding-bottom: 8px; }
  .menu-main { align-items: center; padding-top: 4px; padding-bottom: 4px; }
  .hero .logo { font-size: clamp(32px, 5vw, 48px); margin-bottom: 4px; }
  .hero p.tagline { margin-top: 0; margin-bottom: 0; font-size: 12px; max-width: none; }
  .modes { margin-top: 10px; gap: 6px; }
  .mode { height: 56px; padding: 6px; gap: 4px; }
  .mode.primary { height: 42px; }
  .lnk.learn { margin-top: 8px; }
  .acct-line { margin-top: 4px; }
  .menu-foot { padding-top: 6px; padding-bottom: 8px; font-size: 10px; }
}

/* ------------------------------------------------------------------ Overdrive home screen (robot on its plinth) */
:root { --od: #ff7a1a; --od-2: #ffb36b; --od-soft: rgba(255, 122, 26, 0.14); }
.mark { text-decoration: none; color: #fff; }
.mark-name i { font-style: normal; font-family: var(--mono); font-weight: 600; font-size: 0.78em; letter-spacing: 0.1em; color: var(--od-2); margin-left: 2px; }
a.nav-btn { display: inline-grid; place-items: center; text-decoration: none; }
.team-chip { position: relative; display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; padding: 6px 16px 6px 6px; border: 0; border-radius: 999px; text-align: left;
  background: var(--lg-bloom), var(--lg-fill); box-shadow: var(--lg-depth); backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur); transition: transform 0.45s var(--spring), background-color 0.25s; }
.team-chip::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.team-chip:hover { background: var(--lg-bloom), var(--lg-fill-hover); }
.team-chip:active { transform: scale(0.97); }
.tc-plate { display: grid; place-items: center; min-width: 64px; height: 38px; padding: 0 12px; border-radius: 10px; background: #fff; color: #0b0c0f; font: 800 19px/1 var(--display); letter-spacing: 0.02em;
  box-shadow: inset 0 3px 0 var(--red), inset 0 -3px 0 var(--red), 0 6px 18px rgba(0, 0, 0, 0.35); }
.tc-txt b { display: block; font: 650 14px/1.2 var(--display); }
.tc-txt small { display: block; color: var(--muted); font-size: 12px; }
.spin-hint { position: fixed; z-index: 21; right: 32px; bottom: 26px; display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, 0.55); font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; pointer-events: none; animation: fadeIn 1.4s 1.2s var(--ease) both; }
.spin-hint span { width: 34px; height: 18px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.4); position: relative; }
.spin-hint span::after { content: ''; position: absolute; top: 4px; left: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--od-2); animation: spinHint 2.4s var(--ease) infinite; }
@keyframes spinHint { 50% { transform: translateX(13px); } }
#menu.hidden + .spin-hint, #menu.hidden ~ .spin-hint { display: none; }
#hud { transition: opacity 0.6s var(--ease); }
#hud.intro { opacity: 0; pointer-events: none; }
#hud.intro * { pointer-events: none !important; }
@media (max-width: 860px) { .spin-hint { display: none; } }
@media (max-width: 560px) { .team-chip { margin-top: 12px; } .tc-txt small { display: none; } }
.google-btn { gap: 12px; background: #fff !important; color: #1f1f1f !important; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important; }
.google-btn::after { display: none; }
.google-btn:hover { background: #f2f3f5 !important; }
.google-btn svg.g { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--faint); font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.1); }

/* ------------------------------------------------------------------ editorial theme (Overdrive 009)
   Deep ink and warm cream with one accent; Instrument Serif for headings; hairline frosted panes over the daylight
   venue (no glow, no gradient rim); slow ease-out motion without overshoot. Overrides the tokens above. */
:root {
  --bg: #0d0e10;
  --text: #f2ede3; --muted: #aaa397; --faint: #938c80;
  --display: 'Instrument Sans', ui-sans-serif, sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
  --spring: cubic-bezier(0.22, 0.61, 0.21, 1);
  --od: #e2531b; --od-2: #f08a55; --od-soft: rgba(226, 83, 27, 0.14);
  --lg-fill: rgba(16, 17, 20, 0.7);
  --lg-fill-strong: rgba(13, 14, 16, 0.9);
  --lg-fill-hover: rgba(30, 31, 36, 0.86);
  --lg-blur: blur(20px) saturate(115%);
  --lg-blur-strong: blur(26px) saturate(110%);
  --lg-bloom: linear-gradient(transparent, transparent);
  --lg-rim: linear-gradient(rgba(242, 237, 227, 0.14), rgba(242, 237, 227, 0.14));
  --lg-depth: 0 1px 0 rgba(0, 0, 0, 0.2);
  --accent: #f2ede3;
}
body { background: var(--bg); }
.logo { font: 400 64px/0.95 var(--serif); letter-spacing: -0.01em; text-shadow: none; }
.logo span { font-weight: 400; font-style: italic; }
.hero .logo { font-size: clamp(60px, 7.2vw, 108px); }
.tagline { color: #d6d0c5; }
.modal-h h2, .center-card h2, #coach h3, .mode .mt b, .res-side .s { font-family: var(--serif); font-weight: 400; letter-spacing: 0; }
.mode .mt b { font-size: 19px; }
.mark { font-family: var(--serif); font-weight: 400; letter-spacing: 0; font-size: 19px; }
.mark-name i { color: var(--od-2); }
/* the menu column sits on an ink wash: the venue behind it is bright daylight */
#menu::before { background: linear-gradient(90deg, rgba(13, 14, 16, 0.94) 0%, rgba(13, 14, 16, 0.84) 30%, rgba(13, 14, 16, 0.18) 58%, rgba(13, 14, 16, 0) 72%), linear-gradient(0deg, rgba(13, 14, 16, 0.75), transparent 28%); }
@media (max-width: 860px) { #menu::before { background: linear-gradient(0deg, rgba(13, 14, 16, 0.97) 18%, rgba(13, 14, 16, 0.8) 55%, rgba(13, 14, 16, 0.1)); } }
.btn, .hud-btn, .nav-btn, .pill-btn, .user-chip, .mode, .icon-btn, .tbtn { border-radius: 10px; }
.btn.primary { background: #f2ede3; color: #0d0e10; box-shadow: none; }
.btn.primary:hover { background: #fff; }
.mode:hover, .mode:active { transform: none; }
.mode.primary { background: #f2ede3; color: #0d0e10; }
.mode.primary .mi { background: transparent; color: #0d0e10; box-shadow: none; }
.mode .mi { background: transparent; }
.mode:active, .hud-btn:active, .hp-btn:active, .btn:active, .nav-btn:active, .icon-btn:active, .tbtn:active { transform: translateY(1px); }
.team-chip { border-radius: 12px; }
.tc-plate { font-family: var(--display); font-weight: 700; }
.tc-txt b { font: 600 14px/1.2 var(--display); }
/* arriving from the landing page: its last frame stays on screen while the simulator loads */
#loading.done { transition: opacity 0.9s var(--ease); }
#loading { background: var(--bg); }

/* audit pass: no glows, a visible focus ring on every control, 44 px touch targets, the shared film grain */
:focus-visible { outline: 2px solid var(--od-2); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.fld input:focus-visible, .field-in:focus-visible, .field-sel:focus-visible, .code-in:focus-visible, .rc-ta:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--od-2), 0 0 0 3px rgba(240, 138, 85, 0.18); }
@media (pointer: coarse) { .btn.sm { height: 44px; } .icon-btn, .nav-btn { width: 44px; height: 44px; } }
#menu::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.045;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ------------------------------------------------------------------ design review, November 2026
   One token set with Scout and the landing page (od.css values), one radius scale (10 / 12 / 16 / 18), no glows,
   no blur over the live canvas, readable HUD type, and restrained entrance motion (transform and opacity only). */
:root {
  --red: #d8434e; --red-2: #f0a0a6; --red-soft: rgba(216, 67, 78, 0.16);
  --blue: #4370e0; --blue-2: #a9bdf2; --blue-soft: rgba(67, 112, 224, 0.18);
  --gold: #d9a441; --gold-soft: rgba(217, 164, 65, 0.16); --green: #4fb58a; --warn: #d9a441; --danger: #e0584f;
  --stroke: rgba(242, 237, 227, 0.12); --stroke-2: rgba(242, 237, 227, 0.2); --edge: rgba(242, 237, 227, 0.12); --edge-hi: rgba(242, 237, 227, 0.22);
  --surface: rgba(16, 17, 20, 0.86); --surface-solid: #131418; --surface-2: rgba(27, 29, 34, 0.9); --surface-3: #1b1d22;
  --glass: rgba(16, 17, 20, 0.78); --glass-strong: rgba(13, 14, 16, 0.9); --glass-solid: rgba(13, 14, 16, 0.96);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
/* radii */
.btn, .hud-btn, .nav-btn, .pill-btn, .user-chip, .mode, .icon-btn, .tbtn, .mode.primary { border-radius: 10px; }
#scorebar, .seg, .tabs, #toast, .dropdown { border-radius: 12px; }
.seg button, .tabs button { border-radius: 9px; }
.card, .rc-panel, #coach { border-radius: 16px; }
.modal, .center-card { border-radius: 18px; }
kbd { border-radius: 5px; }
.chip, .tag, .link-tag { border-radius: 8px; }
/* selected segment: solid cream, as in Scout */
.tabs button.on, .seg button.on { background: #f2ede3; color: #0d0e10; box-shadow: none; }
/* Play: a solid cream slab with sans type, like every other primary button on the site */
.mode.primary { height: 60px; }
.mode.primary .mt b { font: 600 16px/1 var(--font); letter-spacing: 0.01em; }
.mode.primary .mi svg { transition: transform 0.4s var(--ease-out); }
.mode.primary:hover .mi svg { transform: translateX(3px); }
.mode .mi svg { transition: transform 0.3s var(--ease-out); }
.mode:not(.primary):hover .mi svg { transform: translateY(-2px); }
.mode:active, .btn:active, .hud-btn:active, .nav-btn:active, .icon-btn:active { transform: scale(0.98); }
/* HUD type at readable sizes */
#phase { font: 500 9.5px/1 var(--mono); letter-spacing: 0.12em; color: var(--muted); }
.hp-btn { min-width: 64px; }
.hp-btn .cap { font-size: 10px; }
kbd { font-size: 10.5px; min-width: 18px; height: 18px; background: #0d0e10; box-shadow: inset 0 0 0 1px rgba(242, 237, 227, 0.2); color: #e4ddcf; }
.kgrp { align-self: center; line-height: 1; font-size: 10px; vertical-align: middle; }
/* no glows */
.sb-side.red .sb-name::before, .sb-side.blue .sb-name::before, .net-pill .dot, .rc-dot.running, .hp-btn .st.on { box-shadow: none; }
@keyframes pulse { 50% { opacity: 0.55; } }
/* scrims are a flat ink wash: blurring the live 3D every frame is slow and soft */
.scrim { background: rgba(13, 14, 16, 0.72); backdrop-filter: none; -webkit-backdrop-filter: none; align-items: center; }
.modal, .dropdown, #toast, .center-card, #coach, .rc-panel, #details { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(15, 16, 19, 0.96); }
.lg, .hud-btn, #scorebar, .hp-btn, .rc, .fi, .mode, .card, .icon-btn, .pill-btn, .user-chip, .tbtn, .joy, .nav-btn, .btn:not(.primary):not(.ghost):not(.danger) {
  background: rgba(15, 16, 19, 0.82); backdrop-filter: blur(14px) saturate(110%); -webkit-backdrop-filter: blur(14px) saturate(110%);
}
.mode.primary { background: #f2ede3; }
.mode.primary:hover { background: #fff; }
/* the menu header sits on an ink band so its buttons read over the mural */
.menu-top::before { content: ''; position: absolute; inset: 0 0 -60px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(13, 14, 16, 0.85), rgba(13, 14, 16, 0)); }
.menu-top { view-transition-name: od-nav; }
.mark { font: 400 22px/1 var(--serif); letter-spacing: 0; }
.mark-name i { font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: 0.1em; color: var(--od-2); }
@media (max-width: 760px) { .menu-top .mark-name { display: inline; } .mark { font-size: 19px; } }
/* team plate: cream with ink figures, no licence-plate bars */
.tc-plate { background: #f2ede3; color: #0d0e10; font: 600 18px/1 var(--mono); letter-spacing: 0.02em; box-shadow: none; }
.tc-plate::before, .tc-plate::after { display: none; }
/* learn to play + sign in: one quiet line */
.lnk.learn, .acct-line, .acct-line .lnk { font: 500 13px/1.5 var(--font); }
.acct-line .lnk, .lnk.learn { text-decoration-color: rgba(242, 237, 227, 0.3); text-underline-offset: 4px; color: #f2ede3; }
/* banners rise through a mask instead of blurring in */
@keyframes bannerIn { 0% { opacity: 0; transform: translateY(14px) scale(0.98); } 14% { opacity: 1; transform: none; } 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
#banner .bn { font-family: var(--serif); font-weight: 400; letter-spacing: 0.02em; text-shadow: none; }
/* menu entrance: the wordmark, then the copy, then the actions */
@keyframes simRise { from { opacity: 0; transform: translateY(16px); } }
@keyframes simFade { from { opacity: 0; } }
#menu:not(.hidden) .hero > * { animation: simRise 0.8s var(--ease-out) backwards; }
#menu:not(.hidden) .hero > :nth-child(1) { animation-delay: 0.05s; }
#menu:not(.hidden) .hero > :nth-child(2) { animation-delay: 0.16s; }
#menu:not(.hidden) .hero > :nth-child(3) { animation-delay: 0.24s; }
#menu:not(.hidden) .hero > :nth-child(4) { animation-delay: 0.32s; }
#menu:not(.hidden) .hero > :nth-child(n+5) { animation-delay: 0.42s; }
#menu:not(.hidden) .modes > * { animation: simRise 0.7s var(--ease-out) backwards; }
#menu:not(.hidden) .modes > :nth-child(1) { animation-delay: 0.34s; } #menu:not(.hidden) .modes > :nth-child(2) { animation-delay: 0.41s; }
#menu:not(.hidden) .modes > :nth-child(3) { animation-delay: 0.48s; } #menu:not(.hidden) .modes > :nth-child(4) { animation-delay: 0.55s; }
#menu:not(.hidden) .menu-nav > * { animation: simFade 0.6s var(--ease-out) backwards; }
#menu:not(.hidden) .menu-nav > :nth-child(1) { animation-delay: 0.5s; } #menu:not(.hidden) .menu-nav > :nth-child(2) { animation-delay: 0.55s; }
#menu:not(.hidden) .menu-nav > :nth-child(3) { animation-delay: 0.6s; } #menu:not(.hidden) .menu-nav > :nth-child(4) { animation-delay: 0.65s; }
/* dialogs and cards settle in */
@keyframes simPop { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.modal, .center-card { animation: simPop 0.42s var(--ease-out); }
.scrim { animation: simFade 0.3s var(--ease-out); }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; }
@media (prefers-reduced-motion: reduce) { #menu .hero > *, #menu .modes > *, #menu .menu-nav > *, .modal, .center-card, .scrim { animation: none !important; } }

/* ---- design review round 2: flat surfaces (no blur over the live 3D anywhere), readable HUD, sans labels */
.lg, .hud-btn, #scorebar, .hp-btn, .rc, .fi, .mode, .card, .icon-btn, .pill-btn, .user-chip, .tbtn, .joy, .nav-btn, .team-chip,
.btn:not(.primary):not(.ghost):not(.danger), .modal, .dropdown, #toast, .center-card, #coach, .rc-panel, #details {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.lg, .hud-btn, #scorebar, .hp-btn, .rc, .fi, .mode:not(.primary), .icon-btn, .pill-btn, .user-chip, .tbtn, .nav-btn, .team-chip, .btn:not(.primary):not(.ghost):not(.danger) { background: rgba(13, 14, 16, 0.88); }
.hp-btn, .rc, .fi { border-radius: 14px; }
.mode .mt b, .mode:not(.primary) .mt b { font: 600 15px/1.2 var(--font); letter-spacing: 0.005em; }
#phase { font-size: 11px; letter-spacing: 0.1em; }
.hp-btn .cap, .hp-btn .cap b, .rc .num { font-size: 11px; }
kbd, .hp-btn kbd { font-size: 11px; min-width: 18px; height: 18px; }
body.modal-open #center { visibility: hidden; }
/* banners sit on an ink plate so they read over the light field */
#banner .bn { display: inline-block; padding: 18px 30px 16px; border-radius: 16px; background: rgba(13, 14, 16, 0.84); color: #f2ede3; }
#banner .bn small { font: 500 12px/1.3 var(--mono); letter-spacing: 0.14em; color: rgba(242, 237, 227, 0.8); }
#banner .bn.gold { color: var(--gold); }
/* drag hint: plain words with a turn glyph, not a switch */
.spin-hint span { display: none; }
.spin-hint::before { content: '\21BB'; font: 400 16px/1 var(--font); color: rgba(242, 237, 227, 0.7); }
.menu-top::before { inset: 0 0 -120px; background: linear-gradient(180deg, rgba(13, 14, 16, 0.92), rgba(13, 14, 16, 0.55) 55%, rgba(13, 14, 16, 0)); }
.acct-line .lnk { margin-right: 0; }
/* round 2: the STARBURST / key-listening pulse is a gentle breath, not a half fade */
@keyframes pulse { 50% { opacity: 0.82; } }
/* phones: the touch toolbar and the coach never sit on the pre-match card or the scorebar */
#hud:has(#center .center-card) .t-top { visibility: hidden; }
@media (max-width: 700px), (max-height: 500px) {
  #coach { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; width: auto; max-width: none; }
}
@media (max-height: 500px) { .t-top { top: 64px; } }

/* ---- layout pass: nothing overlaps or clips, at any size (desktop, tablet, phone portrait and landscape) */
/* banners span the screen (minus a gutter) so the subtitle wraps at the edge, not at half the width */
#banner { left: 16px; right: 16px; transform: translateY(-50%); }
#banner .bn { max-width: 100%; }
/* foul lines: ink like every other feed line, so the text reads over the bright field */
.fi.foul { background: rgba(13, 14, 16, 0.88); box-shadow: inset 0 0 0 1px rgba(216, 67, 78, 0.5); }
.fi > span:last-child { text-wrap: pretty; }
/* the pinned score breakdown takes the stage: the feed and banners would sit half under it */
#hud:has(#details:not(.hidden)) #feed, #hud:has(#details:not(.hidden)) #banner { visibility: hidden; }
/* dialog footers wrap instead of pushing buttons off the left edge */
.modal-f { flex-wrap: wrap; }
@media (max-width: 520px) { .modal-f > .btn { flex: 1 1 auto; } }
/* short screens: dialogs use the full height, and the result fits without scrolling */
@media (max-height: 800px) {
  .scrim { padding: 16px; }
  .modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .res-hero { padding: 12px 16px; margin-bottom: 10px; }
  .res-side .s { font-size: 44px; }
  .res-side .rp { margin-top: 6px; }
  .modal .bd-table td { padding-top: 4px; padding-bottom: 4px; }
}
@media (max-height: 500px) {
  .scrim { padding: 10px 16px; }
  .modal { max-height: calc(100dvh - 20px); }
  .modal-h { padding: 12px 18px 6px; }
  .modal-b { padding: 4px 18px 14px; }
  .modal-f { padding: 8px 18px 12px; }
  .tabs { margin: 0 18px 8px; }
  .modal .form { gap: 8px; }
  .modal .btn.lg { height: 44px; }
}
/* tablet portrait without touch: the coach sits under the scorebar, not on it */
@media (max-width: 860px) and (min-width: 701px) and (min-height: 501px) { #coach { top: 124px; } }
/* phones and tablets in portrait: scorebar, then the touch toolbar, then the breakdown; feed and coach above the sticks */
@media (pointer: coarse) and (max-width: 860px) and (min-height: 501px) {
  .t-top { top: 122px; bottom: auto; }
  #details { top: 168px; max-height: calc(100dvh - 360px); overflow-y: auto; }
  #feed { top: auto; bottom: calc(184px + env(safe-area-inset-bottom, 0px)); }
  #coach { top: auto; bottom: calc(184px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; width: auto; }
}
/* landscape phones and short windows: the scorebar joins the top row; the pre-match card and breakdown start below it */
@media (max-height: 500px) {
  .hud-tl, .hud-tr { top: 10px; }
  #scorebar { top: 8px; height: 44px; }
  #details { top: 60px; max-height: calc(100dvh - 72px); overflow-y: auto; padding: 8px 14px 10px; }
  #details .bd-table td { padding-top: 4px; padding-bottom: 4px; }
  #hud > #center { padding: 60px 16px 10px; }
  #center > .center-card { max-height: calc(100dvh - 70px); padding: 18px 22px 16px; }
}
@media (pointer: coarse) and (max-height: 500px) {
  /* the toolbar moves to the bottom, between the joystick and the arm buttons; feed and coach stay in that lane too */
  .t-top { top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  #feed, #coach { top: auto; bottom: calc(62px + env(safe-area-inset-bottom, 0px)); left: calc(max(18px, env(safe-area-inset-left, 0px)) + 166px); right: calc(max(16px, env(safe-area-inset-right, 0px)) + 168px); width: auto; }
  #coach { max-height: calc(100dvh - 124px); overflow-y: auto; }
  /* the breakdown stays in the same lane and ends above the toolbar (it scrolls if it has to) */
  #details { left: calc(max(18px, env(safe-area-inset-left, 0px)) + 166px); right: calc(max(16px, env(safe-area-inset-right, 0px)) + 168px); width: auto; transform: none;
    max-height: calc(100dvh - 128px - env(safe-area-inset-bottom, 0px)); }
}
/* small screens: while the coach talks, the feed steps aside (they share the lane above the controls) */
@media (max-width: 700px), (max-height: 500px) { #hud:has(#coach:not(.hidden)) #feed { visibility: hidden; } }
/* short menu: team chip, actions and the two links fit one screen */
@media (max-height: 540px) {
  .team-chip { margin-top: 8px; padding: 4px 14px 4px 4px; }
  .tc-plate { height: 30px; min-width: 54px; font-size: 15px; }
  .tc-txt small { display: none; }
  .modes { max-width: 520px; }
  .lnk.learn { margin-right: 16px; }
  .acct-line { display: inline-block; margin-top: 8px; }
}

/* ---- instant start: the loading screen IS the home screen (a still of the venue + the wordmark where the menu puts
   it), so the page looks ready from the first paint and the live menu fades in over it without a jump */
html:not(.handoff-in) #loading:not(.handoff) {
  place-items: center start; padding-left: 32px;
  background: linear-gradient(90deg, rgba(13, 14, 16, 0.94) 0%, rgba(13, 14, 16, 0.84) 30%, rgba(13, 14, 16, 0.18) 58%, rgba(13, 14, 16, 0) 72%),
    linear-gradient(0deg, rgba(13, 14, 16, 0.75), transparent 28%), url('../assets/poster-sim-wide.jpg') center / cover no-repeat, #0d0e10;
}
html:not(.handoff-in) #loading:not(.handoff) .load-box { width: min(452px, 86vw); text-align: left; }
html:not(.handoff-in) #loading:not(.handoff) .logo { font-size: clamp(60px, 7.2vw, 108px); margin: 0; animation: simRise 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
html:not(.handoff-in) #loading:not(.handoff) .load-team { margin-top: 10px; color: #d6d0c5; font: 500 11px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; animation: simFade 0.9s 0.15s backwards; }
html:not(.handoff-in) #loading:not(.handoff) .load-bar { width: 100%; max-width: 280px; height: 2px; margin: 28px 0 10px; border-radius: 0; background: rgba(242, 237, 227, 0.12); }
html:not(.handoff-in) #loading:not(.handoff) .load-bar i { background: var(--od); width: 8%; transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
html:not(.handoff-in) #loading:not(.handoff) #loading-status { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; color: rgba(242, 237, 227, 0.6); }
@media (max-width: 860px) {
  html:not(.handoff-in) #loading:not(.handoff) { place-items: end start; padding: 0 20px 18vh;
    background: linear-gradient(0deg, rgba(13, 14, 16, 0.97) 18%, rgba(13, 14, 16, 0.8) 55%, rgba(13, 14, 16, 0.1)), url('../assets/poster-sim-tall.jpg') center / cover no-repeat, #0d0e10; }
}
#loading.done { transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1); }

/* arriving from the landing page: its last frame from the first paint, then the wash and the wordmark settle over it
   while the simulator loads, so the camera move flows straight into the menu */
html.handoff-in #loading { place-items: center start; padding-left: 32px; background: var(--handoff) center / cover no-repeat, #0d0e10; }
html.handoff-in #loading::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(13, 14, 16, 0.94) 0%, rgba(13, 14, 16, 0.84) 30%, rgba(13, 14, 16, 0.18) 58%, rgba(13, 14, 16, 0) 72%), linear-gradient(0deg, rgba(13, 14, 16, 0.75), transparent 28%);
  animation: simFade 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
html.handoff-in #loading .load-box { position: relative; inset: auto; width: min(452px, 86vw); padding: 0; text-align: left; }
html.handoff-in #loading .load-box > * { display: block; }
html.handoff-in #loading .load-box > #loading-retry.hidden { display: none; }
html.handoff-in #loading .logo { font-size: clamp(60px, 7.2vw, 108px); margin: 0; animation: simRise 0.9s 0.2s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
html.handoff-in #loading .load-team { margin-top: 10px; color: #d6d0c5; font: 500 11px/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; animation: simFade 0.9s 0.35s backwards; }
html.handoff-in #loading .load-bar { width: 100%; max-width: 280px; height: 2px; margin: 28px 0 10px; border-radius: 0; background: rgba(242, 237, 227, 0.12); }
html.handoff-in #loading .load-bar i { background: var(--od); }
html.handoff-in #loading #loading-status { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; color: rgba(242, 237, 227, 0.6); }
@media (max-width: 860px) {
  html.handoff-in #loading { place-items: end start; padding: 0 20px 18vh; }
  html.handoff-in #loading::before { background: linear-gradient(0deg, rgba(13, 14, 16, 0.97) 18%, rgba(13, 14, 16, 0.8) 55%, rgba(13, 14, 16, 0.1)); }
}
body.logo-handed #menu .hero > :nth-child(1) { animation: none; }   /* the loading wordmark is already there */
body.logo-handed:not(.logo-done) #menu .hero .logo { opacity: 0; }
