/* =====================================================================
   GolNama — classic sports-portal look (navy bars, dense tables, gold accent)
   ===================================================================== */
:root {
  --bg: #e9edf2;
  --page: #ffffff;
  --ink: #1b2430;
  --ink-2: #4a5666;
  --muted: #7a8594;
  --line: #d7dde5;
  --line-2: #e8ecf1;
  --row: #ffffff;
  --row-alt: #f4f7fb;
  --row-hover: #fff7e0;
  --navy: #0a3a6b;
  --navy-2: #0f4c8a;
  --navy-3: #072c52;
  --bar-1: #1a5a9c;
  --bar-2: #0b3c70;
  --gold: #f2a900;
  --gold-2: #ffcc33;
  --live: #d71920;
  --win: #0f8a3c;
  --draw: #8a8f98;
  --lose: #c62828;
  --score-bg: #12385f;
  --score-ink: #ffffff;
  --chip: #eef2f7;
  --shadow: 0 1px 2px rgba(10, 30, 60, .08), 0 1px 0 rgba(10, 30, 60, .04);
  --radius: 4px;
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1320; --page: #111b2b; --ink: #e6ecf4; --ink-2: #b4c0d0; --muted: #8592a6;
    --line: #22324a; --line-2: #1a2840; --row: #111b2b; --row-alt: #0f1826; --row-hover: #1d2a3f;
    --navy: #0b2442; --navy-2: #12355f; --navy-3: #081a31; --bar-1: #16406e; --bar-2: #0c2a4d;
    --score-bg: #f2a900; --score-ink: #10223a; --chip: #18263b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1320; --page: #111b2b; --ink: #e6ecf4; --ink-2: #b4c0d0; --muted: #8592a6;
  --line: #22324a; --line-2: #1a2840; --row: #111b2b; --row-alt: #0f1826; --row-hover: #1d2a3f;
  --navy: #0b2442; --navy-2: #12355f; --navy-3: #081a31; --bar-1: #16406e; --bar-2: #0c2a4d;
  --score-bg: #f2a900; --score-ink: #10223a; --chip: #18263b; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 13px/1.6 var(--font); font-feature-settings: "ss01";
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--navy-2); }
:root[data-theme="dark"] a:hover { color: var(--gold-2); }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 12px; }
.muted { color: var(--muted); }
.muted-inv { color: rgba(255,255,255,.7); font-weight: 400; }
.small { font-size: 11.5px; }
.pad { padding: 12px; }
.pad-s { padding: 6px; }
.skip { position: absolute; right: -999px; top: 0; background: var(--gold); color: #000; padding: 6px 12px; z-index: 99; }
.skip:focus { right: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---------------- top bar & masthead ---------------- */
.topbar { background: var(--navy-3); color: #cfe0f3; font-size: 12px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; height: 28px; }
.topbar-links { display: flex; gap: 14px; }
.topbar a:hover, .linkish:hover { color: var(--gold-2); }
.linkish { background: none; border: 0; padding: 0; color: inherit; font-size: 12px; }

.masthead {
  background:
    radial-gradient(1200px 120px at 80% -40px, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff; border-bottom: 3px solid var(--gold);
}
.masthead-in { display: flex; align-items: center; gap: 14px; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff !important; }
.brand img { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-size: 30px; font-weight: 800; letter-spacing: -.5px; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.brand-txt small { font-size: 10px; letter-spacing: 1.5px; color: var(--gold-2); margin-top: 4px; }
.mast-ad {
  margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px;
  background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.15); padding: 8px 16px; border-radius: 30px;
}
.ball-trail { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #cfd6de); box-shadow: 8px 0 0 -4px rgba(255,255,255,.5), 16px 0 0 -6px rgba(255,255,255,.3); }
.menu-btn { display: none; width: 40px; height: 40px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 9px; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 2px; background: #fff; border-radius: 2px; }

.mainnav { background: linear-gradient(180deg, #23272e, #15181d); border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.mainnav-in { display: flex; overflow-x: auto; scrollbar-width: none; }
.mainnav-in::-webkit-scrollbar { display: none; }
.mainnav a {
  color: #e9edf2; font-weight: 700; padding: 0 14px; height: 38px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; border-left: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(0,0,0,.5);
}
.mainnav a:hover { background: rgba(255,255,255,.07); color: var(--gold-2); }
.mainnav a.is-on { background: var(--gold); color: #1a1a1a; }
.nav-live .pulse { background: var(--live); }

/* ---------------- layout ---------------- */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr) 288px; gap: 12px; padding-top: 12px; padding-bottom: 24px; align-items: start; }
.main { min-width: 0; outline: none; }
.side { position: sticky; top: 50px; max-height: calc(100vh - 62px); overflow: auto; scrollbar-width: thin; border-radius: var(--radius); }
.aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------------- boxes ---------------- */
.box { background: var(--page); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.aside .box, .side .box { margin-bottom: 0; }
.box-h {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px;
  background: linear-gradient(180deg, var(--bar-1), var(--bar-2)); color: #fff; font-weight: 700; font-size: 13.5px;
  border-bottom: 2px solid var(--gold);
}
.box-h > span:first-child, .box-h > .lbox-title { flex: 1; min-width: 0; }
.box-h select { font: inherit; font-size: 12px; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 2px 6px; }
.box-h select option { color: #000; }
.box-more { display: block; text-align: left; padding: 6px 10px; font-size: 12px; color: var(--navy-2); border-top: 1px solid var(--line-2); font-weight: 700; }
.sub-h { font-size: 12.5px; padding: 6px 10px; background: var(--row-alt); border-bottom: 1px solid var(--line-2); color: var(--ink-2); }

/* ---------------- page header / chips ---------------- */
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.page-h h1 { font-size: 17px; font-weight: 800; color: var(--navy); }
:root[data-theme="dark"] .page-h h1 { color: var(--gold-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .page-h h1 { color: var(--gold-2); } }
.page-h h1 small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-inline-start: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--page); border: 1px solid var(--line); padding: 3px 12px; border-radius: 30px; font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.chip.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip--live.is-on { background: var(--live); border-color: var(--live); }
.chip-n:not(:empty) { background: rgba(0,0,0,.12); border-radius: 20px; padding: 0 7px; font-size: 11px; }
.chip.is-on .chip-n:not(:empty) { background: rgba(255,255,255,.25); }

/* ---------------- date bar ---------------- */
.datebar { display: flex; align-items: stretch; padding: 0; }
.db-nav { display: flex; align-items: center; justify-content: center; width: 34px; font-size: 22px; font-weight: 800; background: var(--row-alt); color: var(--navy-2); flex: none; }
.db-nav:hover { background: var(--gold); color: #000; }
.db-days { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; min-width: 0; }
.db-day { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 2px; border-inline-start: 1px solid var(--line-2); text-align: center; line-height: 1.3; }
.db-day small { font-size: 11px; color: var(--muted); }
.db-day b { font-size: 12.5px; white-space: nowrap; }
.db-day.is-today small { color: var(--live); font-weight: 700; }
.db-day.is-on { background: linear-gradient(180deg, var(--bar-1), var(--bar-2)); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
.db-day.is-on small { color: var(--gold-2); }
.db-cal { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; flex: none; background: var(--row-alt); border-inline-start: 1px solid var(--line-2); cursor: pointer; font-size: 16px; }
.db-cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.db-cal input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

.progress { height: 3px; background: transparent; margin: -8px 0 8px; border-radius: 3px; overflow: hidden; transition: opacity .4s; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--live)); transition: width .25s; }
.progress.is-done { opacity: 0; }

/* ---------------- league box & match rows ---------------- */
.lbox-h { padding-inline-start: 4px; }
.lbox-title { display: flex; align-items: center; gap: 8px; color: #fff !important; overflow: hidden; }
.lbox-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbox-title .sep { opacity: .5; margin: 0 2px; }
.lbox-link { font-size: 11.5px; font-weight: 500; background: rgba(255,255,255,.12); padding: 1px 8px; border-radius: 3px; color: #fff !important; }
.lbox-link:hover { background: var(--gold); color: #000 !important; }
.live-count { display: inline-flex; align-items: center; gap: 5px; background: var(--live); padding: 0 8px; border-radius: 3px; font-size: 11.5px; }
.collapse { background: none; border: 0; color: #fff; font-size: 14px; width: 24px; transition: transform .2s; }
.lbox.is-collapsed .lbox-b { display: none; }
.lbox.is-collapsed .collapse { transform: rotate(90deg); }
.lbox.is-collapsed .box-h { border-bottom-width: 0; }

.mrow {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px minmax(0, 1fr) 46px;
  align-items: center; gap: 6px; min-height: 40px; padding: 4px 8px;
  background: var(--row); border-bottom: 1px solid var(--line-2); color: var(--ink) !important;
}
.mrow:nth-child(even) { background: var(--row-alt); }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--row-hover); }
.m-status { font-size: 12px; font-weight: 700; text-align: center; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.m-status.st-live { color: var(--live); }
.m-status.st-ft { color: var(--muted); font-weight: 500; }
.m-status.st-off { color: var(--lose); font-size: 11px; }
.m-team { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 500; }
.m-home { justify-content: flex-end; text-align: left; }
.m-away { justify-content: flex-start; }
.m-team .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-team.win .tn { font-weight: 800; }
.m-team.fav .tn { color: var(--navy-2); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.m-score {
  display: flex; align-items: center; justify-content: center; gap: 2px; position: relative;
  background: var(--score-bg); color: var(--score-ink); border-radius: 3px; height: 26px; font-weight: 800; font-size: 14px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.25);
}
.m-score b { min-width: 18px; text-align: center; }
.m-score i { font-style: normal; opacity: .6; }
.m-score.is-live { background: var(--live); color: #fff; animation: glow 2s infinite; }
.m-score--pre { background: transparent; color: var(--ink); box-shadow: none; border: 1px solid var(--line); font-size: 13px; }
.m-score--pre small { font-size: 10px; color: var(--lose); }
.m-score .pen { position: absolute; top: 100%; font-size: 9.5px; color: var(--muted); font-weight: 500; white-space: nowrap; margin-top: 1px; }
.m-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); min-width: 0; }
.m-lg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-note { cursor: help; color: var(--navy-2); font-size: 13px; }
.rc { display: inline-block; width: 9px; height: 12px; background: var(--live); border-radius: 1.5px; font-size: 8px; color: #fff; text-align: center; line-height: 12px; flex: none; }
.res { position: absolute; }
.mrow { position: relative; }
.mrow .res { right: 2px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 3px; font-size: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.res-w { background: var(--win); } .res-d { background: var(--draw); } .res-l { background: var(--lose); }
.mrow:has(.res) { padding-right: 24px; }
.day-h { background: var(--chip); padding: 4px 10px; font-weight: 700; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }

/* crests & flags */
.crest { width: var(--s); height: var(--s); object-fit: contain; flex: none; }
.crest--ph { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--chip); color: var(--ink-2); font-size: calc(var(--s) * .42); font-weight: 800; border: 1px solid var(--line); }
.flag { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }
.cicon { width: var(--s); height: var(--s); display: inline-flex; flex: none; }
.cicon svg { width: 100%; height: 100%; }

/* star */
.star { background: none; border: 0; padding: 4px; display: inline-flex; flex: none; }
.star svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .75; transition: transform .15s; }
.star:hover svg { opacity: 1; transform: scale(1.15); }
.star.is-on svg { fill: var(--gold); stroke: var(--gold); opacity: 1; }
.box-h .star { color: #fff; }

/* pulse */
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.3s infinite; flex: none; }
.live-count .pulse { background: #fff; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.75); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(215,25,32,.45); } 50% { box-shadow: 0 0 0 4px rgba(215,25,32,0); } }

/* ---------------- sidebar ---------------- */
.side-search { padding: 8px; border-bottom: 1px solid var(--line-2); }
.side-search input { width: 100%; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--row-alt); color: var(--ink); }
.side-sec + .side-sec { border-top: 1px solid var(--line); }
.side-h { font-size: 12px; background: var(--chip); color: var(--navy); padding: 6px 10px; font-weight: 800; border-bottom: 1px solid var(--line-2); }
:root[data-theme="dark"] .side-h { color: var(--gold-2); }
.side-h small { font-weight: 500; color: var(--muted); }
.side-h--fav { color: #a66b00; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: flex; align-items: center; border-bottom: 1px dotted var(--line-2); }
.side-list li:last-child { border-bottom: 0; }
.side-list a { flex: 1; display: flex; align-items: center; gap: 8px; padding: 5px 10px; min-width: 0; font-size: 12.5px; }
.side-list a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-list a:hover { background: var(--row-hover); }
.side-list a.is-active { background: var(--gold); color: #000; font-weight: 700; }
.side-list .star { opacity: .0; padding: 4px 6px; }
.side-list li:hover .star, .side-list .star.is-on { opacity: 1; }
.side-list .star svg { width: 13px; height: 13px; }
.side-country summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font-weight: 700; font-size: 12.5px; background: var(--row); border-bottom: 1px solid var(--line-2); }
.side-country summary::-webkit-details-marker { display: none; }
.side-country summary::after { content: '‹'; margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.side-country[open] summary::after { transform: rotate(-90deg); }
.side-country summary:hover { background: var(--row-hover); }
.side-country .side-list { background: var(--row-alt); }
.side-country .side-list a { padding-inline-start: 22px; }
.rank { width: 18px; text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 500; }
.tier { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px; background: var(--navy-2); color: #fff; font-size: 10.5px; font-weight: 800; flex: none; }
.tier--cup { background: var(--gold); color: #000; font-size: 9px; }

/* ---------------- aside widgets ---------------- */
.mini-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line-2); }
.mini-tabs button { border: 1px solid var(--line); background: var(--row-alt); border-radius: 3px; padding: 1px 7px; font-size: 11.5px; }
.mini-tabs button.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.news-list .news { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto; gap: 2px 8px; padding: 8px; border-bottom: 1px solid var(--line-2); }
.news-list .news:last-child { border-bottom: 0; }
.news-list .news-img { grid-row: span 2; width: 72px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--chip); }
.news-t { font-weight: 700; font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news time { font-size: 11px; color: var(--muted); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 10px; }
.news-grid .news { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; padding-bottom: 8px; }
.news-grid .news-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--chip); }
.news-grid .news-t, .news-grid time { padding: 0 8px; }

/* ---------------- tables ---------------- */
.tbl-wrap { overflow-x: auto; }
.tbl-cap { background: var(--chip); padding: 5px 10px; font-weight: 800; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { background: var(--row-alt); color: var(--ink-2); font-weight: 700; padding: 6px 4px; border-bottom: 2px solid var(--line); text-align: center; white-space: nowrap; font-size: 11.5px; }
.tbl td { padding: 5px 4px; border-bottom: 1px solid var(--line-2); text-align: center; white-space: nowrap; }
.tbl tbody tr:nth-child(even) { background: var(--row-alt); }
.tbl tbody tr:hover { background: var(--row-hover); }
.tbl .team { text-align: right; }
.tbl td.team a, .tbl td.team .pl { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.tbl td.team span { overflow: hidden; text-overflow: ellipsis; }
.tbl .pts { font-weight: 800; color: var(--navy); }
:root[data-theme="dark"] .tbl .pts { color: var(--gold-2); }
.tbl .pos { width: 30px; }
.tbl tr.hl { background: #fff1c7 !important; }
:root[data-theme="dark"] .tbl tr.hl { background: #3a3215 !important; }
.zone { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; border-radius: 3px; font-weight: 700; background: var(--z, transparent); color: var(--ink); }
.zone[style*="--z"] { color: #10223a; }
.pos-gd { color: var(--win); } .neg-gd { color: var(--lose); }
.standings.compact td, .standings.compact th { padding: 4px 3px; font-size: 11.5px; }
.legend { list-style: none; margin: 0; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--line-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--z); margin-inline-end: 5px; vertical-align: -2px; }

/* ---------------- hero (league/team) ---------------- */
.hero-b { display: flex; align-items: center; gap: 14px; padding: 14px; background: linear-gradient(135deg, var(--page) 55%, color-mix(in srgb, var(--team, var(--navy-2)) 14%, var(--page))); }
.hero-logo { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.hero-logo .flag { width: 56px; height: auto; }
.hero-txt { flex: 1; min-width: 0; }
.hero-txt h1 { font-size: 20px; font-weight: 800; }
.hero-txt p { margin: 4px 0 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12.5px; }
.hero-txt p a { display: inline-flex; align-items: center; gap: 5px; }
.hero .star svg { width: 24px; height: 24px; color: var(--muted); }
.tabs { display: flex; background: linear-gradient(180deg, var(--bar-1), var(--bar-2)); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { color: #dfe9f5 !important; font-weight: 700; padding: 8px 14px; border: 0; background: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover, .tabs button:hover { color: #fff !important; background: rgba(255,255,255,.07); }
.tabs .is-on { color: #fff !important; border-bottom-color: var(--gold); background: rgba(0,0,0,.18); }

.md-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; background: var(--row-alt); border-bottom: 1px solid var(--line); }
.md-nav select { flex: 1; max-width: 320px; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--page); color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: #fff !important; border: 0; border-radius: 3px; padding: 4px 12px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn.is-off { opacity: .35; pointer-events: none; }

/* ---------------- match header ---------------- */
.mhead { background: linear-gradient(180deg, var(--page), var(--row-alt)); }
.mh-league { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 8px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.mh-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; padding: 16px 10px 10px; }
.mh-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.mh-team > a { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mh-team h2 { font-size: 16px; font-weight: 800; }
.mh-scorers { list-style: none; padding: 0; margin: 4px 0 0; font-size: 11.5px; color: var(--ink-2); }
.mh-scorers b { color: var(--muted); font-weight: 500; }
.mh-center { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 14px; min-width: 120px; }
.mh-score { display: flex; align-items: center; gap: 6px; background: var(--score-bg); color: var(--score-ink); border-radius: 6px; padding: 4px 16px; font-size: 34px; font-weight: 800; line-height: 1.2; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.mh-score.is-live { background: var(--live); color: #fff; }
.mh-score--pre { font-size: 26px; background: transparent; color: var(--ink); box-shadow: none; border: 2px solid var(--line); }
.mh-status { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.mh-status.st-in { color: var(--live); }
.mh-pen, .mh-note { font-size: 12px; color: var(--muted); text-align: center; }
.mh-info { list-style: none; margin: 0; padding: 8px 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line-2); }
.mh-team .star svg { width: 20px; height: 20px; color: var(--muted); }

/* timeline */
.tl { list-style: none; margin: 0; padding: 8px 0; position: relative; }
.tl::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--line); transform: translateX(-1px); }
.tl-ev { display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; padding: 5px 10px; position: relative; }
.tl-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-ev .tl-side:first-child { justify-content: flex-end; }
.tl-min { justify-self: center; background: var(--page); border: 2px solid var(--line); border-radius: 20px; padding: 0 8px; font-weight: 800; font-size: 12px; z-index: 1; min-width: 40px; text-align: center; }
.tl-txt { display: flex; flex-direction: column; line-height: 1.35; font-size: 12.5px; }
.tl-home .tl-txt { text-align: left; align-items: flex-end; }
.tl-txt small { color: var(--muted); font-size: 11px; }
.tl-txt .in { color: var(--win); font-weight: 700; } .tl-txt .out { color: var(--lose); font-size: 11.5px; }
.tl-mark { text-align: center; padding: 6px; position: relative; }
.tl-mark span { background: var(--navy); color: #fff; padding: 2px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; position: relative; z-index: 1; }
.ev-ico { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.card { width: 12px; height: 16px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.card-y { background: #f7d10a; } .card-r { background: var(--live); }
.ev-sub { flex-direction: column; font-size: 8px; line-height: 1; gap: 0; }
.ev-sub b:first-child { color: var(--win); } .ev-sub b:last-child { color: var(--lose); }
.ev-sub.sm { display: inline-flex; }
.ev-miss { color: var(--lose); font-weight: 800; }
.ev-var { font-size: 8px; font-weight: 800; background: #222; color: #fff; border-radius: 2px; width: 24px; }
.legend-ev { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 8px; margin: 0; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); }
.legend-ev span { display: inline-flex; align-items: center; gap: 5px; }

/* stats */
.stats { padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.st-vals { display: grid; grid-template-columns: 60px 1fr 60px; text-align: center; font-size: 12.5px; }
.st-vals b { font-weight: 700; } .st-vals b.lead { color: var(--navy-2); font-weight: 800; }
:root[data-theme="dark"] .st-vals b.lead { color: var(--gold-2); }
.st-vals b:first-child { text-align: right; } .st-vals b:last-child { text-align: left; }
.st-bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--line-2); gap: 2px; margin-top: 3px; }
.st-bar .h { background: var(--navy-2); } .st-bar .a { background: var(--gold); }

/* lineups */
.lineup { list-style: none; margin: 0; padding: 0; }
.lineup li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.lineup li:nth-child(even) { background: var(--row-alt); }
.lineup .jn { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; }
.lineup.bench .jn { background: var(--muted); }
.lineup small { color: var(--muted); margin-inline-start: auto; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 > .box { margin-bottom: 0; }

/* h2h */
.h2h-sum { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 12px; gap: 8px; border-bottom: 1px solid var(--line); }
.h2h-sum div { display: flex; flex-direction: column; gap: 2px; }
.h2h-sum b { font-size: 24px; color: var(--navy); font-weight: 800; }
:root[data-theme="dark"] .h2h-sum b { color: var(--gold-2); }
.h2h-sum span { font-size: 11.5px; color: var(--muted); }

/* commentary */
.comm { list-style: none; margin: 0; padding: 0; }
.comm li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); align-items: start; }
.comm b { background: var(--chip); border-radius: 3px; text-align: center; font-size: 12px; }
.comm p { margin: 0; font-size: 12.5px; }

/* favourites */
.fav-team { border-bottom: 1px solid var(--line); }
.fav-team-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--chip); }
.fav-team-h a { display: flex; align-items: center; gap: 8px; }
.fav-leagues { list-style: none; margin: 0; padding: 0; }
.fav-leagues li { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--line-2); }
.fav-leagues a { display: flex; align-items: center; gap: 8px; font-weight: 700; }

/* prose (about) */
.prose h3 { font-size: 14px; margin: 14px 0 6px; color: var(--navy); }
:root[data-theme="dark"] .prose h3 { color: var(--gold-2); }
.prose p { margin: 6px 0; line-height: 1.9; }
.rank-list { columns: 3; font-size: 12.5px; padding-inline-start: 22px; }

/* empty / skeleton */
.empty { padding: 34px 16px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.empty--err .empty-ico { background: #fde2e2; color: var(--lose); }
.empty p { margin: 0; color: var(--muted); font-size: 12px; max-width: 420px; }
.empty .btn { margin-top: 6px; }
.skel { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.skel-row, .skel-box { height: 34px; border-radius: 4px; background: linear-gradient(90deg, var(--line-2) 0%, var(--row-alt) 50%, var(--line-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel-box { height: 150px; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* settings dialog */
.settings { border: 0; padding: 0; border-radius: 6px; width: min(460px, calc(100vw - 24px)); background: var(--page); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.settings::backdrop { background: rgba(5, 15, 30, .55); }
.dlg-b { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.dlg fieldset { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px 10px; margin: 0; }
.dlg legend { font-weight: 800; padding: 0 6px; font-size: 12.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 30px; cursor: pointer; font-size: 12.5px; }
.seg-opt input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--gold); }
.x { background: none; border: 0; color: #fff; font-size: 16px; }

/* footer & tabbar */
.footer { background: var(--navy-3); color: #cfe0f3; padding: 18px 0; text-align: center; border-top: 3px solid var(--gold); font-size: 12.5px; }
.footer p { margin: 4px 0; }
.tabbar { display: none; }
.drawer-shade { display: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1140px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .aside { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 860px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 8px; }
  .aside { grid-column: 1; grid-template-columns: 1fr; }
  .menu-btn { display: flex; }
  .mast-ad { display: none; }
  .masthead-in { height: 60px; }
  .brand-txt b { font-size: 24px; }
  .brand img { width: 38px; height: 38px; }
  .side {
    position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 86vw); max-height: none; z-index: 60;
    transform: translateX(105%); transition: transform .25s ease; background: var(--page); border-radius: 0;
  }
  .side .box { border-radius: 0; border: 0; min-height: 100%; }
  .drawer-open .side { transform: none; box-shadow: -10px 0 30px rgba(0,0,0,.3); }
  .drawer-shade { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
  .drawer-open .drawer-shade { display: block; }
  .drawer-open { overflow: hidden; }
  .side-list .star { opacity: 1; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--navy-3); border-top: 2px solid var(--gold); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 56px; color: #cfe0f3; font-size: 11px; font-weight: 700; background: none; border: 0; }
  .tabbar span { font-size: 18px; line-height: 1; height: 20px; display: flex; align-items: center; }
  .tabbar .is-on { color: var(--gold-2); }
  .tb-live .pulse { width: 12px; height: 12px; background: var(--live); }
  .mainnav { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
  .rank-list { columns: 2; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 8px; }
  .mrow { grid-template-columns: 46px minmax(0, 1fr) 62px minmax(0, 1fr); gap: 4px; padding: 4px 6px; min-height: 44px; }
  .m-meta { display: none; }
  .m-team { gap: 5px; font-size: 12.5px; }
  .m-team .crest { --s: 18px !important; }
  .mrow .res { display: none; }
  .mrow:has(.res) { padding-right: 6px; }
  .db-days { grid-template-columns: repeat(5, 1fr); }
  .db-day:nth-child(1), .db-day:nth-child(7) { display: none; }
  .db-day b { font-size: 11.5px; }
  .hide-s { display: none; }
  .mh-score { font-size: 26px; padding: 2px 10px; }
  .mh-team h2 { font-size: 13.5px; }
  .mh-team .crest { --s: 52px !important; }
  .mh-center { min-width: 92px; }
  .topbar-links a { display: none; }
  .page-h h1 { font-size: 15px; }
  .page-h h1 small { display: block; margin: 2px 0 0; }
  .tl-ev { grid-template-columns: 1fr 44px 1fr; padding: 5px 4px; }
  .lbox-link { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.side-more summary { list-style: none; cursor: pointer; padding: 5px 10px; font-size: 12px; color: var(--navy-2); font-weight: 700; border-top: 1px dotted var(--line-2); }
.side-more summary::-webkit-details-marker { display: none; }
.side-more[open] summary { color: var(--muted); }
.db-nav svg { display: block; }

/* ---------- v1.1 additions ---------- */
.more-wrap { padding: 10px; text-align: center; border-top: 1px solid var(--line-2); }
.more-wrap:has(.btn-more[hidden]) { display: none; }
.btn-more { padding: 7px 22px; font-size: 13px; }
.btn-more[disabled] { opacity: .6; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; padding: 10px; }
.club { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 4px; text-align: center; font-weight: 700; font-size: 12.5px; background: var(--row-alt); }
.club:hover { background: var(--row-hover); border-color: var(--gold); }
.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0; }
.facts dt, .facts dd { padding: 7px 10px; border-bottom: 1px solid var(--line-2); margin: 0; font-size: 12.5px; }
.facts dt { color: var(--muted); font-weight: 700; background: var(--row-alt); }
.facts dd { display: flex; align-items: center; gap: 4px; }
.facts .form .res { position: static; transform: none; width: 20px; height: 20px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10.5px; font-weight: 800; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-cell { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line-2); border-inline-start: 1px solid var(--line-2); }
.stat-cell b { font-size: 20px; font-weight: 800; color: var(--navy); }
:root[data-theme="dark"] .stat-cell b { color: var(--gold-2); }
.stat-cell span { font-size: 11.5px; color: var(--muted); text-align: center; }
.pl-photo img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--chip); border: 2px solid var(--line); }
.lineup a:hover { color: var(--navy-2); text-decoration: underline; }
.tbl td.team a:hover span { text-decoration: underline; }
.diag { margin: 0; padding: 12px; font: 12px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; background: var(--row-alt); }
.show-s { display: none; }
@media (max-width: 560px) {
  .show-s { display: block; font-size: 11px; }
  .tbl td.team { white-space: normal; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .club-grid { grid-template-columns: repeat(2, 1fr); }
}
.tbl-wrapnames td.team { white-space: normal; }
.facts-2 { grid-template-columns: max-content 1fr max-content 1fr; }
@media (max-width: 700px) { .facts-2 { grid-template-columns: max-content 1fr; } }
