
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  --bg:#f6f2e7; --surface:#ffffff; --surface-2:#f0e9d6;
  --border:#ddd0ab; --border-strong:#c7b382;
  --gold:#8a6416; --gold-bright:#6b4d10; --on-gold:#fffaf0;
  --text:#221f16; --text-dim:#6b6250;
  --good:#2f7a45; --good-bg:#e3efe4; --bad:#a83e35; --bad-bg:#f5e4e1; --warn:#a8631f; --warn-bg:#f3e6d3;
  --radius:10px;
  --font-display:'Fraunces',Georgia,'Times New Roman',serif;
  --font-body:'Manrope',-apple-system,'Segoe UI',Roboto,sans-serif;
  --font-mono:'JetBrains Mono','SFMono-Regular',Consolas,monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0d0c0a; --surface:#18160f; --surface-2:#221f16;
    --border:#3a331f; --border-strong:#57492a;
    --gold:#c9a227; --gold-bright:#e7c667; --on-gold:#171207;
    --text:#f4efe2; --text-dim:#a89e86;
    --good:#4f9d63; --good-bg:#173322; --bad:#c1554b; --bad-bg:#37201d; --warn:#d99a3d; --warn-bg:#3a2b13;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0d0c0a; --surface:#18160f; --surface-2:#221f16;
  --border:#3a331f; --border-strong:#57492a;
  --gold:#c9a227; --gold-bright:#e7c667; --on-gold:#171207;
  --text:#f4efe2; --text-dim:#a89e86;
  --good:#4f9d63; --good-bg:#173322; --bad:#c1554b; --bad-bg:#37201d; --warn:#d99a3d; --warn-bg:#3a2b13;
  color-scheme: dark;
}

*{box-sizing:border-box;}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--font-body); -webkit-font-smoothing:antialiased;
  padding-bottom:78px;
}
h1,h2,h3{ font-family:var(--font-display); text-wrap:balance; margin:0; }
.mono{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
button{ font-family:inherit; }
input,select,textarea{ font-family:inherit; font-size:15px; }

.shell{ max-width:520px; margin:0 auto; min-height:100vh; position:relative; }

/* header */
.topbar{
  position:sticky; top:0; z-index:20; background:var(--bg);
  border-bottom:1px solid var(--border); padding:14px 18px 12px;
}
.eyebrow{
  font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--gold);
  font-weight:700; display:flex; align-items:center; gap:6px; margin-bottom:2px;
}
.eyebrow .dot{ width:5px;height:5px;border-radius:50%;background:var(--gold); }
.topbar-row{ display:flex; align-items:flex-end; justify-content:space-between; gap:10px; }
.page-title{ font-size:24px; font-weight:600; }
.id-chip{
  border:1px solid var(--border-strong); background:var(--surface-2); color:var(--text);
  border-radius:999px; padding:7px 12px 7px 8px; font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:6px; cursor:pointer; white-space:nowrap;
}
.id-chip .avatar{
  width:20px;height:20px;border-radius:50%;background:var(--gold);color:var(--on-gold);
  display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;
}
.id-chip .admin-dot{ width:6px;height:6px;border-radius:50%;background:var(--warn); }

/* content */
.content{ padding:16px 16px 24px; display:flex; flex-direction:column; gap:14px; }

/* cards */
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px;
}
.card-2{ background:var(--surface-2); }
.card-title{ font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); font-weight:700; margin-bottom:10px; }
.callout{
  border:1px solid var(--gold); background:var(--surface-2); border-radius:var(--radius); padding:16px;
}
.callout .card-title{ color:var(--gold); }

/* pills / badges */
.pill{
  display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700;
  padding:3px 9px; border-radius:999px; border:1px solid transparent; white-space:nowrap;
}
.pill-pending{ background:var(--surface-2); color:var(--text-dim); border-color:var(--border); }
.pill-good{ background:var(--good-bg); color:var(--good); }
.pill-bad{ background:var(--bad-bg); color:var(--bad); }
.pill-warn{ background:var(--warn-bg); color:var(--warn); }
.pill-gold{ background:var(--gold); color:var(--on-gold); }

/* buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  border-radius:8px; padding:11px 16px; font-size:14px; font-weight:700; cursor:pointer;
  border:1px solid var(--border-strong); background:var(--surface-2); color:var(--text);
}
.btn:active{ transform:translateY(1px); }
.btn-gold{ background:var(--gold); border-color:var(--gold); color:var(--on-gold); }
.btn-block{ width:100%; }
.btn-sm{ padding:7px 11px; font-size:12.5px; border-radius:7px; }
.btn-ghost{ background:transparent; border-color:var(--border); }
.btn-good{ background:var(--good-bg); border-color:var(--good); color:var(--good); }
.btn[disabled]{ opacity:.45; cursor:not-allowed; }

/* forms */
label.field{ display:flex; flex-direction:column; gap:5px; font-size:12.5px; font-weight:600; color:var(--text-dim); }
.field input, .field select, .field textarea{
  border:1px solid var(--border-strong); background:var(--surface); color:var(--text);
  border-radius:7px; padding:9px 10px; font-size:15px;
}
.field textarea{ resize:vertical; min-height:56px; }
.form-row{ display:flex; flex-direction:column; gap:12px; }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* slots grid */
.slots{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.slot{
  border:1px solid var(--border); border-radius:var(--radius); padding:12px; background:var(--surface-2);
  display:flex; flex-direction:column; gap:6px; min-height:118px;
}
.slot.slot-you{ border-color:var(--gold); box-shadow:inset 0 0 0 1px var(--gold); }
.slot-num{ font-size:10.5px; letter-spacing:.1em; color:var(--text-dim); text-transform:uppercase; font-weight:700; }
.slot-picker{ font-weight:700; font-size:15px; display:flex; align-items:center; gap:6px; }
.slot-pick{ font-size:13.5px; color:var(--text-dim); flex:1; }
.slot-pick.set{ color:var(--text); font-style:normal; }
.slot-odds{ font-size:12.5px; color:var(--text-dim); }

/* live bet */
.card-live{ border-color:var(--gold); }
.live-dot{
  display:inline-block; width:8px; height:8px; border-radius:50%;
  background:var(--good); margin-right:5px; box-shadow:0 0 0 0 rgba(60,170,100,.6);
  animation:live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse{
  0%{ box-shadow:0 0 0 0 rgba(60,170,100,.55); }
  70%{ box-shadow:0 0 0 7px rgba(60,170,100,0); }
  100%{ box-shadow:0 0 0 0 rgba(60,170,100,0); }
}
@media (prefers-reduced-motion: reduce){ .live-dot{ animation:none; } }
.live-links{ display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; }

/* rows */
.row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.row:last-child{ border-bottom:none; }
.row-left{ display:flex; align-items:center; gap:9px; min-width:0; }
.row-name{ font-weight:600; font-size:14.5px; }
.avatar-sm{ width:26px;height:26px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border-strong); color:var(--text); display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800; flex-shrink:0; }

/* big number */
.stat-big{ font-family:var(--font-display); font-size:30px; font-weight:600; }
.stat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

/* stats table */
.stats-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.stats-table th{ text-align:left; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--text-dim); padding:0 6px 8px; font-weight:700; }
.stats-table td{ padding:9px 6px; border-top:1px solid var(--border); }
.stats-table td.num, .stats-table th.num{ text-align:right; font-family:var(--font-mono); }
.rank{ color:var(--text-dim); font-family:var(--font-mono); width:18px; display:inline-block; }

/* rules */
.rules-section{ display:flex; flex-direction:column; gap:8px; }
.rules-section h3{ font-size:16px; }
.rules-list{ margin:0; padding-left:18px; display:flex; flex-direction:column; gap:6px; font-size:14.5px; line-height:1.5; }
.rules-list li::marker{ color:var(--gold); }

/* history */
details.round-card{ border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
details.round-card > summary{
  list-style:none; cursor:pointer; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px;
}
details.round-card > summary::-webkit-details-marker{ display:none; }
details.round-card .rc-body{ padding:0 16px 16px; border-top:1px solid var(--border); }
.leg-line{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-bottom:1px dashed var(--border); font-size:13.5px; }
.leg-line:last-child{ border-bottom:none; }

/* bottom nav */
.tabbar{
  position:fixed; bottom:0; left:0; right:0; z-index:30;
  background:var(--surface); border-top:1px solid var(--border);
  display:flex; justify-content:center;
}
.tabbar-inner{ max-width:520px; width:100%; display:flex; }
.tab-btn{
  flex:1; background:none; border:none; padding:9px 4px 10px; display:flex; flex-direction:column;
  align-items:center; gap:3px; color:var(--text-dim); font-size:10.5px; font-weight:700; cursor:pointer;
  border-top:2px solid transparent; letter-spacing:.02em;
}
.tab-btn svg{ width:20px; height:20px; }
.tab-btn.active{ color:var(--gold); border-top-color:var(--gold); }

/* misc */
.muted{ color:var(--text-dim); }
.divider{ height:1px; background:var(--border); border:none; margin:2px 0; }
.tip-banner{
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius);
  padding:12px 14px; font-size:13px; color:var(--text-dim); display:flex; gap:10px; align-items:flex-start;
}
.tip-banner .tip-dismiss{ background:none;border:none;color:var(--text-dim);font-size:16px;cursor:pointer;line-height:1;padding:0 0 0 6px; }
.tip-banner.install-banner{ align-items:center; flex-wrap:wrap; border-color:var(--gold); }
.tip-banner.install-banner > div:first-child{ flex:1; min-width:180px; }
.install-banner-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.toast{
  position:fixed; left:50%; bottom:92px; transform:translateX(-50%); z-index:60;
  background:var(--text); color:var(--bg); padding:10px 16px; border-radius:8px; font-size:13.5px;
  max-width:88%; text-align:center; box-shadow:0 6px 24px rgba(0,0,0,.25);
}
.onboard{ min-height:100vh; display:flex; flex-direction:column; justify-content:center; padding:32px 24px; gap:22px; }
.onboard .brand{ text-align:center; }
.onboard .brand h1{ font-size:30px; margin-top:6px; }
.people-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.people-grid button{
  border:1px solid var(--border-strong); background:var(--surface); color:var(--text);
  border-radius:var(--radius); padding:14px 10px; font-weight:700; font-size:15px; cursor:pointer;
  text-align:center;
}
.people-grid button:active{ background:var(--gold); color:var(--on-gold); border-color:var(--gold); }
.section-label{ font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-dim); font-weight:700; }
