:root {
  --chrome: #0a251c;
  --sheet: #113428;
  --felt: #17604a;
  --felt-deep: #0c3b2c;
  --ink: #f4f0e3;
  --muted: rgba(244, 240, 227, .66);
  --line: rgba(255, 255, 255, .14);
  --gold: #e4b85c;
  --red: #ff8a80;
  --danger: #d9534f;
  --cw: 80px; --tw: 68px; --mw: 40px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--chrome); color: var(--ink);
  font: 15px/1.4 var(--sans); -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }
code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 5px; font-size: .92em; }

.sH, .sD { color: var(--red); }
.sS, .sC { color: var(--ink); }
.sN { color: var(--gold); }
.gold { color: var(--gold); }
.dimtx { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- buttons and form bits ---------- */

.btn {
  min-height: 42px; padding: 8px 16px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1d1608; }
.btn.primary:hover:not(:disabled) { background: #f0c874; }
.btn.primary .ctext { color: inherit; }
.btn.danger { background: rgba(217, 83, 79, .2); border-color: rgba(217, 83, 79, .7); }
.btn.big { min-height: 50px; font-size: 16px; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.icon {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: none;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.icon:hover { background: rgba(255, 255, 255, .1); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

input[type=text] {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-size: 16px;
}
.field { display: block; margin: 0 0 14px; }
.flabel { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-height: 40px; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--line); font-size: 14px;
}
.seg.tight button { flex: 1 1 40px; padding: 6px 4px; }
.seg button.on { background: var(--gold); border-color: var(--gold); color: #1d1608; font-weight: 600; }
.seg button.on span { color: inherit; }
.seg button:disabled { cursor: default; }

/* ---------- home and lobby ---------- */

.home { max-width: 680px; margin: 0 auto; padding: 20px 14px calc(28px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; }
.home.lobby { padding-top: 0; }
.brand { margin: 6px 4px 18px; }
.brand h1 { line-height: 0; }
.brand svg { display: block; height: clamp(62px, 19vw, 92px); width: auto; max-width: 100%; }
/* The line under the logo starts where its lettering does (the lettering begins 41.9% of the way across). */
.brand p { margin: 6px 0 0; color: var(--muted); padding-left: calc(clamp(62px, 19vw, 92px) * 1.607); }
/* The pair of cards on each game's tile. */
.logo { position: relative; width: 74px; height: 70px; flex: none; }
.logo .card { --w: 44px; position: absolute; top: 4px; }
.logo .l1 { left: 4px; transform: rotate(-12deg); }
.logo .l2 { left: 26px; transform: rotate(9deg); }

.gamegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; } /* the column count is set to keep rows even */
.gamecard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; cursor: pointer;
  min-height: 176px; padding: 14px 14px 16px; border-radius: 16px; background: var(--sheet); border: 1px solid var(--line);
}
.gamecard:hover { border-color: var(--gold); background: #153d2f; }
.gamecard .logo { margin-bottom: 8px; }
/* Shed: a hand of exactly three, fanned */
.gamecard.g-shed .l1, .gamecard.g-kalooki .l1 { left: 0; transform: rotate(-15deg); }
.gamecard.g-shed .l2, .gamecard.g-kalooki .l2 { left: 15px; top: 0; transform: none; }
.gamecard.g-shed .l3, .gamecard.g-kalooki .l3 { left: 30px; transform: rotate(15deg); }
/* Bridge: a fan of four, one of each suit. */
.gamecard.g-bridge .logo { width: 90px; }
.gamecard.g-bridge .logo .card { --w: 38px; top: 8px; }
.gamecard.g-bridge .l1 { left: 0; transform: rotate(-18deg); }
.gamecard.g-bridge .l2 { left: 15px; top: 3px; transform: rotate(-6deg); }
.gamecard.g-bridge .l3 { left: 30px; top: 3px; transform: rotate(6deg); }
.gamecard.g-bridge .l4 { left: 45px; transform: rotate(18deg); }
/* Rummy: a run of four and a set of three, as they lie on the table. */
.gamecard.g-rummy .logo { width: 98px; }
.gamecard.g-rummy .logo .card { --w: 28px; transform: none; }
.gamecard.g-rummy .l1 { left: 0; top: 0; }
.gamecard.g-rummy .l2 { left: 14px; top: 0; }
.gamecard.g-rummy .l3 { left: 28px; top: 0; }
.gamecard.g-rummy .l4 { left: 42px; top: 0; }
.gamecard.g-rummy .l5 { left: 42px; top: 30px; }
.gamecard.g-rummy .l6 { left: 56px; top: 30px; }
.gamecard.g-rummy .l7 { left: 70px; top: 30px; }
/* 52 Pickup: the deck thrown across the floor */
.gamecard.g-pickup .logo { width: 96px; }
.gamecard.g-pickup .logo .card { --w: 30px; }
.gamecard.g-pickup .l1 { left: 2px; top: 26px; transform: rotate(-40deg); }
.gamecard.g-pickup .l2 { left: 12px; top: 0; transform: rotate(18deg); }
.gamecard.g-pickup .l3 { left: 28px; top: 30px; transform: rotate(74deg); }
.gamecard.g-pickup .l4 { left: 38px; top: 2px; transform: rotate(-22deg); }
.gamecard.g-pickup .l5 { left: 52px; top: 28px; transform: rotate(33deg); }
.gamecard.g-pickup .l6 { left: 64px; top: 4px; transform: rotate(-64deg); }
.gamecard.g-pickup .l7 { left: 24px; top: 14px; transform: rotate(-6deg); }
.gamecard b { font-family: var(--serif); font-size: 22px; }
.gamecard small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.opencount { margin-top: auto; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px; background: var(--gold); color: #1d1608; }

.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.sheet h2 { font-size: 20px; margin-bottom: 12px; }
.gametabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 16px; }
.gametabs button {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  padding: 10px 12px; border-radius: 12px; cursor: pointer; min-height: 64px;
  background: rgba(0, 0, 0, .22); border: 1px solid var(--line);
}
.gametabs b { font-family: var(--serif); font-size: 18px; }
.gametabs small { color: var(--muted); font-size: 12px; line-height: 1.25; }
.gametabs button.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: rgba(228, 184, 92, .12); }
.custom { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.custom summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.custom[open] summary { margin-bottom: 4px; }
.cta { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.hint + .field { margin-top: 16px; }
.hint.lead { margin: -6px 0 12px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; }
.tip { display: block; width: fit-content; margin: 12px auto 0; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--line); color: var(--gold); font-size: 14px; font-weight: 600; text-decoration: none; }
.tip:hover { border-color: var(--gold); }
a.tip { color: var(--gold); font-weight: 600; }
.btn.tipbtn { text-decoration: none; color: var(--gold); white-space: nowrap; font-size: clamp(11.5px, 3.45vw, 14px); padding-left: 12px; padding-right: 12px; }
.tip { white-space: nowrap; font-size: clamp(12px, 3.6vw, 14px); }
.tipwrap { display: flex; flex-direction: column; align-items: center; margin-top: 14px; }
.tipwrap .tip { margin-top: 5px; }
.tiplead { font-size: 13px; color: var(--muted); }
.tip.line { margin-top: 14px; padding: 8px 14px; font-size: clamp(11px, 3.3vw, 14px); }
.prose .tipwrap { align-items: flex-start; margin-top: 2px; }
.prose .tip { margin: 4px 0 0; }
.wait { color: var(--muted); font-style: italic; }

.rooms, .seats { list-style: none; margin: 0; padding: 0; }
.rooms li, .seats li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rooms li:first-child, .seats li:first-child { border-top: 0; }
.rooms li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rooms small { color: var(--muted); }
.seats .who { flex: 1; min-width: 0; }
.seats .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; }
.seats .bot .dot { background: #7fb6a3; }
.seats .empty .dot { background: none; border: 1px dashed var(--muted); }
.seats .empty .who { color: var(--muted); }
.share, .codejoin .row { display: flex; gap: 8px; }
.codejoin { display: block; }
.rooms + .codejoin, .hint + .codejoin { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share { margin-top: 0; }
@media (max-width: 559px) { .share { flex-wrap: wrap; } .share input { flex: 1 1 100%; } .share .btn { flex: 1; } }
.codejoin input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .2em; }
.codejoin input::placeholder { text-transform: none; letter-spacing: normal; }
.rules { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.rules dt { color: var(--muted); }
.rules dd { margin: 0; }

@media (min-width: 560px) {
  .cta { flex-direction: row; flex-wrap: wrap; }
  .cta .btn { flex: 1 1 auto; }
}

/* ---------- top bar ---------- */

.bar {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 2px 6px;
  padding-top: env(safe-area-inset-top); background: var(--chrome); border-bottom: 1px solid var(--line);
}
.bar .title { font-family: var(--serif); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.bar .info { flex: 1; display: flex; justify-content: flex-end; gap: 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.tag { border: 1px solid var(--line); border-radius: 20px; padding: 0 8px; }
.lobby .bar { margin: 0 -14px 14px; }

/* ---------- cards ---------- */

.card {
  --w: var(--cw);
  position: relative; flex: none; width: var(--w); height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * .09); background: linear-gradient(160deg, #fffdf7, #f1ead8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 0, 0, .22);
  color: #171b20; user-select: none; -webkit-user-select: none; overflow: hidden;
}
.card.red { color: #c5222b; }
.card .idx { position: absolute; top: 4%; left: 6%; display: flex; flex-direction: column; align-items: center; line-height: .95; }
.card .idx b { font-size: calc(var(--w) * .31); font-weight: 700; letter-spacing: -.05em; }
.card .idx i { font-style: normal; font-size: calc(var(--w) * .27); }
.card .pip { position: absolute; right: 7%; bottom: 3%; font-size: calc(var(--w) * .6); line-height: 1; }
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 2px, transparent 2px 7px),
    #8c2f39;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 0, 0, .25), inset 0 0 0 calc(var(--w) * .06) #f6f0df;
}
.card.slot { background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.card.mini { --w: var(--mw); }
.card.tiny { --w: 13px; }
.ctext { font-weight: 700; white-space: nowrap; }

/* ---------- table ---------- */

.table { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; position: relative; }
.felt {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #1c6e55 0%, var(--felt) 45%, var(--felt-deep) 100%);
}
.ring { position: absolute; inset: 7% 5%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .055); pointer-events: none; }

.plate { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 3; }
.pbox {
  position: relative; min-width: 82px; max-width: 124px; padding: 4px 10px 5px; border-radius: 11px; text-align: center;
  background: rgba(5, 22, 16, .8); border: 1px solid var(--line);
}
.pname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--red); }
.off { color: var(--red); }
.plate.turn .pbox, .dlabel.turn { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 20px rgba(228, 184, 92, .55); }
.plate.thinking .psub::after { content: " …"; }
.plate.vul .pbox { border-color: rgba(255, 138, 128, .75); }
.plate.folded { opacity: .45; }
/* A seat the computer is playing for someone (blue) or that the game is waiting on (gold). */
.plate.covered .pbox { border: 1px dashed #7cc7ff; background: #12324a; }
.plate.away .pbox { border: 1px dashed var(--gold); }
.ptag { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: #7cc7ff; white-space: nowrap; }
.plate.away .ptag { color: var(--gold); }
.tclock { display: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.tclock.soon, .tclock.mine { display: inline-block; }
.tclock.soon { color: #ff8a80; animation: pulse 1s infinite; }
.prompt .tclock { margin-left: 8px; }
.hand.inert { pointer-events: none; opacity: .45; }
.plate.won .pbox { background: #5a4513; border-color: var(--gold); }
.badges { position: absolute; top: -10px; right: -8px; display: flex; gap: 2px; }
.badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px;
  background: var(--ink); color: #0b2a20; font-size: 10px; font-weight: 800;
}
.badge.gold { background: var(--gold); }
.badge.word { padding: 0 8px; font-size: 10.5px; letter-spacing: .03em; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); transform: translateY(-6px); }
.meplate .badge.word { transform: none; }
/* Hearts, where penalty cards taken are shown: small face-up cards beside each player */
.pens { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 0; max-width: 150px; padding-left: 6px; }
.pen { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 22px; height: 29px; margin-left: -6px; border-radius: 4px; line-height: 1; background: #f6f1e4; color: #1a1a1a; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .45); }
.pen b { font-size: 12px; letter-spacing: -.04em; }
.pen i { font-style: normal; font-size: 11px; }
.pen.sH, .pen.sD { color: #c62828; }
.pen.big { width: 27px; height: 35px; margin-right: 8px; box-shadow: 0 0 0 2px var(--gold), 0 1px 4px rgba(0, 0, 0, .5); }
.pen.big b { font-size: 14px; }
.pen.big i { font-size: 13px; }
.pen.enter { animation: penin .45s ease-out both; }
@keyframes penin { from { transform: translateY(-14px) scale(1.7); opacity: 0; } }
.mypens { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mypens .pens { max-width: 300px; }
.backs { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.bfan { display: inline-flex; }
.bfan .card { --w: var(--bw, 13px); }
.bfan .card + .card { margin-left: calc(var(--bs) - var(--bw, 13px)); }
.game-shed .plate .backs { --bw: 19px; }
.holes { display: flex; }
.holes .card + .card { margin-left: calc(var(--mw) * -.42); }
.made { font-size: 11px; color: var(--gold); max-width: 120px; text-align: center; line-height: 1.2; }
.pill { font-size: 12px; font-weight: 700; padding: 0 8px; border-radius: 10px; background: var(--gold); color: #1d1608; font-variant-numeric: tabular-nums; }
.allin { color: var(--gold); font-weight: 700; }

.note, .chipbox {
  position: absolute; z-index: 2; background: rgba(5, 22, 16, .6); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-size: 12.5px;
}
.note { left: 50%; top: 46%; transform: translate(-50%, -50%); font-size: 15px; white-space: nowrap; }
.note.wrap { white-space: normal; width: min(86%, 400px); text-align: center; font-size: 13.5px; line-height: 1.35; }
.fdhand {
  position: absolute; z-index: 2; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px;
  background: rgba(5, 22, 16, .6); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; font-size: 12px; white-space: nowrap;
}
.fdhand small { color: var(--muted); }
.card.called { box-shadow: 0 0 0 2px var(--gold), 0 1px 3px rgba(0, 0, 0, .4); }
.chipbox { left: 8px; bottom: 8px; max-width: 42vw; line-height: 1.35; }
.chipbox .big { font-size: 17px; }
.chipbox small { font-size: 12px; color: var(--muted); font-weight: 400; }
.dbltag { color: var(--red); font-weight: 700; }

.tcard { --w: var(--tw); position: absolute; transform: translate(-50%, -50%); z-index: 4; }
.tcard.enter { animation: enter .22s ease-out; }
.tcard.collect { animation: collect .4s ease-in .8s forwards; }
.tcard.enter.collect { animation: enter .22s ease-out, collect .4s ease-in .8s forwards; }
.tcard.winner { box-shadow: 0 0 0 3px var(--gold), 0 2px 10px rgba(0, 0, 0, .5); z-index: 5; }
@keyframes enter { from { transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(.85); opacity: .3; } }
@keyframes collect { to { transform: translate(calc(-50% + var(--wx)), calc(-50% + var(--wy))) scale(.55); opacity: 0; } }
/* Tripoley: the round board of nine stakes (the Pot in the middle), and the rummy sequence below it */
.tboard {
  position: absolute; left: 50%; top: 41%; transform: translate(-50%, -50%); z-index: 2; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(9, 38, 28, .96) 0 23%, transparent 23.4%),
    repeating-conic-gradient(from 22.5deg, rgba(228, 184, 92, .5) 0 .7deg, transparent .7deg 45deg),
    radial-gradient(circle, rgba(5, 22, 16, .78), rgba(5, 22, 16, .6));
  border: 2px solid rgba(228, 184, 92, .65); box-shadow: 0 0 0 5px rgba(5, 22, 16, .45), 0 6px 22px rgba(0, 0, 0, .4);
}
.twedge { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.tstake { position: absolute; transform: translate(-50%, -50%); z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; text-align: center; }
.tstake .tl { white-space: nowrap; color: var(--muted); font-weight: 600; }
.tstake b { font-family: var(--serif); font-size: 1.3em; }
.tstake.tpot { left: 50%; top: 50%; width: 44%; height: 44%; justify-content: center; border-radius: 50%; border: 2px solid rgba(228, 184, 92, .5); background: #0b281e; }
.tstake.tpot .tl { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .95em; }
.tstake.tpot b { font-size: 1.7em; }
.tstake.tpot.live { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(228, 184, 92, .55); }
.tstake.live .tl, .tstake.paid .tl, .tstake.paid b { color: var(--gold); }
.tstake small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); z-index: 2; margin-top: 1px; white-space: nowrap; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #10261d; background: var(--gold); }
.tcorner {
  position: absolute; transform: translate(-50%, -50%); z-index: 1; width: 3.1em; height: 3.1em; display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05; border-radius: 9px; border: 1.5px solid rgba(228, 184, 92, .45); background: rgba(5, 22, 16, .8); box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.tcorner b { font-family: var(--serif); font-size: 1.15em; }
.tcorner.far { transform: none; z-index: 2; width: 3.4em; height: 3.4em; }
.tcorner.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(228, 184, 92, .5); }
.tcorner.on b, .tcorner.paid b { color: var(--gold); }
.tcorner.pick { cursor: pointer; border-color: var(--gold); animation: sglow 1.4s ease-in-out infinite; }
.tcorner small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); z-index: 2; margin-top: 2px; white-space: nowrap; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #10261d; background: var(--gold); }
.tshow { position: absolute; left: 50%; top: 69%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; gap: 5px; width: min(360px, 84%); }
.tshow .ts { display: grid; grid-template-columns: minmax(48px, 1fr) auto minmax(0, 1.5fr); align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; background: rgba(5, 22, 16, .6); border: 1px solid var(--line); font-size: 12px; line-height: 1.2; }
.tshow .ts.win { border-color: var(--gold); }
.tshow .ts.win > b, .tshow .ts.win > span { color: var(--gold); }
.tshow .ts > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tshow .ts > span { color: var(--muted); }
.tshow .card.mini { --w: calc(var(--mw) * .8); }
.tsteps { display: flex; justify-content: center; gap: 6px; padding: 7px 10px 0; font-size: 12.5px; }
.tsteps span { display: inline-flex; align-items: center; gap: 6px; padding: 2px 13px 2px 3px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap; }
.tsteps i { font-style: normal; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .09); }
.tsteps .now { color: #1d1608; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px rgba(228, 184, 92, .45); }
.tsteps .now i { background: rgba(0, 0, 0, .2); }
.tsteps .now.enter { animation: stepin .5s ease-out both; }
.tsteps .done { opacity: .6; }
@keyframes stepin { from { transform: scale(1.35); box-shadow: 0 0 30px 6px rgba(228, 184, 92, .9); } }
.trun { position: absolute; left: 50%; top: 67%; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: flex-start; justify-content: center; gap: 3px; max-width: 78%; flex-wrap: wrap; }
.trun .tr { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
.trun .tr.enter { animation: trin .25s ease-out both; }
.trun .tstop { align-self: center; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #10261d; background: var(--red); }
@keyframes trin { from { transform: translateY(-14px) scale(1.25); opacity: 0; } }
.howto { margin: 0 0 8px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
/* 52 Pickup: the deck riffles in the middle, tumbles across the table and lands in a mess */
.game-pickup .ring { display: none; }
.pcard {
  --w: clamp(38px, 11.5vw, 68px);
  position: absolute; left: var(--x); top: var(--y); z-index: 3;
  transform: translate(-50%, -50%) rotate(var(--r)); touch-action: manipulation;
}
.pcard.ok { cursor: pointer; }
.pcard.mys::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: calc(var(--w) * .5); color: var(--gold); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.ppop {
  position: absolute; z-index: 7; pointer-events: none; transform: translate(-50%, -50%);
  padding: 2px 10px; border-radius: 999px; font-family: var(--serif); font-weight: 700; font-size: 22px;
  color: #10261d; background: var(--gold); box-shadow: 0 4px 14px rgba(0, 0, 0, .45); animation: ppop 1.3s ease-out both;
}
.ppop.bad { background: var(--red); }
.ppop.nil { background: #cfd6d2; }
@keyframes ppop {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  70% { transform: translate(-50%, -90%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(1); opacity: 0; }
}
.ctag { position: absolute; right: 4px; bottom: 4px; padding: 0 6px; border-radius: 999px; font: 700 12px/18px var(--sans); color: #10261d; background: var(--gold); }
.ctag.bad { background: var(--red); }
.pcard.gone { visibility: hidden; }
.pcard.toss { animation: toss 1.3s cubic-bezier(.3, .1, .3, 1) both; }
.pcard.ghost { z-index: 5; pointer-events: none; animation: grabbed .4s ease-in both; }
@keyframes toss {
  0%, 22% { left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(0deg); }
  11% { left: 50%; top: 52%; transform: translate(calc(-50% + var(--sx)), -50%) rotate(var(--sr)); }
  64% { left: var(--mx); top: var(--my); transform: translate(-50%, -50%) rotate(calc(var(--r) * -2)) scale(1.3); }
  100% { left: var(--x); top: var(--y); transform: translate(-50%, -50%) rotate(var(--r)); }
}
@keyframes grabbed {
  from { left: var(--x); top: var(--y); transform: translate(-50%, -50%) rotate(var(--r)); opacity: 1; }
  to { left: var(--gx); top: var(--gy); transform: translate(-50%, -50%) rotate(0deg) scale(.45); opacity: 0; }
}
.pscore { position: absolute; left: 0; right: 0; top: 0; z-index: 6; display: flex; gap: 4px; padding: 6px; pointer-events: none; }
.pchip {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.15;
  padding: 4px 4px 5px; border-radius: 10px; background: rgba(5, 22, 16, .72); border: 1px solid var(--line); font-size: 12px;
}
.pchip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pchip b { font-family: var(--serif); font-size: 20px; }
.pchip small { font-size: 10.5px; color: var(--muted); }
.pchip.me { border-color: rgba(255, 255, 255, .5); }
.pchip.me span { color: inherit; }
.pchip.lead b { color: var(--gold); }
.ptimer { font-variant-numeric: tabular-nums; }
.shout {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%); z-index: 8; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .7); animation: shout 2.4s ease-out both;
}
.shout b { font-family: var(--serif); font-size: clamp(34px, 11vw, 64px); color: var(--gold); }
@keyframes shout {
  0% { transform: translate(-50%, -50%) scale(.4) rotate(-6deg); opacity: 0; }
  12% { transform: translate(-50%, -50%) scale(1.08) rotate(-3deg); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.15) rotate(-3deg); opacity: 0; }
}

@keyframes flip { from { transform: rotateY(90deg) translateY(-8px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .25; } }
.pulse { animation: pulse 1.2s infinite; }

.board { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.pot { margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.pot b { color: var(--gold); font-size: 18px; font-variant-numeric: tabular-nums; }
.bcards { display: flex; gap: 5px; justify-content: center; }
.bcard { --w: min(var(--tw), calc((100vw - 214px) / 5)); }
.bcard.flip { animation: flip .3s ease-out; }
.bcard .idx b { font-size: calc(var(--w) * .36); }

.auction {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 2;
  width: min(330px, calc(100% - 196px)); display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(5, 22, 16, .62); border: 1px solid var(--line); border-radius: 12px; padding: 6px; row-gap: 2px;
}
.ahead { font-size: 11px; color: var(--muted); text-align: center; padding: 2px 2px 5px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ahead.vul { color: var(--red); }
.acell { text-align: center; min-height: 24px; font-size: 14px; line-height: 24px; }
.call.pass { color: var(--muted); font-size: 12.5px; }
.call.dbl, .call.rdbl { color: var(--red); font-weight: 700; font-size: 12.5px; }

.dummy { position: absolute; z-index: 2; display: flex; gap: 5px; align-items: flex-start; }
.dlabel { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 9px; background: rgba(5, 22, 16, .8); border: 1px solid var(--line); white-space: nowrap; align-self: center; }
.drow { display: flex; }
.drow .card + .card { margin-left: calc(var(--mw) * -.5); }
.dummy.rel2, .dummy.rel0 { --mw: min(calc((100vw - 110px) / 8.7), calc(var(--cw) * .74)); left: 50% !important; transform: translateX(-50%); top: 8px !important; }
.dummy.rel0 { top: auto !important; bottom: 8px; }
.dummy.rel1, .dummy.rel3 { flex-direction: column; top: 52% !important; transform: translateY(-50%); }
.dummy.rel1 { left: 6px !important; }
.dummy.rel3 { left: auto !important; right: 6px; align-items: flex-end; }
.dummy.rel1 .dlabel, .dummy.rel3 .dlabel { align-self: auto; }
.dummy .card.dim { filter: brightness(.62); }
.dummy.live .card.ok { cursor: pointer; box-shadow: 0 0 0 2px var(--gold), 0 1px 3px rgba(0, 0, 0, .4); }
.dummy .card.sel { transform: translateY(8px); z-index: 2; }

.panel {
  position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); z-index: 6;
  width: min(380px, 92%); max-height: 94%; overflow: auto; padding: 16px 18px;
  background: rgba(8, 30, 22, .95); border: 1px solid var(--gold); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.panel h2 { font-size: 22px; margin-bottom: 6px; }
.panel p { margin: 0 0 10px; }
.scores { width: 100%; border-collapse: collapse; }
.scores td { padding: 6px 4px; border-top: 1px solid var(--line); }
.scores tr.win td { color: var(--gold); font-weight: 700; }

/* ---------- dock: my seat, controls and hand ---------- */

.dock { background: var(--chrome); border-top: 1px solid var(--line); position: relative; z-index: 7; }
.dock.turn { border-top-color: var(--gold); box-shadow: 0 -2px 18px rgba(228, 184, 92, .28); }
.dockbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px 0; min-height: 34px; }
.meplate { font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.meplate .badge { flex: none; }
.prompt { flex: 1; text-align: right; font-size: 14px; min-width: 0; }
.dock.turn .prompt { color: var(--gold); font-weight: 600; }
.dock > :last-child { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.tip { color: var(--muted); font-weight: 400; }
.playbtn { min-width: 200px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; padding: 8px 10px 0; }
.actions { display: flex; gap: 8px; width: 100%; max-width: 520px; }
.actions .btn { flex: 1; padding: 8px 6px; }
.raise { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; }
.raise input { flex: 1; min-width: 0; height: 34px; accent-color: var(--gold); }
.presets { display: flex; gap: 4px; }
.presets .btn { padding: 4px 8px; }

.hand { display: flex; justify-content: center; padding: 12px 10px calc(8px + env(safe-area-inset-bottom)); min-height: calc(var(--cw) * 1.4 + 20px); }
.hand .card { transition: transform .12s ease-out, filter .12s; }
.hand .card + .card { margin-left: calc(var(--step) - var(--cw)); }
.hand .card.ok { cursor: pointer; }
.hand.choosing .card.ok { transform: translateY(-6px); }
.hand .card.dim { filter: brightness(.6); }
.hand .card.mark { box-shadow: 0 0 0 2px #7cc7ff, 0 1px 3px rgba(0, 0, 0, .4); }
.handkey { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 3px 10px 1px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.handkey .passed { display: flex; gap: 4px; }
.handkey .pen { margin-left: 0; }
.hand .card.sel, .hand.choosing .card.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0, 0, 0, .5); }
.hand.faded { opacity: .45; }
@media (hover: hover) {
  .hand .card.ok:hover { transform: translateY(-12px); }
  .hand .card.sel:hover { transform: translateY(-16px); }
}

.bidbox { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 460px; }
.brow { display: flex; gap: 6px; }
.brow.wrap { flex-wrap: wrap; }
.brow .btn { flex: 1; }
.bid {
  flex: 1; min-width: 0; min-height: 40px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 16px;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line);
}
.bid.rank { flex: 1 0 12%; }
.bid.on { background: rgba(228, 184, 92, .2); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.bid:disabled { opacity: .3; cursor: default; }
.btn.pass { background: rgba(92, 170, 120, .22); border-color: rgba(92, 170, 120, .7); }
.btn.dbl, .btn.rdbl { background: rgba(217, 83, 79, .2); border-color: rgba(217, 83, 79, .7); }

/* ---------- drawer, toast, banner ---------- */

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 90vw); z-index: 20; overflow: auto;
  background: #0d2c22; border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0, 0, 0, .45);
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); padding-top: calc(8px + env(safe-area-inset-top));
  transform: translateX(105%); transition: transform .2s ease-out; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.dhead { display: flex; align-items: center; justify-content: space-between; }
.dhead h3 { font-size: 20px; }
.drawer section { margin-top: 14px; }
.drawer .pref { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.drawer .pref .seg { flex-wrap: nowrap; }
.drawer .pref .seg button { padding: 5px 10px; font-size: 12.5px; white-space: nowrap; }
.tag.crack { display: inline-block; color: var(--red); border-color: var(--red); animation: crack .9s ease-out both; }
@keyframes crack { 0% { transform: scale(1.6) rotate(-6deg); } 20% { transform: scale(1.25) rotate(5deg); } 40% { transform: scale(1.15) rotate(-3deg); } 100% { transform: none; } }
.drawer h4 { font-size: 13px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.lasttrick { display: flex; gap: 10px; }
.lt { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.lt.win { color: var(--gold); }
.log { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.log li { padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .07); }

.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.modal .box { width: min(400px, 100%); background: var(--sheet); border: 1px solid var(--gold); border-radius: 16px; padding: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.modal h2 { font-size: 22px; margin-bottom: 8px; }
.modal p { margin: 0 0 14px; color: var(--muted); }
.modal p.quote { color: inherit; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); overflow-wrap: anywhere; }
.modal ul.missed { list-style: none; margin: 0 0 14px; padding: 8px 12px; max-height: 40vh; overflow: auto; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.modal ul.missed li { padding: 3px 0; overflow-wrap: anywhere; }
.modal ul.missed li.mh { margin-top: 6px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.modal ul.missed li.mh:first-child { margin-top: 0; }
.modal ul.missed .rs { color: var(--red); }
.sharelinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.sharelinks a { flex: 1 1 auto; text-align: center; text-decoration: none; }

#toasts {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: 92vw; pointer-events: none;
}
.toast {
  max-width: 100%; padding: 10px 16px; border-radius: 12px; background: #2b1a19; border: 1px solid var(--danger);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5); transition: opacity .5s; text-align: center;
}
/* Table announcements: the computer taking a seat, someone coming back, a change of host. */
.toast.notice { background: #12324a; border-color: #7cc7ff; font-weight: 600; }
.toast.gone { opacity: 0; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 40; text-align: center; padding: 6px; background: var(--danger); font-size: 13px; font-weight: 600; }

/* ---------- small screens ---------- */

/* Shed: the stock and the pile in the middle, each player's table cards by their name */
.spile { position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%); z-index: 2; width: 74%; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.srow { display: flex; align-items: center; justify-content: center; gap: 12px; }
.sstock, .sside { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: var(--mw); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sdir { font-size: 22px; line-height: 1; color: var(--gold); }
.sheap { display: flex; align-items: center; min-height: calc(var(--tw) * 1.4); position: relative; }
/* A burn: the cards catch, flare and fall to ash. */
.sheap.ablaze .card { position: relative; z-index: 1; animation: burnup 1.1s ease-in both; animation-delay: var(--bd, 0ms); }
.sflame {
  position: absolute; left: 50%; top: 50%; width: calc(var(--tw) * 3.2); height: calc(var(--tw) * 3.2); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 150, .95), rgba(255, 138, 30, .75) 38%, rgba(255, 60, 0, 0) 70%);
  transform: translate(-50%, -50%) scale(.3); opacity: 0; pointer-events: none;
  animation: flare 1s ease-out both; animation-delay: var(--bd, 0ms);
}
.sneed.hot { animation: hot 1.1s ease-out both; animation-delay: var(--bd, 0ms); }
@keyframes burnup {
  0% { opacity: 1; filter: none; transform: none; box-shadow: 0 0 0 2px #ffb347, 0 0 16px #ff6a00; }
  30% { opacity: 1; filter: sepia(1) saturate(5) hue-rotate(-18deg) brightness(1.15); transform: translateY(-5px) scale(1.07) rotate(-2deg); box-shadow: 0 0 0 3px #ffc46b, 0 0 32px 8px #ff5a00; }
  65% { opacity: .8; filter: sepia(1) saturate(2) hue-rotate(-25deg) brightness(.55); transform: translateY(-2px) scale(1.02) rotate(1deg); box-shadow: 0 0 14px 2px rgba(255, 90, 0, .6); }
  100% { opacity: .38; filter: grayscale(.7); transform: none; }
}
@keyframes flare {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.5); }
}
@keyframes hot { 0%, 40% { background: #ff7a1a; color: #1d1608; transform: scale(1.18); } }
.sheap .card { --w: var(--tw); }
.sheap .card + .card { margin-left: calc(var(--tw) * -.7); }
.sheap .card.enter { animation: trin .22s ease-out both; }
.sheap.burnt .card { opacity: .38; filter: grayscale(.7); }
.sneed { padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(0, 0, 0, .3); color: var(--gold); }
.slast { font-size: 12px; color: var(--muted); text-align: center; }
.stable { display: flex; justify-content: center; gap: 3px; padding-top: 4px; }
.plate .stable { --mw: 26px; }
.sslot { position: relative; }
.sslot .under { position: absolute; left: 0; top: -4px; }
.sslot .card:not(.under) { position: relative; z-index: 1; transition: transform .12s ease-out; }
.stable.me { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 3; gap: 7px; --mw: calc(var(--cw) * .62); }
.stable .card.ok { cursor: pointer; box-shadow: 0 0 0 2px var(--gold), 0 1px 3px rgba(0, 0, 0, .4); }
.stable .card.dim { filter: brightness(.6); }
.stable .card.sel { transform: translateY(-9px); box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0, 0, 0, .5); }
/* A pick-up: what was tried is held up in the middle, then goes to the player; a copy stays beside them. */
.sheap.taken .card { position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--red), 0 2px 10px rgba(0, 0, 0, .5); animation: taken 2.3s ease-in both; animation-delay: var(--bd, 0ms); }
@keyframes taken {
  0% { transform: scale(1.3); opacity: 0; }
  7%, 68% { transform: scale(1.12); opacity: 1; }
  100% { transform: translate(var(--wx), var(--wy)) scale(.5); opacity: 0; }
}
.sneed.bad { background: var(--red); color: #2a0b08; }
.stook { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px; padding: 2px 6px; border-radius: 8px; background: rgba(0, 0, 0, .3); font-size: 10.5px; color: var(--muted); white-space: nowrap; --mw: 22px; }
.stook .card { box-shadow: 0 0 0 2px var(--red); }
/* A word under each card in the hand that does something. */
.hand.noted { padding-bottom: 3px; min-height: 0; }
.cnotes { position: relative; margin: 1px auto 0; height: 22px; }
.cnotes.two { height: 36px; }
.cmark { position: absolute; top: 0; height: 6px; box-sizing: border-box; border: 2px solid rgba(228, 184, 92, .6); border-top: 0; border-radius: 0 0 3px 3px; pointer-events: none; }
.cnote { position: absolute; top: 7px; transform: translateX(-50%); padding: 0 2px; text-align: center; font: 700 10.5px/14px var(--sans); color: var(--gold); white-space: nowrap; pointer-events: none; }
.cnote.low { top: 21px; }
/* Hand gone: the cards to play are up on the table. */
.stable.me.live {
  --mw: calc(var(--cw) * .8); gap: 9px; padding: 9px 13px 7px; border-radius: 14px; background: rgba(228, 184, 92, .14);
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(228, 184, 92, .5); animation: sglow 1.4s ease-in-out infinite;
}
@keyframes sglow { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 38px 4px rgba(228, 184, 92, .9); } }
.handnote { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 12px; text-align: center; font-size: 13px; color: var(--muted); }
.handnote.turn b { font-family: var(--serif); font-size: 22px; color: var(--gold); }
.handnote.turn span { color: var(--ink); font-weight: 600; }
.handnote.turn i { order: -1; font-style: normal; font-size: 20px; line-height: 1; color: var(--gold); animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-5px); } }
.hands .hand { min-height: 0; padding-bottom: 0; }
.hands .hand + .hand { padding-top: 0; margin-top: calc(var(--cw) * -.62); }
.hands .hand:last-child { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }

/* The Daily Scatter board */
.bhead { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 4px; font-size: 15px; }
.bhead small { font-weight: 400; font-size: 12px; color: var(--muted); }
.dboard { list-style: none; margin: 6px 0 10px; padding: 0; text-align: left; }
.dboard li { display: flex; align-items: baseline; gap: 10px; padding: 5px 2px; border-top: 1px solid rgba(255, 255, 255, .08); font-variant-numeric: tabular-nums; }
.dboard li:first-child { border-top: 0; }
.dboard .bn { flex: none; width: 1.6em; text-align: right; color: var(--muted); }
.dboard .bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dboard .bname i { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 7px; padding: 0 6px; border-radius: 8px; background: var(--gold); color: #1d1608; }
.dboard .bt { flex: none; color: var(--muted); }
.dboard li.me, .dboard li.me .bt { color: var(--gold); font-weight: 700; }

/* Shed, at the end: what the Shed was left with, the face-down cards turning over one by one */
.sleft { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px; }
.sgroup { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sgroup.under { color: var(--gold); }
.scards { display: flex; flex-wrap: wrap; gap: 4px; }
.sleft .card.mini { --w: max(30px, calc(var(--mw) * .86)); }
.sgroup.wide { flex: 1 1 100%; min-width: 0; }
.scards.fan { flex-wrap: nowrap; gap: 0; --fw: max(30px, calc(var(--mw) * .86)); }
.scards.fan .fc { flex: 1 1 0; min-width: 0; max-width: calc(var(--fw) + 4px); }
.scards.fan .fc:last-child { flex: 0 0 var(--fw); max-width: none; }
.sflip { position: relative; width: max(30px, calc(var(--mw) * .86)); height: calc(max(30px, calc(var(--mw) * .86)) * 1.4); perspective: 500px; }
.sflip .card { position: absolute; left: 0; top: 0; }
.sflip .card.back { animation: sflipout .28s ease-in var(--d) both; }
.sflip .card:not(.back) { animation: sflipin .32s ease-out calc(var(--d) + .28s) both; box-shadow: 0 0 0 2px var(--gold), 0 3px 10px rgba(0, 0, 0, .5); }
@keyframes sflipout { from { transform: rotateY(0); } to { transform: rotateY(90deg); } }
@keyframes sflipin { from { transform: rotateY(-90deg) scale(1.25); } to { transform: rotateY(0) scale(1); } }

@media (max-width: 640px) {
  .pbox { min-width: 70px; max-width: 92px; padding: 3px 7px 4px; }
  .pname { font-size: 12px; }
  .psub { font-size: 11px; }
  .bar .title { font-size: 15px; }
  .bar .info { font-size: 11px; gap: 0; flex-direction: column; align-items: flex-end; line-height: 1.25; }
  .gametabs button { padding: 8px; min-height: 58px; }
  .gametabs b { font-size: 16px; }
  .gametabs small { font-size: 11px; }
  .prompt { font-size: 13px; }
  .chipbox { font-size: 11.5px; padding: 4px 8px; }
  .chipbox .big { font-size: 15px; }
}
@media (max-height: 460px) {
  .bar { min-height: 38px; }
  .hand { padding-top: 8px; }
  .dockbar { padding-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .tcard.enter, .bcard.flip, .pulse, .pcard.toss, .pcard.ghost, .shout { animation: none; }
  .sheap.ablaze .card, .sneed.hot, .stable.me.live, .handnote.turn i, .tsteps .now.enter, .tcorner.pick, .tag.crack, .pen.enter { animation: none; }
  .sheap.taken .card { animation: none; opacity: .45; }
  .sflame { display: none; }
  .pcard.ghost { display: none; }
  .tcard.collect, .tcard.enter.collect { animation: collect .01s linear 1s forwards; }
  .hand .card, .drawer { transition: none; }
  .sflip .card.back { display: none; }
  .sflip .card:not(.back) { animation: none; }
}

/* ---------- results ---------- */
.more { display: flex; justify-content: center; gap: 10px; margin: 0 0 14px; }
.hint.first { margin-top: 0; }
.results { list-style: none; margin: 0; padding: 0; }
.result { padding: 14px 0; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; padding-top: 0; }
.result:last-child { padding-bottom: 0; }
.rhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 8px; }
.rhead b { font-family: var(--serif); font-size: 17px; }
.rhead small { color: var(--muted); font-size: 12.5px; }
.rplayers { list-style: none; margin: 0; padding: 0; }
.rplayers li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; color: var(--muted); }
.rplayers li.won { color: inherit; }
.rplayers li.won b { color: var(--gold); }
.rname { min-width: 0; overflow-wrap: anywhere; }
.rname i { font-style: normal; font-size: 11.5px; margin-left: 7px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.rname i.rwon { border-color: var(--gold); color: var(--gold); }
.rscore { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rsolo { margin: 0; }
.rsolo b { color: var(--gold); }

/* ---------- about and privacy ---------- */
.prose p { margin: 0 0 10px; line-height: 1.5; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin: 6px 0; line-height: 1.5; }
.prose a, .foot a { color: var(--gold); }

/* Rummy and Kalooki: the stock and discards in the middle, with every meld laid out beneath them. */
.rmid { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 2; width: min(80%, 600px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rrow { display: flex; align-items: flex-end; justify-content: center; gap: 16px; }
.rstock, .rtop { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rstock .card, .rtop .card { --w: var(--tw); }
.rstock.ok, .rtop.ok { cursor: pointer; color: var(--gold); }
.rstock.ok .card, .rtop.ok .card { box-shadow: 0 0 0 2px var(--gold), 0 3px 10px rgba(0, 0, 0, .5); }
.rtop .card.enter { animation: trin .22s ease-out both; }
.rmelds { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; max-height: 148px; overflow-y: auto; padding: 3px; }
.rmeld { display: flex; gap: 2px; padding: 4px 5px; border: 0; border-radius: 7px; background: rgba(0, 0, 0, .24); font: inherit; }
.rmeld .pen { margin-left: 0; }
.rmeld.ok { cursor: pointer; background: rgba(228, 184, 92, .22); box-shadow: 0 0 0 2px var(--gold); }
.rmeld.enter { animation: penin .45s ease-out both; }
.rnone { font-size: 12px; color: var(--muted); text-align: center; }
.pen.joker, .card.joker { color: #6a3fb5; }
.pen.joker i { font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.card.joker .jname { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: calc(var(--w) * .2); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.card.joker .pip { font-size: calc(var(--w) * .42); }
.hand.rhand { padding-top: 22px; }
.hand .card.fresh { box-shadow: 0 0 0 2px rgba(228, 184, 92, .8), 0 1px 3px rgba(0, 0, 0, .4); }
.rsort { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.rsort:hover { color: var(--gold); border-color: var(--gold); }
.rscores td { vertical-align: top; }
.rleft { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 0 2px; max-width: 250px; }
.rleft .pen { margin-left: 0; }
/* On a phone the players sit round the edges, and the piles and melds run down the middle. */
@media (max-width: 639px) {
  .rmid { top: 21%; transform: translateX(-50%); width: 54%; max-height: 77%; }
  .rstock .card, .rtop .card { --w: calc(var(--tw) * .9); }
  .rmelds { max-height: none; min-height: 0; flex: 0 1 auto; gap: 5px; }
  .rmeld { flex-wrap: wrap; justify-content: center; max-width: 100%; row-gap: 3px; }
}

/* Shed: a place on the table whose cards have been played stays empty, and the rest stay put. */
.sslot.gone .card { visibility: hidden; }
/* The Shed's face-down cards are turned over where they lie when the game ends. */
.stable .sflip { width: var(--mw); height: calc(var(--mw) * 1.4); }
.stable .sslot .sflip .card { --w: var(--mw); position: absolute; left: 0; top: 0; z-index: 0; }
.stable.stacked { padding-top: calc(var(--mw) * .7 + 4px); }
.sslot .under.shown { position: absolute; left: 0; top: calc(var(--mw) * -.7); }
.scards .card.last { box-shadow: 0 0 0 2px var(--gold), 0 2px 8px rgba(0, 0, 0, .5); }
/* A pile picked up by this player drops into the hand, and the cards show there as it lands. */
.sheap.taken.mine .card { animation-name: takenmine; }
@keyframes takenmine {
  0% { transform: scale(1.3); opacity: 0; }
  7%, 68% { transform: scale(1.12); opacity: 1; }
  92% { opacity: .85; }
  100% { transform: translate(0, var(--wy)) scale(.95); opacity: 0; }
}
.hand .card.arrive { animation: arrive .32s ease-out var(--ad, 0ms) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-54px); } to { opacity: 1; transform: none; } }
.plate .stable.final { --mw: 40px; }
/* The Shed's game-over panel sits a little higher, clear of the cards turned over below it. */
.game-shed .panel { top: 41%; max-height: 80%; }
