:root {
  --bg: #0e1412;
  --bg2: #16201c;
  --card: #1c2823;
  --line: #2a3b34;
  --text: #eef4f0;
  --muted: #9aafa5;
  --gold: #d4b45a;
  --green: #3dcf8a;
  --red: #ef6b6b;
  --navy: #1f4d3a;
  --college: #c9a24a;
  --nfl: #6ea8ff;
  --safe: max(16px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding-bottom: 96px; }
.game-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 768px) {
  .app { max-width: 980px; }
  .game-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .slip { width: min(980px, 100%) !important; }
}
.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(#121b18, #121b18ee);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 10px;
}
.brand { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: .08em; color: var(--gold); font-weight: 700; }
.brand small { color: var(--muted); font-size: 12px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tabs { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; }
.tab {
  border: 1px solid var(--line); background: var(--bg2); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; white-space: nowrap;
}
.tab.on { background: var(--navy); color: #fff; border-color: #2f6b52; }
.screen { padding: 14px 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.card h2, .card h3 { margin: 0 0 10px; font-size: 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select {
  width: 100%; background: #101816; border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.btn {
  width: 100%; border: 0; border-radius: 12px; padding: 12px;
  background: var(--gold); color: #1a1406; font-weight: 700; margin-top: 12px;
}
.btn.sec { background: #24332d; color: var(--text); font-weight: 600; }
.btn.danger { background: #5a2424; color: #ffd6d6; }
.btn:disabled { opacity: .45; }
.pool-item, .stand-item, .ticket {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.pool-item:last-child, .stand-item:last-child, .ticket:last-child { border-bottom: 0; }
.kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 18px 0 8px; }
.kicker.nfl { color: var(--nfl); }
.game {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; margin-bottom: 10px;
}
.game-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.teams { font-weight: 650; margin-bottom: 8px; display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
.tm-logo { width:26px; height:26px; object-fit:contain; flex:0 0 26px; }
.markets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick {
  border: 1px solid var(--line); background: #141d1a; border-radius: 10px;
  padding: 8px 6px; text-align: center; font-size: 13px;
}
.pick b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.pick.on { border-color: var(--gold); background: #2a2616; }
.pick.lock { opacity: .45; }
.score { color: var(--green); font-variant-numeric: tabular-nums; }
.score-stack { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.score-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 650; }
.score-line .score { font-size: 20px; }
.modal-back {
  position: fixed; inset: 0; background: #0008; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; width: min(480px, 100%); max-height: 80dvh; overflow: auto;
}
.pop-type { font-size: 17px; color: var(--muted); margin-bottom: 8px; }
.pop-team { font-size: 17px; line-height: 1.35; font-weight: 650; }
.pop-win { font-size: 17px; line-height: 1.35; margin: 2px 0 8px; }
.slip {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(520px, 100%); z-index: 30;
  background: #121c18; border-top: 1px solid var(--line);
  padding: 10px 16px var(--safe);
}
.slip-head { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); font-size: 13px; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.neg { color: var(--red); font-weight: 700; }
.pill { font-size: 11px; border-radius: 999px; padding: 2px 8px; background: #24332d; color: var(--muted); }
.pill.out { background: #4a1f1f; color: #ffb4b4; }
.msg { font-size: 13px; color: var(--red); min-height: 1.2em; margin-top: 6px; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .16em; color: var(--gold); }
.empty { color: var(--muted); padding: 20px 8px; text-align: center; }
.linkish { background: none; border: 0; color: var(--gold); padding: 0; width: auto; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.radios label { margin: 0; color: var(--text); font-size: 13px; display: flex; gap: 6px; align-items: center; background: #141d1a; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.radios input { width: auto; }
.table-wrap { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 12px; }
table.admin th, table.admin td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
table.admin th { color: var(--gold); font-weight: 600; }
table.admin input[type="text"] { padding: 6px 8px; min-width: 90px; }
.statgrid { display: grid; grid-template-columns: 1.1fr 0.7fr 0.9fr 0.7fr 0.7fr; gap: 4px; font-size: 12px; }
.wmgrid { grid-template-columns: 1.1fr 0.5fr 1fr 1.2fr 0.7fr; }
.statgrid .h { color: var(--muted); }
.ticket.alt { background: #24332d; margin: 0 -14px; padding: 12px 14px; border-radius: 10px; }
.score-game.mine { border-color: var(--gold); background: #2a2616; }
.ok-banner { background: #163326; border: 1px solid #2f6b52; color: var(--green); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.banner { background: #2a2616; border: 1px solid #5a4a22; color: #ead9a0; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.check { width: auto; }
.tab-select {
  border: 1px solid var(--line); background: var(--bg2); color: var(--muted);
  border-radius: 999px; padding: 7px 10px; width: auto;
}
.tab-select.on { background: var(--navy); color: #fff; border-color: #2f6b52; }
.ticket { flex-direction: column; align-items: stretch; }
.pick-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pick-legs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 17px; line-height: 1.35; }
.pick-leg { padding: 4px 0; border-bottom: 1px solid var(--line); }
.pick-leg:last-child { border-bottom: 0; }
button.pick-final {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; font: inherit; padding: 4px 0; cursor: pointer;
}
.pick-leg.ok, button.pick-final.ok, .pop-team.ok { color: var(--green) !important; font-weight: 700; }
.pick-leg.neg, button.pick-final.neg, .pop-team.neg { color: var(--red) !important; font-weight: 700; }
.net-flat { color: var(--text); font-weight: 700; }
