:root {
  --bg: #070d0b;
  --bar: #0c1411;
  --card: #121c18;
  --card-2: #18241f;
  --line: #24362c;
  --text: #f3f7f4;
  --muted: #93a79b;
  --gold: #f0a04a;
  --ink: #1a1206;
  --live: #ff3b30;
  --danger: #ff8d86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 480px at 90% -10%, rgba(31, 138, 76, 0.2), transparent 55%),
    radial-gradient(800px 360px at -10% 0%, rgba(240, 160, 74, 0.1), transparent 50%),
    var(--bg);
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--gold); color: var(--ink); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { top: 8px; }

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 72px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand b { color: var(--gold); font-weight: 700; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}
.nav a.on, .nav a:hover { background: #1b2922; color: var(--text); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search input, .field input, .field select, .field textarea, .pay input, .auth input, textarea {
  width: 100%;
  background: #0b1210;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 120px; }
.search input { width: 190px; }
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus, .pay input:focus, .auth input:focus {
  border-color: var(--gold);
}
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.langs button, .ghost, .text-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 700;
}
.langs button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.grace {
  min-width: 64px;
  text-align: center;
  background: #2a2116;
  color: var(--gold);
  border-radius: 999px;
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.who, .primary, .signin {
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.who { background: #1b2922; }
.primary, .signin {
  background: var(--gold);
  color: var(--ink);
  border: 0;
}
.ghost {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
}
label.ghost { cursor: pointer; display: inline-block; }

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 72px;
}
.enter { animation: rise 0.18s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero {
  position: relative;
  height: min(68vh, 620px);
  min-height: 280px;
  border-radius: 18px;
  overflow: hidden;
  background: #08110e;
  border: 1px solid var(--line);
}
.hero iframe, .hero .hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.hero iframe { pointer-events: none; background: #000; }
.hero-shade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 56px 24px 22px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78) 42%, rgba(0, 0, 0, 0.92));
}
.hero-shade h1 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
  max-width: 16ch;
}
.hero-shade p { color: #d5e2d8; margin-top: 6px; }
.hero-link { color: var(--gold); font-weight: 700; display: inline-block; margin-top: 10px; }
.live-pill, .past-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.live-pill { background: var(--live); color: white; }
.live-pill i, .dot {
  width: 8px; height: 8px; border-radius: 50%; background: white; display: inline-block;
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.past-pill { background: #24362c; color: var(--muted); }
.arrows { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; pointer-events: none; }
.arrows button, .dots button {
  pointer-events: auto;
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(8, 17, 14, 0.8); color: white; font-size: 22px;
}
.dots { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; }
.dots button { width: 9px; height: 9px; padding: 0; background: rgba(255,255,255,0.45); }
.dots button.on { background: var(--gold); }

.empty-live, .empty, .note {
  color: var(--muted);
  padding: 8px 0 18px;
}
.block { margin-top: 26px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.block-head h2 { font-size: 22px; }
.block-head a { color: var(--gold); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.card:hover { border-color: #6d5433; transform: translateY(-2px); }
.poster { aspect-ratio: 16/9; background: #0c1814 center/cover no-repeat; position: relative; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 42px; color: rgba(240, 160, 74, 0.8);
  background: linear-gradient(160deg, #163024, #101815 60%, #2a2116);
}
.poster .live-pill, .poster .past-pill { position: absolute; left: 8px; top: 8px; }
.card-meta { padding: 10px 12px 12px; display: grid; gap: 2px; }
.card-meta strong { font-size: 15px; }
.card-meta span { color: var(--muted); font-size: 13px; }

.crumbs { color: var(--muted); margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--gold); }
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.player iframe, .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.watch-title { margin: 14px 0 4px; font-size: clamp(28px, 4vw, 44px); font-family: "Barlow Condensed", Impact, sans-serif; }
.lock {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.page-head { margin-bottom: 16px; }
.page-head h1 { font-family: "Barlow Condensed", Impact, sans-serif; font-size: 42px; }
.league-list { display: grid; gap: 10px; }
.league-list a {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.league-list a:hover { border-color: var(--gold); }
.account, .pay, .sheet, .rail, .preview-pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.account { padding: 18px; display: grid; gap: 8px; max-width: 560px; }
.account .row, .admin-actions, .auth-actions, .catalog-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.sheet { width: min(440px, 100%); padding: 20px; position: relative; }
.sheet-wide { width: min(920px, 100%); max-height: min(92vh, 900px); overflow: auto; }
.x {
  position: absolute; right: 10px; top: 8px;
  border: 0; background: transparent; color: var(--muted); font-size: 28px; line-height: 1;
}
.auth h2, .pay h2, .suggest h2, .rail h2 { font-size: 28px; font-family: "Barlow Condensed", Impact, sans-serif; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 13px; }
.form-error { color: var(--danger); min-height: 1.2em; }
.auth, .suggest, .pay { display: grid; gap: 10px; }
.auth-actions button, .primary.wide { width: 100%; }
.auth-actions { display: grid; grid-template-columns: 1fr 1fr; }

.pay-group { margin-top: 8px; }
.pay-group h3 { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.method {
  min-height: 74px;
  border-radius: 12px;
  border: 0;
  display: grid;
  place-items: center;
  padding: 8px;
}
.method.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.method.mpesa { background: #fff; color: #e10600; }
.method.mixx { background: #0052cc; color: #ffe14a; }
.method.airtel { background: #ed1c24; color: #fff; }
.method.halo { background: #f5b400; color: #241c00; }
.method.visa, .method.mastercard { background: #fff; }
.method img { height: 28px; width: auto; }
.method.mastercard img { height: 40px; }
.logo-mno { font-weight: 800; letter-spacing: 0.02em; font-size: 20px; }
.method.mixx .logo-mno { font-style: italic; font-size: 26px; }
.method.airtel .logo-mno { font-weight: 700; font-size: 18px; text-transform: lowercase; }
.method.airtel small { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan {
  text-align: left;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
  position: relative;
}
.plan.on { border-color: var(--gold); background: #2a2116; }
.plan strong { font-size: 20px; }
.plan em {
  position: absolute; right: 8px; top: 8px;
  font-style: normal; font-size: 11px; font-weight: 800;
  background: var(--gold); color: var(--ink); border-radius: 999px; padding: 2px 6px;
}

.admin-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 18px; align-items: start; }
.rail { padding: 14px; display: grid; gap: 12px; position: sticky; top: 86px; max-height: calc(100vh - 104px); overflow: auto; }
.preview-pane { padding: 14px; }
.field { display: grid; gap: 6px; }
.field span, .check { color: var(--muted); font-size: 13px; font-weight: 700; }
.stack { display: grid; gap: 8px; }
details.fold { border-top: 1px solid var(--line); padding-top: 8px; }
details.fold summary { cursor: pointer; font-weight: 800; padding: 8px 0; list-style: none; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary:before { content: "▸ "; color: var(--gold); }
details.fold[open] summary:before { content: "▾ "; }
.readout {
  background: #0b1210;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  color: var(--text);
}
.danger { background: transparent; color: var(--danger); border: 1px solid #5c2c2c; border-radius: 999px; padding: 10px 14px; font-weight: 700; }
.catalog-actions { margin-top: 4px; }
.hidden { display: none !important; }

#toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: min(92vw, 520px);
  text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 800px) {
  .top-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; min-width: 0; overflow: auto; }
  .tools { width: 100%; min-width: 0; flex-wrap: wrap; }
  .search { flex: 1 1 120px; min-width: 0; }
  .search input { width: 100%; min-width: 0; }
  .admin-layout { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; }
  .plans { grid-template-columns: 1fr; }
  .hero { height: 320px; min-height: 240px; }
  .auth-actions { grid-template-columns: 1fr; }
}
@media (min-width: 801px) {
  .method-grid.mno { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
