:root {
  --red: #EF0107;
  --red-dark: #DB0007;
  --navy: #063672;
  --gold: #9C824A;
  --gold-2: #c4a56a;
  --bg: #070b16;
  --bg-2: #0c1222;
  --paper: #121a2d;
  --ink: #f4f1ea;
  --muted: #9aa6bf;
  --line: rgba(156, 130, 74, 0.28);
  --live: #ff4d4d;
  --win: #3dd68c;
  --draw: #d4b15f;
  --lose: #f07178;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Anuphan", system-ui, sans-serif;
  --display: "Outfit", "Anuphan", system-ui, sans-serif;
  --pad-b: calc(76px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.site {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(239, 1, 7, 0.18), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(6, 54, 114, 0.45), transparent 50%),
    var(--bg);
  color: var(--ink);
  padding-bottom: var(--pad-b);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.skip {
  position: absolute; left: -999px; top: 8px;
}
.skip:focus { left: 8px; z-index: 50; background: #fff; color: #000; padding: 8px 12px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 22, 0.78);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 0 0 2px var(--gold);
}
.brand-text { display: flex; align-items: baseline; gap: 2px; line-height: 1; }
.brand-text strong {
  font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.02em;
}
.brand-text small { color: var(--gold-2); font-weight: 600; }
.nav-desk { display: none; gap: 6px; margin-left: auto; }
.nav-desk a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600;
}
.nav-desk a.active, .nav-desk a:hover {
  color: #fff; background: rgba(239, 1, 7, 0.18);
}
.nav-toggle {
  margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.6rem;
}
.menu-canvas { background: #0d1528; color: #fff; }
.menu-canvas a {
  display: block; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 600;
}

.hero {
  position: relative; overflow: hidden;
  min-height: 320px; display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,11,22,.25), rgba(7,11,22,.92)),
    url("/assets/hero.jpg") center/cover no-repeat;
}
.hero-inner { position: relative; padding: 36px 0 28px; }
.kicker {
  display: flex; gap: 10px; align-items: center; text-transform: uppercase;
  letter-spacing: .14em; font-size: .78rem; color: var(--gold-2); font-weight: 700;
}
.hero-scoreline {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  align-items: center; margin: 18px 0 10px;
}
.hero-club {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.hero-club strong { font-size: 1.05rem; }
.hero-score {
  font-family: var(--display); font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800;
  color: #fff; min-width: 110px; text-align: center;
}
.hero-sub { color: var(--muted); margin-bottom: 16px; }
.btn-gold {
  display: inline-flex; gap: 8px; align-items: center;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1208; font-weight: 700; border-radius: 999px; padding: 10px 18px;
}

.section { padding: 28px 0 8px; }
.section h2 {
  font-family: var(--display); font-size: 1.35rem; margin: 0 0 14px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.section h2 a { color: var(--gold-2); font-size: .9rem; font-family: var(--font); }

.match-list { display: grid; gap: 10px; }
.match-card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.match-card.is-live { border-color: rgba(239,1,7,.55); }
.match-meta {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; margin-bottom: 8px;
}
.match-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-sides {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center;
}
.side { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.side.away { justify-content: flex-end; text-align: right; }
.score {
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; min-width: 72px; text-align: center;
}
.crest, .crest-sm, .crest-lg, .crest-xs {
  object-fit: contain; background: #fff; border-radius: 50%; flex: none;
}
.crest { width: 36px; height: 36px; }
.crest-sm { width: 20px; height: 20px; }
.crest-lg { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--gold); }
.crest-xs { width: 22px; height: 22px; }
.crest-ph {
  display: inline-block; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--red));
}

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 8px; font-size: .75rem; font-weight: 700;
  background: rgba(255,255,255,.06); margin-left: auto;
}
.pill.live { background: var(--red); color: #fff; animation: pulse 1.6s ease infinite; }
.pill.done { background: rgba(255,255,255,.1); }
.pill.ns { background: rgba(156,130,74,.18); color: var(--gold-2); }
.pill.result { margin-left: 6px; }
.r-w { background: rgba(61,214,140,.18); color: var(--win); }
.r-d { background: rgba(212,177,95,.18); color: var(--draw); }
.r-l { background: rgba(240,113,120,.18); color: var(--lose); }
@keyframes pulse { 50% { opacity: .65; } }

.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.standings { width: 100%; border-collapse: collapse; background: var(--paper); }
.standings th, .standings td { padding: 10px 8px; text-align: center; font-size: .92rem; }
.standings th { color: var(--muted); font-weight: 600; }
.standings td.team-cell, .standings th:nth-child(2) { text-align: left; }
.team-cell { display: flex; align-items: center; gap: 8px; }
.standings tr.us { background: rgba(239,1,7,.16); }
.standings .pts { font-weight: 800; color: var(--gold-2); }

.league-tabs { display: flex; gap: 8px; overflow: auto; padding-bottom: 12px; }
.league-tabs a, .league-tabs button {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; white-space: nowrap; font-weight: 600;
}
.league-tabs a.active, .league-tabs button.active {
  background: var(--red); border-color: var(--red); color: #fff;
}

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li {
  display: grid; grid-template-columns: 56px 24px 1fr; gap: 10px; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.timeline .clock { color: var(--gold-2); font-weight: 700; }
.timeline .ours { border-left: 3px solid var(--red); }
.timeline .yellow { color: #f5d76e; }
.timeline .red { color: var(--red); }

.stats { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stats-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.stat-row { margin: 10px 0 14px; }
.stat-vals { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; font-size: .9rem; margin-bottom: 6px; }
.stat-vals span { color: var(--muted); text-align: center; }
.stat-vals b:last-child { text-align: right; }
.stat-bars { display: flex; height: 6px; gap: 4px; }
.stat-bars i { display: block; background: var(--red); border-radius: 99px; }
.stat-bars i.r { background: #4b5d86; margin-left: auto; }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.lineup header h3 { margin: 0; font-size: 1.1rem; }
.lineup header p { color: var(--muted); margin: 4px 0 10px; }
.players { list-style: none; margin: 0; padding: 0; }
.players li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.players img, .players .ph {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #1b2438;
}
.players b { width: 24px; color: var(--gold-2); }

.news-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .news-grid { grid-template-columns: 1fr 1fr; } }
.news-card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.news-card img { width: 100%; height: 160px; object-fit: cover; }
.news-card div { padding: 12px 14px; }
.news-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.news-card p { margin: 0; color: var(--muted); }

.empty {
  background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--muted);
}
.page-head { padding: 22px 0 0; }
.page-head h1 { font-family: var(--display); font-size: 1.8rem; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0 0 16px; }

.match-hero {
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.tabs .nav-link {
  color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent;
}
.tabs .nav-link.active { color: #fff; border-bottom-color: var(--red); }

.foot {
  margin-top: 32px; padding: 24px 0 12px; color: var(--muted); font-size: .9rem;
  border-top: 1px solid var(--line);
}
.nav-mobile {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(7,11,22,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-mobile a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .7rem; color: var(--muted);
}
.nav-mobile a.active, .nav-mobile a:hover { color: #fff; }
.nav-mobile i { font-size: 1.15rem; }

@media (min-width: 992px) {
  .nav-desk { display: flex; }
  .nav-mobile { display: none; }
  body.site { padding-bottom: 0; }
}

.muted { color: var(--muted); }
.group-h { margin: 16px 0 8px; font-size: 1rem; color: var(--gold-2); }
.form-check-label { color: var(--muted); }
.article-body { font-size: 1.05rem; line-height: 1.75; }
.article-body p { margin: 0 0 1em; }
