:root {
  color-scheme: dark;
  --bg: #050814;
  --panel: rgba(17, 24, 39, .78);
  --panel-2: rgba(2, 6, 23, .82);
  --line: rgba(255, 255, 255, .11);
  --gold: #d4af37;
  --gold-2: #f7d46a;
  --green: #34d399;
  --red: #fb7185;
  --text: #f8fafc;
  --muted: #9ca3af;
  --radius: 8px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(212, 175, 55, .18), transparent 34rem),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, .12), transparent 28rem),
    linear-gradient(140deg, #0f172a 0%, var(--bg) 55%, #020617 100%);
  color: var(--text);
}
button, input, select { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  color: inherit;
  border-radius: var(--radius);
  min-height: 42px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
input, select {
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, .76);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(212, 175, 55, .75); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: right; }
th { color: var(--gold-2); font-size: 13px; white-space: nowrap; }
td { color: #e5e7eb; }
.hidden { display: none !important; }
.wrap { width: min(1180px, calc(100% - 24px)); margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,.24);
}
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.auth-hero { padding: 28px; background: rgba(2, 6, 23, .62); border-left: 1px solid var(--line); }
.auth-form { padding: 24px; }
.auth-notes { margin-top: 22px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, .55);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(212,175,55,.2), rgba(255,255,255,.03));
  color: var(--gold-2);
  font-size: 27px;
  font-weight: 900;
}
h1 { margin: 0; color: var(--gold-2); font-size: clamp(26px, 4vw, 44px); letter-spacing: 0; }
h2, h3 { margin: 0; }
h2 { color: var(--gold-2); font-size: 24px; }
h3 { color: #fff; font-size: 17px; }
.subtitle { margin: 5px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grid { display: grid; gap: 12px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { flex: 1; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.tab.active { background: var(--gold); color: #080808; font-weight: 900; }
.form-stack { display: grid; gap: 10px; }
.message { min-height: 22px; color: var(--gold-2); margin-top: 8px; }
.app-header { padding: 28px 0 18px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 36px; }
.side { padding: 12px; position: sticky; top: 12px; }
.main { padding: 18px; min-height: 620px; }
.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  color: #d1d5db;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  text-align: right;
}
.nav-btn.active { background: linear-gradient(180deg, #d4af37, #b8860b); color: #080808; font-weight: 800; box-shadow: 0 0 18px rgba(212,175,55,.25); }
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }
.session-card { margin-top: 14px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: #e5e7eb; font-size: 12px; white-space: nowrap; margin-top: 8px; }
.badge.gold { color: #111827; background: var(--gold-2); border-color: transparent; font-weight: 900; }
.badge.green { color: #042f2e; background: var(--green); border-color: transparent; font-weight: 900; }
.badge.red { color: white; background: rgba(190, 18, 60, .9); border-color: transparent; }
.btn-primary { background: linear-gradient(180deg, #d4af37, #b8860b); color: #060606; font-weight: 900; padding: 0 16px; }
.btn-blue { background: #0369a1; color: white; font-weight: 800; padding: 0 14px; }
.btn-green { background: #047857; color: white; font-weight: 800; padding: 0 14px; }
.btn-red { background: #be123c; color: white; font-weight: 800; padding: 0 14px; }
.btn-ghost { background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 0 14px; }
.view { display: none; }
.view.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.match-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.teams { font-size: 20px; font-weight: 900; color: #fff; }
.date-line { color: var(--muted); margin-top: 4px; }
.prediction-box { display: grid; grid-template-columns: 72px 24px 72px auto; gap: 8px; align-items: center; }
.prediction-box input { text-align: center; font-weight: 900; }
.score-inputs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.score-inputs input { text-align: center; font-weight: 900; font-size: 22px; color: var(--gold-2); }
.vs { color: var(--muted); font-weight: 900; padding-bottom: 11px; }
.footer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ranking-row:first-child td { color: var(--gold-2); font-weight: 900; }
.group-list { display: grid; gap: 8px; margin-top: 10px; }
.group-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; }
.group-position {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: var(--radius);
  background: rgba(212, 175, 55, .15);
  border: 1px solid rgba(212, 175, 55, .35);
  color: var(--gold-2);
  font-weight: 900;
}
.group-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.group-admin-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 110px; gap: 8px; align-items: center; }
@media (max-width: 860px) {
  .shell, .auth-card { grid-template-columns: 1fr; }
  .side { position: static; }
  .nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav-btn { margin-bottom: 0; }
  .two, .three, .four { grid-template-columns: 1fr; }
  .auth-hero { border-left: 0; border-bottom: 1px solid var(--line); }
  .match-card { grid-template-columns: 1fr; }
  .prediction-box { grid-template-columns: 1fr auto 1fr; }
  .prediction-box button { grid-column: 1 / -1; }
  .group-admin-row { grid-template-columns: 36px minmax(0, 1fr); }
  .group-admin-row select { grid-column: 2; }
}
