/* Stephen's Game Room: green felt and warm wood. Placeholder look; the real art comes later.
   Phones (body.phone) and the TV (body.tv) share everything here. */
:root {
  --felt: #12402c; --felt2: #0b2c1e; --wood: #5a3a22; --ink: #fff8ef; --mute: #b9d3c4; --line: rgba(255,255,255,.14);
  --panel: rgba(0,0,0,.28); --gold: #ffcf4a; --red: #e5484d; --go: #6be37a; --card: #fffdf7; --card-ink: #1c1c22; --card-red: #c8232c;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh; font-family: 'Nunito', system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(1200px 700px at 50% 0%, #1c5a3e 0%, transparent 70%), linear-gradient(180deg, var(--felt), var(--felt2));
  background-color: var(--felt2);
}
button, input { font: inherit; }
.hidden { display: none !important; }
.fine { color: var(--mute); font-size: 14px; line-height: 1.4; }
.center { text-align: center; }
.ok { color: var(--go); }
.lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin-bottom: 6px; font-weight: 800; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.brand { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 18px; }
.brand b { color: var(--gold); }
.brand.big { font-size: clamp(36px, 7vw, 72px); text-align: center; margin: 20px 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; }
.btn {
  border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 800; color: var(--on-gold); background: var(--gold);
  box-shadow: 0 3px 0 rgba(0,0,0,.35); cursor: pointer; min-height: 44px;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.big { width: 100%; font-size: 20px; padding: 16px; margin: 10px 0; }
.btn.ghost { background: rgba(255,255,255,.1); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 8px 14px; min-height: 36px; font-size: 14px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 700; min-height: 40px; }
.chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.icon-btn { border: 0; background: rgba(255,255,255,.1); color: var(--ink); width: 42px; height: 42px; border-radius: 12px; font-size: 20px; cursor: pointer; }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }
input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: #111; font-size: 18px; }
.code-in { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; max-width: 160px; }
form.row input { flex: 1; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111; color: #fff; padding: 12px 18px; border-radius: 12px;
  z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.4); font-weight: 700; }
.confirm-overlay, .menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; padding: 16px; }
.confirm-box, .menu-box { width: min(420px, 100%); background: var(--panel-solid); }
.confirm-msg { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }
.menu-box .btn { width: 100%; margin-top: 10px; }
.menu-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 18px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }

.face svg, .face-fb { display: block; border-radius: 30%; }
.face-fb { display: grid; place-items: center; color: var(--on-gold); font-weight: 800; }

/* ---------- phone ---------- */
.ph { max-width: 560px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.ph-top { display: flex; align-items: center; gap: 10px; padding: 12px 0; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--felt) 70%, transparent); }
.code-chip { border: 0; background: var(--gold); color: var(--on-gold); font-weight: 800; letter-spacing: .15em; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.top-game { flex: 1; font-family: 'Fredoka', sans-serif; font-size: 18px; font-weight: 600; }
.tv-on { font-size: 20px; }
.me-panel input { margin-bottom: 8px; }
.pick-face summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 8px; max-height: 340px; overflow: auto; }
.av { border: 2px solid transparent; background: rgba(255,255,255,.06); border-radius: 12px; padding: 6px; color: var(--ink); cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.av.on { border-color: var(--gold); }
.av-nm { font-size: 11px; text-align: center; }
.shelf-h { font-family: 'Fredoka', sans-serif; font-weight: 600; margin: 18px 0 8px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); color: var(--ink); cursor: pointer; text-decoration: none; }
.tile b { font-family: 'Fredoka', sans-serif; font-size: 20px; font-weight: 600; }
.tile small { color: var(--mute); }
.tile-icon { font-size: 30px; }
.tile.soon { opacity: .45; cursor: default; }
.room-card { text-align: center; }
.room-code { font-family: 'Fredoka', sans-serif; font-size: 54px; letter-spacing: .2em; color: var(--gold); line-height: 1.1; }
.game-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.game-now { font-size: 20px; margin-bottom: 4px; }
.game-now.big { font-size: 34px; font-family: 'Fredoka', sans-serif; }
.roster { display: grid; gap: 8px; margin-bottom: 10px; }
.who { display: flex; align-items: center; gap: 10px; }
.who .nm { flex: 1; font-weight: 700; }
.who.away { opacity: .5; }
.roster .grip { display: grid; place-items: center; width: 36px; height: 44px; margin: -6px -6px -6px -4px; fill: currentColor; opacity: .55; cursor: grab; touch-action: none; }
.roster .who.dragging { position: relative; z-index: 2; background: rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.roster .who.dragging .grip { cursor: grabbing; opacity: 1; }
.waiting { text-align: center; padding: 16px; color: var(--mute); font-weight: 700; }
.status { text-align: center; font-weight: 800; font-size: 18px; margin: 8px 0; min-height: 26px; }
.status.go, .my-turn > .status { color: var(--gold); }
.over-box { text-align: center; }
.over-h { font-family: 'Fredoka', sans-serif; font-size: 28px; margin-bottom: 10px; }
.over-box .row { justify-content: center; }

/* The table strip: a thin view of the table at the top of the phone. Tap for the whole table. */
.strip { display: grid; gap: 4px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.3);
  color: var(--ink); padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font: inherit; }
.strip.watching { cursor: default; color: var(--mute); }
.s-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.s-face svg, .s-face .face-fb { display: block; border-radius: 30%; }
.s-note { color: var(--mute); font-size: 13px; }
.s-scores { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.s-scores b { color: var(--ink); }
.s-scores .folded { opacity: .5; }
.strip-more { font-size: 12px; color: var(--gold); justify-self: end; }
.table-view { margin-top: 4px; }

/* ---------- cards: Bicycle Rider Back look (public/cards/*.png, see cards.js) ---------- */
.card { --w: 64px; position: relative; display: inline-block; width: var(--w); height: calc(var(--w) * 1.453); border-radius: calc(var(--w) * .06);
  background: var(--card); color: var(--card-ink); box-shadow: 0 2px 6px rgba(0,0,0,.35); flex: none; overflow: hidden;
  user-select: none; -webkit-user-select: none; vertical-align: middle; transition: transform .12s; }
.card img { display: block; width: 100%; height: 100%; pointer-events: none; }
.card.slot { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
/* Mini cards (the phone strip, seats on the table): the real card's corner redrawn crisp at small size,
   with the deck's own index font (Arial), red (#df0000) and suit shapes, plus the big pip. */
.card.mini { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0,0,0,.45), inset 0 0 0 .5px rgba(0,0,0,.35);
  border-radius: calc(var(--w) * .1); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; }
.card.mini.red { color: #df0000; }
.card.mini svg { display: block; fill: currentColor; }
.card.mini .idx { position: absolute; top: 5%; left: 7%; width: 34%; display: grid; justify-items: center; gap: calc(var(--w) * .04); }
.card.mini .idx b { font-weight: 400; font-size: calc(var(--w) * .38); line-height: .82; letter-spacing: -.02em; }
.card.mini.ten .idx b { letter-spacing: -.12em; font-size: calc(var(--w) * .33); margin-left: -.1em; }
.card.mini .idx-pip { width: 100%; height: auto; }
.card.mini .big-pip { position: absolute; right: 9%; bottom: 7%; width: 50%; height: auto; }
.card.tiny { --w: 30px; }
.card.big { --w: 110px; }
.card.dim { filter: brightness(.55); }
.card.picked, .card.lifted { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 8px 14px rgba(0,0,0,.4); }
.card.wins { box-shadow: 0 0 0 3px var(--gold), 0 2px 6px rgba(0,0,0,.35); }
.hand.fan { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; padding: 22px 4px 8px; }
.hand.fan .card { --w: 78px; margin: 0 -17px 10px; cursor: pointer; }
.trick { display: flex; justify-content: center; gap: 8px; min-height: 104px; align-items: center; color: var(--mute); }
.trick .played { display: grid; justify-items: center; gap: 2px; font-size: 12px; }
.trick.big .card { --w: 90px; }
.my-pts { text-align: center; color: var(--mute); margin-top: 8px; }
.mini-scores { width: 100%; border-collapse: collapse; text-align: center; }
.mini-scores th { font-size: 13px; color: var(--mute); font-weight: 700; padding: 4px; }
.mini-scores td { font-size: 20px; font-weight: 800; padding: 4px; }
.mini-scores small { color: var(--red); font-size: 13px; }
.mini-scores tr.total td { border-top: 1px solid var(--line); }

/* ---------- dice ---------- */
.dice-row { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.die { --s: 54px; width: var(--s); height: var(--s); border-radius: 22%; background: #fffdf7; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: calc(var(--s) * .12); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 3px 6px rgba(0,0,0,.35); cursor: default; flex: none; position: relative; }
.die i { display: grid; place-items: center; }
.die i.pip::after { content: ''; width: 72%; aspect-ratio: 1; border-radius: 50%; background: #1c1c22; }
.die.blank { background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 2px rgba(255,255,255,.2); }
.die.held { box-shadow: 0 0 0 4px var(--gold), 0 3px 6px rgba(0,0,0,.35); transform: translateY(-6px); }
.die.held::after { content: 'HELD'; position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--gold); }
.die[data-move] { cursor: pointer; }
.die.tumble { animation: tumble .7s cubic-bezier(.2,.8,.3,1); }
@keyframes tumble { 0% { transform: translateY(-40px) rotate(-200deg) scale(.6); opacity: .3; } 60% { transform: translateY(4px) rotate(15deg) scale(1.05); opacity: 1; } 100% { transform: none; } }
.dice-row.mini { margin: 0; gap: 4px; } .dice-row.mini .die { --s: 22px; } .dice-row.mini .die.held::after { display: none; }
.dice-row.big .die { --s: 110px; }
.roll-btn small { font-weight: 600; opacity: .7; margin-left: 6px; }

/* ---------- yahtzee ---------- */
.scorecard { width: 100%; border-collapse: collapse; }
.scorecard th { text-align: left; font-weight: 700; padding: 5px 4px; }
.scorecard td { text-align: right; padding: 5px 4px; font-weight: 800; min-width: 64px; }
.scorecard tbody + tbody tr:first-child th, .scorecard tbody + tbody tr:first-child td { border-top: 2px solid var(--line); }
.scorecard tr.sub th, .scorecard tr.sub td { color: var(--mute); font-size: 14px; }
.scorecard tr.total th, .scorecard tr.total td { font-size: 20px; border-top: 1px solid var(--line); }
.scorecard tr.just td { color: var(--gold); }
.score-btn { border: 0; border-radius: 999px; background: var(--go); color: #0b2c1e; font-weight: 800; padding: 4px 12px; min-width: 52px; cursor: pointer; }
.score-btn.zero { background: rgba(255,255,255,.15); color: var(--ink); }
.y-roller { display: flex; align-items: center; gap: 14px; justify-content: center; }
.big-name { font-family: 'Fredoka', sans-serif; font-size: 32px; }
/* Scorecards share the row, centered: each one wide enough to read (never squeezed into a skinny column), as many side by side as fit. */
.y-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.y-card { flex: 1 1 300px; max-width: 400px; min-width: 0; }
.y-card.up { border-color: var(--gold); }
.y-card.won { box-shadow: 0 0 0 3px var(--gold); }
.y-card-h { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.y-card .scorecard th, .y-card .scorecard td { padding: 2px 4px; font-size: 14px; }

/* ---------- hearts ---------- */
.felt { position: relative; height: 360px; border-radius: 24px; background: radial-gradient(circle, #1b6a47, #0f3d29); border: 8px solid var(--wood); }
.seat { position: absolute; display: grid; justify-items: center; gap: 2px; text-align: center; font-size: 13px; }
.seat .nm { font-weight: 800; font-size: 15px; }
.seat .sub { color: var(--mute); }
.seat.up .nm { color: var(--gold); }
.seat.south { bottom: 8px; left: 50%; transform: translateX(-50%); }
.seat.north { top: 8px; left: 50%; transform: translateX(-50%); }
.seat.west { left: 10px; top: 50%; transform: translateY(-50%); }
.seat.east { right: 10px; top: 50%; transform: translateY(-50%); }
.felt .center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.big-note { font-family: 'Fredoka', sans-serif; font-size: 26px; }
.hand-over { text-align: center; }

/* ---------- hold'em ---------- */
.hole { display: flex; gap: 10px; justify-content: center; border: 0; background: none; margin: 8px auto; cursor: pointer; position: relative; padding-bottom: 26px; width: 100%; }
.peek-hint { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; color: var(--gold); font-weight: 800; }
.my-stack { text-align: center; font-size: 18px; margin: 6px 0; }
.chips::before { content: '● '; color: var(--gold); }
.dealer { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #111; font-size: 12px; font-weight: 800; }
.bet-box .row { justify-content: center; }
.bet-box .row .btn { flex: 1; }
.raise { margin-top: 10px; }
.raise input[type=range] { padding: 0; background: none; border: 0; accent-color: var(--gold); height: 40px; }
.raise .quick .chip { flex: 1; }
.board { display: flex; gap: 6px; justify-content: center; }
.board.mini .card { --w: 26px; }
.oval { position: relative; height: 420px; border-radius: 50%; background: radial-gradient(circle, #1b6a47, #0f3d29); border: 10px solid var(--wood); margin: 30px 10px 50px; }
.oval .center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; }
.pot { font-size: 22px; font-weight: 800; }
.pseat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 1px; text-align: center; font-size: 12px;
  background: rgba(0,0,0,.45); padding: 6px 8px; border-radius: 12px; min-width: 86px; }
.pseat .nm { font-weight: 800; font-size: 13px; }
.pseat .sub { color: var(--mute); }
.pseat.up { box-shadow: 0 0 0 3px var(--gold); }
.pseat.folded, .pseat.out { opacity: .45; }
.pseat .pcards { display: flex; gap: 2px; }
.pseat .made { color: var(--gold); font-weight: 700; }
.pseat .bet { position: absolute; top: -18px; font-weight: 800; font-size: 12px; }
.showdown { text-align: center; }
.win-line { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 18px; margin: 4px 0; }
.log { font-size: 14px; }

/* ---------- TV ---------- */
body.tv { font-size: 20px; }
.tv-top { display: flex; align-items: center; gap: 18px; padding: 14px 28px; background: rgba(0,0,0,.25); }
.tv-top .brand { font-size: 26px; }
.tv-top .top-game { flex: none; font-size: 24px; }
.join-mini .code { color: var(--gold); letter-spacing: .15em; }
.tv-main { padding: 18px 28px; max-width: 1500px; margin: 0 auto; }
.tv-start { max-width: 640px; margin: 8vh auto; text-align: center; }
.tv-start form { justify-content: center; }
.tv-lobby { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.join-side { text-align: center; }
.join-side .hand { color: var(--mute); }
.join-url { font-size: 34px; font-weight: 800; margin-bottom: 10px; }
.join-side .room-code { font-size: 96px; }
.qr { display: inline-block; background: #fff; padding: 12px; border-radius: 12px; margin-top: 10px; }
.roster.big .who { font-size: 24px; }
.tv-size .felt { height: 520px; }
.tv-size .oval { height: 560px; }
.tv-size .card { --w: 70px; } .tv-size .card.tiny { --w: 38px; } .tv-size .trick.big .card { --w: 110px; }
.tv-size .pseat { font-size: 16px; min-width: 130px; } .tv-size .pseat .nm { font-size: 18px; }
.tv-picker { max-width: 1200px; margin: 0 auto; padding: 24px; }
.tv-shelf { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tv-shelf .tile { padding: 22px; }
.tv-shelf .tile-icon { font-size: 48px; }
@media (max-width: 800px) { .tv-lobby { grid-template-columns: 1fr; } }
@media (max-width: 420px) {
  .hand.fan .card { --w: 72px; margin: 0 -16px 10px; }
  .die { --s: 48px; }
  .felt { height: 320px; }
  .oval { height: 380px; margin: 30px 0 50px; }
  .pseat { min-width: 70px; font-size: 11px; }
}

/* ---------- poker chips, table setup, results ---------- */
/* A poker chip: a colored disc with the white edge stripes real clay chips have. --c is the chip color. */
.pchip { display: block; width: 26px; height: 7px; border-radius: 50%; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 1px 0 rgba(0,0,0,.4);
  background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255,255,255,.85) 4px 6px); margin-top: -3px; }
.cstack { display: inline-flex; flex-direction: column-reverse; align-items: center; margin: 0 4px; vertical-align: bottom; }
.cstack small { order: -1; font-size: 11px; color: var(--mute); margin-top: 3px; }
.chipstacks { display: inline-flex; align-items: flex-end; justify-content: center; padding-top: 6px; }
.chipdot { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c);
  border: 3px dashed rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.5); margin-right: -6px; }
.chipdot b { font-size: 9px; font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.8); }
.setup .lbl { margin-top: 14px; }
.chipsets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chipset { display: grid; gap: 4px; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; }
.chipset.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.chipset small { color: var(--mute); }
.chipset .dots { display: flex; padding: 2px 0; }
.stepper { gap: 8px; }
.big-amt { font-family: 'Fredoka', sans-serif; font-size: 26px; min-width: 90px; text-align: center; }
.breakdown { text-align: center; }
.setup-sum { margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.25); font-weight: 700; }
.results { width: 100%; border-collapse: collapse; }
.results th { text-align: left; color: var(--mute); font-size: 13px; padding: 4px; }
.results td { padding: 6px 4px; border-top: 1px solid var(--line); font-weight: 700; }
.results tr.first td { color: var(--gold); }
.up { color: var(--go); } .down { color: #ff8a8a; }
.my-stack .chipstacks { margin-bottom: 4px; }
.pseat .bet { display: flex; align-items: flex-end; gap: 3px; }
.pseat .bet .pchip { width: 16px; height: 5px; }
.strip .btn.small { margin-left: 8px; }

/* ---------- table votes (poker tournaments) ---------- */
.vote-box { border-color: var(--gold); background: rgba(255, 207, 74, .1); }
.vote-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.vote-what { font-family: 'Fredoka', sans-serif; font-size: 22px; margin: 4px 0; }
.vote-box .row .btn { flex: 1; }
.deal-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.deal-list .me { color: var(--gold); }
.vote-menu .btn { width: 100%; margin-top: 8px; text-align: left; }
.vote-menu .btn small { opacity: .7; font-weight: 600; }
.deal-opt { display: grid; gap: 2px; width: 100%; text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; }
.deal-opt span { color: var(--gold); }
.deal-opt small { color: var(--mute); }
.nudge { text-align: center; border-color: var(--gold); }
.s-vote { color: var(--gold); font-size: 13px; font-weight: 700; }

/* ---------- money: amount picker, money log, settle-up ---------- */
.amount-pick { display: grid; gap: 8px; justify-items: center; margin-top: 8px; }
.amount-pick .quick { justify-content: center; }
.money-log .ledger { margin-top: 8px; font-size: 14px; color: var(--mute); display: grid; gap: 2px; }
.money-log .ledger b, .ledger-all b { color: var(--ink); }
.ledger .t, .ledger-all .t { display: inline-block; min-width: 64px; color: var(--mute); }
.settle { margin-top: 10px; display: grid; gap: 4px; font-size: 18px; }
.ledger-all { margin-top: 10px; font-size: 14px; }
.ledger-all summary { cursor: pointer; color: var(--gold); font-weight: 700; }

/* Two-tier shelf (shelf.js): category tiles, Recently played, and a category page with a Back button. */
.shelf-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.shelf-bar .shelf-h { margin: 0; }
.shelf-back { flex: none; }
.tile.cat { min-height: 120px; align-content: start; }
.tile.cat .tile-icon { font-size: 40px; }
.tile.cat b { font-size: 22px; }
.recent-row { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.recent-row .tile { padding: 10px 12px; }
.recent-row .tile-icon { font-size: 24px; }
.recent-row .tile small { display: none; }
.pick-shelf { margin-top: 10px; }
.pick-shelf .shelf-h { font-size: 17px; margin: 12px 0 6px; }
.pick-shelf .cat-row { grid-template-columns: repeat(2, 1fr); }
.pick-shelf .tile.cat { min-height: 0; }
.tv-shelf .shelf-h { font-size: 30px; margin: 22px 0 12px; }
.tv-shelf .recent-row { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tv-shelf .recent-row .tile-icon { font-size: 36px; }
.tv-shelf .shelf-back { font-size: 24px; padding: 12px 22px; }
.tv-shelf .shelf { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.tv-shelf .tile { padding: 22px; }
.tv-shelf .tile-icon { font-size: 48px; }
.tv-shelf .tile.cat { min-height: 170px; }
.tv-shelf .tile.cat .tile-icon { font-size: 64px; }
.tv-shelf { display: block; }

/* ---------- House Rules page (rules.html / rules.js) and the lobby's rules picker ---------- */
.rules-page .ph-top { gap: 12px; }
.rules-page a { color: inherit; }
.r-back { text-decoration: none; background: rgba(255,255,255,.12); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 800; min-height: 44px; display: inline-flex; align-items: center; }
.r-title { flex: 1; font-family: 'Fredoka', sans-serif; font-size: 20px; font-weight: 600; }
.r-game { padding: 14px; }
.r-game h2 { margin: 0 0 4px; font-family: 'Fredoka', sans-serif; font-size: 22px; font-weight: 600; }
.r-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.r-chips a.chip, .r-chips button.chip { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.r-chips .chip.new { border-style: dashed; color: var(--gold); }
.r-field { padding: 12px 0; border-top: 1px solid var(--line); }
.r-field:first-of-type { border-top: 0; }
.r-field.bad .r-label { color: #ff9aa0; }
.r-label { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.r-help { color: var(--mute); font-size: 14px; margin-top: 6px; line-height: 1.35; }
.r-err { color: #ff9aa0; font-weight: 800; font-size: 15px; margin-top: 6px; }
.r-err::before { content: '⚠ '; }
.r-num { display: flex; align-items: center; gap: 8px; }
.r-num .icon-btn { width: 52px; height: 52px; font-size: 26px; flex: none; }
.r-num input { text-align: center; font-weight: 800; font-size: 22px; min-height: 52px; }
.r-switch { display: flex; align-items: center; gap: 12px; width: 100%; background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--ink); border-radius: 14px; padding: 10px 14px; min-height: 56px; cursor: pointer; font-weight: 800; font-size: 17px; }
.r-switch .knob { width: 54px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.2); position: relative; flex: none; transition: background .15s; }
.r-switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.r-switch.on .knob { background: var(--go); }
.r-switch.on .knob::after { left: 27px; }
.r-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.r-choices .chip { min-height: 48px; font-size: 16px; }
.r-table { width: 100%; border-collapse: collapse; }
.r-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 4px 4px; }
.r-table td { padding: 5px 4px; vertical-align: middle; }
.r-table td.lab { font-weight: 700; }
.r-table input { padding: 8px 10px; font-size: 17px; min-height: 46px; }
.r-table input.bad { outline: 2px solid #ff9aa0; }
.r-table .r-switch { padding: 6px 8px; min-height: 46px; width: auto; }
.r-table .r-switch .knob { width: 44px; height: 26px; }
.r-table .r-switch .knob::after { width: 20px; height: 20px; }
.r-table .r-switch.on .knob::after { left: 21px; }
.r-table tr.off td.lab { opacity: .5; text-decoration: line-through; }
.r-tact { display: flex; gap: 8px; margin-top: 8px; }
.r-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.r-actions .btn { flex: 1; min-width: 120px; min-height: 52px; }
.r-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 10px 0 0; }
.r-sum dt { color: var(--mute); }
.r-sum dd { margin: 0; font-weight: 800; text-align: right; }
.r-sum .sub { grid-column: 1 / -1; font-size: 15px; background: rgba(0,0,0,.2); border-radius: 10px; padding: 8px 10px; }
.r-badge { display: inline-block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.14); border-radius: 8px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.r-name-in { margin-bottom: 4px; }
.r-pin-in { letter-spacing: .3em; text-align: center; font-weight: 800; }
.r-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.r-copy select, .rules-select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: #111; font-size: 18px; font-weight: 800; min-height: 52px; }
.rules-tag { font-weight: 800; font-size: 17px; }
.rules-tag small { color: var(--gold); font-weight: 800; }
.rules-panel .fine a { color: var(--gold); }
.home-rules { text-align: center; margin: 14px 0 0; }
.home-rules a { color: var(--gold); font-weight: 800; }
.r-table { table-layout: fixed; }
.r-table th:nth-child(2), .r-table td:nth-child(2) { width: 104px; }
.r-table th:last-child, .r-table td:last-child { width: 62px; }
.r-table input { min-width: 0; width: 100%; padding: 8px 8px; }
.r-table td.lab { overflow-wrap: anywhere; font-size: 15px; }
.r-table .r-switch { padding: 6px 6px; justify-content: center; }
.tv .rules-tag { font-size: 24px; margin-top: 10px; }
