/* Mobile-first app shell. Layout: one 480px column; top bar, scrolling content, bottom nav. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* .row/.chip set display, which would otherwise beat the attribute */
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--f-body); font-size: 15px; line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column;
  padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px); }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: .12em; text-decoration: none; }
.brand b { color: var(--attack); }
.who { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; }
.who strong { color: var(--ink); font-family: var(--f-display); letter-spacing: .06em; }
main { flex: 1; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 16px; }
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.bottomnav a { text-decoration: none; text-align: center; padding: 10px 4px 12px; font-family: var(--f-display);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bottomnav:has(> a:nth-child(6)) a { font-size: 11px; letter-spacing: .05em; padding-inline: 2px; }
.bottomnav a[aria-current="page"] { color: var(--attack); box-shadow: inset 0 2px 0 var(--attack); }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: .03em; margin: 0; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.lbl { font-family: var(--f-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.chip { display: inline-block; font-family: var(--f-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--muted); white-space: nowrap; }
.chip.attack { color: var(--attack); border-color: color-mix(in srgb, var(--attack) 50%, var(--line)); }
.chip.defense { color: var(--defense); border-color: color-mix(in srgb, var(--defense) 50%, var(--line)); }
.chip.win { color: var(--good); } .chip.loss { color: var(--bomb); }
.rarity-common { color: var(--rarity-common); } .rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); } .rarity-legendary { color: var(--rarity-legendary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-family: var(--f-display);
  font-weight: 600; letter-spacing: .06em; font-size: 14px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--attack); border-color: var(--attack); color: #1b1205; }
.btn.block { width: 100%; }
.btn:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--defense); outline-offset: 2px; }
form p { margin: 0 0 12px; }
label { display: block; font-family: var(--f-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px; }
select, input[type=text], input[type=email], input[type=password], input[type=number] { width: 100%; background: var(--panel-2);
  color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; min-height: 44px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list a.item, .list .item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 2px; text-decoration: none; }
.slot { font-family: var(--f-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); width: 56px; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovr { font-family: var(--f-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.attrs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.attr { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.attr .bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.attr .bar span { display: block; height: 100%; background: var(--attack); }
.score { font-family: var(--f-display); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: 8px; padding: 10px 12px; }
.messages li.error { border-left-color: var(--bomb); }
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); width: min(448px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 8px; z-index: 20; pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--attack);
  border-radius: 8px; padding: 10px 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .4); animation: toast-in .2s ease-out; text-decoration: none; display: block; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: .6; } to { transform: none; opacity: 1; } }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.rounds a { text-align: center; text-decoration: none; font-family: var(--f-mono); font-size: 12px; padding: 6px 0; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line); }
.rounds a.home { box-shadow: inset 0 -3px 0 var(--attack); } .rounds a.away { box-shadow: inset 0 -3px 0 var(--defense); }
.rounds a.hl { border-color: var(--ink); }
.rounds a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.mapwrap canvas { display: block; width: 100%; border-radius: 8px; touch-action: manipulation; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; max-height: 180px; overflow: auto; }
.feed time { font-family: var(--f-mono); color: var(--muted); margin-right: 8px; }
.attack-txt { color: var(--attack); font-weight: 600; } .defense-txt { color: var(--defense); font-weight: 600; }
.transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.transport input[type=range] { flex: 1 1 160px; accent-color: var(--attack); min-width: 0; }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
fieldset.reflexes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
label.check { display: flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: 0; font-family: var(--f-body);
  font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 44px; }
label.check input { accent-color: var(--attack); width: 18px; height: 18px; }
.timerbar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.timerbar span { display: block; height: 100%; background: var(--attack); transition: width 1s linear; }
fieldset.hand, fieldset.mods { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.mods { flex-direction: row; flex-wrap: wrap; }
label.call, label.mod { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0;
  font-family: var(--f-body); font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; min-height: 44px; cursor: pointer; }
label.mod { align-items: center; padding: 8px 12px; }
label.call:has(input:checked), label.mod:has(input:checked) { border-color: var(--attack); box-shadow: inset 0 0 0 1px var(--attack); }
label.call input, label.mod input { accent-color: var(--attack); margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .timerbar span { transition: none; } }
/* Live call overlay: sits on the map so the picker never needs scrolling */
.mapwrap.stage { position: relative; }
.callbox { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.callpill { pointer-events: auto; align-self: center; margin-bottom: 10px; font: inherit; font-family: var(--f-display); font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: rgb(15 20 27 / .85); border: 1px solid var(--attack);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.calloverlay { pointer-events: auto; position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: rgb(10 14 20 / .78); backdrop-filter: blur(2px); border-radius: 8px; }
.calltime { font-size: 22px; } .calltime.urgent { color: var(--bomb); }
.callgrid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.modgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.callopt, .modopt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: inherit; font-family: var(--f-display); font-weight: 600; color: var(--ink); background: rgb(26 35 48 / .92);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; cursor: pointer; text-align: center; min-height: 44px; }
.callopt { font-size: 15px; letter-spacing: .03em; }
.modopt { font-size: 11px; letter-spacing: .04em; }
.callopt.on, .modopt.on { border-color: var(--attack); box-shadow: inset 0 0 0 2px var(--attack); background: rgb(233 162 59 / .16); }
.callopt kbd, .modopt kbd { position: absolute; top: 5px; left: 6px; font-family: var(--f-mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: rgb(10 14 20 / .6); }
.callnote { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.livehead { padding: 10px 14px; } .livehead .score { font-size: 28px; }
/* Player comparison */
.peerlist { display: flex; flex-wrap: wrap; gap: 6px; } .peerlist .chip { text-decoration: none; padding: 6px 10px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs a { text-decoration: none; }
.cmp { display: flex; flex-direction: column; gap: 8px; }
.cmprow { display: grid; grid-template-columns: 2.2em 1fr 2.2em; align-items: center; gap: 8px; }
.cmprow > .mono:last-child { text-align: right; }
.cmpbars { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.cmpbars .lbl { min-width: 7.5em; text-align: center; }
.cmpbars .bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; display: flex; }
.cmpbars .bar.left { justify-content: flex-end; }
.cmpbars .bar span { display: block; height: 100%; background: var(--muted); }
.cmprow.trait .bar span { background: var(--defense); }
.mono.better { color: var(--good); font-weight: 600; } .mono.worse { color: var(--muted); }
.cmpnote { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -4px; }
.modopt .cost { font-size: 9.5px; color: var(--muted); font-weight: 400; }
.bank { font-size: 12px; }

/* circuit: career world map and tournament pages */
.worldmap { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.citycard { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--attack);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.citycard p { margin: 0; }
.citycard.locked { border-left-color: var(--line); opacity: .6; }
.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th { text-align: left; font-family: var(--f-display); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.standings td, .standings th { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.standings tr.me td, .fixture.me { color: var(--attack); }
.standings .small { font-size: 12px; }
.fixture { padding: 4px 0; border-top: 1px solid var(--line); gap: 8px; }
.fixture .name { flex: 1; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* wide tables scroll sideways on phones */
.scroll { overflow-x: auto; }
.agents td, .agents th { white-space: nowrap; }
.win-txt { color: var(--good); } .loss-txt { color: var(--bomb); }

/* small busy indicator for work running on the server */
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* cup bracket: rounds side by side, scroll sideways on phones */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.tie { padding: 10px 12px; }
.tie.mine { outline: 1px solid var(--attack); }

/* breadcrumbs: where you are, and the way back */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }
