:root {
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f3f6fa;
  --cream: #fff8ef;
  --red: #c8102e;
  --blue: #0057a8;
  --blue-dark: #0a3264;
  --sky: #1fb6ff;
  --green: #118847;
  --charcoal: #2b2f39;
  --gold: #d8ad42;
  --ok: #027a48;
  --danger: #b42318;
  --shadow: 0 22px 52px rgba(10, 50, 100, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.84), rgba(239, 245, 251, 0.9)),
    radial-gradient(circle at top, rgba(31, 182, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(200, 16, 46, 0.08), rgba(255, 255, 255, 0.6) 24%, rgba(17, 136, 71, 0.08) 56%, rgba(0, 87, 168, 0.1)),
    url("https://i.ytimg.com/vi/KYUpj9f0GBg/maxresdefault.jpg") center / cover fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 184, 56, 0.08) 0 16%, transparent 16% 38%, rgba(0, 87, 168, 0.08) 38% 55%, transparent 55%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.14));
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  min-height: 100vh;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
}

.hero-copy {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: clamp(12px, 2vw, 24px) 0;
  padding-top: clamp(10px, 1vw, 18px);
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 10% 8% auto;
  height: 68%;
  border-radius: 32px;
  background:
    radial-gradient(circle at top, rgba(255, 184, 56, 0.24), transparent 24%),
    linear-gradient(135deg, rgba(0, 87, 168, 0.16), rgba(255, 255, 255, 0.7) 40%, rgba(17, 136, 71, 0.14));
  filter: blur(2px);
  transform: rotate(-6deg);
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 14px;
  width: min(560px, 100%);
  padding: clamp(18px, 3vw, 28px);
}

.login-side {
  display: grid;
  gap: 18px;
  align-content: start;
  padding-top: clamp(10px, 1vw, 18px);
}

.login-logo-wrap {
  display: grid;
  place-items: center;
  width: min(420px, 78vw);
  padding: 18px;
  border: 1px solid rgba(0, 87, 168, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 184, 56, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 26px 60px rgba(10, 50, 100, 0.12);
}

.login-logo {
  position: relative;
  display: block;
  width: min(100%, 300px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 32px rgba(10, 50, 100, 0.18));
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-left: 4px solid var(--red);
  padding-left: 10px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 620px;
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
}

.hero-copy p {
  max-width: 520px;
  color: #475467;
  font-size: 18px;
  line-height: 1.6;
}

.login-panel,
.panel,
.match,
.leaderboard-row,
.front-empty {
  position: relative;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 28px;
  overflow: hidden;
}

.rules-box {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 222, 232, 0.92);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.rules-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--gold), var(--sky) 32%, var(--red) 58%, var(--green) 80%, var(--charcoal));
}

.rules-box h2 {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 20px;
  line-height: 1.2;
}

.rules-box ul {
  margin: 0;
  padding-left: 20px;
  color: #314155;
  line-height: 1.55;
}

.rules-box li + li {
  margin-top: 7px;
}

.login-panel::before,
.panel::before,
.match::before,
.front-empty::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--gold), var(--sky) 32%, var(--red) 58%, var(--green) 80%, var(--charcoal));
}

.login-brand,
.brand,
.userbar,
.toolbar,
.tabs,
.score-row,
.match-head,
.bet-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.login-brand {
  gap: 14px;
  margin-bottom: 18px;
}

.club-mark {
  display: block;
  flex: 0 0 auto;
  width: 52px;
  height: 68px;
  object-fit: contain;
}

.club-mark.large {
  width: 72px;
  height: 96px;
}

.wc-mark {
  filter: drop-shadow(0 10px 18px rgba(10, 50, 100, 0.14));
}

.chant-strip {
  margin: 0 -28px 18px;
  padding: 10px 28px;
  color: var(--blue-dark);
  background: linear-gradient(90deg, rgba(200, 16, 46, 0.12), white, rgba(0, 87, 168, 0.12));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  color: white;
  background:
    linear-gradient(90deg, rgba(255, 184, 56, 0.18), transparent 18%, transparent 82%, rgba(31, 182, 255, 0.18)),
    linear-gradient(100deg, #0a2d63, #0d4c8d 56%, #12834c);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 12px 30px rgba(10, 50, 100, 0.18);
}

.brand-logo {
  display: block;
  width: 50px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

h1,
h2,
p {
  margin-top: 0;
}

.brand h1,
.login-panel h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.brand p,
.login-panel p,
.fineprint,
.meta {
  color: var(--muted);
}

.brand p {
  color: rgba(255, 255, 255, 0.82);
}

.brand p,
.login-panel p,
.fineprint {
  margin: 6px 0 0;
  font-size: 14px;
}

.meta {
  font-size: 13px;
}

.userbar {
  justify-content: flex-end;
}

.content {
  position: relative;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 32px) 42px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.season-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.season-control label {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.tabs {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 87, 168, 0.14);
  border-radius: 12px;
  padding: 4px;
}

.tab,
.ghost,
.primary,
.danger-btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 13px;
  font-weight: 800;
}

.tab {
  background: transparent;
  color: var(--muted);
}

.tab.active,
.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.ghost {
  color: var(--blue-dark);
  background: white;
  border: 1px solid rgba(0, 87, 168, 0.18);
}

.danger-btn {
  color: var(--danger);
  background: #fff5f4;
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.primary:disabled,
.danger-btn:disabled,
.choice:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.compact-input,
.score-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

.field input:focus,
.field select:focus,
.compact-input:focus,
.score-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 87, 168, 0.13);
  outline: 0;
}

.compact-input {
  max-width: 230px;
}

.score-input {
  max-width: 94px;
  text-align: center;
}

.notice {
  margin-top: 14px;
  border-left: 4px solid var(--red);
  background: #fff7ed;
  padding: 10px 12px;
  color: #7c2d12;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 16px;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.match-list {
  display: grid;
  gap: 12px;
}

.match {
  padding: 14px;
  overflow: hidden;
}

.match-head {
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.teams {
  min-width: 220px;
}

.teams strong {
  display: block;
  font-size: 17px;
}

.teams strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 18px;
  margin-right: 9px;
  vertical-align: -3px;
  background: linear-gradient(180deg, var(--red) 0 50%, var(--blue) 50%);
  border-radius: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.pill.locked {
  background: #fef3f2;
  color: var(--danger);
}

.bet-grid {
  align-items: end;
}

.choice-group {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  gap: 6px;
}

.choice {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #edf2f7;
  color: var(--ink);
  font-weight: 900;
}

.choice.selected {
  background: var(--red);
  color: white;
  border-color: #8f0e23;
}

.prediction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
}

.prediction-table th,
.prediction-table td {
  padding: 9px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.prediction-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.prediction-table td.hit-cell {
  background: #dcfae6;
  color: #05603a;
  font-weight: 900;
}

.bet-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.bet-status.submitted {
  color: var(--blue-dark);
  background: rgba(0, 87, 168, 0.10);
}

.bet-status.visible {
  color: var(--ok);
  background: #ecfdf3;
}

.bet-status.missing {
  color: var(--muted);
  background: var(--soft);
}

.leaderboard {
  display: grid;
  gap: 8px;
}

.next-match-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.next-match {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 184, 56, 0.08), rgba(31, 182, 255, 0.06)),
    rgba(243, 246, 250, 0.78);
  padding: 10px;
}

.next-match strong {
  color: var(--blue-dark);
}

.next-match span,
.next-match small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.stats-view {
  display: grid;
  gap: 16px;
}

.stat-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--gold), var(--sky) 32%, var(--red) 58%, var(--green) 80%, var(--charcoal));
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  color: var(--blue-dark);
  font-size: 42px;
  line-height: 1;
}

.stat-card p {
  margin: 8px 0 4px;
  font-weight: 900;
}

.stat-card small {
  color: var(--muted);
  line-height: 1.4;
}

.rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--blue));
  color: white;
  font-weight: 900;
}

.points {
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 900;
}

.admin-view {
  display: grid;
  gap: 16px;
}

.admin-add-user,
.admin-user-grid,
.admin-points-grid,
.admin-grid {
  display: grid;
  gap: 8px;
  align-items: center;
}

.admin-add-user {
  grid-template-columns: minmax(110px, 180px) minmax(130px, 220px) minmax(130px, 220px) 100px 90px;
}

.admin-user-grid {
  grid-template-columns: 130px minmax(140px, 1fr) minmax(150px, 220px) 96px 180px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.admin-points-grid {
  grid-template-columns: minmax(170px, 1fr) 110px 90px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.admin-grid {
  grid-template-columns: minmax(170px, 1fr) 180px 96px 90px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.admin-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-actions,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.auto-sync-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 12px;
  border: 1px solid rgba(0, 87, 168, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

.auto-sync-status strong {
  color: var(--blue-dark);
}

.danger-text {
  color: var(--danger);
}

.reminder-grid,
.mini-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reminder-card,
.mini-bar,
.sync-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 246, 250, 0.78);
  padding: 10px;
}

.reminder-card p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.reminder-card span,
.mini-bar small {
  color: var(--muted);
}

.mini-bar strong {
  display: block;
  color: var(--blue-dark);
  font-size: 22px;
}

.round-graph {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 10px;
  align-items: end;
}

.round-graph-row {
  display: grid;
  gap: 6px;
  min-height: 160px;
  align-content: end;
}

.round-graph-row > strong {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.round-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 3px;
  height: 118px;
  border-bottom: 1px solid var(--line);
}

.round-bar {
  position: relative;
  display: grid;
  align-items: end;
  height: 100%;
  min-width: 0;
}

.round-bar i {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--red), var(--blue));
}

.round-bar small {
  position: absolute;
  inset: auto 0 2px;
  color: white;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.result-preview {
  grid-column: 1 / -1;
}

.compact-table {
  margin: 4px 0 8px;
  background: white;
}

.sync-list {
  display: grid;
  gap: 8px;
}

.sync-row {
  display: grid;
  grid-template-columns: 24px 80px minmax(160px, 1fr) 60px 120px;
  align-items: center;
  gap: 8px;
}

.sync-row em {
  color: var(--ok);
  font-style: normal;
  font-weight: 900;
}

code {
  white-space: normal;
  word-break: break-word;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.front-empty {
  min-height: 380px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 42px;
  overflow: hidden;
  text-align: center;
}

.front-empty::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  inset: auto -60px -70px auto;
  background: url("/static/wclogo.PNG") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.front-empty h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(30px, 4vw, 48px);
}

.front-empty p {
  max-width: 620px;
  color: #475467;
  line-height: 1.6;
}

.stadium-lines {
  display: block;
  width: min(360px, 80%);
  height: 96px;
  border: 2px solid rgba(0, 87, 168, 0.18);
  border-bottom: 0;
  border-radius: 220px 220px 0 0;
  background:
    radial-gradient(circle at top, rgba(255, 184, 56, 0.18), transparent 38%),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(31, 182, 255, 0.16) 25px 27px);
}

@media (max-width: 900px) {
  .login-screen,
  .layout,
  .stat-columns,
  .stats-grid,
  .reminder-grid,
  .mini-bars {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    justify-items: center;
    text-align: center;
  }

  .login-side {
    padding-top: 0;
  }

  .hero-copy::before {
    inset: 14% 4% auto;
    height: 58%;
  }

  .app-top,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .userbar {
    justify-content: space-between;
  }

  .season-control {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-input {
    max-width: none;
  }

  .admin-add-user,
  .admin-user-grid,
  .admin-points-grid,
  .admin-grid,
  .sync-row {
    grid-template-columns: 1fr;
  }
}
