:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg2: #0c2034;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5fbff;
  --muted: #9fb5c8;
  --ice: #aee8ff;
  --red: #ff3b4f;
  --gold: #ffd36a;
  --green: #64f2b2;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 59, 79, 0.22), transparent 28rem),
    radial-gradient(circle at 10% 0%, rgba(94, 211, 255, 0.22), transparent 34rem),
    linear-gradient(145deg, #06101f 0%, #08182a 48%, #11151d 100%);
}

.ice-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(105deg, transparent 0 48%, rgba(255,255,255,0.06) 49% 50%, transparent 51%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.hero, main, footer { position: relative; z-index: 1; }
.hero {
  min-height: 92vh;
  padding: 24px clamp(18px, 4vw, 56px) 70px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(6, 16, 31, 0.98) 0%, rgba(6, 16, 31, 0.76) 48%, rgba(6, 16, 31, 0.30) 100%),
    url("./background.png") center right / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 52%, rgba(174,232,255,0.18), transparent 28rem),
    linear-gradient(180deg, transparent 72%, #07111f 100%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: -12vw;
  right: -12vw;
  bottom: -10vh;
  height: 34vh;
  background: linear-gradient(90deg, transparent, rgba(174,232,255,0.16), transparent);
  transform: rotate(-7deg);
  filter: blur(1px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), #8a1024);
  box-shadow: 0 16px 50px rgba(255, 59, 79, 0.32);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small, .muted { color: var(--muted); }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.top-actions a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1220px;
  min-height: 72vh;
  margin: 34px auto 0;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--ice);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-logo {
  display: block;
  width: min(280px, 58vw);
  max-height: 92px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 22px;
  filter: drop-shadow(0 18px 36px rgba(0,0,0,0.5));
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7vw, 6.9rem);
  line-height: 0.9;
  letter-spacing: 0;
}
h2 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 0.95; }
h3 { margin-bottom: 12px; font-size: 1.2rem; }
.lead {
  max-width: 680px;
  color: #c9d8e5;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}
.hero-buttons, .inline-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.primary-btn, .ghost-btn {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
}
.primary-btn { background: linear-gradient(135deg, var(--red), #b81830); box-shadow: 0 18px 50px rgba(255,59,79,0.34); }
.ghost-btn { border: 1px solid var(--line); background: rgba(255,255,255,0.08); }

.rink-card {
  position: relative;
  min-height: 470px;
  border: 1px solid rgba(174,232,255,0.26);
  border-radius: 32px;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.15), rgba(255,255,255,0.04)),
    radial-gradient(circle at 52% 48%, transparent 0 84px, rgba(255,59,79,0.72) 85px 88px, transparent 89px),
    linear-gradient(90deg, transparent 0 49.5%, rgba(255,255,255,0.24) 50%, transparent 50.5%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.24);
  overflow: hidden;
}
.hero-wallpaper-card {
  background:
    linear-gradient(180deg, rgba(2,10,20,0.16), rgba(2,10,20,0.72)),
    url("./background.png") center / cover no-repeat;
}
.rink-card::before, .rink-card::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(174,232,255,0.22);
  border-radius: 50%;
}
.rink-card::after {
  inset: auto -20% 16% auto;
  width: 280px;
  height: 280px;
  border-color: rgba(255,59,79,0.45);
}
.puck-orbit {
  position: absolute;
  width: 64px;
  height: 64px;
  right: 18%;
  top: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4f5b67, #05080d 62%);
  box-shadow: 0 22px 48px rgba(0,0,0,0.5);
}
.hero-trophy {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86%, 520px);
  max-height: 94%;
  object-fit: contain;
  transform: translate(-50%, -48%);
  filter: drop-shadow(0 42px 70px rgba(0,0,0,0.68));
  z-index: 1;
}
.hero-info-panel {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: min(72%, 360px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(2, 10, 20, 0.7);
  backdrop-filter: blur(18px);
  z-index: 2;
}
.hero-info-panel span,
.hero-info-panel small {
  display: block;
  color: var(--muted);
}
.hero-info-panel strong {
  display: block;
  margin: 4px 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}
.score-burst, .hero-match {
  position: absolute;
  left: 28px;
  right: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(2, 10, 20, 0.7);
  backdrop-filter: blur(18px);
  z-index: 2;
}
.score-burst { top: 28px; padding: 20px; }
.score-burst strong { display: block; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; }
.score-burst span { color: var(--muted); }
.hero-match { bottom: 28px; padding: 22px; }
.hero-match .teams { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 900; font-size: 1.15rem; }
.hero-match .score { color: var(--gold); font-size: 2rem; }

.section { max-width: 1220px; margin: 0 auto; padding: 52px clamp(18px, 4vw, 56px); }
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-strip article, .leaderboard-shell, .insights, .chart-card, .admin-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0,0,0,0.22);
  backdrop-filter: blur(18px);
}
.stat-strip article { padding: 22px; }
.stat-strip span { display: block; font-size: clamp(1.7rem, 3vw, 3rem); font-weight: 950; color: var(--gold); }
.stat-strip small { color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr); gap: 18px; }
.section-head { margin-bottom: 22px; }
.section-head.row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-head.compact h2 { font-size: 2.1rem; }
.section-note { color: var(--muted); font-weight: 800; }

.leaderboard-shell { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.08); }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
td { font-weight: 750; }
tr.top-one td { background: linear-gradient(90deg, rgba(255,211,106,0.18), transparent); }
.rank { color: var(--gold); font-weight: 950; }
.form-pill {
  display: inline-flex;
  align-items: center;
  min-width: 46px;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(100,242,178,0.14);
  color: var(--green);
}

.insights { padding: 22px; }
.insight-list { display: grid; gap: 12px; }
.insight {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}
.insight strong { display: block; margin-bottom: 5px; }
.insight span { color: var(--muted); line-height: 1.45; }

.today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.today-card {
  border: 1px solid rgba(174,232,255,0.24);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.055));
  box-shadow: 0 18px 70px rgba(0,0,0,0.2);
}
.today-card.live {
  border-color: rgba(100,242,178,0.52);
  box-shadow: 0 18px 70px rgba(100,242,178,0.08);
}
.today-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}
.today-status.live { color: var(--green); background: rgba(100,242,178,0.12); }
.search { display: grid; gap: 6px; color: var(--muted); min-width: min(100%, 320px); }
input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  outline: none;
}
select option { color: #06101f; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.match-groups { display: grid; gap: 22px; }
.group-section {
  border: 1px solid rgba(174,232,255,0.18);
  border-radius: 26px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(174,232,255,0.08), rgba(255,255,255,0.035));
}
.group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.group-title h3 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.group-title span { color: var(--muted); }
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.match-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.045));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(174,232,255,0.42);
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
}
.match-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.86rem; margin-bottom: 12px; }
.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.team { display: flex; align-items: center; gap: 8px; font-weight: 900; }
.team:last-child { justify-content: end; text-align: right; }
.match-score { min-width: 72px; text-align: center; color: var(--gold); font-size: 1.3rem; font-weight: 950; }
.match-picks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 0.82rem; }
.match-picks span, .pick-badge { border: 1px solid rgba(255,255,255,0.11); border-radius: 999px; padding: 5px 8px; background: rgba(0,0,0,0.16); }
.pick-badge.exact { color: var(--gold); border-color: rgba(255,211,106,0.46); background: rgba(255,211,106,0.12); }
.pick-badge.outcome { color: var(--green); border-color: rgba(100,242,178,0.38); background: rgba(100,242,178,0.10); }
.wide-search { max-width: 420px; margin-bottom: 18px; }
.player-picks { display: grid; gap: 10px; }
.player-pick {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.065);
}
.player-pick strong { display: block; }
.player-pick small { color: var(--muted); }
.player-pick-score { color: var(--gold); font-weight: 950; }
.compare-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}
.compare-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  flex: 1;
}
.compare-slot {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.compare-actions { display: flex; gap: 10px; }
.compare-date-filter { min-width: 180px; }
.compare-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.compare-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.065);
}
.compare-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.compare-card span { color: var(--muted); }
.compare-table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0,0,0,0.22);
}
.compare-table th,
.compare-table td {
  min-width: 150px;
  vertical-align: top;
}
.compare-table th:first-child,
.compare-table td:first-child {
  min-width: 250px;
  position: sticky;
  left: 0;
  background: rgba(7,17,31,0.96);
  z-index: 1;
}
.compare-tip {
  display: grid;
  gap: 5px;
}
.compare-tip strong { color: var(--gold); }
.compare-tip small { color: var(--muted); }

.match-dialog {
  width: min(940px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  border: 1px solid rgba(174,232,255,0.34);
  border-radius: 24px;
  padding: 0;
  color: var(--text);
  background: linear-gradient(145deg, rgba(9,22,38,0.98), rgba(12,19,31,0.98));
  box-shadow: var(--shadow);
}
.match-dialog::backdrop { background: rgba(0,0,0,0.68); backdrop-filter: blur(8px); }
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,0.08);
  font-size: 1.6rem;
  cursor: pointer;
}
.dialog-body { padding: 28px; }
.dialog-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding-right: 44px;
}
.dialog-title .team { font-size: clamp(1.1rem, 3vw, 1.7rem); }
.dialog-score { color: var(--gold); font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 950; }
.tips-table-shell { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
.tips-table td, .tips-table th { white-space: nowrap; }
.tips-table tr.is-exact td { background: rgba(255,211,106,0.12); }
.tips-table tr.is-outcome td { background: rgba(100,242,178,0.07); }

.admin-section { padding-bottom: 80px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-card { padding: 22px; }
.admin-card p { color: var(--muted); line-height: 1.5; }
.score-editor { display: grid; gap: 12px; }
.score-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.score-inputs span { color: var(--gold); font-weight: 950; }
.toggle { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.toggle input { width: auto; min-height: auto; }
.live-status {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(0,0,0,0.14);
  color: var(--muted);
  font-size: 0.9rem;
}
.live-status strong { color: var(--gold); }
.hidden { display: none; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero { min-height: auto; padding-bottom: 44px; }
  .topbar, .section-head.row { align-items: flex-start; flex-direction: column; }
  .hero-grid, .two-col, .admin-grid { grid-template-columns: 1fr; }
  .rink-card { min-height: 390px; border-radius: 24px; }
  .stat-strip, .match-grid, .today-grid { grid-template-columns: 1fr; }
  .filters { width: 100%; }
  .filters .search { width: 100%; }
  .player-pick { grid-template-columns: 1fr; }
  .compare-panel, .compare-controls, .compare-summary { grid-template-columns: 1fr; width: 100%; }
  .dialog-title { grid-template-columns: 1fr; text-align: left; }
  h1 { font-size: clamp(2.9rem, 15vw, 4.8rem); }
  .leaderboard th:nth-child(4), .leaderboard td:nth-child(4) { display: none; }
  th, td { padding: 13px 10px; }
  footer { flex-direction: column; }
}
