:root {
  --bg: #020c3f;
  --panel: #090b12;
  --panel-2: #111626;
  --text: #ffffff;
  --muted: #a7a7a7;
  --line: rgba(255,255,255,.10);
  --orange: #b97428;
  --orange-2: #d89a45;
  --header-h: 60px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -15%, rgba(200,128,43,.15), transparent 34%),
    radial-gradient(circle at 85% 5%, rgba(2,12,63,.92), transparent 38%),
    #020817;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px clamp(14px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(2,8,23,.95);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 105px; height: 48px; object-fit: contain; flex: 0 0 auto; }
.brand span {
  display: block;
  margin-bottom: 2px;
  color: var(--orange-2);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .15em;
}
.brand h1 { margin: 0; font-size: clamp(.88rem, 1.55vw, 1.14rem); line-height: 1.05; white-space: nowrap; }
.brand h1 strong { color: var(--orange-2); }
.refresh {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: white;
  background: #111;
  font-size: 1.15rem;
}
.refresh:hover { border-color: rgba(216,154,69,.72); background: #15100a; }

.date-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(610px, calc(100% - 24px));
  margin: 9px auto 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12,12,12,.94);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
}
.date-tab {
  min-width: 0;
  padding: 6px 6px;
  border: 0;
  border-radius: 9px;
  color: #cfcfcf;
  background: transparent;
  text-align: center;
}
.date-tab small, .date-tab strong, .date-tab span { display: block; }
.date-tab small { color: #8d8d8d; font-size: .52rem; font-weight: 900; letter-spacing: .08em; }
.date-tab strong { margin: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .73rem; }
.date-tab span { color: #8d8d8d; font-size: .58rem; }
.date-tab.active {
  color: white;
  background: linear-gradient(135deg, #9a5a1e, #d89a45);
  box-shadow: 0 8px 18px rgba(198,126,39,.28);
}
.date-tab.active small, .date-tab.active span { color: rgba(255,255,255,.85); }

main { width: min(1320px, calc(100% - 30px)); margin: 0 auto; padding: 2px 0 64px; }
.notice {
  width: min(760px, 100%);
  margin: 14px auto;
  padding: 11px 14px;
  border: 1px solid rgba(216,154,69,.35);
  border-radius: 10px;
  color: #f5d6a7;
  background: rgba(198,126,39,.11);
  text-align: center;
  font-size: .82rem;
}
.state-panel {
  min-height: 55vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}
.state-panel h2 { margin: 4px 0 0; color: white; font-size: 1.2rem; }
.state-panel p { margin: 0; }
.ball { font-size: 2rem; filter: grayscale(1); opacity: .55; }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.competition-section {
  display: block;
  padding: 27px 0 31px;
  scroll-margin-top: 132px;
}
.competition-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  text-align: center;
}
.competition-heading::before,
.competition-heading::after {
  content: "";
  width: min(110px, 10vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216,154,69,.60));
}
.competition-heading::after { transform: rotate(180deg); }
.competition-logo {
  width: 30px;
  height: 30px;
  padding: 3px;
  border-radius: 7px;
  object-fit: contain;
  background: white;
}
.competition-heading h2 {
  margin: 0;
  font-size: clamp(1.22rem, 2.1vw, 1.62rem);
  letter-spacing: -.035em;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.match-card {
  position: relative;
  height: 184px;
  min-height: 184px;
  display: grid;
  grid-template-columns: 69% 31%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: #171717;
  box-shadow: 0 10px 22px rgba(0,0,0,.28);
}
.match-card::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -12%;
  bottom: -12%;
  left: 66%;
  width: 24px;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 45%, rgba(255,255,255,.2));
  transform: skewX(-16deg);
  filter: drop-shadow(-6px 0 8px rgba(255,255,255,.38));
  pointer-events: none;
}
.match-main {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 16px 14px 12px;
  background: linear-gradient(145deg, #10131d, #07080d);
}
.teams {
  display: grid;
  grid-template-columns: minmax(0,1fr) 25px minmax(0,1fr);
  align-items: center;
  gap: 5px;
}
.team { min-width: 0; text-align: center; }
.team-logo-wrap {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
}
.team-logo { max-width: 54px; max-height: 54px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.team-name {
  min-height: 2.4em;
  display: grid;
  place-items: start center;
  overflow-wrap: anywhere;
  color: #f5f5f5;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.2;
}
.versus { color: var(--orange-2); font-size: .95rem; font-weight: 950; font-style: italic; text-align: center; }
.round { margin: 5px 0 0; color: #c8c8c8; font-size: .64rem; font-weight: 750; }

.match-side {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 13px 8px 11px 15px;
  color: #171717;
  background: #fff;
  text-align: center;
}
.match-time { font-size: clamp(1.08rem, 1.5vw, 1.28rem); font-weight: 950; letter-spacing: -.04em; }
.side-label { color: #6c6c6c; font-size: .49rem; font-weight: 800; text-transform: uppercase; }
.score { font-size: clamp(1.25rem, 1.8vw, 1.55rem); font-weight: 950; line-height: 1; }
.status-badge { padding: 4px 7px; border-radius: 6px; font-size: .58rem; font-weight: 900; text-transform: uppercase; }
.status-badge.live { color: white; background: #e51b1b; animation: pulse 1.3s infinite; }
.status-badge.finished { color: #444; background: #e8e8e8; }
@keyframes pulse { 50% { opacity: .65; } }
.channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
}
.channel-pill {
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid #d3d3d3;
  border-radius: 5px;
  background: #ededed;
  color: #333;
  font-size: .48rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.channel-placeholder { color: #777; font-size: .53rem; font-weight: 750; line-height: 1.16; }


@media (max-width: 1050px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competition-section { padding: 25px 0 28px; }
}

@media (max-width: 680px) {
  :root { --header-h: 56px; }
  .topbar { padding: 4px 11px; }
  .brand img { width: 88px; height: 43px; }
  .brand span { font-size: .48rem; }
  .brand h1 { font-size: .79rem; }
  .refresh { width: 34px; height: 34px; }
  .date-tabs { width: calc(100% - 14px); margin-top: 6px; border-radius: 10px; }
  .date-tab { padding: 6px 3px; }
  .date-tab strong { font-size: .66rem; }
  .date-tab small, .date-tab span { font-size: .49rem; }
  main { width: calc(100% - 16px); padding-bottom: 54px; }
  .competition-section { padding: 21px 0 24px; scroll-margin-top: 108px; }
  .competition-heading { margin-bottom: 11px; }
  .competition-heading::before, .competition-heading::after { width: 28px; }
  .competition-logo { width: 27px; height: 27px; }
  .competition-heading h2 { font-size: 1.15rem; }
  .games-grid { grid-template-columns: 1fr; gap: 12px; }
  .match-card { height: 172px; min-height: 172px; grid-template-columns: 68% 32%; }
  .match-main { padding: 14px 11px 10px; }
  .team-logo-wrap { width: 50px; height: 50px; }
  .team-logo { max-width: 50px; max-height: 50px; }
  .team-name { font-size: .72rem; }
  .match-side { padding-left: 13px; }
  .match-card::after { left: 65%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner, .status-badge.live { animation: none; }
}
