/* MKOSZ Live Analytics — design system */
/* Layout-specifikus változók — adatainál: --font-base, --font-h, --space-card, --table-pad, --table-font, --card-radius */
:root {
  /* Alapértelmezett (Klasszikus) layout-változók */
  --font-base: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-h:    'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-size-base: 14px;
  --space-card:  18px 20px;
  --table-pad:   9px 8px;
  --table-font:  14px;
  --card-radius: 12px;
  --score-size:  64px;
  --letter-spacing-h: .3px;
}
[data-layout="compact"] {
  --font-size-base: 13px;
  --space-card:  10px 12px;
  --table-pad:   5px 6px;
  --table-font:  12px;
  --card-radius: 8px;
  --score-size:  48px;
}
[data-layout="magazine"] {
  --font-base: Georgia, 'Times New Roman', 'Charter', serif;
  --font-h:    Georgia, serif;
  --font-size-base: 15px;
  --space-card:  26px 30px;
  --table-pad:   12px 10px;
  --table-font:  15px;
  --card-radius: 4px;
  --score-size:  56px;
  --letter-spacing-h: 0;
}
[data-layout="stadium"] {
  --font-base: 'Inter', sans-serif;
  --font-h:    'Inter', sans-serif;
  --font-size-base: 14px;
  --space-card:  20px 22px;
  --table-pad:   10px 10px;
  --table-font:  14px;
  --card-radius: 2px;
  --score-size:  76px;
  --letter-spacing-h: 2px;
}

:root, [data-theme="midnight"] {
  --bg:        #0b0d12;
  --bg-elev:   #131722;
  --bg-card:   #1a1f2c;
  --bg-hover:  #232938;
  --line:      #2a3142;
  --line-soft: #1f2533;
  --txt:       #e8ecf2;
  --txt-mut:   #8a93a5;
  --txt-dim:   #5e6677;
  --accent:    #b15cd8;
  --accent-dk: #7a00a6;
  --accent-bg: #2a0d3a;
  --home:      #b15cd8;
  --away:      #4ea8ff;
  --good:      #2dc56e;
  --bad:       #ef5350;
  --warn:      #f0b323;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  --radius:    12px;
  --radius-sm: 8px;
}

[data-theme="ocean"] {
  --bg:        #07111c;
  --bg-elev:   #0e1c2c;
  --bg-card:   #14283d;
  --bg-hover:  #1c3650;
  --line:      #25445f;
  --line-soft: #1a324a;
  --txt:       #e6f0fa;
  --txt-mut:   #87a3bf;
  --txt-dim:   #5a7a96;
  --accent:    #4dd0e1;
  --accent-dk: #0288a3;
  --accent-bg: #0e3a48;
  --home:      #4dd0e1;
  --away:      #ffb74d;
}

[data-theme="crimson"] {
  --bg:        #100808;
  --bg-elev:   #1f1010;
  --bg-card:   #2a1818;
  --bg-hover:  #3a2222;
  --line:      #4a2a2a;
  --line-soft: #321c1c;
  --txt:       #f4e8e8;
  --txt-mut:   #b39595;
  --txt-dim:   #7a5a5a;
  --accent:    #ef5350;
  --accent-dk: #a01818;
  --accent-bg: #401818;
  --home:      #ef5350;
  --away:      #ffc857;
}

[data-theme="forest"] {
  --bg:        #0a120b;
  --bg-elev:   #142217;
  --bg-card:   #1c3023;
  --bg-hover:  #28412d;
  --line:      #355a3b;
  --line-soft: #20381f;
  --txt:       #e8f4ea;
  --txt-mut:   #98b39c;
  --txt-dim:   #5e7a62;
  --accent:    #6bd47a;
  --accent-dk: #2e8540;
  --accent-bg: #1a3a22;
  --home:      #6bd47a;
  --away:      #ffb74d;
}

[data-theme="carbon"] {
  --bg:        #0d0d0d;
  --bg-elev:   #181818;
  --bg-card:   #202020;
  --bg-hover:  #2b2b2b;
  --line:      #353535;
  --line-soft: #252525;
  --txt:       #ededed;
  --txt-mut:   #999999;
  --txt-dim:   #666666;
  --accent:    #ff8a3d;
  --accent-dk: #c25612;
  --accent-bg: #3a2010;
  --home:      #ff8a3d;
  --away:      #5b9bff;
}

[data-theme="light"] {
  --bg:        #f4f6f9;
  --bg-elev:   #ffffff;
  --bg-card:   #ffffff;
  --bg-hover:  #eef2f7;
  --line:      #d9dfe7;
  --line-soft: #e6ebf2;
  --txt:       #1a2030;
  --txt-mut:   #5f6b80;
  --txt-dim:   #9aa3b3;
  --accent:    #7a00a6;
  --accent-dk: #5c0079;
  --accent-bg: #f0e0fa;
  --home:      #7a00a6;
  --away:      #1e6dd5;
  --good:      #1f7d44;
  --bad:       #c62828;
  --warn:      #a06000;
  --shadow:    0 1px 2px rgba(20,30,60,.06), 0 6px 18px rgba(20,30,60,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'tnum';
}

/* ---------- Fejléc ---------- */
.topbar {
  background: linear-gradient(180deg, rgba(122,0,166,.18) 0%, transparent 100%), var(--bg-elev);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.topbar-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.topbar-row.secondary { padding-top: 4px; border-top: 1px solid var(--line-soft); margin-top: 2px; }
.brand {
  font-weight: 800; font-size: 16px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 10px; color: var(--txt);
  text-decoration: none;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dk));
  box-shadow: 0 0 12px var(--accent);
}
.brand-sub { color: var(--txt-mut); font-weight: 500; font-size: 13px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: var(--txt-mut); text-decoration: none; padding: 6px 12px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
}
.topbar nav a:hover { background: var(--bg-hover); color: var(--txt); }
.topbar nav a.active { background: var(--accent-bg); color: var(--accent); }
.topbar .spacer { flex: 1; }
.topbar input.code {
  flex: 1; min-width: 200px;
  background: var(--bg-card); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.topbar input.code:focus { outline: none; border-color: var(--accent); }
.icon-btn { padding: 6px 10px; font-size: 15px; }
.auto-label {
  display: inline-flex; align-items: center; gap: 6px; color: var(--txt-mut);
  font-size: 12px; padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
}
.auto-label:hover { background: var(--bg-hover); color: var(--txt); }

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; }
  .brand { font-size: 15px; }
  .brand-sub { display: none; }
  .topbar nav a { padding: 5px 8px; font-size: 12px; }
  .live-toggle .live-text { display: none; }
  .theme-picker { font-size: 11px; padding: 5px 6px; max-width: 110px; }
  .topbar input.code { min-width: 0; flex: 1; }
  .auto-label span { display: none; }
}
.btn {
  background: var(--bg-card); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 500;
  transition: all .15s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.btn.primary { background: var(--accent-dk); border-color: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent); }
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px;
  font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.status-badge.live { background: rgba(239,83,80,.15); color: var(--bad); }
.status-badge.live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bad); animation: pulse 1.2s infinite;
}
.status-badge.done { background: rgba(45,197,110,.12); color: var(--good); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.freshness {
  font-size: 11px; color: var(--txt-mut); padding: 3px 8px;
  border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; transition: all .3s;
}
.freshness.warn { color: var(--warn); border-color: var(--warn); background: rgba(240,179,35,.08); }
.freshness.stale { color: var(--bad); border-color: var(--bad); background: rgba(239,83,80,.08); }

/* ---------- Layout ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .container { padding: 16px; }
}

/* ---------- Kártyák ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: var(--space-card);
  box-shadow: var(--shadow);
  position: relative;
}
.card h2 {
  font-size: 11px; margin: 0 0 14px;
  color: var(--txt-mut); text-transform: uppercase;
  letter-spacing: 1.2px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h2 .sub { color: var(--txt-dim); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.card h2 .grow { flex: 1; }
.fs-btn {
  background: transparent; border: 1px solid var(--line); color: var(--txt-mut);
  padding: 3px 8px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 12px; font-weight: 600; transition: all .12s;
}
.fs-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Fullscreen mód: a card az egész viewportet kitölti */
.card.fullscreen {
  position: fixed; inset: 0; z-index: 200;
  border-radius: 0; border: none; margin: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: 14px 18px;
  overflow: hidden;
}
.card.fullscreen > h2 { flex-shrink: 0; }
.card.fullscreen .scroll {
  flex: 1 1 auto; max-height: none; overflow: auto;
}
.card.fullscreen .combo-wrap { flex: 1 1 auto; overflow: auto; }
body.has-fs { overflow: hidden; }

/* ---------- Eredménykijelző ---------- */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 28px;
  padding: 26px 24px 22px;
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-card) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 18px;
}
.scoreboard .tname {
  font-size: 20px; font-weight: 600; line-height: 1.25;
}
.scoreboard .tname.home { text-align: right; }
.scoreboard .tname.home::before {
  content: ''; display: inline-block; width: 4px; height: 22px;
  background: var(--home); margin-right: 10px; vertical-align: -4px; border-radius: 2px;
}
.scoreboard .tname.away::after {
  content: ''; display: inline-block; width: 4px; height: 22px;
  background: var(--away); margin-left: 10px; vertical-align: -4px; border-radius: 2px;
}
.scoreboard .center-col {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scoreboard .scores {
  display: flex; gap: 16px; align-items: baseline;
  font-family: var(--font-h); font-weight: 800;
  font-variant-numeric: tabular-nums; font-size: var(--score-size);
  line-height: 1; letter-spacing: var(--letter-spacing-h);
}
.scoreboard .scores .sep { color: var(--txt-dim); font-size: 40px; font-weight: 300; }
.scoreboard .scores .h { color: var(--home); }
.scoreboard .scores .a { color: var(--away); }
.scoreboard .clock-big {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 28px; font-weight: 700; color: var(--txt);
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
  display: flex; gap: 10px; align-items: center;
}
.scoreboard .clock-big .qchip {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  background: var(--accent-bg); color: var(--accent);
  padding: 3px 10px; border-radius: 12px; letter-spacing: 1px;
}
.qscores {
  display: flex; gap: 0; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.qscores .qcell {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 11px; min-width: 56px;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.qscores .qcell:last-child { border-right: none; }
.qscores .qcell .qlabel { font-size: 9px; color: var(--txt-mut); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-bottom: 2px; }
.qscores .qcell .qvals { font-size: 13px; font-weight: 600; }
.qscores .qcell .qvals .h { color: var(--home); }
.qscores .qcell .qvals .a { color: var(--away); }
.qscores .qcell .qvals .d { color: var(--txt-dim); margin: 0 2px; }
@media (max-width: 720px) {
  .scoreboard { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .scoreboard .tname.home, .scoreboard .tname.away { text-align: center; }
  .scoreboard .scores { font-size: 52px; }
  .scoreboard .clock-big { font-size: 24px; }
}

/* ---------- Theme picker ---------- */
.theme-picker {
  background: var(--bg-card); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 12px; cursor: pointer; font-weight: 500;
}
.theme-picker:hover { border-color: var(--accent); }
.meta-row {
  text-align: center; color: var(--txt-mut); font-size: 12px;
  margin-top: 12px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row .sep-dot { color: var(--txt-dim); }

/* ---------- Csapat-összehasonlítás (bar chart) ---------- */
.cmp { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 8px 14px; align-items: center; }
.cmp .lbl {
  text-align: center; color: var(--txt-mut);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
}
.bar { height: 28px; background: var(--bg-elev); border-radius: 6px; position: relative; overflow: hidden; }
.bar > span {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
  padding: 0 10px; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: width .5s ease;
}
.bar.l > span { right: 0; background: linear-gradient(90deg, transparent 0%, var(--home) 100%); justify-content: flex-end; color: white; }
.bar.r > span { left: 0; background: linear-gradient(270deg, transparent 0%, var(--away) 100%); color: white; }
.bar.l.winner > span { box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.bar.r.winner > span { box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }

/* ---------- Trend chart ---------- */
.trend-wrap { position: relative; }
canvas.trend { width: 100%; height: 240px; display: block; cursor: crosshair; }
.trend-tooltip {
  position: absolute; pointer-events: none; opacity: 0;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums; box-shadow: var(--shadow);
  transition: opacity .12s, transform .05s linear;
  white-space: nowrap; z-index: 10;
}
.trend-tooltip.on { opacity: 1; }
.trend-tooltip .tt-time { font-weight: 700; color: var(--txt); margin-bottom: 2px; }
.trend-tooltip .tt-row { display: flex; gap: 8px; justify-content: space-between; min-width: 130px; }
.trend-tooltip .tt-row .lbl { color: var(--txt-mut); }
.trend-tooltip .tt-row .h { color: var(--home); font-weight: 600; }
.trend-tooltip .tt-row .a { color: var(--away); font-weight: 600; }
.trend-note {
  font-size: 12px; color: var(--txt-mut); margin-top: 8px; text-align: center;
}

/* ---------- Tabok / Tab gombok ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 500; color: var(--txt-mut);
  transition: all .15s;
}
.tab:hover { color: var(--txt); border-color: var(--accent); }
.tab.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* ---------- Táblázatok ---------- */
table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: var(--table-font);
}
thead { background: var(--bg-elev); }
th, td {
  padding: var(--table-pad); text-align: right; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; padding-left: 14px; }
th:last-child, td:last-child { padding-right: 14px; }
th {
  color: var(--txt-mut); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: var(--bg-elev); z-index: 10;
  /* Opák alsó vonal + árnyék hogy a görgő tartalom NE látszódjon át a fejléc alatt */
  box-shadow: 0 1px 0 var(--line), 0 6px 8px -6px rgba(0,0,0,0.4);
}
th:hover { color: var(--txt); }
th.sorted { color: var(--accent); }
th.sorted::after {
  content: '▾'; margin-left: 4px; display: inline-block; font-size: 9px;
}
th.sorted.asc::after { content: '▴'; }
/* Oszlop-csoportosítás láthatóvá tétele: a csoportok közti határt nagyobb térrel
   és világosabb függőleges elválasztóval jelöljük. */
th.group-start, td.group-start { border-left: 1px solid var(--line); }
th.group-end,   td.group-end   { border-right: 1px solid var(--line); }
/* td-knek áttetsző tint (mögötte a tbody van, ez OK) */
td.col-shoot   { background: rgba(122,0,166,.04); }
td.col-reb     { background: rgba(120,180,255,.04); }
td.col-foul    { background: rgba(240,179,35,.04); }
/* th-k OPÁK alappal (sticky miatt!), a tint a tetején linear-gradient-tel */
th.col-shoot {
  background-image: linear-gradient(rgba(122,0,166,.18), rgba(122,0,166,.18));
  background-color: var(--bg-elev);
}
th.col-reb {
  background-image: linear-gradient(rgba(120,180,255,.18), rgba(120,180,255,.18));
  background-color: var(--bg-elev);
}
th.col-foul {
  background-image: linear-gradient(rgba(240,179,35,.18), rgba(240,179,35,.18));
  background-color: var(--bg-elev);
}
th.col-key { color: var(--accent); font-weight: 800; }
td.col-key { font-weight: 700; color: var(--txt); }
/* Light témán halványabb háttér ne adjon ronda kontúrt */
[data-theme="light"] th.col-shoot, [data-theme="light"] td.col-shoot { background: rgba(122,0,166,.05); }
[data-theme="light"] th.col-reb,   [data-theme="light"] td.col-reb   { background: rgba(30,109,213,.05); }
[data-theme="light"] th.col-foul,  [data-theme="light"] td.col-foul  { background: rgba(160,96,0,.05); }
tbody tr { transition: background .12s; cursor: pointer; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected { background: var(--accent-bg); }
.pname { font-weight: 600; }
.pnum { color: var(--txt-mut); font-size: 11px; margin-right: 6px; }
.scroll { max-height: 540px; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--txt-dim); }

.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.zero { color: var(--txt-dim); }
.heat { font-weight: 600; }
.tag { font-size: 11px; color: var(--txt-mut); font-weight: normal; text-transform: none; letter-spacing: 0; }
.foot { text-align: center; color: var(--txt-dim); font-size: 12px; margin-top: 24px; padding: 12px; }

/* ---------- Modal (játékos drilldown) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 500;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  width: 100%; max-width: 720px; max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.modal header {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, var(--accent-bg) 0%, transparent 100%);
}
.modal header .num {
  background: var(--accent-dk); color: white; width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.modal header .pn { flex: 1; }
.modal header .pn .nm { font-size: 18px; font-weight: 700; }
.modal header .pn .tm { font-size: 12px; color: var(--txt-mut); }
.modal header .close {
  background: none; border: none; color: var(--txt-mut); font-size: 22px;
  cursor: pointer; padding: 4px 10px; border-radius: 6px;
}
.modal header .close:hover { background: var(--bg-hover); color: var(--txt); }
.modal .body { padding: 18px 24px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  background: var(--bg-elev); border-radius: var(--radius-sm); padding: 10px 12px;
  border: 1px solid var(--line-soft);
}
.kpi .lbl { font-size: 10px; color: var(--txt-mut); text-transform: uppercase; letter-spacing: .5px; }
.kpi .val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .sub { font-size: 11px; color: var(--txt-dim); margin-top: 2px; }
.kpi.good .val { color: var(--good); }
.kpi.bad  .val { color: var(--bad); }
.section-head {
  font-size: 11px; color: var(--txt-mut); text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700; margin: 14px 0 8px;
}
.shotchart { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.shotbar {
  background: var(--bg-elev); border-radius: var(--radius-sm); padding: 10px;
  border: 1px solid var(--line-soft);
}
.shotbar .nm { font-size: 11px; color: var(--txt-mut); }
.shotbar .stat { font-size: 16px; font-weight: 700; margin: 4px 0; }
.shotbar .bar2 { height: 6px; background: var(--bg-card); border-radius: 3px; overflow: hidden; }
.shotbar .bar2 > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dk)); }

/* Lövéstérkép */
.shot-controls { display: flex; gap: 6px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.shot-svg-wrap { display: flex; justify-content: center; padding: 8px 0; }
.shot-zone-summary {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  font-size: 12px; color: var(--txt-mut); margin-top: 10px;
}
.shot-zone-summary strong { color: var(--txt); }
.modal-shotchart { margin: 0 0 14px; }
.shot-svg { width: 100%; max-width: 540px; height: auto; display: block; margin: 0 auto; }
.shot-dot { cursor: pointer; transition: r .12s; }
.shot-dot:hover { r: 7; stroke-width: 2; }
.shot-tip {
  margin-top: 10px; padding: 8px 12px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; opacity: 0; transition: opacity .15s; text-align: center;
}
.shot-tip.show { opacity: 1; }
.shot-tip .pos { color: var(--good); font-weight: 700; }
.shot-tip .neg { color: var(--bad); font-weight: 700; }

/* Kedvencek */
.fav-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 4px; justify-content: center; }
.fav-empty { color: var(--txt-dim); font-size: 12px; padding: 8px; font-style: italic; }
.fav-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px;
  padding: 3px 4px 3px 12px; font-size: 12px;
}
.fav-chip a { color: var(--accent); text-decoration: none; font-weight: 600; }
.fav-chip a:hover { color: var(--txt); }
.fav-chip .fav-x {
  background: transparent; border: none; color: var(--txt-mut); font-size: 16px;
  cursor: pointer; padding: 0 6px; border-radius: 50%; line-height: 1;
}
.fav-chip .fav-x:hover { background: var(--bg-hover); color: var(--bad); }
.fav-star {
  background: transparent; border: 1px solid var(--line); color: var(--txt-mut);
  padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
}
.fav-star.on { color: var(--warn); border-color: var(--warn); }
.fav-star:hover { color: var(--warn); border-color: var(--warn); }

/* ---------- Combo eszköz ---------- */
.combo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .combo-wrap { grid-template-columns: 1fr; } }
.combo-list {
  background: var(--bg-elev); border-radius: var(--radius-sm); padding: 4px;
  max-height: 360px; overflow: auto; border: 1px solid var(--line-soft);
}
.combo-list label {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 5px; cursor: pointer; font-size: 13px;
}
.combo-list label:hover { background: var(--bg-hover); }
.combo-list label.checked { background: var(--accent-bg); }
.combo-list label input { accent-color: var(--accent); }
.combo-list label .nm { flex: 1; }
.combo-list label .minS { font-size: 11px; color: var(--txt-mut); font-variant-numeric: tabular-nums; }
.combo-result {
  background: var(--bg-elev); border-radius: var(--radius-sm); padding: 16px;
  border: 1px solid var(--line-soft);
}
.combo-result .empty { color: var(--txt-mut); text-align: center; padding: 40px 0; font-size: 13px; }
.combo-result h3 { margin: 0 0 12px; font-size: 13px; color: var(--accent); }

/* ---------- Magyarázó oldal ---------- */
.docs { max-width: 900px; margin: 0 auto; padding: 20px 0; }
.docs h1 { font-size: 28px; margin: 0 0 8px; font-weight: 800; }
.docs .lead { color: var(--txt-mut); font-size: 15px; margin-bottom: 30px; }
.docs h2 {
  font-size: 18px; margin: 32px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); color: var(--accent);
}
.docs h3 { font-size: 14px; margin: 18px 0 6px; color: var(--txt); font-weight: 700; }
.docs p { color: var(--txt); margin: 8px 0; }
.docs .formula {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; color: var(--accent); margin: 10px 0; overflow-x: auto;
}
.docs .note {
  background: rgba(240,179,35,.08); border-left: 3px solid var(--warn);
  padding: 10px 14px; border-radius: 4px; margin: 10px 0; font-size: 13px;
}
.docs .note strong { color: var(--warn); }
.docs ul { padding-left: 22px; }
.docs li { margin: 4px 0; }
.docs table.glossary { margin: 12px 0; }
.docs table.glossary td:first-child { color: var(--accent); font-family: monospace; font-weight: 600; }

/* ---------- Üres állapot ---------- */
.empty-state {
  text-align: center; padding: 24px 20px 40px; color: var(--txt-mut);
}
.empty-state h2 { color: var(--txt); font-size: 24px; margin-bottom: 8px; font-weight: 700; }
.empty-state p { font-size: 14px; max-width: 620px; margin: 0 auto 18px; }
.empty-state code { background: var(--bg-card); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 7px; font-size: 12px; color: var(--accent); font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Bajnokságok ---------- */
.lg-cat { margin: 18px 0; }
.lg-cat h3 {
  font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; margin: 0 0 10px; padding-left: 4px;
}
.lg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px;
}
.lg-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; transition: all .15s;
}
.lg-card:hover { border-color: var(--accent); }
.lg-card .lg-name { font-weight: 600; color: var(--txt); font-size: 14px; margin-bottom: 8px; }
.lg-card .lg-phases { display: flex; flex-wrap: wrap; gap: 5px; }
.lg-phase {
  background: var(--bg-elev); border: 1px solid var(--line-soft); color: var(--txt-mut);
  padding: 4px 10px; border-radius: 14px; font-size: 11px; cursor: pointer; font-weight: 600;
  transition: all .12s;
}
.lg-phase:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.lg-phase.on { background: var(--accent); color: white; border-color: var(--accent); }
.lg-phase.beta { border-style: dashed; }
.lg-phase .beta-tag {
  background: var(--warn); color: var(--bg); font-size: 9px; padding: 0 4px;
  border-radius: 3px; margin-left: 4px; font-weight: 800; letter-spacing: .5px; vertical-align: 1px;
}

.phases-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.league-teams {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.lg-team {
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
}
@media (max-width: 720px) {
  .lg-team { grid-template-columns: 1fr; }
}
.lg-team-name { font-weight: 600; color: var(--txt); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-team-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lg-team-actions .btn { font-size: 11px; padding: 5px 10px; text-decoration: none; }
.lg-team.faded { opacity: .6; }
.lg-team.faded:hover { opacity: 1; }
.phase-chip {
  display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 10px;
  background: var(--bg-card); color: var(--txt-mut); border: 1px solid var(--line);
  font-weight: 600;
}
.phase-chip.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-bg); color: var(--accent);
  min-width: 28px; height: 22px; padding: 0 6px; border-radius: 11px;
  font-size: 11px; font-weight: 800;
}

.empty-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 24px;
}
.etab {
  background: transparent; color: var(--txt-mut); border: none; padding: 8px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer; border-radius: var(--radius-sm);
  transition: all .15s;
}
.etab:hover { color: var(--txt); }
.etab.on { background: var(--accent-bg); color: var(--accent); }

.team-input-row {
  max-width: 720px; margin: 0 auto 14px;
  display: flex; gap: 8px;
}
.team-input {
  flex: 1; background: var(--bg-card); color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.team-input:focus { outline: none; border-color: var(--accent); }
.team-suggestions {
  font-size: 12px; color: var(--txt-mut); margin-bottom: 16px;
}
.team-suggestions code { cursor: pointer; margin: 0 4px; }
.team-suggestions code:hover { background: var(--accent-bg); }

.team-result-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin: 8px auto; max-width: 900px;
  text-align: left;
}
.team-result-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.team-result-head .nm { font-size: 18px; font-weight: 700; color: var(--txt); }
.team-result-head .ssn { font-size: 12px; color: var(--txt-mut); }
.team-result-head .spacer { flex: 1; }
.team-game-row {
  display: grid; grid-template-columns: 90px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .12s;
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  margin-bottom: 5px;
}
.team-game-row:hover { border-color: var(--accent); background: var(--bg-hover); }
.team-game-row .rnd { font-size: 11px; color: var(--txt-mut); font-weight: 600; }
.team-game-row .opp { font-weight: 600; font-size: 14px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-game-row .ha {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg-card); color: var(--txt-mut); font-weight: 700;
}
.team-game-row .res {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px; font-weight: 700; min-width: 88px; text-align: right;
}
.team-game-row .res.win { color: var(--good); }
.team-game-row .res.loss { color: var(--bad); }
.team-game-row .res .rletter { font-family: 'Inter'; font-size: 11px; padding: 0 5px; opacity: .7; }
@media (max-width: 640px){
  .team-game-row { grid-template-columns: 60px 1fr auto; }
  .team-game-row .ha { display: none; }
  .team-game-row .opp { font-size: 13px; }
}

.season-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.season-status {
  font-size: 12px; color: var(--txt-mut); margin-top: 8px; text-align: center;
}
.progress-wrap {
  background: var(--bg-elev); border-radius: 10px; overflow: hidden;
  height: 6px; margin: 8px 0;
}
.progress-bar { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.season-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.season-head .season-title { font-size: 18px; font-weight: 700; }
.season-head .season-title .tag { font-weight: 400; }

/* ---------- Élő meccsek lista ---------- */
.live-list-empty {
  max-width: 900px; margin: 0 auto;
}
.live-empty-msg {
  color: var(--txt-mut); padding: 40px 20px; font-size: 14px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.live-section {
  margin: 12px 0; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: left;
}
.live-section .league-hd {
  font-size: 11px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700; margin-bottom: 8px;
}
.live-row {
  display: grid; grid-template-columns: 1fr auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .12s;
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.live-row:hover { border-color: var(--accent); background: var(--bg-hover); transform: translateY(-1px); }
.live-row:last-child { margin-bottom: 0; }
.live-row .h, .live-row .a {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-row .h { text-align: right; color: var(--home); }
.live-row .a { text-align: left; color: var(--away); }
.live-row .score {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 17px; font-weight: 700; color: var(--txt);
  white-space: nowrap; padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.live-row .time {
  font-size: 11px; color: var(--txt-mut);
  background: var(--bg-card); padding: 3px 8px; border-radius: 10px;
  font-weight: 600; white-space: nowrap; min-width: 70px; text-align: center;
}
@media (max-width: 640px) {
  .live-row { grid-template-columns: 1fr auto 1fr; }
  .live-row .time { grid-column: 1 / -1; text-align: center; margin-top: 4px; }
  .live-row .h, .live-row .a { font-size: 13px; }
  .live-row .score { font-size: 15px; }
}

/* ---------- Topbar live dropdown ---------- */
.live-dd-wrap { position: relative; }
.live-toggle {
  display: inline-flex; align-items: center; gap: 6px;
}
.live-toggle .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bad); animation: pulse 1.2s infinite;
}
.live-toggle .live-count {
  background: var(--accent-bg); color: var(--accent);
  padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 700;
  margin-left: 2px; min-width: 16px; text-align: center;
}
.live-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; min-width: 360px; max-width: 480px;
  max-height: 540px; overflow: auto; z-index: 100;
  display: none;
}
.live-dropdown.show { display: block; }
.live-dropdown .league-hd {
  font-size: 10px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 1px; font-weight: 700; padding: 8px 10px 4px;
}
.live-dropdown .live-row {
  margin-bottom: 4px; padding: 8px 12px; font-size: 13px;
  grid-template-columns: 1fr auto 1fr;
}
.live-dropdown .live-row .time { display: none; }
.live-dropdown .live-row .score { font-size: 14px; }
.live-dropdown .empty {
  padding: 24px; text-align: center; color: var(--txt-mut); font-size: 13px;
}
@media (max-width: 720px) {
  .live-dropdown { position: fixed; left: 8px; right: 8px; top: 60px; min-width: 0; max-width: none; }
}
.error-banner {
  background: rgba(239,83,80,.1); border: 1px solid var(--bad); border-radius: var(--radius-sm);
  padding: 12px 16px; color: var(--bad); margin: 16px 0; font-size: 13px;
}

/* ---------- Layout-specifikus extra szabályok ---------- */

/* Tömör layout: zsugorítva, kis padding, kompakt vizuális */
[data-layout="compact"] .card { padding: 10px 12px; }
[data-layout="compact"] .card h2 { font-size: 10px; margin-bottom: 8px; }
[data-layout="compact"] .scoreboard { padding: 14px 14px 10px; gap: 16px; }
[data-layout="compact"] .scoreboard .tname { font-size: 16px; }
[data-layout="compact"] .scoreboard .clock-big { font-size: 22px; }
[data-layout="compact"] .qscores .qcell { padding: 2px 8px; min-width: 44px; }
[data-layout="compact"] .qscores .qcell .qvals { font-size: 11px; }
[data-layout="compact"] .scroll { max-height: 660px; }
[data-layout="compact"] .modal { max-width: 600px; }
[data-layout="compact"] .modal .body { padding: 14px 18px; }
[data-layout="compact"] .modal .kpi-grid { gap: 6px; }
[data-layout="compact"] .modal .kpi { padding: 6px 8px; }

/* Magazin layout: serif heading, szellős, halvány keretek, klasszikus újság-érzet */
[data-layout="magazine"] body { line-height: 1.6; }
[data-layout="magazine"] .card { border-width: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
[data-layout="magazine"] .card h2 {
  font-size: 13px; font-style: italic; text-transform: none;
  letter-spacing: 0; font-weight: 400; color: var(--accent);
  border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; margin-bottom: 16px;
}
[data-layout="magazine"] .scoreboard { background: transparent; border: none; padding: 30px 10px; box-shadow: none; }
[data-layout="magazine"] .scoreboard .tname { font-family: Georgia, serif; font-weight: 600; }
[data-layout="magazine"] .scoreboard .scores { letter-spacing: -2px; }
[data-layout="magazine"] thead { background: transparent; border-bottom: 2px solid var(--txt); }
[data-layout="magazine"] th {
  font-family: var(--font-h); font-style: italic; font-weight: 400;
  text-transform: none; letter-spacing: 0; font-size: 12px;
}
[data-layout="magazine"] th.sorted { font-weight: 700; font-style: normal; }
[data-layout="magazine"] tbody tr { border-bottom: 1px solid var(--line-soft); }
[data-layout="magazine"] .brand { font-family: Georgia, serif; font-weight: 700; }

/* Tribün layout: vastag broadcast-stílus, hangsúlyos színek, NagyKönyv betűk */
[data-layout="stadium"] .card { border-width: 2px; box-shadow: 0 0 0 1px var(--line-soft), 0 8px 30px rgba(0,0,0,.35); }
[data-layout="stadium"] .card h2 {
  font-size: 12px; font-weight: 900; letter-spacing: 2px;
  color: var(--accent); border-bottom: 3px solid var(--accent); padding-bottom: 10px; margin-bottom: 16px;
}
[data-layout="stadium"] .scoreboard { padding: 36px 24px; }
[data-layout="stadium"] .scoreboard .tname {
  font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; font-size: 22px;
}
[data-layout="stadium"] .scoreboard .tname.home::before,
[data-layout="stadium"] .scoreboard .tname.away::after { width: 8px; height: 28px; }
[data-layout="stadium"] .scoreboard .scores { font-weight: 900; gap: 22px; }
[data-layout="stadium"] .scoreboard .clock-big { font-weight: 900; font-size: 32px; }
[data-layout="stadium"] .scoreboard .clock-big .qchip {
  background: var(--accent); color: white; font-weight: 900; padding: 5px 16px; border-radius: 2px;
}
[data-layout="stadium"] thead { background: var(--accent-dk); }
[data-layout="stadium"] th { color: white !important; font-weight: 900; text-transform: uppercase; }
[data-layout="stadium"] th.sorted { background: var(--accent); }
[data-layout="stadium"] tbody tr td { font-weight: 600; }
[data-layout="stadium"] tbody tr:nth-child(even) { background: var(--bg-elev); }
[data-layout="stadium"] .qscores .qcell { background: var(--bg); border-color: var(--accent-dk); }
[data-layout="stadium"] .qscores .qcell .qlabel { color: var(--accent); }
[data-layout="stadium"] .brand { text-transform: uppercase; letter-spacing: 2px; }
[data-layout="stadium"] .pos, [data-layout="stadium"] .neg { font-weight: 900; }
