/* MLB Craps — page chrome on top of the existing styles.css theme tokens. */

body { min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
@media (max-width: 700px) { .topbar { padding: 10px 12px; gap: 8px; } }
.brand { font-weight: 800; font-size: 18px; letter-spacing: .3px; text-decoration: none; color: var(--text); }
.navlinks {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  max-width: 100%;
}
@media (max-width: 700px) { .navlinks { gap: 8px; font-size: 13px; } }
.navlinks a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.navlinks a:hover { color: var(--accent); }
.bankroll {
  color: var(--muted); font-weight: 700;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.inline-form { display: inline; }

.page { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
@media (max-width: 700px) { .page { margin: 12px auto; padding: 0 10px; } }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  width: 100%; box-sizing: border-box;
}
@media (max-width: 700px) { .card { padding: 16px; } }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }

h1, h2, h3 { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.smaller { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* login */
.login-card { max-width: 480px; margin: 60px auto; text-align: center; }
.login-form { display: flex; gap: 10px; margin: 16px 0 10px; }
.login-form input {
  flex: 1; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card2); color: var(--text);
  font-size: 16px;
}

/* buttons */
.btn {
  border: 1px solid transparent; color: var(--btn-text);
  background: var(--btn-bg);
  padding: 9px 14px; border-radius: 10px;
  text-decoration: none; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: filter .15s ease, transform .08s ease;
}
.btn:hover { filter: var(--btn-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--accent { background: var(--btn-bg); color: var(--btn-text); }

/* Topbar Rules button — sits inline with the navlinks */
.navbtn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.navbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ============== Topbar v2: brand · pickers · rules · avatar ============== */
.topbar-v2 {
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  flex-wrap: nowrap;
}
.topbar-v2 .tb-main {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  min-width: 0;
}
.topbar-v2 .brand {
  flex: 0 0 auto; order: 1;
  display: inline-flex; align-items: center;
  text-decoration: none;
  padding: 0;
}
.topbar-v2 .brand-logo {
  height: 38px; width: auto; display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
}
.topbar-v2 .topbar-pickers {
  display: flex; gap: 8px;
  min-width: 0; flex: 1 1 280px;
  order: 2;
}
.topbar-v2 .tb-spacer { flex: 1 0 0; order: 3; min-width: 0; }
.topbar-v2 .bankroll-pill {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 215, 102, .14), rgba(212, 175, 55, .08));
  border: 1px solid rgba(212, 175, 55, .55);
  color: var(--accent);
  font-family: 'Bodoni Moda', Georgia, serif;
  font-weight: 900; font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 215, 102, .15);
  margin-right: 4px;
}
@media (max-width: 700px) {
  .topbar-v2 .bankroll-pill { font-size: 12px; padding: 3px 9px; }
}
.topbar-v2 .tb-trail {
  display: flex; align-items: center; gap: 8px;
  order: 4; flex: 0 0 auto;
  margin-left: auto;
}
.topbar-v2 .rules-mini {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 800;
}
/* In-topbar pickers are smaller than the standalone toolbar versions. */
.topbar-v2 .tp-trigger {
  min-width: 0;
  padding: 4px 10px 4px 6px;
  height: 36px;
  border-radius: 999px;
  font-size: 12px;
}
.topbar-v2 .tp-logo { width: 24px; height: 24px; }
.topbar-v2 .tp-name { font-size: 12px; }
.topbar-v2 .fp-trigger {
  height: 36px;
  border-radius: 999px;
  padding: 4px 12px 4px 10px;
  min-width: 0;
}
.topbar-v2 .fp-trigger .fp-label { font-size: 12px; }
@media (max-width: 700px) {
  .topbar-v2 { padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px; gap: 6px; }
  .topbar-v2 .tb-main { gap: 6px; }
  .topbar-v2 .topbar-pickers { flex-basis: 100%; order: 5; gap: 4px; }
  .topbar-v2 .brand-logo { height: 32px; }
  .topbar-v2 .rules-mini { width: 30px; height: 30px; font-size: 13px; }
  .topbar-v2 .avatar-btn { width: 30px; height: 30px; font-size: 12px; }
  .topbar-v2 .tp-trigger,
  .topbar-v2 .fp-trigger { height: 30px; padding: 2px 8px 2px 4px; }
  .topbar-v2 .tp-logo { width: 20px; height: 20px; }
  .topbar-v2 .tp-name,
  .topbar-v2 .fp-trigger .fp-label { font-size: 11px; }
  .topbar-v2 .fp-trigger .fp-icon { font-size: 13px; }
}
@media (max-width: 380px) {
  /* Trim brand to a tiny diamond on tiny phones so the picker row can
     stay compact. The avatar dropdown still has full nav inside. */
  .topbar-v2 .brand { display: none; }
}

/* Avatar circle + dropdown */
.profile-menu { position: relative; }
.avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), #1a3550);
  color: #fff;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 900; font-size: 14px;
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.avatar-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.avatar-btn .avatar-initial { line-height: 1; }
.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .25);
  padding: 6px;
  z-index: 60;
}
.ad-bankroll {
  padding: 10px 12px 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.ad-bk-name-row {
  display: flex; align-items: center; gap: 6px;
}
.ad-bk-name { font-weight: 700; color: var(--text); font-size: 13px; }
.ad-admin {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ad-admin-pill {
  font-size: 9px; font-weight: 800; letter-spacing: .14em;
  background: linear-gradient(180deg, rgba(255,215,102,.22), rgba(212,175,55,.10));
  border: 1px solid rgba(212,175,55,.55);
  color: var(--accent);
  padding: 2px 7px; border-radius: 999px;
  font-family: 'Cinzel', serif; text-transform: uppercase;
}
.ad-bk-edit {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: none; border: none; cursor: pointer;
  padding: 2px 4px; font-weight: 700;
}
.ad-bk-edit:hover { text-decoration: underline; }
.ad-name-editor {
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.ad-name-editor.hidden { display: none; }
.ad-name-editor input {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card2); color: var(--text);
  font-size: 14px;
}
.ad-name-editor .btn--sm { padding: 6px 10px; font-size: 12px; }
.ad-name-msg { font-size: 11px; }
.ad-bk-amt {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-weight: 900; font-size: 20px;
  color: var(--accent);
  border: none; padding: 0;
}
.ad-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.ad-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 10px 12px;
  color: var(--text); text-decoration: none;
  font-weight: 600; font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}
.ad-item:hover { background: var(--row-hover, rgba(127, 127, 127, .12)); color: var(--accent); }
.ad-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  font-weight: 600; font-size: 14px; color: var(--text);
}
.ad-logout { color: #ef4444; margin-top: 2px; }
.ad-logout:hover { background: rgba(239, 68, 68, .1); color: #ef4444; }
.login-link { font-size: 14px; }

/* ================== Loader overlay — bat hits dice =========================
   Shown during page navigation (intercepted link clicks) and explicit
   redirects (auth flow). Has a 150 ms reveal delay to skip the flicker on
   instant loads. */
.loader-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(ellipse at center, rgba(8, 32, 20, .96), rgba(0, 0, 0, .96));
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .22s ease;
  padding: 16px;
  pointer-events: auto;
}
.loader-overlay.hidden { display: none; }
.loader-overlay.show   { opacity: 1; }

.loader-card {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .06), transparent 55%),
    linear-gradient(180deg, #1a3a2a, #0a2417);
  border: 2.5px solid #d4af37;
  border-radius: 18px;
  padding: 28px 36px;
  text-align: center;
  color: #f4e8c1;
  box-shadow: 0 0 60px rgba(255, 215, 102, .25), 0 30px 60px rgba(0, 0, 0, .6);
}

.loader-stage {
  position: relative;
  width: 320px; height: 130px;
  margin: 0 auto 16px;
  overflow: visible;
}
/* Bat swings through a natural ~100° arc — cocked back over the shoulder,
   whips down and through the strike zone, then follows through. Fades out
   between iterations so the snap-back to ready is invisible. */
.loader-bat {
  position: absolute;
  left: 36px; top: 50%;
  width: 130px; height: 28px;
  transform-origin: 7px 14px;        /* knob end — pivot like a real swing */
  transform: translateY(-50%) rotate(-50deg);
  animation: batSwing 1.5s cubic-bezier(.4, .05, .25, 1) infinite;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  will-change: transform, opacity;
}
@keyframes batSwing {
  0%, 14%   { transform: translateY(-50%) rotate(-50deg); opacity: 0; }
  20%       { transform: translateY(-50%) rotate(-50deg); opacity: 1; }    /* ready */
  38%       { transform: translateY(-50%) rotate(-58deg); opacity: 1; }    /* small wind */
  50%       { transform: translateY(-50%) rotate(0deg);   opacity: 1; }    /* CRACK */
  62%       { transform: translateY(-50%) rotate(38deg);  opacity: 1; }    /* through */
  82%       { transform: translateY(-50%) rotate(48deg);  opacity: 1; }    /* follow-through hold */
  92%       { transform: translateY(-50%) rotate(48deg);  opacity: 0; }
  100%      { transform: translateY(-50%) rotate(-50deg); opacity: 0; }    /* invisible reset */
}
.loader-dice {
  position: absolute;
  top: 50%;
  font-size: 36px; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
  will-change: transform, opacity;
}
.loader-dice-1 {
  left: 152px;
  animation: diceFly1 1.5s cubic-bezier(.25, .55, .4, 1) infinite;
}
.loader-dice-2 {
  left: 188px;
  animation: diceFly2 1.5s cubic-bezier(.25, .55, .4, 1) infinite;
}
/* Modest flight — within the stage bounds. They get smacked, tumble up-right
   maybe 50px horizontal and 60px vertical, and fade well before the loop
   resets. They are NOT supposed to leave the loader card. */
@keyframes diceFly1 {
  0%, 46%   { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 1; }
  50%       { transform: translate(4px, -58%) rotate(22deg) scale(1.1); opacity: 1; }
  66%       { transform: translate(34px, -110%) rotate(320deg) scale(0.88); opacity: 0.85; }
  80%       { transform: translate(54px, -160%) rotate(560deg) scale(0.6); opacity: 0; }
  100%      { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 0; }
}
@keyframes diceFly2 {
  0%, 48%   { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 1; }
  52%       { transform: translate(6px, -56%) rotate(-20deg) scale(1.08); opacity: 1; }
  68%       { transform: translate(30px, -100%) rotate(-280deg) scale(0.9); opacity: 0.85; }
  82%       { transform: translate(50px, -148%) rotate(-520deg) scale(0.62); opacity: 0; }
  100%      { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 0; }
}
.loader-smack {
  position: absolute;
  left: 188px; top: 50%;
  width: 88px; height: 88px;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255, 217, 102, .85));
  animation: smackBurst 1.5s linear infinite;
}
@keyframes smackBurst {
  0%, 46%  { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 0; }
  50%      { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  60%      { transform: translate(-50%, -50%) scale(1.5) rotate(30deg); opacity: 0; }
  100%     { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

.loader-text {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  letter-spacing: .35em;
  font-size: 13px;
  color: #d4af37;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  animation: loaderTextPulse 1.5s ease-in-out infinite;
}
@keyframes loaderTextPulse {
  0%, 100% { opacity: .65; }
  50%      { opacity: 1; }
}

@media (max-width: 480px) {
  .loader-card  { padding: 22px 26px; }
  .loader-stage { width: 260px; height: 110px; }
  .loader-bat   { width: 108px; height: 24px; transform-origin: 6px 12px; left: 26px; }
  .loader-dice  { font-size: 28px; }
  .loader-dice-1 { left: 124px; }
  .loader-dice-2 { left: 154px; }
  .loader-smack  { left: 152px; width: 72px; height: 72px; }
  @keyframes diceFly1 {
    0%, 46%   { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 1; }
    50%       { transform: translate(3px, -58%) rotate(22deg) scale(1.1); opacity: 1; }
    66%       { transform: translate(26px, -110%) rotate(320deg) scale(0.88); opacity: 0.85; }
    80%       { transform: translate(42px, -160%) rotate(560deg) scale(0.6); opacity: 0; }
    100%      { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 0; }
  }
  @keyframes diceFly2 {
    0%, 48%   { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 1; }
    52%       { transform: translate(5px, -56%) rotate(-20deg) scale(1.08); opacity: 1; }
    68%       { transform: translate(24px, -100%) rotate(-280deg) scale(0.9); opacity: 0.85; }
    82%       { transform: translate(40px, -148%) rotate(-520deg) scale(0.62); opacity: 0; }
    100%      { transform: translate(0, -50%) rotate(0deg) scale(1); opacity: 0; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-bat, .loader-dice, .loader-smack, .loader-text { animation: none !important; }
}

/* While the page is still loading, hide body-level chrome that sits above the
   loader (props slide-in tab, chip drawer, etc). The is-loading class is set
   in the HTML and removed by bet.js after the first reloadState() resolves. */
body.is-loading .props-tab,
body.is-loading .props-rail,
body.is-loading .chip-drawer,
body.is-loading .topbar { visibility: hidden; }

/* While the Rules modal is open, hide the floating props rail and chip
   drawer so they don't poke through the rules content. */
body:has(#rulesModal:not(.hidden)) .props-rail,
body:has(#rulesModal:not(.hidden)) .chip-drawer { visibility: hidden; }

/* ================== Rules modal — themed to match the felt table ========== */
.rules-modal {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(8,32,20,.88), rgba(0,0,0,.92));
  z-index: 200;
  display: grid; place-items: center;
  padding: 16px;
  animation: rulesFade .22s ease-out;
}
.rules-modal.hidden { display: none; }
@keyframes rulesFade { from { opacity: 0; } to { opacity: 1; } }

/* Outer card = wood frame, mirrors .shooter-board. */
.rules-card {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,.05) 0 1px, transparent 1px 4px,
      rgba(255,255,255,.02) 4px 5px, transparent 5px 11px),
    linear-gradient(180deg, #5a3a26 0%, #2c180e 100%);
  border-radius: 18px;
  padding: 8px;
  display: flex; flex-direction: column;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.6),
    0 30px 60px -10px rgba(0,0,0,.55),
    0 18px 30px -12px rgba(0,0,0,.4);
  position: relative;
  animation: rulesPop .32s cubic-bezier(.3, 1.3, .5, 1);
}
.rules-card::before {
  content: ""; position: absolute;
  inset: 4px; border-radius: 14px; pointer-events: none;
  border: 1px dashed #c9a043;
  opacity: .55;
}
@keyframes rulesPop {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1);     opacity: 1; }
}

/* Brass header band — sits on top of the felt below. */
.rules-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #1a3a2a 0%, #0f2a1d 100%);
  border-bottom: 1.5px solid #d4af37;
  color: #f4e8c1;
  flex: 0 0 auto;
  position: relative; z-index: 1;
}
.rules-header h2 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 20px; font-weight: 900;
  letter-spacing: .08em;
  color: #f4e8c1;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.rules-close {
  background: rgba(0,0,0,.3);
  border: 1px solid #a08020;
  color: #f4e8c1;
  width: 30px; height: 30px;
  border-radius: 6px;
  font-size: 22px; line-height: 1;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.rules-close:hover {
  background: rgba(0,0,0,.55);
  border-color: #d4af37;
  color: #ffd966;
}

/* Body = the felt itself. */
.rules-body {
  overflow-y: auto;
  padding: 18px 24px 26px;
  flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,.5), transparent 60%),
    linear-gradient(180deg, #0d4a34 0%, #082617 70%, #051a0f 100%);
  border-radius: 0 0 12px 12px;
  color: #f4e8c1;
  box-shadow: inset 0 0 90px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.4);
  position: relative; z-index: 1;
}
.rules-body::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.014) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.014) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,.04) 0 1px, transparent 1px);
  background-size: 7px 7px, 9px 9px, 5px 5px;
  opacity: .55;
  border-radius: inherit;
}
.rules-body > * { position: relative; z-index: 1; }

/* Felt scrollbar in brass tones. */
.rules-body::-webkit-scrollbar { width: 8px; }
.rules-body::-webkit-scrollbar-track { background: rgba(0,0,0,.25); border-radius: 4px; }
.rules-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a08020, #6b5215);
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.4);
}
.rules-body { scrollbar-color: #a08020 rgba(0,0,0,.25); scrollbar-width: thin; }

/* Each section gets a subtle dashed brass border, like a felt panel. */
.rules-section {
  border: 1.5px dashed #a08020;
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(0,0,0,.18);
}
.rules-section.rules-walkthrough-cta {
  text-align: center;
  border-style: solid;
  background: linear-gradient(180deg, rgba(212,175,55,.18), rgba(212,175,55,.08));
  border-color: #d4af37;
}
.rules-section.rules-walkthrough-cta p { margin: 0; font-size: 14px; }
.rules-section.rules-walkthrough-cta a {
  color: #ffd966; text-decoration: none;
}
.rules-section.rules-walkthrough-cta a:hover { text-decoration: underline; }
.rules-section h3 {
  margin: 0 0 8px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #d4af37;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212,175,55,.25);
}
.rules-section p {
  margin: 0 0 8px;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px; line-height: 1.6;
  color: #b5c9b8;
}
.rules-section p:last-child { margin-bottom: 0; }
.rules-section ul,
.rules-section ol {
  margin: 8px 0 0; padding-left: 22px;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px; line-height: 1.7; color: #b5c9b8;
}
.rules-section li { margin-bottom: 5px; }
.rules-section li::marker { color: #d4af37; font-weight: 700; }
.rules-section b, .rules-section strong { color: #ffd966; font-weight: 800; }

/* Tables — green felt cells with brass borders, Bodoni Moda numerics. */
.rules-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin-top: 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid #a08020;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,.22);
}
.rules-table th {
  text-align: left;
  padding: 7px 12px;
  background: linear-gradient(180deg, #1a3a2a, #0f2a1d);
  color: #d4af37;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  border-bottom: 1.5px solid #a08020;
}
.rules-table td {
  padding: 6px 12px;
  border-bottom: 1px dashed rgba(212,175,55,.2);
  color: #f4e8c1;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-weight: 600;
}
.rules-table tr:last-child td { border-bottom: none; }
.rules-table tr:hover td { background: rgba(212,175,55,.06); }

@media (max-width: 600px) {
  .rules-card    { max-height: 94vh; border-radius: 14px; padding: 6px; }
  .rules-header  { padding: 12px 14px; border-radius: 10px 10px 0 0; }
  .rules-header h2 { font-size: 16px; letter-spacing: .06em; }
  .rules-body    { padding: 14px 14px 20px; gap: 14px; border-radius: 0 0 10px 10px; }
  .rules-section { padding: 10px 12px; }
  .rules-section h3 { font-size: 11px; letter-spacing: .2em; }
  .rules-section p  { font-size: 13px; }
  .rules-table   { font-size: 12px; }
  .rules-table th { font-size: 9px; padding: 6px 8px; }
  .rules-table td { padding: 5px 8px; }
}

/* grid layout for bet page */
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* slate */
.slate-controls { display: flex; gap: 8px; align-items: center; }
.slate-controls input[type=date] {
  padding: 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card2); color: var(--text);
}
.slate { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.game-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card2);
}
.game-row.locked { opacity: .6; }
.game-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.game-meta .start { font-weight: 700; }
.game-meta .status { color: var(--muted); }
.teams { display: flex; align-items: center; gap: 10px; }
.team-pick {
  flex: 1; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; color: var(--text); font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  transition: border-color .15s ease, background .15s ease;
}
.team-pick:hover:not(:disabled) { border-color: var(--accent); background: var(--row-hover); }
.team-pick:disabled { cursor: not-allowed; }
.team-pick .tscore { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.teams .vs { color: var(--muted); font-size: 12px; }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); }
.pill.open { background: color-mix(in hsl, #22c55e 25%, transparent); color: #16a34a; border-color: #16a34a55; }
.pill.lock { background: color-mix(in hsl, #ef4444 25%, transparent); color: #ef4444; border-color: #ef444455; }

/* payout card */
.group { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.paytable { width: 100%; border-collapse: collapse; }
.paytable td { padding: 6px 8px; border-top: 1px solid var(--row-border); font-size: 13px; vertical-align: top; }
.paytable .bet-name { font-weight: 700; white-space: nowrap; }
.paytable .pay { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: grid; place-items: center; z-index: 50;
}
.modal-card {
  width: min(460px, 92vw);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.5);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-card header, .modal-card footer {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-card footer { border-top: 1px solid var(--border); border-bottom: none; gap: 8px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.modal-body select, .modal-body input[type=number] {
  padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text); font-size: 15px;
}
.iconbtn { background: transparent; color: var(--muted); border: none; font-size: 22px; cursor: pointer; }
.potential { color: var(--accent); font-weight: 700; font-size: 14px; }
.error { color: #ef4444; font-weight: 700; font-size: 13px; }

/* bets & leaderboard tables */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.bets { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bets th, table.bets td { padding: 10px 10px; border-bottom: 1px solid var(--row-border); text-align: left; }
table.bets th { background: var(--thead-bg); color: var(--thead-text); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.bets td.r, table.bets th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.bets tbody tr:hover { background: var(--row-hover); }
tr.win td  { }
tr.lose td { opacity: .85; }
tr.pending td { color: var(--muted); }
.win  { color: #16a34a; font-weight: 700; }
.lose { color: #ef4444; font-weight: 700; }
.bankroll-big { font-size: 16px; color: var(--muted); }
.bankroll-big b { color: var(--accent); }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-weight: 700; opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
