:root {
  --bg: #070b14;
  --panel: rgba(9, 14, 26, 0.86);
  --panel2: rgba(18, 26, 44, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef2f8;
  --muted: #9aa7bb;
  --accent: #ffd23f;
  --accent2: #36c2ff;
  --good: #3ddc84;
  --bad: #ff5a5a;
  --head: 'Teko', Impact, 'Arial Narrow', sans-serif;
  --body: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--body); user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.35em; margin: 0 0.3em 0 0; border-radius: 4px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 2px; font-family: var(--body); font-weight: 700; font-size: 0.9em; text-align: center; color: #fff; }

/* ---------------------------------------------------------- loading */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #13213d, #04070d 70%); transition: opacity 0.7s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld-logo { font-family: var(--head); font-size: 96px; font-weight: 700; letter-spacing: 4px; line-height: 1; }
.ld-logo span, .title span { color: var(--accent); margin-left: 12px; }
.ld-bar { width: 260px; height: 4px; background: rgba(255,255,255,0.1); margin: 18px 0 10px; overflow: hidden; border-radius: 2px; }
.ld-bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: ld 1.1s infinite ease-in-out; }
@keyframes ld { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.ld-text { color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: 14px; }

/* ---------------------------------------------------------- menus */
.menu { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 24px; overflow-y: auto; background: linear-gradient(180deg, rgba(4,8,16,0.35), rgba(4,8,16,0.8)); }
.menu.main { justify-content: center; align-items: flex-start; padding-left: 8vw; background: linear-gradient(90deg, rgba(4,8,16,0.92) 0%, rgba(4,8,16,0.6) 38%, rgba(4,8,16,0) 70%); }
.menu.pause, .menu.break, .menu.final, .menu.settings, .menu.controls, .menu.teamselect { background: rgba(4, 8, 16, 0.78); backdrop-filter: blur(6px); }
.title-wrap { margin-bottom: 36px; }
.title-kicker { font-family: var(--head); letter-spacing: 8px; color: var(--accent2); font-size: 22px; }
.title { font-family: var(--head); font-size: clamp(72px, 11vw, 150px); line-height: 0.85; margin: 0; letter-spacing: 3px; text-shadow: 0 6px 30px rgba(0,0,0,0.6); }
.title-sub { color: var(--muted); font-size: 20px; letter-spacing: 1px; margin-top: 6px; }
.main-buttons { display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
.btn { font-family: var(--head); font-size: 26px; letter-spacing: 2px; padding: 8px 26px 4px; color: #fff; background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 4px; cursor: pointer; text-align: left; transition: all 0.12s; }
.btn.big { font-size: 34px; }
.btn:hover, .btn.focus { background: linear-gradient(90deg, rgba(255,210,63,0.25), rgba(255,210,63,0.05)); border-left-color: var(--accent); transform: translateX(6px); }
.btn.go { background: linear-gradient(90deg, #ffd23f, #ffb300); color: #111; border: none; }
.btn.go.focus, .btn.go:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.8), 0 10px 30px rgba(255,200,0,0.35); transform: translateY(-2px); }
.menu-foot { position: fixed; bottom: 1.4vh; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 15px; letter-spacing: 1px; }
.menu.main .menu-foot { left: 8vw; transform: none; }
.menu-note { color: var(--muted); margin: 12px 0; font-size: 16px; text-align: center; }
.screen-title { font-family: var(--head); font-size: clamp(34px, 6vh, 54px); letter-spacing: 4px; margin-bottom: 1.2vh; line-height: 1; }

.ts-wrap { display: flex; align-items: stretch; gap: 26px; }
.team-card { position: relative; width: 290px; padding: 1.8vh 20px 1.4vh; border-radius: 10px; background: linear-gradient(160deg, var(--tc), #0b0f18 75%); border: 2px solid rgba(255,255,255,0.1); text-align: center; overflow: hidden; transition: transform 0.15s; }
.team-card.you { box-shadow: 0 0 0 2px var(--accent); }
.team-card.focus { transform: translateY(-4px); border-color: #fff; }
.tc-side { font-family: var(--head); letter-spacing: 3px; font-size: 20px; color: #fff; opacity: 0.85; }
.team-card.you .tc-side { color: var(--accent); }
.tc-arrows { position: absolute; top: calc(4vh + min(75px, 8.5vh)); left: 8px; right: 8px; display: flex; justify-content: space-between; }
.tc-arrows button, .opt-sel button { background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 14px; }
.tc-arrows button:hover, .opt-sel button:hover { background: var(--accent); color: #000; }
.tc-logo { width: min(150px, 17vh); height: min(150px, 17vh); margin: 0.6vh auto 0.4vh; display: block; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5)); }
.tc-city { font-size: 20px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.8); }
.tc-name { font-family: var(--head); font-size: clamp(32px, 5.5vh, 44px); line-height: 0.9; letter-spacing: 1px; }
.tc-ovr { font-family: var(--head); font-size: clamp(40px, 7vh, 58px); line-height: 1; margin: 0.6vh 0 0.3vh; }
.tc-ovr small { font-size: 18px; margin-left: 6px; color: var(--muted); letter-spacing: 2px; }
.rbar { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 700; letter-spacing: 1px; }
.rbar div { flex: 1; height: 8px; background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden; }
.rbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.rbar b { width: 26px; text-align: right; }
.tc-stars { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: rgba(255,255,255,0.85); text-align: left; }
.tc-stars b { color: var(--accent); float: right; }
.ts-vs { align-self: center; font-family: var(--head); font-size: 64px; color: var(--muted); text-align: center; line-height: 0.8; }
.ts-vs small { display: block; font-size: 24px; }
.ts-opts { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 0.8vh 20px; margin: 2vh 0 1vh; }
.ts-opts.wide { grid-template-columns: minmax(420px, 1fr); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 12px; border-radius: 6px; background: rgba(255,255,255,0.04); border: 1px solid transparent; }
.opt.focus { border-color: var(--accent); background: rgba(255,210,63,0.08); }
.opt label { font-size: 18px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.opt-sel { display: flex; align-items: center; gap: 10px; }
.opt-sel span { min-width: 120px; text-align: center; font-family: var(--head); font-size: 26px; letter-spacing: 1px; line-height: 1; padding-top: 4px; }
.opt-sel button { width: 28px; height: 28px; font-size: 11px; }
.ts-actions { display: flex; gap: 14px; margin-top: 1.6vh; }
.ts-actions .btn { text-align: center; }

.controls-table { width: min(900px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 0; max-height: 64vh; overflow-y: auto; }
.ct-head, .ct-row { display: grid; grid-template-columns: 1.1fr 1.5fr 1fr; padding: 5px 18px; font-size: 18px; }
.ct-head { color: var(--accent); font-family: var(--head); font-size: 22px; letter-spacing: 2px; border-bottom: 1px solid var(--line); }
.ct-row:nth-child(odd) { background: rgba(255,255,255,0.03); }
.ct-row span:first-child { color: var(--muted); }

.pause-grid { display: flex; gap: 40px; align-items: flex-start; }
.pause-buttons { display: flex; flex-direction: column; gap: 10px; min-width: 300px; }
.stats-table { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 0; min-width: 380px; }
.st-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; text-align: center; padding: 0.35vh 12px; font-size: 18px; }
.st-row.head { font-family: var(--head); font-size: 26px; border-bottom: 1px solid var(--line); }
.st-row span { color: var(--muted); letter-spacing: 1px; text-transform: uppercase; font-size: 15px; align-self: center; }
.qtable { border-collapse: collapse; margin: 1vh auto 1.6vh; background: var(--panel); border-radius: 8px; overflow: hidden; font-size: 20px; }
.qtable th, .qtable td { padding: 0.6vh 16px; text-align: center; border-bottom: 1px solid var(--line); }
.qtable th { color: var(--muted); font-weight: 600; }
.qtable td.tn { text-align: left; font-family: var(--head); font-size: 24px; display: flex; align-items: center; gap: 8px; }
.qtable td.tn img { width: 28px; height: 28px; }
.qtable td.tot { font-family: var(--head); font-size: 28px; color: var(--accent); }
.break-title { font-family: var(--head); font-size: clamp(40px, 8vh, 72px); letter-spacing: 4px; line-height: 1; text-align: center; }
.break-sub { color: var(--muted); font-size: 22px; margin-bottom: 6px; }
.break-grid { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.perfs { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; min-width: 360px; }
.perf-title { font-family: var(--head); letter-spacing: 2px; color: var(--accent); font-size: 24px; }
.perf { display: grid; grid-template-columns: 100px 1fr; padding: 5px 0; border-bottom: 1px solid var(--line); }
.perf span { color: var(--muted); letter-spacing: 1px; }
.perf b { font-size: 20px; }
.perf em { grid-column: 2; color: var(--muted); font-style: normal; font-size: 15px; }
.final-score { display: flex; align-items: center; gap: 30px; font-family: var(--head); font-size: clamp(60px, 12vh, 110px); line-height: 1; margin: 0.5vh 0; }
.final-score span { display: flex; align-items: center; gap: 16px; }
.final-score img { width: min(90px, 10vh); height: min(90px, 10vh); }
.final-score em { font-size: 28px; color: var(--muted); font-style: normal; letter-spacing: 3px; }
.verdict { font-family: var(--head); font-size: 36px; letter-spacing: 12px; padding: 2px 20px 0; border-radius: 4px; }
.verdict.win { color: #111; background: var(--good); }
.verdict.loss { color: #fff; background: var(--bad); }

/* ---------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.scorebug { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: stretch; height: 56px; background: #0a0f1b; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.55); overflow: hidden; border: 1px solid rgba(255,255,255,0.12); }
.sb-team { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 8px; background: linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 60%, #000)); min-width: 168px; }
.sb-logo { width: 42px; height: 42px; }
.sb-abbr { font-family: var(--head); font-size: 30px; letter-spacing: 1px; line-height: 1; padding-top: 5px; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.sb-score { margin-left: auto; font-family: var(--head); font-size: 44px; line-height: 1; padding-top: 6px; min-width: 40px; text-align: right; text-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.sb-poss { position: absolute; top: 5px; right: 6px; width: 10px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; box-shadow: 0 0 8px var(--accent); }
.sb-poss.on { opacity: 1; }
.sb-to { position: absolute; bottom: 4px; left: 58px; display: flex; gap: 4px; }
.sb-to i { width: 16px; height: 3px; background: #ffd23f; border-radius: 2px; }
.sb-to i.used { background: rgba(255,255,255,0.18); }
.sb-clock { display: flex; align-items: center; gap: 12px; padding: 0 16px; font-family: var(--head); font-size: 32px; line-height: 1; padding-top: 5px; background: #111a2c; }
.sb-clock span:first-child { color: var(--muted); font-size: 26px; }
.sb-down { display: flex; align-items: center; padding: 5px 16px 0; font-family: var(--head); font-size: 28px; color: var(--accent); background: #0d1424; white-space: nowrap; }
.sb-down em { font-style: normal; color: #fff; margin-left: 10px; font-size: 22px; }
.sb-pc { display: flex; align-items: center; justify-content: center; width: 50px; padding-top: 5px; font-family: var(--head); font-size: 30px; background: #1a2338; }
.sb-pc.warn { color: #111; background: var(--bad); }

.banner-wrap { position: absolute; top: 16%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.3s; }
.banner-wrap.show { opacity: 1; }
.banner-wrap.anim .banner { animation: slam 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes slam { 0% { transform: scale(2.2) skewX(-8deg); opacity: 0; } 100% { transform: scale(1) skewX(-8deg); opacity: 1; } }
.banner { font-family: var(--head); font-size: 88px; letter-spacing: 4px; line-height: 0.95; padding: 8px 40px 0; transform: skewX(-8deg); background: linear-gradient(90deg, transparent, rgba(6,10,20,0.85) 15%, rgba(6,10,20,0.85) 85%, transparent); text-shadow: 0 4px 12px rgba(0,0,0,0.6); white-space: nowrap; }
.banner-sub { font-family: var(--head); font-size: 30px; letter-spacing: 3px; color: var(--muted); margin-top: 4px; }
.k-td .banner { font-size: 120px; background: linear-gradient(90deg, transparent, rgba(255,190,0,0.9) 12%, rgba(255,120,0,0.9) 88%, transparent); color: #fff; }
.k-td .banner-sub { color: #fff; text-shadow: 0 2px 6px #000; }
.k-big .banner { background: linear-gradient(90deg, transparent, rgba(200,20,40,0.88) 15%, rgba(140,10,30,0.88) 85%, transparent); }
.k-good .banner { color: #eaffd9; background: linear-gradient(90deg, transparent, rgba(20,110,50,0.88) 15%, rgba(10,80,40,0.88) 85%, transparent); font-size: 70px; }
.k-bad .banner { color: #ffd7d7; font-size: 66px; }
.k-info .banner { font-size: 58px; }
.mini-msg { position: absolute; top: 30%; left: 50%; transform: translate(-50%, 10px); font-family: var(--head); font-size: 34px; letter-spacing: 2px; color: var(--accent); text-shadow: 0 2px 8px #000; opacity: 0; transition: all 0.25s; white-space: nowrap; }
.mini-msg.show { opacity: 1; transform: translate(-50%, 0); }
.ticker { position: absolute; top: 16px; left: 16px; max-width: min(640px, 60vw); padding: 8px 14px; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 4px; font-size: 18px; opacity: 0; transform: translateY(-8px); transition: all 0.35s; }
.ticker.show { opacity: 1; transform: none; }
.ticker b { font-family: var(--head); color: var(--accent); letter-spacing: 2px; margin-right: 8px; font-size: 20px; }
.hints { position: absolute; left: 16px; bottom: 26px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.hints span { background: rgba(6,10,20,0.7); padding: 3px 10px 3px 4px; border-radius: 4px; width: fit-content; }
.hints kbd { background: var(--accent); color: #000; border-color: #b58f00; }
.play-name { position: absolute; top: 16px; right: 16px; text-align: right; font-family: var(--head); font-size: 34px; letter-spacing: 1px; line-height: 1; padding: 8px 14px 4px; background: var(--panel); border-right: 4px solid var(--accent2); border-radius: 4px; opacity: 0; transition: opacity 0.3s; }
.play-name.show { opacity: 1; }
.play-name small { display: block; font-family: var(--body); font-size: 13px; letter-spacing: 3px; color: var(--muted); }
.play-name i { font-size: 20px; color: var(--muted); font-style: normal; }
.windbox { position: absolute; right: 16px; bottom: 26px; display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--panel); border-radius: 4px; font-family: var(--head); font-size: 22px; letter-spacing: 1px; padding-top: 8px; }
.windbox .wx { color: var(--muted); font-size: 18px; margin-right: 4px; }
.wind-arrow { display: inline-block; color: var(--accent2); transition: transform 0.4s; }
.corner-hint { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.35); font-size: 13px; letter-spacing: 2px; }

.icon-layer { position: absolute; inset: 0; }
.rec-icon { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: var(--c); color: #fff; font-family: var(--head); font-size: 24px; padding-top: 4px; box-shadow: 0 3px 10px rgba(0,0,0,0.6), inset 0 -3px 0 rgba(0,0,0,0.25); border: 2px solid rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.rec-icon.primary { box-shadow: 0 0 0 3px rgba(255,210,63,0.9), 0 3px 10px rgba(0,0,0,0.6); }
.rec-icon svg { position: absolute; inset: -6px; width: 48px; height: 48px; transform: rotate(-90deg); pointer-events: none; }
.rec-icon .pw-bg { fill: none; stroke: transparent; stroke-width: 3; }
.rec-icon .pw { fill: none; stroke: #fff; stroke-width: 3.5; stroke-dasharray: 113; stroke-dashoffset: calc(113 - 113 * var(--p, 0)); opacity: 0; }
.rec-icon.charging .pw { opacity: 1; }
.rec-icon span { position: relative; }

.kick-meter { position: absolute; right: 7%; top: 50%; transform: translateY(-55%); width: 150px; padding: 12px 12px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.km-title { font-family: var(--head); font-size: 24px; letter-spacing: 2px; color: var(--accent); line-height: 1; }
.km-dist { font-size: 14px; color: var(--muted); letter-spacing: 2px; min-height: 16px; }
.km-bar { position: relative; width: 56px; height: min(300px, 40vh); margin: 8px auto 4px; background: linear-gradient(0deg, #0e1628, #1b2a45); border: 2px solid rgba(255,255,255,0.35); border-radius: 8px; overflow: visible; }
.km-fill { position: absolute; left: 2px; right: 2px; background: linear-gradient(0deg, #2fbf4a, #ffd23f 70%, #ff7a3a); border-radius: 3px; }
.km-base { position: absolute; left: -6px; right: -6px; height: 2px; background: rgba(255,255,255,0.5); }
.km-zone { position: absolute; left: 0; right: 0; background: rgba(255,210,63,0.85); box-shadow: 0 0 12px rgba(255,210,63,0.8); }
.kick-meter.acc .km-zone { animation: zonePulse 0.5s infinite alternate; }
@keyframes zonePulse { to { box-shadow: 0 0 22px rgba(255,210,63,1); } }
.km-need { position: absolute; left: -10px; right: -10px; height: 3px; background: #fff; box-shadow: 0 0 6px #fff; }
.km-need span { position: absolute; left: 100%; top: -8px; margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; color: #fff; }
.km-need.out { background: var(--bad); }
.km-need.out span { color: var(--bad); }
.km-lock { position: absolute; left: -4px; right: -4px; height: 3px; background: #7fd4ff; }
.km-cursor { position: absolute; left: -14px; right: -14px; height: 4px; margin-bottom: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 10px #fff; }
.km-cursor::before, .km-cursor::after { content: ''; position: absolute; top: -5px; border: 7px solid transparent; }
.km-cursor::before { left: -12px; border-left-color: #fff; }
.km-cursor::after { right: -12px; border-right-color: #fff; }
.km-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.km-prompt { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 8px 18px 6px; background: rgba(6,10,20,0.85); border-radius: 6px; border-bottom: 3px solid var(--accent); font-size: 22px; white-space: nowrap; }
.km-prompt b { color: var(--accent); }

/* ---------------------------------------------------------- play call */
#playcall { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: min(62vh, 560px); background: linear-gradient(180deg, rgba(5,9,18,0.92), rgba(5,9,18,0.98)); border-top: 2px solid var(--accent); display: flex; flex-direction: column; animation: pcIn 0.25s ease-out; }
@keyframes pcIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pc-head { display: flex; align-items: center; gap: 24px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.pc-role { display: flex; align-items: center; gap: 10px; padding-right: 20px; border-right: 1px solid var(--line); }
.pc-role img { width: 46px; height: 46px; }
.pc-role small { display: block; color: var(--muted); letter-spacing: 3px; font-size: 13px; }
.pc-role b { font-family: var(--head); font-size: 34px; letter-spacing: 2px; line-height: 0.9; }
.pc-sit { flex: 1; }
.pc-score { display: flex; gap: 14px; font-family: var(--head); font-size: 26px; }
.pc-score span { padding: 2px 10px 0; border-left: 4px solid var(--tc); background: rgba(255,255,255,0.05); }
.pc-dd { color: var(--accent); font-size: 20px; letter-spacing: 1px; }
.pc-keys { display: flex; gap: 14px; color: var(--muted); font-size: 15px; flex-wrap: wrap; justify-content: flex-end; }
.pc-body { flex: 1; display: flex; min-height: 0; }
.pc-groups { width: 230px; overflow-y: auto; border-right: 1px solid var(--line); padding: 8px 0; }
.pc-group { display: flex; justify-content: space-between; padding: 7px 18px 5px; font-family: var(--head); font-size: 24px; letter-spacing: 1px; cursor: pointer; color: var(--muted); border-left: 4px solid transparent; }
.pc-group em { font-style: normal; font-size: 18px; opacity: 0.6; }
.pc-group.sel { color: #fff; background: rgba(255,255,255,0.06); border-left-color: var(--accent2); }
.pc-groups.focus .pc-group.sel { border-left-color: var(--accent); background: rgba(255,210,63,0.12); }
.pc-plays { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 12px; padding: 12px 16px; overflow-y: auto; align-content: start; }
.pc-body.simple .pc-plays { grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; }
.pc-card { min-height: max-content; background: #0d1526; border: 2px solid rgba(255,255,255,0.08); border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.1s, border-color 0.1s; }
.pc-card canvas { display: block; width: 100%; aspect-ratio: 240 / 150; }
.pc-card.sel { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(255,210,63,0.18); }
.pc-card.sug { border-color: var(--good); }
.pc-name { font-family: var(--head); font-size: 26px; padding: 6px 10px 0; letter-spacing: 1px; line-height: 1; }
.pc-name i { font-size: 16px; color: var(--accent2); font-style: normal; }
.pc-tag { color: var(--muted); font-size: 14px; padding: 0 10px 8px; letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 900px) { .pc-plays { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-keys { display: none; } }

/* ---------------------------------------------------------- replay */
#replay-badge { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 12; display: none; font-family: var(--head); font-size: 34px; letter-spacing: 8px; padding: 4px 24px 0; background: #c8102e; color: #fff; border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); animation: pulse 1.4s infinite; }
body.replaying #replay-badge { display: block; }
body.replaying .scorebug, body.replaying .ticker, body.replaying .play-name, body.replaying .windbox { opacity: 0.25; }
@keyframes pulse { 50% { opacity: 0.75; } }

/* ---------------------------------------------------------- penalties */
.pen-card { position: absolute; top: 12%; right: 2.5%; display: flex; gap: 14px; align-items: center; max-width: min(460px, 70vw); padding: 12px 20px 10px 14px; background: linear-gradient(120deg, rgba(20,16,4,0.94), rgba(10,12,20,0.92)); border-left: 6px solid #ffd21a; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); opacity: 0; transform: translateX(30px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.pen-card.show { opacity: 1; transform: translateX(0); }
.pen-flag { flex: none; width: 34px; height: 34px; background: #ffd21a; border-radius: 3px; transform: rotate(-12deg); box-shadow: inset -6px -6px 0 rgba(0,0,0,0.12); position: relative; }
.pen-flag::after { content: ''; position: absolute; right: -5px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #f4f4f0; }
.pen-flag.small { width: 20px; height: 20px; display: inline-block; vertical-align: middle; margin-right: 10px; }
.pen-kicker { font-size: 13px; letter-spacing: 3px; color: #ffd21a; }
.pen-title { font-family: var(--head); font-size: 36px; line-height: 0.95; letter-spacing: 1px; }
.pen-who { font-size: 17px; color: var(--muted); letter-spacing: 1px; }
.pen-detail { font-size: 17px; letter-spacing: 1px; color: #fff; margin-top: 2px; }
.pen-detail.dec { color: var(--muted); }
.pen-choice { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); width: min(640px, 92vw); padding: 14px 18px 12px; background: rgba(8,12,22,0.95); border: 1px solid rgba(255,210,26,0.5); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.6); pointer-events: auto; }
.pen-choice.hidden { display: none; }
.pcx-head { font-family: var(--head); font-size: 32px; letter-spacing: 1px; line-height: 1; }
.pcx-head small { display: block; font-family: var(--body); font-size: 15px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
.pcx-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pc-opt { padding: 10px 14px 8px; border: 2px solid rgba(255,255,255,0.1); border-radius: 8px; background: rgba(255,255,255,0.04); cursor: pointer; }
.pc-opt.sel { border-color: var(--accent); background: rgba(255,210,63,0.1); }
.pc-opt b { display: block; font-family: var(--head); font-size: 28px; letter-spacing: 2px; line-height: 1; }
.pc-opt b em { font-style: normal; font-family: var(--body); font-size: 12px; color: var(--good); letter-spacing: 2px; vertical-align: middle; margin-left: 6px; }
.pc-opt span { display: block; font-size: 16px; color: var(--muted); margin-top: 4px; line-height: 1.2; }
.pcx-keys { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: right; }
@media (max-width: 700px) { .pen-card { top: auto; bottom: 22%; right: 50%; transform: translateX(50%); } .pen-card.show { transform: translateX(50%); } .pcx-opts { grid-template-columns: 1fr; } }

/* coach picks */
.pc-group.picks span { color: var(--accent); }
.pc-card.pick { border-color: rgba(255,210,63,0.22); }
.pc-card.pick.sel { border-color: var(--accent); }
.pc-why { font-size: 14px; line-height: 1.2; padding: 0 10px 9px; color: #e8f0ff; letter-spacing: 0.3px; }
.pc-why b { color: var(--accent); letter-spacing: 1px; font-weight: 700; }

/* pre-snap: your defender's assignment */
.assign-card {
  position: absolute; right: 16px; bottom: 74px; min-width: 210px; max-width: 320px;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.92), rgba(6, 10, 18, 0.92));
  border-right: 4px solid var(--ac, #fff); border-radius: 6px; padding: 8px 14px 9px; text-align: right;
  font-family: var(--head); color: #fff; letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.assign-card.hidden { opacity: 0; transform: translateY(8px); }
.assign-card .as-who { font-size: 14px; color: #9fb0c8; line-height: 1; }
.assign-card .as-what { font-size: 26px; line-height: 1.05; color: var(--ac, #fff); }
.assign-card .as-tip { font-family: var(--body); font-size: 12px; letter-spacing: 0; color: #d6deea; margin-top: 2px; }
@media (max-width: 700px) { .assign-card { right: 16px; bottom: 120px; max-width: calc(100vw - 32px); } }

/* narrower windows: lift the controls list, wind box and assignment card above the scorebug */
@media (max-width: 1040px) {
  .hints { bottom: 92px; font-size: 14px; }
  .windbox { bottom: 92px; }
  .assign-card { bottom: 140px; }
}

/* ---------------------------------------------------------- online play */
.btn.online i { font-style: normal; font-size: 0.62em; letter-spacing: 1px; color: var(--accent2); margin-left: 8px; vertical-align: 3px; }
.menu.online { background: rgba(4, 8, 16, 0.8); backdrop-filter: blur(6px); }
.ol-hub { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: min(560px, 100%); }
.ol-hub .main-buttons { min-width: 0; }
.ol-field { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 6px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.ol-field span { font-size: 16px; letter-spacing: 2px; color: var(--muted); white-space: nowrap; }
.ol-hub input { flex: 1; min-width: 0; font-family: var(--head); font-size: 26px; letter-spacing: 2px; padding: 4px 10px 0; color: #fff; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.18); border-radius: 4px; outline: none; user-select: text; }
.ol-hub input:focus { border-color: var(--accent); }
.ol-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ol-mode { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.ol-mode b { display: block; font-family: var(--head); font-size: 28px; letter-spacing: 2px; line-height: 1; padding-top: 3px; }
.ol-mode span { color: var(--muted); font-size: 15px; line-height: 1.2; }
.ol-mode.on { border-color: var(--accent); background: rgba(255,210,63,0.08); }
.ol-mode.on b { color: var(--accent); }
.ol-mode.soon { opacity: 0.55; }
.ol-mode.soon i { font-style: normal; font-size: 14px; letter-spacing: 2px; color: #111; background: var(--accent2); padding: 1px 6px 0; border-radius: 3px; vertical-align: 5px; margin-left: 6px; }
.ol-join { display: flex; gap: 10px; padding: 4px; border-radius: 4px; border: 1px solid transparent; }
.ol-join.focus { border-color: var(--accent); }
.ol-join input { text-transform: uppercase; }
.ol-join .btn { text-align: center; }
.ol-join input.shake { animation: olshake 0.35s; border-color: var(--bad); }
@keyframes olshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ol-notice { padding: 10px 14px; border-radius: 6px; background: rgba(54,194,255,0.12); border: 1px solid rgba(54,194,255,0.5); }
.ol-notice.bad { background: rgba(255,90,90,0.12); border-color: rgba(255,90,90,0.6); }
.ol-notice b { display: block; font-family: var(--head); font-size: 24px; letter-spacing: 2px; line-height: 1; padding-top: 3px; }
.ol-notice span { color: var(--text); font-size: 16px; }
.ol-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6vh 0 2vh; }
.ol-spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--accent); animation: olspin 0.9s linear infinite; }
.ol-spin.small { width: 34px; height: 34px; border-width: 3px; margin: 7vh auto 2vh; }
@keyframes olspin { to { transform: rotate(360deg); } }
.ol-codebig { font-family: var(--head); color: var(--accent); letter-spacing: 6px; margin-left: 10px; }
.ol-invite { display: flex; align-items: center; gap: 12px; margin-bottom: 1.4vh; color: var(--muted); font-size: 16px; letter-spacing: 1px; flex-wrap: wrap; justify-content: center; }
.ol-invite code { font-family: var(--body); font-size: 18px; color: #fff; background: rgba(0,0,0,0.4); padding: 3px 10px; border-radius: 4px; user-select: text; }
.btn.small { font-size: 20px; padding: 4px 14px 1px; }
.team-card.ol-empty { background: rgba(255,255,255,0.03); border-style: dashed; }
.ol-code-hint { color: var(--muted); font-size: 16px; margin-top: 1vh; }
.ol-code-hint b { color: var(--accent); letter-spacing: 3px; font-size: 20px; }
.ol-player { margin-top: 1vh; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,0.35); }
.ol-player b { font-size: 19px; letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-player em { font-style: normal; font-family: var(--head); letter-spacing: 2px; font-size: 18px; color: var(--muted); padding-top: 3px; }
.ol-player em.ok { color: var(--good); }
.opt.ro { opacity: 0.8; }
.btn.go.on { background: linear-gradient(90deg, #3ddc84, #22b86a); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.menu-note.center { margin-top: -4px; }
.net-box { position: absolute; top: 88px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.nb-ping { display: flex; align-items: center; gap: 6px; padding: 3px 10px 1px; border-radius: 4px; background: var(--panel); font-family: var(--head); font-size: 18px; letter-spacing: 1px; color: var(--muted); }
.nb-ping i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-top: -2px; }
.nb-ping.good i { background: var(--good); }
.nb-ping.ok i { background: var(--accent); }
.nb-ping.bad i { background: var(--bad); }
.nb-text { padding: 5px 12px 3px; border-radius: 4px; background: var(--panel); font-family: var(--head); font-size: 22px; letter-spacing: 1px; }
.nb-text.warn { color: #111; background: var(--accent); }
@media (max-width: 700px) { .ol-modes { grid-template-columns: 1fr; } .ol-field { flex-direction: column; align-items: stretch; } }
.menu.online .menu-foot { position: static; transform: none; margin-top: 1.4vh; text-align: center; max-width: 900px; }
