:root {
  --bg: #050506;
  --panel: rgba(8, 8, 10, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef3f8;
  --muted: #93a1b5;
  --ice: #9fd3ff;
  --accent: #ff3b30;
  --good: #34c759;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: "Saira Semi Condensed", system-ui, sans-serif; -webkit-user-select: none; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.5), rgba(0,0,0,0.88)); overflow-y: auto; }
.panel { margin: auto; width: min(1100px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.panel.narrow { width: min(460px, 100%); text-align: center; }
.title { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: clamp(48px, 9vw, 84px);
  line-height: 0.9; margin: 0; letter-spacing: 1px; }
.title span { color: var(--ice); }
.sub { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 18px 0 8px; }
.note { color: var(--muted); font-size: 13px; min-height: 1.2em; }
.seg { display: inline-flex; background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 10px 18px; border-radius: 9px; font-weight: 600; }
.seg button.on { background: var(--ice); color: #06111d; }
.row { display: flex; gap: 10px; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; }
.primary { background: var(--accent); border: 0; border-radius: 12px; padding: 14px 26px; font-weight: 800;
  letter-spacing: 0.02em; margin-top: 18px; }
.primary:disabled { opacity: 0.4; cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; font-weight: 600; margin-top: 18px; }
.row .primary, .row .ghost { margin-top: 0; }


.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; }
.mteam { text-align: center; }
.mteam img.logo { width: 84px; height: 84px; }
.mteam h3 { margin: 4px 0 2px; font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 30px; letter-spacing: 0.5px; }
.mteam .who { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.mteam ol { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; text-align: left; display: inline-block; }
.mteam li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.mteam li img { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.08); object-fit: cover; }
.mteam li small { color: var(--muted); }
.vs { font-family: "Bebas Neue", Impact, sans-serif; font-size: 40px; color: var(--muted); padding-top: 26px; }
.controls { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; font-size: 13px; }
.controls div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.03); line-height: 1.6; }
.controls b { display: block; margin-bottom: 4px; color: var(--ice); }
kbd { font-family: inherit; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); }

#end img { width: 110px; height: 110px; }
#end h2 { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 46px; margin: 6px 0 0; }
#end p { color: var(--muted); margin: 6px 0 14px; }
.recap { display: grid; gap: 6px; text-align: left; font-size: 13px; max-height: 32vh; overflow-y: auto; }
.recap div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.04); }
.recap .g { color: var(--good); font-weight: 700; }
.recap .m { color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.scorebar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px 14px; backdrop-filter: blur(8px); max-width: calc(100vw - 110px); }
.side { display: flex; align-items: center; gap: 8px; }
.side .logo { width: 34px; height: 34px; }
.side .abbr { font-family: "Bebas Neue", Impact, sans-serif; font-size: 22px; }
.dots { display: flex; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35); }
.dot.g { background: var(--good); border-color: var(--good); }
.dot.m { background: transparent; border-color: var(--accent); position: relative; }
.dot.m::after { content: ""; position: absolute; inset: 3px -1px; border-top: 2px solid var(--accent); transform: rotate(45deg) translateY(1px); }
.dot.now { border-color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }
.score { text-align: center; font-family: "Bebas Neue", Impact, sans-serif; font-size: 30px; line-height: 1; min-width: 70px; }
.score .dash { color: var(--muted); margin: 0 6px; }
#roundLabel { font-family: "Saira Semi Condensed", sans-serif; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.cards { position: absolute; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 10px; }
.card { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 6px 6px; max-width: 48%; }
.card.right { padding: 6px 6px 6px 12px; text-align: right; }
.card img { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.08); object-fit: cover; flex: none; }
.card b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card small { color: var(--muted); font-size: 11px; }
.card .role { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ice); }

#hint { position: absolute; left: 50%; top: max(132px, calc(env(safe-area-inset-top) + 124px)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 24px); text-align: center; font-size: 13px; color: #fff; line-height: 1.5;
  background: rgba(0,0,0,0.72); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; }
#hint:empty { display: none; }
#hint b { color: var(--ice); }

#banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; transform: scale(0.8); transition: opacity 0.2s, transform 0.25s; }
#banner.show { opacity: 1; transform: scale(1); }
#banner .big { font-family: "Bebas Neue", Impact, sans-serif; font-size: clamp(56px, 13vw, 140px); line-height: 0.9;
  text-shadow: 0 4px 24px rgba(0,0,0,0.6); letter-spacing: 2px; }
#banner .small { font-size: clamp(14px, 2.4vw, 20px); font-weight: 600; text-shadow: 0 2px 8px #000; margin-top: 6px; }
#banner.goal .big { color: var(--accent); animation: thump 0.5s ease-out; }
#banner.save .big { color: var(--ice); }
#banner.miss .big { color: #ddd; }
#banner.intro .big { font-size: clamp(40px, 8vw, 84px); }
@keyframes thump { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }

.corner-btns { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.corner-btns button { width: 40px; height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 16px; }

@media (max-width: 640px) {
  .panel { padding: 18px; }
  .scorebar { gap: 8px; padding: 6px 10px; top: max(8px, env(safe-area-inset-top)); left: 12px; transform: none; max-width: calc(100vw - 70px); }
  .side .logo { width: 26px; height: 26px; }
  .side .abbr { display: none; }
  .dot { width: 9px; height: 9px; }
  .score { font-size: 24px; min-width: 56px; }
  .card img { width: 36px; height: 36px; }
  .card b { font-size: 12px; }
  .matchup { grid-template-columns: 1fr 1fr; gap: 10px; }
  .vs { display: none; }
  .mteam img.logo { width: 56px; height: 56px; }
  .mteam h3 { font-size: 22px; }
  .mteam ol { font-size: 12px; }
  .mteam li small { display: none; }
  .mteam li img { width: 24px; height: 24px; }
  .controls { font-size: 12px; }
  .card small { display: none; }
  .card { padding: 4px 10px 4px 4px; }
  .card.right { padding: 4px 4px 4px 10px; }
  #hint { font-size: 12px; }
}

/* ---------- lineup ---------- */
.lineup-head { display: flex; align-items: center; gap: 14px; }
.lineup-head img { width: 64px; height: 64px; }
.lineup-head h3 { margin: 0; font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 34px; }
.lineup-head .label { margin: 0; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.slot { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); text-align: left; min-width: 0; }
.slot.on { border-color: var(--ice); box-shadow: 0 0 0 2px rgba(159,211,255,0.35) inset; }
.slot img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.08); flex: none; }
.slot span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.slot small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.slot b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot em, .ovr { font-style: normal; font-family: "Bebas Neue", Impact, sans-serif; font-size: 22px; color: var(--ice); }
#rosterTabs { margin-bottom: 10px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.pcard { display: flex; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); text-align: left; }
.pcard:hover { border-color: var(--ice); background: rgba(255,255,255,0.07); }
.pcard.picked { border-color: var(--accent); background: rgba(255,59,48,0.08); }
.pcard img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,0.08); flex: none; }
.pc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pc-top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sub, .pcard small { color: var(--muted); font-size: 11px; }
.bars { display: grid; grid-template-columns: 34px 1fr 22px; align-items: center; gap: 2px 6px; font-size: 10px; }
.bars label { color: var(--muted); font-weight: 700; letter-spacing: 0.05em; }
.bars i { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); border-radius: 3px;
  background: linear-gradient(90deg, #4f8cff, var(--ice)); }
.bars em { font-style: normal; font-weight: 700; text-align: right; }

/* ---------- push prompt / replay ---------- */
#pushPrompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px;
  background: rgba(0,0,0,0.75); border: 1px solid var(--line); font-weight: 800; letter-spacing: 0.04em; animation: pulse2 1.2s infinite; white-space: nowrap; }
@keyframes pulse2 { 50% { opacity: 0.55; } }
#replayUi { position: absolute; inset: 0; pointer-events: none; }
.replay-tag { position: absolute; left: 14px; top: max(84px, calc(env(safe-area-inset-top) + 74px)); display: flex; align-items: center; gap: 8px;
  font-family: "Bebas Neue", Impact, sans-serif; font-size: 26px; letter-spacing: 2px; padding: 4px 12px; border-radius: 8px; background: rgba(0,0,0,0.7); }
.rec { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse2 1s infinite; }
#skipBtn { position: absolute; right: 14px; bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); pointer-events: auto;
  padding: 10px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; }
#replayUi:not([hidden]) ~ #hint, #replayUi:not([hidden]) ~ .cards { opacity: 0; }
@media (max-width: 640px) {
  .slots { grid-template-columns: repeat(2, 1fr); }
  .roster { grid-template-columns: 1fr; max-height: 44vh; }
}

/* ---------- stick-handling gauge ---------- */
#stickGauge { position: absolute; left: 50%; transform: translateX(-50%); top: max(84px, calc(env(safe-area-inset-top) + 76px));
  display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
#stickGauge .lbl { color: var(--muted); padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,0.6); }
#stickGauge .lbl.on { color: #06111d; background: var(--ice); }
#stickGauge .track { position: relative; width: 220px; height: 8px; border-radius: 4px; background: rgba(0,0,0,0.6); border: 1px solid var(--line); }
#stickGauge .track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: rgba(255,255,255,0.3); }
#stickGauge .puck { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #111; border: 2px solid #fff; transition: left 0.03s linear; }
#stickGauge .state { position: absolute; left: 0; right: 0; top: 12px; text-align: center; font-style: normal; font-weight: 600; letter-spacing: 0.04em; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; }
#stickGauge.loose .puck { opacity: 0.4; }

/* ---------- 2x scoreboard + player cards (desktop) ---------- */
@media (min-width: 641px) {
  .scorebar { gap: 22px; padding: 14px 26px; border-radius: 22px; }
  .side { gap: 14px; }
  .side .logo { width: 68px; height: 68px; }
  .side .abbr { font-size: 44px; }
  .dots { gap: 7px; }
  .dot { width: 22px; height: 22px; border-width: 3px; }
  .dot.m::after { inset: 6px -2px; border-top-width: 3px; }
  .score { font-size: 60px; min-width: 140px; }
  #roundLabel { font-size: 16px; margin-top: 6px; }
  .cards { left: 18px; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); }
  .card { gap: 16px; padding: 10px 22px 10px 10px; border-radius: 22px; }
  .card.right { padding: 10px 10px 10px 22px; }
  .card img { width: 92px; height: 92px; }
  .card b { font-size: 26px; }
  .card small { font-size: 18px; }
  .card .role { font-size: 16px; }
  #stickGauge { top: 160px; }
  #hint { top: 214px; }
  .replay-tag { top: 160px; }
  #skipBtn { bottom: 150px; font-size: 18px; padding: 14px 22px; }
}

/* ---------- end-of-match summary ---------- */
.panel.summary { width: min(1180px, 100%); text-align: center; padding: 36px 40px; }
#end .summary > img { width: 140px; height: 140px; }
#end .summary h2 { font-size: 84px; margin: 4px 0 0; }
#end .summary p { font-size: 22px; margin: 8px 0 26px; }
.summary .recap { grid-template-columns: 1fr 1fr; gap: 22px; max-height: 52vh; font-size: 18px; }
.summary .recap div.recap-col { display: flex; flex-direction: column; gap: 8px; background: transparent; padding: 0; }
.summary .recap div.recap-head { display: flex; align-items: center; gap: 12px; padding: 8px 6px 12px; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; }
.recap-head img { width: 48px; height: 48px; }
.recap-head b { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 34px; flex: 1; text-align: left; }
.recap-head span { font-family: "Bebas Neue", Impact, sans-serif; font-size: 30px; color: var(--muted); }
.summary .recap div.recap-row { display: grid; grid-template-columns: 52px 1fr auto auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); text-align: left; }
.recap-row img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.08); }
.recap-row .who { display: flex; flex-direction: column; font-weight: 700; min-width: 0; }
.recap-row .who small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.recap-row .kind { color: var(--muted); font-size: 16px; }
.recap-row .res { font-weight: 800; font-size: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.06); white-space: nowrap; }
.recap-row .res.g { color: #06210f; background: var(--good); }
.summary .row { margin-top: 26px; }
.summary .row button { font-size: 20px; padding: 16px 30px; }
@media (max-width: 760px) {
  .summary .recap { grid-template-columns: 1fr; }
  #end .summary h2 { font-size: 54px; }
}

.cards, #hint { transition: opacity 0.35s; }
#hud.carrying .cards { opacity: 0.12; }
#hud.carrying #hint { opacity: 0.55; }
#end .recap-head img { width: 48px; height: 48px; }
#end .recap-row img { width: 52px; height: 52px; }
.summary .recap div.recap-col { justify-content: flex-start; align-self: start; }
.summary .recap { align-items: start; max-height: 56vh; }
#end .summary > img { width: 110px; height: 110px; }
#end .summary h2 { font-size: 72px; }
.panel.summary { padding: 28px 40px; }

/* ---------- home: full screen over the demo, menu on the right ---------- */
#menu.home-screen { padding: 0;
  background:
    linear-gradient(180deg, rgba(3,10,24,0.55) 0%, rgba(3,10,24,0) 22%, rgba(3,10,24,0) 70%, rgba(3,10,24,0.7) 100%),
    linear-gradient(90deg, rgba(4,16,40,0.38) 0%, rgba(4,16,40,0.2) 38%, rgba(4,14,34,0.78) 56%, rgba(3,10,26,0.9) 100%); }
.panel.is-home { width: 100%; min-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; display: flex; }
.panel.is-home > .title, .panel.is-home > .sub { display: none; }
.home { flex: 1; display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; --hblue: #3aa0ff; }

.home-top { display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(16px, 2.6vw, 44px);
  background: rgba(3,10,24,0.72); border-bottom: 1px solid rgba(58,160,255,0.35); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.home-mark { width: 52px; height: auto; display: block; filter: drop-shadow(0 2px 8px rgba(58,160,255,0.35)); }

.home-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(24px, 4vw, 72px);
  padding: clamp(20px, 5vh, 64px) clamp(16px, 2.6vw, 44px) clamp(20px, 4vh, 48px); align-items: start; }
.home-hero { padding-top: clamp(0px, 2vh, 24px); }
.home-hero .title.logo-hero img { width: min(100%, 620px); margin: 0 0 6px -12px; }
.tagline { font-family: "Saira Semi Condensed", sans-serif; font-weight: 800; font-style: italic; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: clamp(14px, 1.25vw, 20px); margin: 0; color: #f2f6fb; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }

.home-opts { align-self: center; max-width: 760px; width: 100%; justify-self: end; }
.rule { display: flex; align-items: center; gap: 18px; margin: 0 0 16px; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(58,160,255,0), rgba(160,200,255,0.55)); }
.rule::after { background: linear-gradient(90deg, rgba(160,200,255,0.55), rgba(58,160,255,0)); }
.rule span { font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: 0.16em; font-size: clamp(15px, 1.25vw, 20px); white-space: nowrap; }
#diffWrap { margin-top: clamp(22px, 4vh, 44px); }

.opts { display: grid; gap: clamp(10px, 1vw, 16px); }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: clamp(14px, 2.2vh, 26px) 14px; border-radius: 12px; border: 1px solid rgba(140,180,240,0.28);
  background: linear-gradient(180deg, rgba(22,40,72,0.82), rgba(8,18,38,0.88)); box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.opt:hover { border-color: rgba(58,160,255,0.7); transform: translateY(-2px); }
.opt.on { border: 2px solid var(--hblue); margin: -1px; background: linear-gradient(180deg, rgba(26,70,130,0.9), rgba(10,30,64,0.92));
  box-shadow: 0 0 22px rgba(58,160,255,0.55), inset 0 0 18px rgba(58,160,255,0.25); }
.opt b { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-style: italic; font-size: clamp(24px, 2.2vw, 36px); line-height: 1; letter-spacing: 0.02em; }
.opt small { color: #d3dceb; font-size: clamp(13px, 1vw, 16px); line-height: 1.3; }
.opt .ico { width: clamp(40px, 3.6vw, 60px); height: auto; color: #eaf2ff; margin-bottom: 6px; }
.opts.mode .opt { min-height: clamp(150px, 24vh, 230px); }
.opts.diff .opt { gap: 4px; }
.opts.diff .opt b { font-size: clamp(22px, 1.8vw, 30px); }
.meter { display: block; width: 100%; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.14); margin-top: 10px; overflow: hidden; }
.meter em { display: block; height: 100%; background: linear-gradient(90deg, #1d8fff, #4cc3ff); box-shadow: 0 0 8px #3aa0ff; }
.meter.hot em { background: linear-gradient(90deg, #d81f1f, #ff3b30); box-shadow: 0 0 8px #ff3b30; }
#modeNote:empty { display: none; }

.cta { display: flex; align-items: center; justify-content: center; gap: 22px; width: min(100%, 560px); margin: clamp(22px, 4vh, 44px) auto 0;
  padding: clamp(12px, 2vh, 20px) 32px; border: 0; border-radius: 6px; transform: skewX(-14deg);
  background: linear-gradient(180deg, #ff4a3d, #d4140c); box-shadow: 0 0 0 2px rgba(255,90,80,0.45), 0 10px 40px rgba(255,40,30,0.45);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s; }
.cta > * { transform: skewX(14deg); }
.cta span { font-family: "Bebas Neue", Impact, sans-serif; font-style: italic; font-size: clamp(30px, 2.8vw, 46px); line-height: 1; letter-spacing: 0.03em; }
.cta svg { width: clamp(26px, 2.2vw, 36px); height: auto; }
.cta:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0 0 2px rgba(255,120,110,0.7), 0 12px 48px rgba(255,40,30,0.6); transform: skewX(-14deg) translateY(-2px); }
.cta:disabled { opacity: 0.45; cursor: default; }

.home-feats { display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(3,10,24,0.82); border-top: 1px solid rgba(58,160,255,0.35);
  padding: clamp(12px, 2vh, 20px) clamp(16px, 2.6vw, 44px); }
.home-feats div { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: clamp(13px, 1.1vw, 18px); font-weight: 500; color: #e4ebf5; }
.home-feats div + div { border-left: 1px solid rgba(160,200,255,0.3); }
.home-feats svg { width: clamp(22px, 1.9vw, 30px); height: auto; color: #eaf2ff; flex: none; }

@media (max-width: 960px) {
  #menu.home-screen { background: linear-gradient(180deg, rgba(3,10,24,0.55), rgba(3,10,24,0.88) 45%, rgba(3,10,24,0.94)); }
  .home-main { grid-template-columns: 1fr; gap: 20px; }
  .home-hero { text-align: center; padding-top: 0; }
  .home-hero .title.logo-hero img { width: min(80%, 440px); margin: 0 auto 6px; }
  .home-opts { justify-self: center; }
  .home-feats { grid-template-columns: 1fr 1fr; gap: 10px 0; }
  .home-feats div:nth-child(3) { border-left: 0; }
}
@media (max-width: 560px) {
  .opts.three { grid-template-columns: 1fr; }
  .opts.mode .opt { min-height: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; column-gap: 14px; }
  .opts.mode .opt .ico { width: 34px; margin: 0; }
  .opts.mode .opt small { flex-basis: 100%; }
  .tagline { letter-spacing: 0.08em; }
  .home-feats { display: none; }
}

/* ---------- team grid: bigger ---------- */

/* ---------- team picker: all 32 in view, sized to the window ---------- */
.panel.is-team { width: min(1500px, 100%); padding: 22px 30px; }
.panel.is-team > .title { font-size: clamp(36px, 5vh, 56px); }
.panel.is-team > .sub { margin: 4px 0 8px; }
.panel.is-team .label { margin: 8px 0 10px; }
.panel.is-team .row { margin-top: 14px; }

/* summary rows: fixed columns so names, shot types and results line up in both lists */
.summary .recap div.recap-row { grid-template-columns: 52px minmax(0, 1fr) 112px 150px; }
.recap-row .who { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recap-row .kind { justify-self: start; }
.recap-row .res { justify-self: stretch; text-align: center; }
.summary .recap div.recap-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) 112px 150px; gap: 14px; padding: 8px 12px 12px; }
.recap-head img { justify-self: center; }
.recap-head .h-kind, .recap-head .h-res { font-family: "Saira Semi Condensed", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #c3cfdd; align-self: center; }
.recap-head .h-kind { justify-self: start; }
.recap-head .h-res { justify-self: stretch; text-align: center; }
.recap-head .tally { color: var(--muted); font-weight: 400; margin-left: 10px; }
.summary .recap div.recap-head, .summary .recap div.recap-row { grid-template-columns: 52px minmax(0, 1fr) 92px 128px; gap: 12px; }
.summary .recap div.recap-head { height: 64px; padding-top: 0; padding-bottom: 0; }
.recap-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 30px; }
.recap-row .who { font-size: 15px; }
.recap-row .who small { font-size: 11px; }
.recap-row .kind { font-size: 15px; }
.recap-row .res { font-size: 14px; padding: 6px 8px; }

/* ---------- team tiles: edit + create ---------- */

/* ---------- team editor ---------- */
.panel.is-editor { width: min(1240px, 100%); }
.panel.is-editor > .title, .panel.is-editor > .sub { display: none; }
.ed-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ed-head img { width: 76px; height: 82px; }
.ed-head .label { margin: 0; }
.ed-head h3 { margin: 2px 0 0; font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 40px; }
.ed-grid { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.ed-identity { display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fld input { font: inherit; font-size: 16px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fld input:focus { outline: none; border-color: var(--ice); }
.fld input[type=color] { padding: 4px; height: 46px; cursor: pointer; }
.ed-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); }
.ed-preview img { width: 150px; height: 150px; border-radius: 16px; }
.ed-rosterhead { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.ed-rosterhead b { font-size: 16px; }
.ed-rosterhead small { color: var(--muted); flex: 1; }
.ghost.sm { padding: 7px 12px; font-size: 13px; margin: 0; border-radius: 9px; }
.ghost:disabled, .ed-row .del:disabled { opacity: 0.35; cursor: default; }
.ed-cols, .ed-row { display: grid; grid-template-columns: 1fr 1.2fr 64px 86px 34px; gap: 8px; align-items: center; }
.ed-cols { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 2px 4px; }
.ed-roster { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; max-height: 34vh; overflow-y: auto; }
.ed-row input { font: inherit; font-size: 14px; color: var(--text); background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-width: 0; }
.ed-row input:focus { outline: none; border-color: var(--ice); }
.ed-row .hand { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ed-row .hand button { flex: 1; border: 0; background: transparent; padding: 7px 0; font-weight: 700; color: var(--muted); }
.ed-row .hand button.on { background: var(--ice); color: #06111d; }
.ed-row .del { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; font-size: 18px; color: var(--muted); }
.ed-row .del:not(:disabled):hover { color: var(--accent); border-color: var(--accent); }
.ed-errors { color: #ff8a80; min-height: 1.2em; font-size: 14px; margin: 8px 0 0; }
.row-right { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .ed-grid { grid-template-columns: 1fr; } }

/* lineup cards without ratings */
.pcard img { width: 56px; height: 56px; }
.pcard .pc-main { justify-content: center; }
.slot em { font-size: 20px; }

/* ---------- username chip + dialog ---------- */
.who-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04); font-size: 13px; font-weight: 700; vertical-align: middle; }
.who-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.who-chip.set .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.who-chip em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; }
.who-chip:hover { border-color: var(--ice); }
.panel.dialog { width: min(460px, 100%); }
.panel.dialog h2 { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 40px; margin: 0; }
#nameInput { width: 100%; font: inherit; font-size: 20px; font-weight: 700; color: var(--text); background: rgba(255,255,255,0.05);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 8px; }
#nameInput:focus { outline: none; border-color: var(--ice); }

/* ---------- lobby ---------- */
.panel.is-lobby { width: min(1180px, 100%); }
.panel.is-lobby > .title, .panel.is-lobby > .sub { display: none; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.lobby-head .label { margin: 0; }
.lobby-head h3 { margin: 2px 0 0; font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 44px; }
.lobby-me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.lobby-me b { color: var(--text); font-size: 18px; margin-left: 10px; }
#lobbyRecord { font-family: "Bebas Neue", Impact, sans-serif; font-size: 22px; color: var(--ice); }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: #d9a400; }
.net-dot.online { background: var(--good); box-shadow: 0 0 10px var(--good); }
.net-dot.offline { background: var(--accent); }
.lobby-grid { display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
.lobby-side .label:first-child { margin-top: 0; }
.lobby-team { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.03); margin-bottom: 8px; }
.lobby-team img { width: 54px; height: 58px; }
.lobby-team b { display: block; font-size: 16px; }
.lobby-team small { color: var(--muted); }
#lobbyTeam { width: 100%; font: inherit; color: var(--text); background: #111; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.players { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.player { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.player img { width: 40px; height: 44px; }
.player .nocrest { width: 40px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.06); }
.pl-main b { display: block; font-size: 17px; }
.pl-main small { color: var(--muted); }
.pl-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); }
.pl-status.idle { color: #06210f; background: var(--good); }
.primary.sm { padding: 9px 16px; font-size: 14px; margin: 0; border-radius: 10px; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.challenge { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 12px; margin-top: 12px;
  border-radius: 14px; border: 1px solid var(--ice); background: rgba(159,211,255,0.08); }
.challenge img { width: 40px; height: 44px; }
.challenge small { display: block; color: var(--muted); }
.challenge.out { grid-template-columns: auto 1fr auto; border-color: var(--line); background: rgba(255,255,255,0.03); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--ice); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--ice); box-shadow: 0 20px 60px rgba(0,0,0,0.6); font-weight: 700; }
#nameDialog { z-index: 40; }
@media (max-width: 860px) { .lobby-grid { grid-template-columns: 1fr; } }
.challenge.in { grid-template-columns: auto 1fr; }
.challenge.in > div { font-size: 15px; }
.challenge.in button { grid-row: 2; }
.challenge.in button[data-accept] { grid-column: 1 / 2; }
.challenge.in { grid-template-columns: auto 1fr auto; }
.challenge.in > img { grid-row: 1; }
.challenge.in > div { grid-column: 2 / 4; }
.challenge.in button[data-accept] { grid-column: 2; justify-self: end; }
.challenge.in button[data-decline] { grid-column: 3; }

/* Logo in place of the text titles */
.title.logo-title, .title.logo-hero { line-height: 0; text-shadow: none; }
.title.logo-title img, .title.logo-hero img { display: block; height: auto; filter: drop-shadow(0 8px 28px rgba(0,0,0,0.55)); }
.title.logo-title img { width: auto; height: clamp(56px, 9vh, 96px); }
.panel.is-team > .title.logo-title img { height: clamp(48px, 7vh, 80px); }

/* ---------- team select: matchup screen (each side in its team's colors) ---------- */
.panel.is-team { width: min(1640px, 96vw); }
.vs-select { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; height: clamp(420px, calc(100vh - 250px), 820px); margin-top: 8px; }
.ps { --tc: #335; --tc2: #fff; position: relative; overflow: hidden; border-radius: 18px; min-width: 0;
  background: radial-gradient(120% 90% at 50% 38%, color-mix(in srgb, var(--tc) 70%, #000) 0%, color-mix(in srgb, var(--tc) 28%, #05060a) 55%, #05060a 100%);
  border: 2px solid color-mix(in srgb, var(--tc) 75%, #fff);
  box-shadow: 0 0 28px color-mix(in srgb, var(--tc) 55%, transparent), inset 0 0 60px color-mix(in srgb, var(--tc) 35%, transparent);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s; }
.ps-crest { position: absolute; left: 50%; top: 42%; width: 78%; max-width: 560px; transform: translate(-50%, -50%); opacity: 0.22; filter: saturate(1.2) blur(0.5px); pointer-events: none; }
.ps-model { position: absolute; inset: 0 0 92px 0; width: 100%; height: calc(100% - 92px); }
.ps-who { position: absolute; top: 16px; left: 20px; font-family: "Bebas Neue", Impact, sans-serif; font-size: clamp(28px, 4vh, 44px); line-height: 1; letter-spacing: 0.04em; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
#ps1 .ps-who { left: auto; right: 20px; }
.ps-name { position: absolute; bottom: 104px; display: flex; flex-direction: column; line-height: 0.95; text-shadow: 0 3px 16px rgba(0,0,0,0.7); }
#ps0 .ps-name { left: 22px; }
#ps1 .ps-name { right: 22px; text-align: right; }
.ps-name small { font-weight: 700; font-size: clamp(14px, 1.6vh, 18px); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.8); }
.ps-name b { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: clamp(44px, 7vh, 84px); color: #fff; }
.ps-arrow { position: absolute; top: 62%; transform: translateY(-50%); width: 52px; height: 72px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35); color: #fff; font-size: 44px; line-height: 1; display: grid; place-items: center; backdrop-filter: blur(4px); }
.ps-arrow:hover { background: rgba(255,255,255,0.16); border-color: #fff; }
.ps-arrow.prev { left: 14px; }
.ps-arrow.next { right: 14px; }
.ps-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 92px; padding: 10px 14px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65) 30%); }
.ps-strip { flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 5px; min-width: 0; max-height: 100%; overflow-y: auto; scrollbar-width: none; padding: 2px; }
.ps-strip::-webkit-scrollbar { display: none; }
.ps-strip button { flex: 0 0 auto; width: 42px; height: 46px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); padding: 3px; }
.ps-strip button img { width: 100%; height: 100%; object-fit: contain; }
.ps-strip button:hover { border-color: #fff; }
.ps-strip button.sel { border-color: #fff; background: rgba(255,255,255,0.2); box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
.ps-strip button.taken { opacity: 0.25; pointer-events: none; }
.ps-actions { display: flex; flex-direction: column; gap: 5px; }
.ps-actions button { padding: 5px 10px; font-size: 12px; white-space: nowrap; line-height: 1.2; }
.vs-badge { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 2; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-family: "Bebas Neue", Impact, sans-serif; font-size: 44px; color: #fff; background: #0a0b0f;
  border: 2px solid rgba(255,255,255,0.55); box-shadow: 0 0 30px rgba(0,0,0,0.8); }
.row .grow { flex: 1; }
#teamsNext:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 899px) {
  .vs-select { grid-template-columns: 1fr; height: auto; }
  .ps { height: 520px; }
  .vs-badge { top: 50%; }
}
