* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #eef1f6;
  --bg-2: #e4e8f0;
  --card: #ffffff;
  --ink: #1c2333;
  --ink-soft: #5c6b84;
  --line: #e3e7ef;
  --brand: #0b1220;
  --brand-2: #1a2540;
  --accent: #1f6feb;
  --accent-soft: #e7f0fe;
  --gold: #c9a227;
  --danger: #e03131;
  --ok: #2f9e44;
  --warn: #f08c00;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(28,35,51,.08), 0 4px 14px rgba(28,35,51,.06);
  --shadow-lg: 0 8px 28px rgba(28,35,51,.14);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-2: #121a2b;
  --card: #161f33;
  --ink: #e8edf7;
  --ink-soft: #8b97b0;
  --line: #243049;
  --brand: #070b14;
  --brand-2: #121a2b;
  --accent: #4c8dff;
  --accent-soft: #1a2a4a;
  --gold: #d4af37;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
  --shadow-lg: 0 10px 32px rgba(0,0,0,.45);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  overscroll-behavior: none;
}

#app { max-width: 920px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.brand-mark {
  background: var(--gold); color: #0b1220; font-weight: 900;
  border-radius: 8px; padding: 2px 8px; letter-spacing: .4px; font-size: .92rem;
}
.brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: .4px; margin-left: 6px; }
#syncBox { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.sync-badge {
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.16);
}
.sync-badge.offline { background: rgba(255,255,255,.16); }
.sync-badge.synced { background: #1f6feb; }
.sync-badge.online { background: #2f9e44; }

.icon-btn {
  border: none; background: rgba(255,255,255,.14); color: #fff;
  width: 36px; height: 36px; border-radius: 10px; font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.26); }
.icon-btn.dark { background: var(--bg-2); color: var(--ink); }

#view { flex: 1; padding: 14px 14px calc(88px + var(--safe-b)); }
.hidden { display: none !important; }

h2.page-title { font-size: 1.22rem; margin-bottom: 4px; letter-spacing: -.2px; }
p.page-sub { color: var(--ink-soft); font-size: .85rem; margin-bottom: 14px; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--line);
}
.card h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .7px;
  color: var(--ink-soft); margin-bottom: 10px; font-weight: 800;
}

.btn {
  border: none; border-radius: 12px; cursor: pointer; font-weight: 800;
  font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 1rem; }
.btn-md { padding: 11px 14px; font-size: .92rem; }
.btn-sm { padding: 8px 12px; font-size: .82rem; border-radius: 9px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(31,111,235,.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-dark { background: var(--brand-2); color: #fff; }
.btn-ghost { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-gold { background: var(--gold); color: #0b1220; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: .8rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 1rem; font-family: inherit; color: var(--ink); background: var(--card);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap input {
  width: 100%; padding: 12px 14px 12px 40px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: 1rem; font-family: inherit; background: var(--card); color: var(--ink);
}
.search-wrap .ic {
  position: absolute; left: 14px; top: 50%; width: 14px; height: 14px;
  border: 2px solid var(--ink-soft); border-radius: 50%; transform: translateY(-60%);
}
.search-wrap .ic:after {
  content: ''; position: absolute; width: 7px; height: 2px; background: var(--ink-soft);
  right: -5px; bottom: -1px; transform: rotate(45deg); border-radius: 2px;
}

.seg { display: flex; background: var(--bg-2); border-radius: 11px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button {
  flex: 1; border: none; background: transparent; padding: 10px 6px; border-radius: 8px;
  font-size: .82rem; font-weight: 800; color: var(--ink-soft); cursor: pointer; font-family: inherit;
  min-width: 64px;
}
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.filter-chip {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 999px; padding: 7px 12px; font-size: .78rem; font-weight: 800; cursor: pointer; font-family: inherit;
}
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.fight-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  border-left: 5px solid var(--line); border: 1px solid var(--line); border-left-width: 5px;
}
.fight-card:hover { box-shadow: var(--shadow-lg); }
.fight-card .vs { min-width: 0; flex: 1; }
.fight-card .names { font-weight: 800; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fight-card .names small { color: var(--ink-soft); font-weight: 600; }
.fight-card .meta { font-size: .78rem; color: var(--ink-soft); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.result-badge {
  font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #fff;
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.empty-state { text-align: center; padding: 46px 20px; color: var(--ink-soft); }
.empty-state .big { font-size: 2.6rem; font-weight: 800; color: var(--line); }
.empty-state p { margin: 8px 0 18px; }

#scoutTimerBar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  background: var(--brand); color: #fff; border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-lg); position: sticky; top: 58px; z-index: 20;
}
#timerClock { font-size: 1.85rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 118px; }
#timerClock.over { color: #ffc9c9; }
#timerClock.paused { opacity: .55; }
#timerMeta { flex: 1; font-size: .78rem; opacity: .92; line-height: 1.3; min-width: 0; }
#timerMeta b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center;
  margin-bottom: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.sb-side { text-align: center; }
.sb-side .sb-name { font-size: .72rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.sb-side .sb-pts { font-size: 1.8rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sb-side .sb-adv { font-size: .72rem; color: var(--gold); font-weight: 800; }
.sb-vs { font-weight: 900; color: var(--ink-soft); font-size: .8rem; }
.sb-side.eu .sb-pts { color: #2f9e44; }
.sb-side.adv .sb-pts { color: #e03131; }

.scout-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.scout-actions .btn { padding: 11px 6px; font-size: .82rem; }

.scout-screen {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.athlete-panel {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
}
.ath-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; color: #fff; background: var(--side, #2f9e44);
  border-radius: var(--radius) var(--radius) 0 0;
}
.ath-name { font-weight: 800; font-size: .92rem; line-height: 1.1; }
.ath-sub { font-size: .66rem; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .4px; }

.sc-cat { border-bottom: 1px solid var(--line); }
.sc-cat-h {
  padding: 5px 12px; color: #fff; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
}
.sc-cat-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px; }
.sc-btn {
  position: relative; border: none; cursor: pointer; border-radius: 11px;
  color: #fff; font-family: inherit; font-weight: 800; font-size: .76rem; line-height: 1.15;
  min-height: 56px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: transform .07s ease, filter .12s ease;
}
.sc-btn small { font-weight: 700; font-size: .62rem; opacity: .85; }
.sc-btn:active { transform: scale(.92); filter: brightness(1.12); }
.sc-btn.flash { animation: flash .45s ease; }
.sc-btn .count {
  position: absolute; top: 4px; right: 5px; min-width: 18px; height: 18px;
  background: rgba(0,0,0,.35); border-radius: 999px; font-size: .62rem;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
@keyframes flash { 0% { filter: brightness(2.1); } 100% { filter: brightness(1); } }

.ath-history { padding: 8px 10px 12px; }
.ath-history-h { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); margin-bottom: 6px; }
.ev-list { list-style: none; max-height: 180px; overflow-y: auto; }
.ev-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 9px; margin-bottom: 4px; background: var(--bg-2);
}
.ev-list li .ev-time { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink-soft); font-size: .72rem; min-width: 40px; }
.ev-list li .ev-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.ev-list li .ev-label { font-weight: 700; font-size: .8rem; }
.ev-list li .ev-desc { font-size: .7rem; color: var(--ink-soft); font-weight: 600; }
.ev-list li .ev-main { flex: 1; min-width: 0; }
.ev-list li .ev-del {
  border: none; background: var(--line); color: var(--danger); width: 24px; height: 24px;
  border-radius: 7px; font-size: .85rem; cursor: pointer; font-weight: 800;
}

.tech-pop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(8,12,22,.55); padding: 0;
}
.tech-pop-inner {
  width: 100%; max-width: 520px; background: var(--card); border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(14px + var(--safe-b)); box-shadow: 0 -6px 24px rgba(0,0,0,.28);
}
.tech-pop-inner input {
  width: 100%; padding: 13px 12px; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 10px; font-family: inherit; background: var(--bg-2); color: var(--ink);
}
.tp-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.tp-chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  border-radius: 999px; padding: 7px 10px; font-size: .72rem; font-weight: 800;
  font-family: inherit; cursor: pointer; letter-spacing: .2px;
}
.tp-chip.on { background: #1b2f55; border-color: #3d6fd9; color: #fff; }

.chart-box { position: relative; width: 100%; }
.chart-box canvas { max-height: 260px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.act-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.act-sum { list-style: none; margin-top: 8px; }
.act-sum li { font-size: .85rem; padding: 4px 0; border-bottom: 1px solid var(--line); }
.stat-tile { background: var(--bg-2); border-radius: 12px; padding: 12px; text-align: center; }
.stat-tile .num { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.stat-tile .lbl { font-size: .68rem; color: var(--ink-soft); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.stat-tile.accent { background: var(--accent); color: #fff; }
.stat-tile.accent .lbl { color: rgba(255,255,255,.85); }
.stat-tile.warn { background: rgba(224,49,49,.12); color: var(--danger); }
.stat-tile.warn .lbl { color: var(--danger); }
.stat-tile.gold { background: rgba(201,162,39,.16); color: var(--gold); }
.stat-tile.gold .lbl { color: var(--gold); }

.eff-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.eff-row .eff-lbl { width: 130px; font-size: .82rem; font-weight: 700; }
.eff-bar { flex: 1; height: 14px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.eff-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.eff-row .eff-val { width: 52px; text-align: right; font-weight: 800; font-size: .82rem; font-variant-numeric: tabular-nums; }

.timeline-strip { height: 34px; border-radius: 10px; overflow: hidden; display: flex; background: var(--bg-2); }
.timeline-strip .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .62rem; font-weight: 800; overflow: hidden; white-space: nowrap; min-width: 0; background: transparent; padding: 0; }
.timeline-scale { display: flex; font-size: .66rem; color: var(--ink-soft); margin-top: 4px; }
.timeline-scale span { flex: 1; }
.timeline-scale span:last-child { text-align: right; }

.insight {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border-radius: 11px; margin-bottom: 8px; font-size: .85rem;
}
.insight.good { background: #ebfbee; color: #1c7a32; }
.insight.warn { background: #fff4e6; color: #b25e00; }
.insight.bad { background: #fff0f0; color: #b02525; }
html[data-theme="dark"] .insight.good { background: #14301c; color: #8ce99a; }
html[data-theme="dark"] .insight.warn { background: #33240e; color: #ffc078; }
html[data-theme="dark"] .insight.bad { background: #3b1414; color: #ffa8a8; }
.insight .ic { font-weight: 800; flex: none; }

table.simple { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.simple th, table.simple td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.simple th { color: var(--ink-soft); text-transform: uppercase; font-size: .7rem; letter-spacing: .4px; }
table.simple td.num, table.simple th.num { text-align: right; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }

.compare-item {
  display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 11px;
  border: 1.5px solid var(--line); padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.compare-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.compare-item input { width: 18px; height: 18px; accent-color: var(--accent); }

.athlete-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.athlete-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex: none;
}
.athlete-card .info { flex: 1; min-width: 0; }
.athlete-card .info b { display: block; }
.athlete-card .info small { color: var(--ink-soft); }

.winrate {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 900; border: 3px solid var(--ok); color: var(--ok);
}

#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  box-shadow: 0 -2px 14px rgba(28,35,51,.08);
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 9px 4px; font-size: .72rem; font-weight: 700; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab .tab-ic { font-size: 1.2rem; line-height: 1; }
.tab.active { color: var(--accent); }
.tab.primary-tab { color: var(--accent); }
.tab.primary-tab .tab-ic {
  background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  margin-top: -20px; box-shadow: 0 4px 12px rgba(31,111,235,.4);
}
@media (min-width: 920px) {
  #tabbar { max-width: 920px; margin: 0 auto; border-radius: 16px 16px 0 0; }
}

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b));
  background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-lg); z-index: 70; max-width: 92vw; text-align: center;
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

.modal-mask { position: fixed; inset: 0; background: rgba(8,12,22,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal {
  background: var(--card); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; color: var(--ink);
}
.modal h3 { margin-bottom: 6px; }

.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; }
.mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.small { font-size: .8rem; color: var(--ink-soft); }
.bold { font-weight: 800; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.export-row { display: flex; flex-wrap: wrap; gap: 10px; }
.export-row .btn { flex: 1; min-width: 120px; }

.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-2); font-size: .72rem; font-weight: 800; font-family: inherit;
}

@media (max-width: 640px) {
  .scout-screen { grid-template-columns: 1fr; }
  .ev-list { max-height: 120px; }
  #timerClock { font-size: 1.45rem; min-width: 92px; }
  .sc-btn { min-height: 48px; font-size: .72rem; }
}

/* ========== PAINEL DE PLACAR (SCOUT) ========== */
body.board-mode {
  background: #070b12;
  color: #e8edf4;
}
body.board-mode #app,
#app.board-mode {
  max-width: 1080px;
}
body.board-mode #topbar {
  background: #070b12;
  box-shadow: none;
  border-bottom: 1px solid #1a2336;
}
body.board-mode .brand-mark {
  background: #1d2a44;
  color: #d7deea;
}
body.board-mode #view {
  padding: 0 12px calc(16px + var(--safe-b));
}
body.board-mode #toast {
  bottom: 18px;
  background: #121a28;
  border: 1px solid #2a3650;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .3px;
}

.board {
  --navy: #070b12;
  --panel: #101826;
  --panel-2: #152033;
  --stroke: #243049;
  --muted: #8b97ad;
  --text: #eef2f8;
  --blue: #3d6fd9;
  --blue-dim: #1b2f55;
  --lead: #2f9e44;
  --crit: #c92a2a;
  color: var(--text);
}

#scoreFlash {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 15;
  background: rgba(61,111,217,.12);
  opacity: 0;
}
#scoreFlash.on { animation: scorePulse .28s ease; }
@keyframes scorePulse {
  0% { opacity: .55; }
  100% { opacity: 0; }
}

.board-score {
  text-align: center;
  padding: 18px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  margin: 12px 0 10px;
}
.sticky-score {
  position: sticky;
  top: 0;
  z-index: 8;
}
.bs-names {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: .78rem; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
}
.bs-name { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-name.left { text-align: left; color: #cfd7e6; }
.bs-name.right { text-align: right; color: #cfd7e6; }
.board.lead-eu .bs-name.left,
.board.lead-eu .bs-n.left { color: var(--lead); }
.board.lead-adv .bs-name.right,
.board.lead-adv .bs-n.right { color: var(--lead); }

.bs-nums {
  display: flex; align-items: baseline; justify-content: center; gap: 18px;
  margin: 6px 0 2px;
}
.bs-n {
  font-size: 4.6rem; font-weight: 900; line-height: .95;
  font-variant-numeric: tabular-nums; letter-spacing: -2px; color: #fff;
  min-width: 1.1em;
}
.bs-x { font-size: 2rem; font-weight: 800; color: #4b5873; }
.bs-subs {
  display: flex; justify-content: space-between; min-height: 18px;
  font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 8px;
}
.bs-sub-col.right { text-align: right; }
.bs-subs .pen { color: var(--crit); }

.bs-clock {
  font-size: 2.15rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: 2px; color: #fff; margin: 4px 0 6px;
}
.bs-clock.paused { opacity: .45; }
.bs-clock.over { color: #ffa8a8; }

.fight-st {
  display: inline-block; font-size: .68rem; font-weight: 800;
  letter-spacing: 1.4px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
  border: 1px solid var(--stroke); color: var(--muted);
}
.fight-st.st-live { color: var(--lead); border-color: rgba(47,158,68,.45); background: rgba(47,158,68,.1); }
.fight-st.st-pause { color: var(--muted); }
.fight-st.st-done { color: var(--crit); border-color: rgba(201,42,42,.45); background: rgba(201,42,42,.12); }

.bs-ctrls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ctrl-btn {
  border: none; border-radius: 12px; min-height: 48px;
  background: var(--blue); color: #fff; font-weight: 800; font-family: inherit;
  font-size: .92rem; letter-spacing: .8px; cursor: pointer;
}
.ctrl-btn:active { transform: scale(.97); }
.ctrl-btn.ctrl-ghost {
  background: transparent; color: #cfd7e6; border: 1px solid var(--stroke);
}

.split-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--panel);
}
.ath-col {
  padding: 12px 10px 14px;
  min-width: 0;
}
.ath-col + .ath-col {
  border-left: 1px solid var(--stroke);
}
.ath-col-h {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  margin-bottom: 4px;
}
.ath-col-name {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: center;
  color: #cfd7e6;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.split-board .pt-btn,
.split-board .pt-btn.ghost {
  min-height: 52px;
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 12px;
}
.split-board .pt-btn .pt-val {
  font-size: 1.05rem;
  order: 2;
}
.split-board .pt-btn .pt-lab {
  font-size: .68rem;
  text-align: left;
  white-space: normal;
  line-height: 1.15;
}
.split-board .sub-btn {
  min-height: 48px;
  font-size: .78rem;
  border-radius: 12px;
}

.board-main { padding-bottom: 8px; }
.bsec { margin-bottom: 14px; }
.bsec.muted { opacity: .92; }
.bsec-h {
  font-size: .68rem; font-weight: 800; letter-spacing: 1.6px;
  color: var(--muted); margin-bottom: 8px;
}
.tech-hint { font-size: .78rem; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }

.ath-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ath-pick {
  border: 1px solid var(--stroke); background: var(--panel); color: #cfd7e6;
  border-radius: 14px; min-height: 56px; padding: 10px 12px;
  font-weight: 800; font-family: inherit; font-size: .92rem; letter-spacing: .4px;
  text-transform: uppercase; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ath-pick.on {
  background: var(--blue-dim); border-color: var(--blue); color: #fff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.pt-grid { display: grid; gap: 10px; }
.pt-grid.n1 { grid-template-columns: 1fr; }
.pt-grid.n2 { grid-template-columns: 1fr 1fr; }
.pt-grid.n3 { grid-template-columns: 1fr 1fr; }
.pt-grid.n3 .pt-btn:last-child { grid-column: 1 / -1; }
.pt-btn {
  border: 1px solid var(--stroke); background: var(--panel-2); color: #fff;
  border-radius: 16px; min-height: 84px; padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: inherit; cursor: pointer;
}
.pt-btn:active { transform: scale(.97); background: #1c2b44; }
.pt-btn.flash { animation: ptFlash .22s ease; }
@keyframes ptFlash {
  0% { background: #243a63; }
  100% { background: var(--panel-2); }
}
.pt-val { font-size: 1.55rem; font-weight: 900; letter-spacing: .5px; line-height: 1; color: #fff; }
.pt-lab { font-size: .72rem; font-weight: 800; letter-spacing: .8px; color: #9aa6bd; }
.pt-btn.ghost { min-height: 64px; background: #0e1522; }
.pt-btn.ghost .pt-val { font-size: 1.2rem; color: #cfd7e6; }
.pt-btn.danger { border-color: #4a1f1f; }
.pt-btn.danger .pt-lab, .pt-btn.danger .pt-val { color: #e03131; }

.sub-btn {
  width: 100%; border: 1px solid #5c1a1a; background: #2a1010; color: #ff6b6b;
  border-radius: 16px; min-height: 64px; font-weight: 900; font-family: inherit;
  font-size: .95rem; letter-spacing: 1px; cursor: pointer;
}
.sub-btn:active { transform: scale(.98); background: #3b1414; }

.hist-list { list-style: none; max-height: 168px; overflow-y: auto; margin-bottom: 10px; }
.hist-row {
  display: grid; grid-template-columns: 52px minmax(0,1.1fr) 36px minmax(0,1.4fr) 28px;
  gap: 8px; align-items: center; padding: 8px 4px;
  border-bottom: 1px solid var(--stroke); font-size: .78rem;
}
.hist-del {
  border: none; background: transparent; color: var(--muted);
  width: 28px; height: 28px; border-radius: 8px; font-size: 1.1rem;
  font-weight: 800; cursor: pointer; font-family: inherit; line-height: 1;
}
.hist-del:active { background: var(--panel); color: var(--crit); }
.hist-t { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); }
.hist-who { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-pts { font-weight: 900; color: #fff; text-align: right; }
.hist-act { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-desc { color: #6d7a92; }
.hist-empty { color: var(--muted); padding: 12px 4px; font-size: .8rem; }
.undo-btn {
  width: 100%; border: 1px solid var(--stroke); background: transparent; color: #cfd7e6;
  border-radius: 12px; min-height: 48px; font-weight: 800; font-family: inherit;
  letter-spacing: .6px; cursor: pointer;
}
.undo-btn:active { background: var(--panel); }

.board-result {
  margin-top: 12px; text-align: center; padding: 16px;
  background: #2a1010; border: 1px solid #5c1a1a; border-radius: 16px;
}
.br-kicker { font-size: .68rem; letter-spacing: 1.6px; font-weight: 800; color: #ff6b6b; }
.br-win { font-size: 1.4rem; font-weight: 900; margin: 4px 0; }
.br-score { font-size: 1.1rem; font-weight: 800; color: var(--muted); }

.board-modal { background: #101826; color: #eef2f8; border: 1px solid #243049; }
.board-modal .small { color: #8b97ad; }

.board.is-locked .pt-btn,
.board.is-locked .sub-btn,
.board.is-locked .ath-pick,
.board.is-locked .undo-btn,
.board.is-locked .col-sub,
.board.is-locked .hist-del {
  pointer-events: none;
  opacity: .42;
}

@media (min-width: 900px) {
  .bs-n { font-size: 5.4rem; }
  .pt-grid.n3 { grid-template-columns: 1fr 1fr 1fr; }
  .pt-grid.n3 .pt-btn:last-child { grid-column: auto; }
  .pt-btn { min-height: 96px; }
  .board-score { padding: 22px 22px 18px; }
}

@media (max-width: 520px) {
  .bs-n { font-size: 3.4rem; }
  .bs-clock { font-size: 1.7rem; }
  .pt-btn { min-height: 74px; }
  .pt-grid.n3 { grid-template-columns: 1fr; }
  .hist-row { grid-template-columns: 44px minmax(0,1fr) 32px minmax(0,1.2fr) 24px; font-size: .72rem; }
}

body.auth-mode #tabbar { display: none !important; }
body.auth-mode #view { padding-bottom: 28px; }

.auth-wrap {
  max-width: 420px;
  margin: 24px auto 0;
}
.auth-card { padding: 22px 18px 20px; }
.auth-mark {
  display: inline-block;
  background: var(--gold);
  color: #0b1220;
  font-weight: 900;
  letter-spacing: .6px;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .82rem;
  margin-bottom: 12px;
}
.user-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

@media print {
  #topbar, #tabbar, #toast, .no-print { display: none !important; }
  #view { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
