:root {
  --bg: #081424;
  --bg-2: #0b1c33;
  --bg-card: #0f2138;
  --bg-card-2: #16294a;
  --border: #1e375d;
  --text: #eaf2ff;
  --muted: #8198bd;
  --accent: #1493ff;       /* FanDuel electric blue */
  --accent-hi: #4db0ff;
  --accent-deep: #0a6dff;
  --pos: #21d07a;          /* alive / win green */
  --pos-dim: rgba(33, 208, 122, 0.14);
  --gold: #ffc83d;         /* draw / highlight */
  --danger: #ff495f;       /* loss / out */
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(20, 147, 255, 0.4), 0 8px 26px rgba(20, 147, 255, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(20, 147, 255, 0.22) 0%, transparent 60%),
    radial-gradient(820px 480px at 0% 0%, rgba(10, 109, 255, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #0a1a30 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

#app { max-width: 980px; margin: 0 auto; padding: 22px 20px 90px; }

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 900; letter-spacing: -0.03em; text-transform: uppercase; }
.brand .ball {
  font-size: 22px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent-deep)); box-shadow: var(--glow);
}
.brand small { display: block; font-size: 10px; font-weight: 700; color: var(--accent-hi); letter-spacing: 0.18em; margin-top: 2px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--bg-card) 0%, #0c1c31 100%);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

/* ---------- hero / landing ---------- */
.hero { text-align: center; padding: 26px 20px 6px; }
.hero h1 { font-size: 44px; font-weight: 900; letter-spacing: -0.04em; margin-bottom: 12px; line-height: 1.02; text-transform: uppercase; }
.hero h1 .grad { background: linear-gradient(92deg, var(--accent-hi), var(--accent) 60%, var(--accent-deep)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--muted); max-width: 540px; margin: 0 auto 6px; font-size: 15px; }
.tabs { display: flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 13px; margin: 18px 0; border: 1px solid var(--border); }
.tabs button { flex: 1; padding: 12px; border: none; background: transparent; color: var(--muted); font-weight: 800; font-size: 14px; border-radius: 9px; cursor: pointer; transition: 0.15s; font-family: inherit; letter-spacing: -0.01em; }
.tabs button.active { background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); color: #fff; box-shadow: 0 6px 18px rgba(20, 147, 255, 0.35); }

/* ---------- forms ---------- */
label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); margin: 14px 0 7px; text-transform: uppercase; letter-spacing: 0.09em; }
input[type="text"], input[type="email"] {
  width: 100%; padding: 14px 15px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit; font-weight: 600; transition: 0.15s;
}
input[type="text"]::placeholder, input[type="email"]::placeholder { color: #5b7298; font-weight: 500; }
input[type="text"]:focus, input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20, 147, 255, 0.18); }
label .opt { color: #5b7298; font-weight: 600; text-transform: none; letter-spacing: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 20px; padding: 15px; border: none; border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); color: #fff; font-size: 15px; font-weight: 800;
  font-family: inherit; cursor: pointer; transition: 0.15s; letter-spacing: -0.01em;
  box-shadow: 0 8px 22px rgba(20, 147, 255, 0.35);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(20, 147, 255, 0.45); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--bg-card-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn.small { width: auto; margin: 0; padding: 10px 15px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: linear-gradient(180deg, #ff6273, var(--danger)); color: #fff; }

.error { background: rgba(255, 73, 95, 0.12); border: 1px solid rgba(255, 73, 95, 0.45); color: #ffb0ba; padding: 12px 14px; border-radius: 11px; font-size: 13.5px; margin-top: 14px; font-weight: 600; }
.notice { background: rgba(20, 147, 255, 0.12); border: 1px solid rgba(20, 147, 255, 0.45); color: #b3dcff; padding: 12px 14px; border-radius: 11px; font-size: 13.5px; margin-top: 14px; font-weight: 600; }

/* ---------- pool header ---------- */
.poolhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.poolhead h2 { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.codechip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border: 1px dashed var(--accent); padding: 9px 13px; border-radius: 11px; font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.codechip b { color: var(--accent-hi); letter-spacing: 0.16em; font-size: 15px; }
.statusline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pill { font-size: 11.5px; font-weight: 800; padding: 6px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.pill.alive { background: var(--pos-dim); color: var(--pos); box-shadow: inset 0 0 0 1px rgba(33, 208, 122, 0.3); }
.pill.out { background: rgba(255, 73, 95, 0.16); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 73, 95, 0.3); }
.pill.muted { background: var(--bg-card-2); color: var(--muted); }

/* ---------- rounds timeline ---------- */
.timeline { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px; }
.rnode { flex: 0 0 auto; text-align: center; min-width: 96px; padding: 13px 10px; border-radius: 13px; background: var(--bg-card-2); border: 1.5px solid var(--border); transition: 0.15s; }
.rnode .seq { font-size: 10px; color: var(--muted); font-weight: 800; letter-spacing: 0.06em; }
.rnode .nm { font-size: 12.5px; font-weight: 700; margin: 3px 0 7px; letter-spacing: -0.01em; }
.rnode .st { font-size: 9.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.rnode.open { border-color: var(--accent); background: linear-gradient(180deg, rgba(20, 147, 255, 0.16), var(--bg-card-2)); box-shadow: 0 0 0 1px rgba(20, 147, 255, 0.25); }
.rnode.open .st { color: var(--accent-hi); }
.rnode.scored .st { color: var(--pos); }
.rnode.locked .st { color: var(--muted); opacity: 0.65; }
.rnode .yourpick { font-size: 18px; margin-top: 5px; min-height: 22px; }

/* ---------- team grid ---------- */
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 9px; margin-top: 8px; }
.team {
  display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 12px;
  background: var(--bg-card-2); border: 1.5px solid var(--border); cursor: pointer; transition: 0.12s; text-align: left;
  font-size: 13.5px; font-weight: 700; color: var(--text); width: 100%; font-family: inherit;
}
.team .fl { font-size: 21px; line-height: 1; }
.team .meta { display: flex; flex-direction: column; min-width: 0; }
.team .gp { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.team:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.team.selected { border-color: var(--accent); background: linear-gradient(180deg, rgba(20, 147, 255, 0.2), rgba(20, 147, 255, 0.08)); box-shadow: var(--glow); }
.team.used { opacity: 0.3; cursor: not-allowed; filter: grayscale(0.7); }
.team .cnt { margin-left: auto; font-size: 11px; color: var(--accent-hi); background: rgba(20, 147, 255, 0.14); padding: 2px 8px; border-radius: 999px; font-weight: 800; }

/* ---------- bracket ties / matchups ---------- */
.ties { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 8px; }
.tie {
  display: flex; align-items: stretch; gap: 7px; padding: 8px;
  background: var(--bg-card-2); border: 1px solid var(--border); border-radius: 13px;
}
.tie .side {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text);
  border: 1.5px solid transparent; background: transparent; font-family: inherit; letter-spacing: -0.01em;
}
.tie .side.right { flex-direction: row-reverse; text-align: right; }
.tie .side .fl { font-size: 19px; line-height: 1; }
.tie .side .snm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tie button.side { cursor: pointer; background: var(--bg); border-color: var(--border); transition: 0.12s; }
.tie button.side:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.tie button.side:disabled { opacity: 0.35; cursor: not-allowed; }
.tie .side.selected { border-color: var(--accent); background: rgba(20, 147, 255, 0.16); box-shadow: var(--glow); }
.tie .side.won { color: var(--pos); }
.tie .side.lost { opacity: 0.45; }
.tie .side .cnt { font-size: 10px; color: var(--accent-hi); background: rgba(20, 147, 255, 0.14); padding: 1px 6px; border-radius: 999px; font-weight: 800; }
.tie .mid {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 64px; font-size: 10px; color: var(--muted); font-weight: 800; text-align: center;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.tie .mid .score { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tie .mid .live { color: var(--danger); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- team detail dropdown (next matches + live group table) ---------- */
.team-detail {
  margin-top: 14px; padding: 16px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(20, 147, 255, 0.08), rgba(20, 147, 255, 0.02));
  border: 1px solid rgba(20, 147, 255, 0.35);
  animation: slideIn 0.18s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.team-detail .td-head { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.team-detail .td-head .fl { font-size: 20px; }
.team-detail .td-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
@media (max-width: 640px) { .team-detail .td-cols { grid-template-columns: 1fr; } }
.td-match {
  display: flex; align-items: center; gap: 9px; padding: 8px 2px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.td-match:last-of-type { border-bottom: none; }
.td-match .td-round {
  flex: 0 0 auto; font-size: 9.5px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-hi); background: rgba(20, 147, 255, 0.13); padding: 3px 8px; border-radius: 999px;
}
.td-match .td-opp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-match .td-when { flex: 0 0 auto; font-size: 11px; color: var(--muted); font-weight: 700; }
.td-match .live { color: var(--danger); font-weight: 900; animation: pulse 1.4s ease-in-out infinite; }

.gtable { width: 100%; border-collapse: collapse; }
.gtable th, .gtable td { padding: 6px 5px; font-size: 12px; text-align: center; border-bottom: 1px solid var(--border); }
.gtable th { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; }
.gtable th:nth-child(2), .gtable td:nth-child(2) { text-align: left; }
.gtable td:nth-child(2) { font-weight: 700; white-space: nowrap; }
.gtable tr:last-child td { border-bottom: none; }
.gtable tr.sel td { background: rgba(20, 147, 255, 0.12); }
.gtable tr.q td:first-child { box-shadow: inset 2.5px 0 0 var(--pos); }
.gtable .live { color: var(--danger); }

.roundchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg-card-2); color: var(--muted); font-weight: 800; font-size: 12px;
  font-family: inherit; cursor: pointer; transition: 0.12s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: linear-gradient(180deg, var(--accent-hi), var(--accent-deep)); color: #fff; border-color: transparent; }

/* ---------- standings ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; font-size: 14px; border-bottom: 1px solid var(--border); }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 800; }
tr:last-child td { border-bottom: none; }
td { font-weight: 600; }
td .rank { color: var(--accent-hi); font-weight: 900; font-size: 15px; }
.me-row { background: rgba(20, 147, 255, 0.08); }
.dead { color: var(--muted); }
.champ-banner {
  background: linear-gradient(100deg, rgba(255, 200, 61, 0.2), rgba(20, 147, 255, 0.18));
  border: 1px solid rgba(255, 200, 61, 0.45); border-radius: var(--radius); padding: 20px; text-align: center;
  font-size: 18px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(255, 200, 61, 0.15);
}

/* ---------- admin ---------- */
.admin-team-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
.admin-team-row .nm { flex: 1; }
.ob { border: 1px solid var(--border); background: var(--bg-card-2); color: var(--muted); width: 36px; height: 32px; border-radius: 9px; font-weight: 900; cursor: pointer; font-size: 13px; font-family: inherit; transition: 0.12s; }
.ob:hover { border-color: var(--accent); }
.ob.W.on { background: var(--pos); color: #04220f; border-color: var(--pos); }
.ob.D.on { background: var(--gold); color: #2a2000; border-color: var(--gold); }
.ob.L.on { background: var(--danger); color: #2a0008; border-color: var(--danger); }
.adminbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
select { padding: 10px 13px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; font-weight: 600; }

/* ---------- segmented countdown clock ---------- */
.deadline-clock {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  margin: 4px 0 16px; padding: 16px 14px 13px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(20, 147, 255, 0.12), rgba(20, 147, 255, 0.04));
  border: 1px solid rgba(20, 147, 255, 0.4);
}
.deadline-clock .dc-label { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-hi); }
.deadline-clock .dc-digits { display: flex; align-items: center; gap: 7px; }
.deadline-clock .dc-seg {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 58px; padding: 8px 6px 6px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
}
.deadline-clock .dc-seg b { font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.deadline-clock .dc-seg span { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.deadline-clock .dc-colon { font-size: 20px; font-weight: 900; color: var(--muted); padding-bottom: 12px; }
.deadline-clock .dc-when { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.deadline-clock.urgent { border-color: rgba(255, 200, 61, 0.55); background: linear-gradient(180deg, rgba(255, 200, 61, 0.14), rgba(255, 200, 61, 0.04)); }
.deadline-clock.urgent .dc-label { color: var(--gold); }
.deadline-clock.urgent .dc-seg b { color: var(--gold); }
.deadline-clock.critical { border-color: rgba(255, 73, 95, 0.6); background: linear-gradient(180deg, rgba(255, 73, 95, 0.15), rgba(255, 73, 95, 0.05)); animation: pulse 1.2s ease-in-out infinite; }
.deadline-clock.critical .dc-label { color: var(--danger); }
.deadline-clock.critical .dc-seg b { color: var(--danger); }
@media (max-width: 460px) {
  .deadline-clock .dc-seg { min-width: 48px; }
  .deadline-clock .dc-seg b { font-size: 21px; }
}

/* ---------- deadline / countdown ---------- */
.deadline {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin: 4px 0 14px; padding: 11px 14px; border-radius: 11px; font-size: 14px; font-weight: 700;
  background: rgba(20, 147, 255, 0.1); border: 1px solid rgba(20, 147, 255, 0.4); color: var(--accent-hi);
}
.deadline b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.deadline.urgent { background: rgba(255, 200, 61, 0.12); border-color: rgba(255, 200, 61, 0.5); color: var(--gold); }
.deadline.closed { background: rgba(255, 73, 95, 0.12); border-color: rgba(255, 73, 95, 0.45); color: #ffb0ba; }

input[type="datetime-local"] {
  padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit; font-weight: 600;
  color-scheme: dark;
}
input[type="datetime-local"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20, 147, 255, 0.18); }

.footer-link { text-align: center; margin-top: 26px; color: var(--muted); font-size: 13px; }
.footer-link a, .footer-link b { color: var(--accent-hi); cursor: pointer; text-decoration: none; }
.muted { color: var(--muted); }
.sectionlabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 800; margin: 4px 0 10px; }
