:root {
  color-scheme: dark;
  --bg: #050915;
  --bg-soft: #081126;
  --panel: #0b1530;
  --panel-strong: #101d3d;
  --surface: rgba(255,255,255,.045);
  --surface-hover: rgba(255,255,255,.075);
  --line: rgba(72,153,255,.25);
  --line-strong: rgba(72,153,255,.52);
  --text: #f7f9ff;
  --muted: #aebada;
  --accent: #248cff;
  --accent-2: #63dcff;
  --accent-warm: #ff9d22;
  --danger: #ff4658;
  --success: #2ad49b;
  --shadow: 0 18px 48px rgba(0,0,0,.38);
  --r: 20px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7ff;
  --bg-soft: #e9f0fb;
  --panel: #ffffff;
  --panel-strong: #eef5ff;
  --surface: rgba(8,28,68,.035);
  --surface-hover: rgba(8,28,68,.065);
  --line: rgba(23,92,177,.2);
  --line-strong: rgba(23,92,177,.45);
  --text: #07152f;
  --muted: #51617f;
  --accent: #0769dc;
  --accent-2: #0aa7cc;
  --accent-warm: #db6a00;
  --danger: #cc263a;
  --success: #087b59;
  --shadow: 0 16px 36px rgba(34,68,118,.14);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  background:
    radial-gradient(1100px 700px at 48% -10%, color-mix(in srgb, var(--accent) 21%, transparent), transparent 62%),
    radial-gradient(760px 520px at 5% 74%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--bg) !important;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app { max-width: 1100px; padding: 10px 16px calc(96px + env(safe-area-inset-bottom)); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(8px + env(safe-area-inset-top)) 2px 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, transparent) 64%, transparent);
  backdrop-filter: blur(18px);
}
.brand-button { border: 0; background: transparent; color: inherit; padding: 0; cursor: pointer; text-align: left; }
.brand-logo { width: 62px; height: 48px; object-fit: contain; object-position: left center; filter: drop-shadow(0 7px 13px rgba(0,73,194,.28)); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy .title { color: var(--text); font-size: 18px; font-weight: 950; letter-spacing: .06em; }
.brand-copy .subtitle { color: var(--muted); font-size: 11px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn, .pill {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
}
.icon-btn { width: 42px; padding: 0; display: inline-grid; place-items: center; font-size: 18px; }
.pill { padding: 9px 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.pill-icon { color: var(--text); line-height: 1; }
.icon-btn:hover, .pill:hover { background: var(--surface-hover); border-color: var(--line-strong); }

.card {
  background: linear-gradient(155deg, color-mix(in srgb, var(--panel) 96%, white 4%), color-mix(in srgb, var(--panel) 88%, transparent)) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text);
}
.content { padding: 0 16px 16px; }
.card-h { min-height: 54px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2 { color: var(--text); }
.btn {
  border: 1px solid var(--line-strong) !important;
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
  color: var(--text) !important;
  border-radius: 13px !important;
  min-height: 42px;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 22%, transparent) !important; }
.primary-btn {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--accent), #0757ce) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}
.primary-btn:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, white), #064fb8) !important; }
.empty, .status-line { color: var(--muted); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 2px 12px;
}
.section-heading h2 { margin: 3px 0 0; color: var(--text); font-size: clamp(22px, 4vw, 30px); line-height: 1.08; letter-spacing: -.02em; }
.eyebrow { color: var(--accent-2); font-weight: 900; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
.status-line { padding: 12px 2px; font-size: 13px; }

.home-hero {
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, .7fr);
  align-items: end;
  gap: 22px;
  padding: clamp(24px, 5vw, 48px);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(120deg, rgba(6,17,43,.96), rgba(7,45,105,.86) 54%, rgba(5,9,21,.92)),
    var(--panel) !important;
}
.home-hero::before {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  right: -80px; top: -120px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-warm), var(--accent));
  filter: blur(2px);
  opacity: .24;
  z-index: -2;
}
.home-hero::after {
  content: "S";
  position: absolute;
  right: 4%; top: -24%;
  font-size: 340px;
  line-height: 1;
  font-weight: 1000;
  font-style: italic;
  color: rgba(255,255,255,.035);
  z-index: -1;
}
html[data-theme="light"] .home-hero { color: #fff; }
html[data-theme="light"] .home-hero h1,
html[data-theme="light"] .home-hero p { color: #fff; }
.home-hero h1 { margin: 7px 0 10px; max-width: 690px; font-size: clamp(33px, 7vw, 60px); line-height: .99; letter-spacing: -.055em; color: #fff; }
.home-hero p { margin: 0; max-width: 630px; color: #bed1ef; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.home-live-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 17px;
  background: rgba(2,10,28,.54);
  color: #fff;
  backdrop-filter: blur(10px);
}
.home-live-card div { min-width: 0; display: grid; gap: 3px; }
.home-live-card small { color: #b8c9e5; overflow: hidden; text-overflow: ellipsis; }
.live-orb { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 7px rgba(255,70,88,.12), 0 0 20px rgba(255,70,88,.64); }
.home-live-card:not(.is-live) .live-orb { background: var(--accent); box-shadow: 0 0 0 7px rgba(36,140,255,.12), 0 0 20px rgba(36,140,255,.42); }

.news-featured {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(0, 1fr);
  min-height: 310px;
  overflow: hidden;
  cursor: pointer;
}
.news-featured-media { min-height: 280px; background: var(--panel-strong); overflow: hidden; }
.news-featured-media img, .news-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.news-featured:hover img, .news-card:hover img { transform: scale(1.025); }
.news-featured-copy { padding: clamp(22px, 4vw, 38px); align-self: end; }
.news-featured h3 { margin: 7px 0 12px; font-size: clamp(24px, 4.6vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
.news-featured p { margin: 0; color: var(--muted); line-height: 1.55; }
.news-meta { margin-top: 14px; color: var(--muted); font-size: 12px; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.news-card { overflow: hidden; cursor: pointer; }
.news-card-media { aspect-ratio: 16/9; background: var(--panel-strong); overflow: hidden; }
.news-card-copy { padding: 15px; }
.news-card h3 { margin: 6px 0 8px; font-size: 17px; line-height: 1.25; }
.news-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.webtv-heading { margin-top: 6px; }
.webtv-subnav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.subnav-btn, .match-tab, .theme-options button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  min-height: 42px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}
.subnav-btn:hover, .match-tab:hover, .theme-options button:hover { background: var(--surface-hover); }
.subnav-btn.is-active, .match-tab.is-active, .theme-options button.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--line-strong);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 14%, transparent);
}
.player-wrap, #stvHomePlayerShell, #stvReplayPlayerShell { background: #000 !important; border-color: var(--line) !important; }
.live-info { padding: 15px 2px 4px; }
.live-title { color: var(--text); font-size: 18px; font-weight: 900; }
.live-meta, .live-next { color: var(--muted); font-size: 13px; margin-top: 6px; }
.badge { background: color-mix(in srgb, var(--danger) 15%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: color-mix(in srgb, var(--danger) 40%, white); }
.stv-program-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  margin: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 9px 24px rgba(0,0,0,.13);
}
.stv-program-time { color: var(--text); background: var(--surface-hover); border-color: var(--line); }
.stv-program-titletext { color: var(--text); }
.stv-program-item:has(.stv-badge-live) { border-color: color-mix(in srgb, var(--danger) 64%, transparent); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.stv-day-btn, .stv-day-current { color: var(--text); border-color: var(--line-strong); background: var(--surface); }

.matches-control-card { padding: 15px; }
.field-label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}
.select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.matches-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.matches-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.match-list { display: grid; gap: 10px; }
.match-card { padding: 14px; }
.match-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.match-status { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: var(--surface-hover); border: 1px solid var(--line); color: var(--muted); font-weight: 900; }
.match-status.live { color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 0 17px rgba(255,70,88,.38); }
.match-teams { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 12px; }
.team { min-width: 0; display: grid; align-items: center; gap: 8px; font-weight: 850; line-height: 1.25; }
.team.home { grid-template-columns: 38px minmax(0,1fr); text-align: left; }
.team.away { grid-template-columns: minmax(0,1fr) 38px; text-align: right; }
.team span { overflow: hidden; text-overflow: ellipsis; }
.team-logo { width: 38px; height: 38px; object-fit: contain; display: block; border-radius: 9px; }
.team-logo-fallback { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); }
.score { min-width: 68px; text-align: center; font-weight: 950; font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.match-meta { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.standings-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); }
.standings { width: 100%; border-collapse: collapse; min-width: 590px; }
.standings th, .standings td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: center; font-size: 12px; }
.standings th { color: var(--muted); font-size: 10px; letter-spacing: .06em; position: sticky; top: 0; background: var(--panel-strong); }
.standings .team-cell { min-width: 190px; text-align: left; display: flex; align-items: center; gap: 9px; font-weight: 850; }
.standings .team-logo, .standings .team-logo-fallback { width: 30px; height: 30px; flex: 0 0 auto; }
.standings tr:last-child td { border-bottom: 0; }
.standings .points { font-weight: 950; color: var(--text); }
.zone-marker { width: 3px; padding: 0 !important; }
.truth-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.5; }

.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-card { min-height: 330px; padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); position: relative; overflow: hidden; isolation: isolate; }
.game-card::after { content: ""; position: absolute; inset: auto -70px -100px auto; width: 270px; height: 270px; border-radius: 50%; filter: blur(2px); opacity: .26; z-index: -1; }
.manager-card { background: linear-gradient(145deg,#101535,#1d1857 65%,#081126); }
.manager-card::after { background: #7d5cff; }
.predict-card { background: linear-gradient(145deg,#061c31,#063f62 62%,#07152e); }
.predict-card::after { background: #18c4ff; }
.game-card, .game-card h3, .game-card p { color: #fff; }
.game-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15); font-size: 27px; }
.coming-badge { float: right; padding: 7px 9px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #dce8ff; font-size: 10px; font-weight: 950; letter-spacing: .08em; }
.game-card h3 { margin: 58px 0 10px; font-size: clamp(25px, 4vw, 38px); line-height: 1; letter-spacing: -.035em; }
.game-card p { color: #bcd0e9; line-height: 1.55; max-width: 470px; }
.game-card > strong { display: inline-block; margin-top: 18px; color: var(--accent-2); letter-spacing: .13em; font-size: 11px; }

.nav { z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); border-color: var(--line); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.nav-inner { gap: 8px; }
.tab { min-height: 58px; padding: 7px 5px; display: grid; place-items: center; gap: 1px; border-color: transparent; background: transparent; color: var(--muted); font-size: 11px; }
.tab span { display: block; font-size: 19px; line-height: 1; }
.tab.active { color: var(--text); border-color: var(--line-strong); background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 14%, transparent); }

.settings-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; background: rgba(0,0,0,.58); backdrop-filter: blur(7px); }
.settings-backdrop[hidden] { display: none; }
.settings-sheet { width: min(620px, 100%); max-height: 92vh; overflow: auto; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 24px 24px 0 0; background: var(--panel); color: var(--text); box-shadow: 0 -22px 80px rgba(0,0,0,.48); }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h2 { margin: 2px 0 0; }
.settings-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.settings-block h3 { margin: 0 0 10px; }
.settings-block p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.settings-foot { padding-top: 18px; color: var(--muted); font-size: 11px; text-align: center; }

.reader-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: stretch center; background: var(--bg); overflow: auto; }
.reader-backdrop[hidden] { display: none; }
.reader-sheet { width: min(840px, 100%); min-height: 100%; background: var(--bg); color: var(--text); }
.reader-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 13px 10px; background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.reader-cover { width: 100%; aspect-ratio: 16/8.6; background: var(--panel-strong); overflow: hidden; }
.reader-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reader-body { padding: clamp(22px, 5vw, 52px) clamp(18px, 6vw, 70px) 80px; }
.reader-body h1 { margin: 8px 0 10px; font-size: clamp(29px, 6vw, 48px); line-height: 1.06; letter-spacing: -.04em; }
.reader-content { margin-top: 28px; color: var(--text); font-size: 17px; line-height: 1.72; }
.reader-content img { max-width: 100%; height: auto; border-radius: 15px; }
.reader-content iframe, .reader-content video { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 15px; background: #000; }
.reader-content a { color: var(--accent); }
.reader-content h2, .reader-content h3 { margin-top: 1.8em; line-height: 1.2; }
.reader-content blockquote { margin: 1.5em 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }

.skeleton { position: relative; overflow: hidden; background: var(--surface); min-height: 120px; border-radius: var(--r); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg,transparent,rgba(255,255,255,.08),transparent); animation: shimmer 1.45s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

html[data-theme="light"] #stvHomeOverlay > div,
html[data-theme="light"] #stvReplayOverlay > div { background: rgba(5,17,42,.76) !important; }
html[data-theme="light"] [style*="color:#eef5ff"],
html[data-theme="light"] [style*="color: #eef5ff"] { color: var(--text) !important; }

@media (max-width: 760px) {
  .app { padding-left: 11px; padding-right: 11px; }
  .app-header { gap: 8px; }
  .brand-logo { width: 52px; height: 41px; }
  .brand-copy .subtitle { display: none; }
  .pill { width: 42px; justify-content: center; overflow: hidden; white-space: nowrap; padding: 9px 11px; color: var(--text); }
  .pill-label { display: none; }
  .home-hero { grid-template-columns: 1fr; min-height: 420px; align-content: end; padding: 24px 19px; }
  .home-hero h1 { max-width: 520px; }
  .home-live-card { width: 100%; }
  .news-featured { grid-template-columns: 1fr; }
  .news-featured-media { min-height: 210px; aspect-ratio: 16/9; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { display: grid; grid-template-columns: 128px minmax(0,1fr); }
  .news-card-media { aspect-ratio: 1/1; }
  .news-card p { display: none; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 290px; }
  .matches-filters { grid-template-columns: 1fr; }
  .match-teams { grid-template-columns: minmax(0,1fr) 54px minmax(0,1fr); gap: 7px; }
  .team { font-size: 12px; gap: 5px; }
  .team.home { grid-template-columns: 31px minmax(0,1fr); }
  .team.away { grid-template-columns: minmax(0,1fr) 31px; }
  .team-logo, .team-logo-fallback { width: 31px; height: 31px; border-radius: 8px; }
  .score { min-width: 54px; font-size: 17px; }
  .stv-program-head { grid-template-columns: 1fr; gap: 10px; }
  .stv-program-head h2 { text-align: center; }
  .stv-program-head .btn { width: 100%; }
  .stv-day-current { min-width: 120px; text-align: center; }
}

@media (max-width: 390px) {
  .webtv-subnav { grid-template-columns: repeat(2, 1fr); }
  .theme-options { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 34px; }
  .hero-actions .btn { width: 100%; }
  .news-card { grid-template-columns: 104px minmax(0,1fr); }
  .tab { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
