/* SUPERLYZER — Superbet-inspired dark theme (red / charcoal / white) */
:root {
  --brand: #e5001f; --brand-dark: #b90019; --brand-soft: rgba(229, 0, 31, .16); --brand-glow: rgba(229, 0, 31, .45);
  --bg: #0f1114; --bg2: #15181c; --card: #1a1e23; --card2: #21262c; --line: #2a3038; --line2: #353c46;
  --text: #eef1f4; --muted: #9aa3ad; --muted2: #6b737c;
  --home: #3b8bff; --away: #ff4d5e; --ok: #22c55e; --warn: #f5a524; --danger: #ef4444; --yellowcard: #f7d21b;
  --radius: 10px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  /* compatibility aliases used by older rules */
  --yellow: var(--brand); --yellow-dark: var(--brand-dark); --green: #15181c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #3a424c; border-radius: 4px; }
.ic { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic.fill { fill: currentColor; stroke: none; }
.card-ic { display: inline-block; width: 9px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.card-ic.y { background: var(--yellowcard); } .card-ic.r { background: var(--brand); }

/* header */
.topbar { background: linear-gradient(90deg, #e5001f 0%, #c30019 100%); height: 52px; display: flex; align-items: center; padding: 0 18px; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 14px rgba(0,0,0,.45); }
.topbar .logo { font-weight: 800; font-size: 21px; color: #fff; letter-spacing: -.4px; text-decoration: none; display: inline-flex; align-items: center; }
.topbar .logo::before { content: ""; width: 22px; height: 22px; border-radius: 6px; margin-right: 8px; background: #fff; box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px var(--brand); background: conic-gradient(from 45deg, #fff 0 25%, var(--brand-dark) 0 50%, #fff 0 75%, var(--brand-dark) 0); }
.topbar .logo span { color: #fff; opacity: .85; font-weight: 600; }
.topbar nav { margin-left: auto; margin-right: auto; display: flex; gap: 6px; }
.topbar nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; position: relative; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar nav a.active { color: #fff; background: rgba(0,0,0,.22); }
.topbar nav a .badge { position: absolute; top: -6px; right: -4px; background: #fff; color: var(--brand); font-size: 10px; border-radius: 9px; padding: 1px 6px; font-weight: 800; }
.topbar .right { display: flex; align-items: center; gap: 8px; }
.topbar .user { color: rgba(255,255,255,.9); font-size: 12px; font-weight: 600; }
.icon-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.icon-btn:hover { background: rgba(255,255,255,.26); }

/* toolbar */
.toolbar-wrap { background: var(--bg2); border-bottom: 1px solid var(--line); padding: 12px 16px 10px; }
.toolbar { display: flex; justify-content: center; }
.toolbar .pill { background: var(--card); border-radius: 12px; padding: 5px; display: inline-flex; gap: 4px; border: 1px solid var(--line); }
.tb-btn { position: relative; width: 42px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.tb-btn:hover { color: #fff; background: var(--card2); }
.tb-btn.active { background: var(--brand); color: #fff; box-shadow: 0 0 0 1px var(--brand-dark), 0 4px 14px var(--brand-glow); }
.tb-btn .cnt { position: absolute; top: -5px; right: -3px; background: #fff; color: var(--brand); font-size: 10px; font-weight: 800; border-radius: 9px; padding: 1px 5px; box-shadow: 0 0 0 2px var(--card); }
.tb-btn.active .cnt { background: #fff; color: var(--brand); }
.countries { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.country { display: flex; flex-direction: column; align-items: center; cursor: pointer; width: 54px; transition: opacity .2s, filter .2s, transform .15s; }
.country .flag { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 18px; border: 2px solid transparent; overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.country:hover .flag { transform: translateY(-1px); }
.country .flag img { width: 34px !important; height: 34px !important; object-fit: cover; border-radius: 50% !important; }
.country.active .flag { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); transform: scale(1.08); }
.country .name { font-size: 10px; margin-top: 3px; background: var(--brand); color: #fff; padding: 1px 5px; border-radius: 3px; max-width: 54px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; transition: background .2s, color .2s; }
.country .n { font-size: 10px; color: var(--muted); }

/* Când există o selecție de țări, țările neselectate devin grayscale */
.countries.has-selection .country:not(.active) {
  filter: grayscale(100%);
  opacity: 0.35;
}
.countries.has-selection .country:not(.active):hover {
  filter: grayscale(30%);
  opacity: 0.8;
}
.countries.has-selection .country:not(.active) .name {
  background: var(--card2);
  color: var(--muted);
}
.countries.has-selection .country.active {
  filter: none;
  opacity: 1;
}

/* Sub-bar ligi pentru țările selectate */
.country-leagues {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 10px auto 2px;
  max-width: 1200px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  animation: clSlideDown .2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes clSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cl-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
}
.cl-title .ic { width: 14px; height: 14px; }
.cl-chip {
  background: var(--card2);
  border: 1px solid var(--line2);
  color: #c9cfd6;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  user-select: none;
}
.cl-chip:hover {
  border-color: var(--muted);
  color: #fff;
  background: #252b33;
}
.cl-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.cl-chip .cl-count {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border-radius: 8px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
}
.cl-chip.active .cl-count {
  background: rgba(0, 0, 0, .3);
}
.cl-all {
  border-style: dashed;
}

.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.qf { background: var(--card); border: 1px solid var(--line); color: #d5dae0; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.qf:hover { border-color: var(--line2); color: #fff; }
.qf.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.qf .hits { background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.qf.active .hits { background: rgba(0,0,0,.25); }
.qf.dragging { opacity: .45; transform: scale(.95); }
.searchrow { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.search-form { display: inline-flex; margin: 0; padding: 0; }
.searchrow input { width: 320px; max-width: 100%; background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-family: var(--font); }
.searchrow input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft); }
.searchrow select { background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 8px; border-radius: 8px; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card2); color: #e2e6ea; border: 1px solid var(--line2); }
.btn.ghost:hover { background: #2a3038; }
.btn.small { padding: 4px 9px; font-size: 11px; border-radius: 6px; }

/* advanced filter panel */
.adv { max-width: 1100px; margin: 10px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: none; }
.adv.open { display: block; }
.adv h4 { margin: 4px 0 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 16px; }
.adv-row { display: grid; grid-template-columns: 130px 1fr 60px 60px; gap: 6px; align-items: center; font-size: 12px; }
.adv-row label { color: #c9cfd6; }
.adv-row select, .adv-row input { background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 5px 6px; border-radius: 6px; font-size: 12px; width: 100%; }
.adv-row input.dirty, .adv-row select.dirty { border-color: var(--brand); }
.adv .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.adv .actions input { background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 6px 8px; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--card2); border: 1px solid var(--line2); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip .x { margin-left: 6px; color: var(--muted); }

/* page */
.page { max-width: 1400px; margin: 0 auto; padding: 12px 16px 60px; }
/* multi-column mode: use the whole width of wide monitors */
.page.wide { max-width: none; padding-left: 20px; padding-right: 20px; }
.page.wide .legend { max-width: none; }
.status-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; font-size: 13px; color: #c3c9d0; }
.status-row .grow { flex: 1; }
.board-cols-picker { display: flex; gap: 2px; background: var(--bg); border-radius: 7px; padding: 2px; border: 1px solid var(--line); }
.board-cols-picker .bcol-btn { background: transparent; border: 0; color: var(--muted); font-size: 11px; font-weight: 700; padding: 2px 8px; height: 24px; cursor: pointer; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease; }
.board-cols-picker .bcol-btn:hover { color: #fff; }
.board-cols-picker .bcol-btn.active { background: var(--brand); color: #fff; box-shadow: 0 1px 6px var(--brand-glow); }
.status-row .view { display: flex; gap: 2px; background: var(--bg); border-radius: 7px; padding: 2px; border: 1px solid var(--line); }
.status-row .view button { background: transparent; border: 0; color: var(--muted); width: 30px; height: 24px; cursor: pointer; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; }
.status-row .view button.active { background: var(--brand); color: #fff; }
.status-row .clear { cursor: pointer; font-size: 16px; color: var(--muted); display: inline-flex; }
.status-row .clear:hover { color: #fff; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; box-shadow: 0 0 6px var(--danger); }
.conn.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.sort { background: var(--bg); border: 1px solid var(--line); color: #e2e6ea; padding: 4px 7px; border-radius: 6px; font-size: 12px; }
.notice { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); }

/* multi-board split view */
.multi-board { display: grid; gap: 18px; margin-top: 4px; align-items: start; }
.multi-board.cols-2 { grid-template-columns: 1fr 1fr; }
.multi-board.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .multi-board.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) { .multi-board.cols-2, .multi-board.cols-3 { grid-template-columns: 1fr; } }

.board-col { background: rgba(18, 22, 28, 0.45); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; min-width: 0; transition: border-color .2s, box-shadow .2s; }
.board-col.drag-over { border-color: var(--brand); box-shadow: 0 0 16px var(--brand-glow); }
.board-col-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); user-select: none; }
.board-col-header .bch-title { font-size: 13px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-col-header .bch-chip { background: var(--card2); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 7px; font-size: 11px; color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.board-col-header .bch-count { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.board-col-header .bch-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.board-col-header .bch-select { background: var(--bg); border: 1px solid var(--line); color: #c9cfd6; font-size: 11px; border-radius: 5px; padding: 2px 6px; max-width: 140px; }
.board-col-header .bch-clear { color: var(--muted); cursor: pointer; display: inline-flex; font-size: 14px; }
.board-col-header .bch-clear:hover { color: #fff; }
.board-col-drop-hint { font-size: 11px; color: var(--muted); font-style: italic; padding: 6px 12px; background: rgba(255, 255, 255, 0.02); border-bottom: 1px dashed var(--line); text-align: center; display: none; }
.board-col.drag-over .board-col-drop-hint { display: block; color: var(--brand); background: rgba(229, 9, 20, 0.08); }
.board-col-cards { display: flex; flex-direction: column; gap: 10px; padding: 10px; min-height: 200px; }
.board-col-cards:empty::after { content: "Niciun meci nu corespunde acestui filtru."; color: var(--muted); font-size: 12px; text-align: center; padding: 30px 10px; }

.chip[draggable="true"] { cursor: grab; user-select: none; }
.chip[draggable="true"]:active { cursor: grabbing; }
.chip.dragging { opacity: 0.45; transform: scale(0.95); box-shadow: 0 0 10px rgba(0,0,0,0.5); }

/* advanced filter: leagues grouped by country */
.lg-toggle { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; margin-bottom: 8px; padding: 7px 10px; background: var(--card2); border: 1px solid var(--line2); border-radius: 8px; color: #d7dce2; cursor: pointer; font-family: var(--font); text-align: left; transition: border-color .15s, background .15s; }
.lg-toggle:hover { border-color: #3a414b; color: #fff; }
.lg-toggle.has-sel { border-color: rgba(229, 9, 20, .55); }
.lg-toggle-caret { display: inline-flex; color: var(--muted); transition: transform .15s; }
.lg-toggle.open .lg-toggle-caret { transform: rotate(90deg); }
.lg-toggle-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.lg-toggle-sum { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.lg-toggle-sum em { font-style: normal; color: var(--brand); font-weight: 700; }
.league-groups { columns: 3 300px; column-gap: 14px; }
.lg { display: inline-block; width: 100%; box-sizing: border-box; break-inside: avoid; margin-bottom: 8px; background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px 8px; min-width: 0; transition: border-color .15s; }
.lg.has-sel { border-color: rgba(229, 9, 20, .55); }
.lg-head { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; margin-bottom: 6px; }
.lg-head:hover .lg-name { color: #fff; }
.lg-flag { display: inline-flex; width: 20px; justify-content: center; }
.lg-name { font-size: 12px; font-weight: 700; color: #d7dce2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-n em { font-style: normal; color: var(--brand); font-weight: 700; }
.lg-n { margin-left: auto; font-size: 10px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.lg-chips .chip { font-size: 11px; padding: 2px 7px; }
.lg-chips .chip b { font-weight: 600; color: var(--muted); margin-left: 2px; }
.lg-chips .chip.active b { color: rgba(255,255,255,.85); }
@media (max-width: 768px) { .league-groups { columns: 1; } }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.grid.list { grid-template-columns: 1fr; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .adv-row { grid-template-columns: 110px 1fr 55px 55px; } }
.match { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.match:hover { border-color: var(--line2); }
.match.hidden { display: none; }
.match.fav-glow { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-soft); }
.m-top { display: flex; align-items: center; padding: 7px 12px; font-size: 12px; color: #b5bcc4; border-bottom: 1px solid var(--line); background: var(--card2); }
.m-top .flag { font-size: 16px; margin-right: 6px; display: inline-flex; }
.m-top .tname { font-weight: 600; color: #e6eaee; }
.m-top .cname { color: var(--muted2); margin-left: 6px; }
.m-top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.m-top .time { font-family: var(--mono); font-weight: 700; color: #fff; }
.m-top .add { color: var(--brand); font-weight: 700; }
.m-top .live { background: var(--brand); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 800; letter-spacing: .6px; animation: blink 2s infinite; }
.m-top .ft { background: #4a525c; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.m-top .ht { background: var(--warn); color: #111; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
@keyframes blink { 50% { opacity: .55; } }
.m-board { display: grid; grid-template-columns: 36px 1fr auto; gap: 0 8px; padding: 8px 12px 4px; position: relative; }
.m-board .score { font-family: var(--mono); font-size: 20px; font-weight: 800; text-align: center; line-height: 24px; }
.m-board .score.home { color: var(--home); } .m-board .score.away { color: var(--away); }
.m-board .team { line-height: 24px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.m-board .team a { text-decoration: none; }
.m-board .team a:hover { text-decoration: underline; }
.m-board .red { display: inline-block; width: 8px; height: 11px; background: var(--brand); border-radius: 2px; }
.m-board .goalflash { animation: pop .8s ease; color: #fff; }
@keyframes pop { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
.m-board .odds { display: grid; grid-template-rows: 24px 24px; align-items: center; gap: 0; }
.m-board .odds .row { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.m-board .odds label { color: var(--muted2); width: 28px; font-size: 11px; }
.m-board .odd { background: var(--bg); border: 1px solid var(--line); min-width: 44px; text-align: center; padding: 2px 4px; border-radius: 5px; font-family: var(--mono); font-size: 12px; position: relative; }
.m-board .odd.up::after { content: "▲"; color: var(--ok); font-size: 8px; position: absolute; right: 2px; top: 0; }
.m-board .odd.down::after { content: "▼"; color: var(--danger); font-size: 8px; position: absolute; right: 2px; top: 0; }
.m-board .odd.empty { color: var(--muted2); }
.bars { padding: 4px 12px 8px; display: grid; grid-template-columns: 1fr; gap: 4px; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bar .track { flex: 1; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; width: 0; transition: width .6s ease; border-radius: 4px; }
.bar.home .fill { background: var(--home); } .bar.away .fill { background: var(--away); }
.bar label { width: 38px; text-align: right; font-family: var(--mono); font-weight: 700; }
.bar.home label { color: var(--home); } .bar.away label { color: var(--away); }

.tabs { display: flex; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg2); }
.tabs .tab { padding: 8px 12px; font-size: 11px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.tabs .tab:hover { color: #fff; }
.tabs .tab.active { color: #fff; border-bottom-color: var(--brand); }
.tabs .oi { margin-left: auto; display: flex; gap: 10px; padding-right: 12px; font-size: 12px; }
.tabs .oi p { margin: 0; display: flex; gap: 4px; align-items: center; }
.tabs .oi label { color: var(--muted2); }
.tabs .oi span { font-weight: 700; font-family: var(--mono); }
.tabs .oi .lvl-low span { color: #c3c9d0; } .tabs .oi .lvl-mid span { color: var(--warn); } .tabs .oi .lvl-high span { color: var(--brand); }
.panel { display: none; padding: 8px 12px; min-height: 120px; }
.panel.active { display: block; }
.chart { width: 100%; height: 210px; display: block; }
.chart-empty { color: var(--muted2); font-size: 12px; text-align: center; padding: 60px 0; }

.stat { margin: 6px 0; }
.stat .labels { display: flex; align-items: center; font-size: 12px; }
.stat .labels .h { color: var(--home); font-weight: 700; width: 44px; font-family: var(--mono); }
.stat .labels .a { color: var(--away); font-weight: 700; width: 44px; text-align: right; font-family: var(--mono); }
.stat .labels .l { flex: 1; text-align: center; color: var(--muted); }
.stat .track { height: 5px; border-radius: 3px; overflow: hidden; margin-top: 3px; background: var(--away); opacity: .9; }
.stat .track div { height: 100%; background: var(--home); transition: width .5s; }
.stat.nodata .track { background: var(--card2); } .stat.nodata .track div { background: var(--card2); }
.stat.oi-row .track { background: var(--card2); }
.stat.oi-row .track div.lvl-low { background: #6b737c; } .stat.oi-row .track div.lvl-mid { background: var(--warn); } .stat.oi-row .track div.lvl-high { background: var(--brand); }
.stat .chg { font-size: 9px; margin-left: 3px; color: var(--ok); }

.ticker { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: 12px; }
.ticker li { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ticker .h { text-align: right; color: #d5dae0; padding-right: 6px; }
.ticker .a { text-align: left; color: #d5dae0; padding-left: 6px; }
.ticker .m { text-align: center; color: var(--muted2); font-family: var(--mono); }
.ticker .ic { opacity: .85; }
.ticker li.goal .h, .ticker li.goal .a, .ticker li.penalty .h, .ticker li.penalty .a { color: #fff; font-weight: 700; }
.ticker li.goal .ic, .ticker li.penalty .ic { color: var(--ok); }
.ticker li.red .h, .ticker li.red .a { color: var(--brand); font-weight: 700; }
.ticker li.yellow .h, .ticker li.yellow .a { color: var(--yellowcard); }
.ticker li.var .ic, .ticker li.goalcancelled .ic { color: var(--warn); }
.ticker li.bigchance .ic { color: var(--warn); }

.ticker-pulse {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.tp-col { display: flex; flex-direction: column; }
.tp-col.home { text-align: left; }
.tp-col.away { text-align: right; }
.tp-col.home .tp-val { color: var(--home); }
.tp-col.away .tp-val { color: var(--away); }
.tp-val { font-size: 17px; font-weight: 800; font-family: var(--mono); line-height: 1.1; }
.tp-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-top: 2px; }
.tp-sub { font-size: 10px; color: var(--muted2); margin-top: 2px; }
.tp-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4px; }
.tp-title { font-size: 10px; font-weight: 700; color: #d5dae0; text-transform: uppercase; letter-spacing: .5px; }
.tp-cor { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tp-cor b { color: #fff; }

.odds-list { max-height: 320px; overflow-y: auto; font-size: 12px; }
.odds-list h5 { margin: 8px 0 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.odds-list .o { display: inline-flex; gap: 6px; background: var(--card2); margin: 2px; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--line); }
.odds-list .o b { font-family: var(--mono); color: #fff; }
.odds-list .o.off { opacity: .4; }

.m-foot { display: flex; align-items: center; padding: 5px 12px; border-top: 1px solid var(--line); background: var(--bg2); font-size: 12px; color: var(--muted2); }
.m-foot .star { cursor: pointer; font-size: 18px; color: var(--muted2); margin-left: auto; display: inline-flex; }
.m-foot .star .ic { width: 18px; height: 18px; }
.m-foot .star.active { color: var(--brand); } .m-foot .star.active .ic { fill: currentColor; }
.m-foot .star:hover { color: var(--brand); }
.m-foot .venue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.legend { max-width: 1400px; margin: 16px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 12px; color: var(--muted); }
.legend h4 { margin: 0 0 8px; color: #e6eaee; font-size: 13px; }
.legend li { list-style: none; display: flex; gap: 8px; margin: 3px 0; align-items: center; }
.legend ul { margin: 0; padding: 0; }
.legend .k { width: 110px; color: #e6eaee; display: inline-flex; align-items: center; gap: 5px; }
.legend .home { color: var(--home); } .legend .away { color: var(--away); }
.legend .dot-goal { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--home); display: inline-block; }
.legend .dot-red { width: 7px; height: 10px; border-radius: 2px; background: var(--brand); display: inline-block; }

/* alerts */
.bell { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; font-size: 22px; cursor: pointer; box-shadow: 0 6px 18px var(--brand-glow); z-index: 60; display: inline-flex; align-items: center; justify-content: center; }
.bell .ic { width: 24px; height: 24px; }
.bell.new { animation: ring .8s ease infinite; }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(12deg); } 75% { transform: rotate(-12deg); } }
.bell .cnt { position: absolute; top: -4px; right: -4px; background: #fff; color: var(--brand); font-size: 11px; border-radius: 9px; padding: 1px 6px; font-weight: 800; }
.alerts { position: fixed; right: 20px; bottom: 82px; width: 340px; max-width: calc(100vw - 40px); max-height: 60vh; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; display: none; flex-direction: column; z-index: 60; box-shadow: 0 12px 32px rgba(0,0,0,.6); }
.alerts.open { display: flex; }
.alerts .head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; font-size: 13px; font-weight: 700; }
.alerts .head .x { margin-left: auto; cursor: pointer; color: var(--muted); display: inline-flex; }
.alerts .opts { padding: 6px 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.alerts .opts label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.alerts .list { overflow-y: auto; padding: 6px; }
.alert { padding: 6px 8px; border-left: 3px solid #4a525c; background: var(--card2); margin-bottom: 4px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.alert:hover { background: #2a3038; }
.alert.goal { border-left-color: var(--ok); } .alert.goalcancelled { border-left-color: var(--muted2); } .alert.redcard { border-left-color: var(--brand); } .alert.pressure { border-left-color: var(--warn); } .alert.fulltime { border-left-color: #4a525c; }
.alert .t { color: var(--muted2); font-size: 10px; float: right; }
.alert .h { color: var(--home); } .alert .a { color: var(--away); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--card2); border: 1px solid var(--line2); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; z-index: 70; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* auth pages */
.auth { max-width: 400px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.auth h2 { margin: 0 0 4px; font-size: 22px; }
.auth p.sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.auth label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.auth input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.auth .btn { width: 100%; margin-top: 16px; padding: 11px; font-size: 13px; }
.auth .err { color: var(--danger); font-size: 12px; margin-top: 10px; min-height: 16px; }
.auth .links { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.auth .links a { color: #fff; font-weight: 600; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; align-items: center; justify-content: center; z-index: 80; backdrop-filter: blur(2px); }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: 20px; width: 440px; max-width: calc(100vw - 32px); box-shadow: 0 16px 48px rgba(0,0,0,.6); }
.modal h3 { margin: 0 0 12px; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.modal input { width: 100%; background: var(--bg); border: 1px solid var(--line); color: #fff; padding: 8px 10px; border-radius: 8px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal .err { color: var(--danger); font-size: 12px; min-height: 16px; }

/* tables (admin/archive) */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
table.tbl tr:hover td { background: var(--card2); }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.card-box h3 { margin: 0 0 10px; font-size: 15px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; font-size: 12px; }
.kv div { background: var(--bg2); padding: 8px 10px; border-radius: 8px; color: var(--muted); border: 1px solid var(--line); } .kv b { display: block; color: #fff; font-size: 14px; margin-top: 2px; }

/* ─── Mobile & Responsive styles ───────────────────────────────── */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  .page { padding: 8px 10px 70px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .topbar { padding: 0 10px; height: 48px; }
  .topbar .logo { font-size: 18px; }
  .topbar nav { gap: 2px; margin: 0 6px; }
  .topbar nav a { font-size: 13px; padding: 5px 8px; }
  .topbar .user { display: none; }
  .toolbar-wrap { padding: 8px 10px; }
  .toolbar .pill { padding: 4px; }
  .tb-btn { width: 38px; height: 34px; font-size: 16px; }
  .countries { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 6px 4px 8px; gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .countries::-webkit-scrollbar { display: none; }
  .country { flex-shrink: 0; width: 50px; }
  .country .flag { width: 32px; height: 32px; }
  .country .flag img { width: 32px !important; height: 32px !important; }
  .quick { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 4px 2px 6px; gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .qf { flex-shrink: 0; white-space: nowrap; font-size: 11px; padding: 4px 8px; }
  .searchrow input { width: 100%; font-size: 16px; }
  .status-row { flex-wrap: wrap; padding: 6px 10px; gap: 8px; font-size: 12px; }
  .card-box { padding: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.tbl { min-width: 480px; }
  .auth { margin: 30px auto; padding: 18px; max-width: calc(100vw - 28px); }
  .auth input { font-size: 16px; }
  .bell { right: 14px; bottom: 14px; width: 46px; height: 46px; }
  .alerts { right: 8px; bottom: 66px; width: calc(100vw - 16px); max-width: 380px; max-height: 65vh; }
}

@media (max-width: 480px) {
  .page { padding: 6px 6px 65px; }
  .m-top { padding: 5px 8px; font-size: 11px; }
  .m-top .flag { font-size: 14px; margin-right: 4px; }
  .m-top .tname { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-top .cname { display: none; }
  .m-board { grid-template-columns: 32px 1fr auto; gap: 0 6px; padding: 6px 8px 3px; }
  .m-board .score { font-size: 18px; line-height: 22px; }
  .m-board .team { font-size: 13px; line-height: 22px; }
  .m-board .odds .row { font-size: 11px; gap: 2px; }
  .m-board .odds label { width: 20px; font-size: 10px; }
  .m-board .odd { min-width: 36px; font-size: 11px; padding: 1px 3px; }
  .bars { padding: 2px 8px 6px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
  .tabs .oi { padding-right: 6px; gap: 6px; font-size: 11px; white-space: nowrap; }
  .tabs .oi label { font-size: 10px; }
  .panel { padding: 6px 8px; }
  .chart { height: 190px; }
  .m-foot { padding: 3px 8px; font-size: 11px; }
  .m-foot .star { padding: 4px 6px; }
  .adv-grid { grid-template-columns: 1fr; }
  .adv-row { grid-template-columns: 90px 1fr 45px 45px; gap: 4px; font-size: 11px; }
  .adv-row input, .adv-row select { font-size: 11px; padding: 4px; }
}

/* ─── auth / account extras ─── */
.notice-box { background: var(--brand-soft); border: 1px solid var(--brand); color: #fff; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.acct { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sessions { display: flex; flex-direction: column; gap: 4px; font-size: 12px; max-height: 160px; overflow: auto; }
.sess { display: grid; grid-template-columns: 120px 1fr 110px 90px; gap: 6px; padding: 5px 8px; background: var(--bg2); border-radius: 6px; color: var(--muted); border: 1px solid var(--line); }
.sess.cur { border-left: 2px solid var(--brand); color: #eef1f4; }
.sess span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── admin panel ─── */
.page.admin { max-width: 1400px; }
.tabs-nav { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs-nav > button { background: none; border: 0; color: var(--muted); padding: 10px 14px; font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; font-family: var(--font); }
.tabs-nav > button:hover { color: #fff; }
.tabs-nav > button.active { color: #fff; border-bottom-color: var(--brand); }
.tabs-nav > button .cnt { background: var(--card2); color: #e2e6ea; font-size: 11px; border-radius: 9px; padding: 1px 6px; margin-left: 4px; }
.tabs-nav > button .cnt.pend { background: var(--warn); color: #111; }
.tabs-nav .grow { flex: 1; }
.tabs-nav .muted { font-size: 11px; margin-right: 8px; }
.admin section[data-panel] { display: none; }
.admin section[data-panel].active { display: block; }
.admin .err { color: var(--danger); font-size: 12px; min-height: 16px; }
.admin .ok { color: var(--ok); font-size: 12px; }
.admin .muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.admin .warn { color: var(--warn); font-weight: 700; }
.admin .on { color: var(--ok); }
.admin .mono { font-family: var(--mono); font-size: 11px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--line2); }
.kpi label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi b { font-size: 22px; font-weight: 800; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi.ok { border-left-color: var(--ok); } .kpi.warn { border-left-color: var(--warn); } .kpi.bad { border-left-color: var(--brand); } .kpi.bad b { color: var(--brand); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form .sort { min-width: 140px; }
.chk { font-size: 12px; color: #c3c9d0; display: inline-flex; align-items: center; gap: 4px; }
.tbl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tbl-head h3 { margin: 0; }
.tbl-wrap { overflow-x: auto; }
table.tbl.compact { font-size: 12px; }
table.tbl.compact th, table.tbl.compact td { padding: 6px 7px; white-space: nowrap; }
table.tbl.compact td.muted { white-space: normal; max-width: 420px; }
table.tbl tr.online td { background: rgba(34, 197, 94, .07); }
.badge-s { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 8px; text-transform: uppercase; background: var(--card2); color: #c3c9d0; }
.badge-s.ok { background: rgba(34,197,94,.15); color: #6ee7a3; } .badge-s.bad { background: rgba(229,0,31,.18); color: #ff8a95; } .badge-s.warn { background: rgba(245,165,36,.16); color: #ffcc66; }
.badge-s.off { background: var(--card2); color: var(--muted); } .badge-s.info { background: rgba(59,139,255,.16); color: #8fc0ff; } .badge-s.admin { background: var(--brand); color: #fff; }
.settings-form label { display: block; font-size: 12px; color: #c3c9d0; margin: 10px 0 4px; }
.settings-form .sort { width: 100%; box-sizing: border-box; margin-top: 4px; }
.settings-form textarea.sort { resize: vertical; font-family: var(--font); }
.settings-form .actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.modal.wide { width: 1000px; max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide .kv { grid-template-columns: repeat(2, 1fr); }
.modal.wide .cols { grid-template-columns: 1fr 1.2fr; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head .x { cursor: pointer; color: var(--muted); display: inline-flex; }
.modal h4 { margin: 14px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.modal .kv { margin-bottom: 8px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.pending-box { background: rgba(245,165,36,.12); border: 1px solid var(--warn); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pending-box .chip { background: var(--card2); border-radius: 6px; padding: 4px 8px; display: inline-flex; gap: 6px; align-items: center; }

/* finished favourites */
.grid-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; padding: 10px 4px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.grid-sep .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.match.archived { opacity: .92; }
.match.archived .m-top { background: linear-gradient(90deg, var(--card2), var(--bg2)); }

/* offline banner */
.offline { display: none; position: fixed; top: 52px; left: 0; right: 0; z-index: 55; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.offline .ic { width: 16px; height: 16px; }
.offline.show { display: flex; }
@media (max-width: 768px) { .offline { top: 48px; } }
