/* The table screen. Rule of the room: everything is either printed on the felt in gold ink,
   or a physical object sitting on it (cards, chips, the dealer button, paper slips).
   Whose turn it is = where the lamp is shining. */
:root { --rail: 3.4vmin; }
body { overflow: hidden; }

#felt {
  --rail: 3.4vmin;
  --seat-w: min(48vmin, 440px);
  --seat-h: 25vmin;
  --trick-cw: 10.5vmin;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255, 236, 190, .06), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, var(--baize-hi) 0%, var(--baize) 50%, var(--baize-deep) 100%);
}
/* Felt nap */
#felt::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .28;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- the rail: walnut edge, padded leather, stitching, brass inlay ---------- */
#rail { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#rail::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: var(--rail);
  background:
    linear-gradient(180deg, rgba(255, 245, 225, .07) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, .35) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .15 0 0 0 0 .1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E"),
    var(--leather);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
#rail::after {
  content: '';
  position: absolute;
  inset: 0;
  border: .7vmin solid var(--walnut-dark);
  box-shadow: inset 0 0 0 .18vmin var(--walnut), inset 0 0 0 .5vmin rgba(0, 0, 0, .35);
}
#rail .stitch {
  position: absolute;
  inset: calc(var(--rail) * .5);
  border: .16vmin dashed rgba(232, 214, 176, .22);
  border-radius: .8vmin;
}
#rail .brass {
  position: absolute;
  inset: var(--rail);
  border: .3vmin solid;
  border-color: #dcbd76 #b08b42 #8e6e2e #b8954e;
  box-shadow:
    0 0 0 .14vmin #0a0705,
    inset 0 1.4vmin 3vmin rgba(0, 0, 0, .42),
    inset 0 0 9vmin rgba(0, 0, 0, .3);
}

/* ---------- printing on the felt ---------- */
#print { position: absolute; inset: 0; pointer-events: none; color: var(--gold-ink); transition: opacity .6s; }
#print svg { width: 100%; height: 100%; display: block; }
#print text { font-family: var(--display); fill: currentColor; letter-spacing: .5em; }
body.in-lobby #print { opacity: .45; }

/* ---------- the lamp ---------- */
#lamp {
  position: absolute; left: 50%; top: 50%;
  width: 84vmin; height: 84vmin; margin: -42vmin 0 0 -42vmin;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 228, 168, .24) 0%, rgba(255, 222, 155, .1) 30%, rgba(255, 215, 140, 0) 62%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: transform 1.1s cubic-bezier(.45, .05, .2, 1), opacity .7s;
}
#lamp.on { opacity: 1; }

/* ---------- seats: each one faces the person sitting on that edge ---------- */
.seat {
  --rot: 0deg;
  --seat-color: var(--seat-0);
  position: absolute;
  width: var(--seat-w);
  height: var(--seat-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1vmin;
  transform: translate(-50%, -50%) rotate(var(--rot));
  transition: transform .5s ease, left .5s ease, top .5s ease;
  z-index: 2;
}
/* --x / --y come from the game's seat layout (js/games.js). */
.seat.side-0 { left: var(--x); top: calc(100% - var(--seat-h) / 2 - var(--rail) - 1.2vmin); }
.seat.side-1 { top: var(--y); left: calc(var(--seat-h) / 2 + var(--rail) + 1.2vmin); --rot: 90deg; }
.seat.side-2 { left: var(--x); top: calc(var(--seat-h) / 2 + var(--rail) + 1.2vmin); --rot: 180deg; }
.seat.side-3 { top: var(--y); left: calc(100% - var(--seat-h) / 2 - var(--rail) - 1.2vmin); --rot: -90deg; }

body.upright .seat { --rot: 0deg !important; }
body.upright .seat.side-1 { left: calc(var(--seat-w) / 2 + var(--rail) + 1.2vmin); }
body.upright .seat.side-3 { left: calc(100% - var(--seat-w) / 2 - var(--rail) - 1.2vmin); }
body.upright .seat.side-2 { flex-direction: column-reverse; justify-content: flex-start; }

/* Up to 8 seats (Hold'em, Veto): smaller placements. */
body.many-seats #felt { --seat-w: min(28vmin, 300px); --seat-h: 21vmin; }
body.many-seats .who .name { font-size: 3vmin; max-width: 19vmin; }
body.many-seats .plate { padding: .8vmin 1.4vmin .9vmin; min-width: 86%; }
body.many-seats .badge { font-size: 1.35vmin; }
body.many-seats .fan .card { --cw: 4.8vmin; margin-left: -3.2vmin; }
body.many-seats .meta { font-size: 1.8vmin; gap: 1.4vmin; }
body.many-seats .bubble { font-size: 2.5vmin; }
body.many-seats .seat-actions button { font-size: 1.4vmin; }

/* The seat's printed box on the felt: a double gold line. */
.plate {
  position: relative;
  min-width: 64%;
  max-width: 100%;
  padding: 1vmin 2.4vmin 1.1vmin;
  text-align: center;
  border-radius: 1.2vmin;
  border: .16vmin solid var(--gold-faint);
  outline: .12vmin solid rgba(218, 188, 118, .16);
  outline-offset: .45vmin;
  transition: border-color .5s, outline-color .5s;
}
.seat.turn .plate { border-color: var(--gold-ink); outline-color: var(--gold-faint); }

.who { display: flex; align-items: center; justify-content: center; gap: 1.1vmin; line-height: 1.05; }
.who .name {
  font-family: var(--display);
  font-size: 3.7vmin;
  letter-spacing: .03em;
  color: var(--ivory);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vmin;
  transition: color .5s, text-shadow .5s;
}
.seat.turn .who .name { color: #fff7de; text-shadow: 0 0 2.4vmin rgba(255, 222, 150, .55); }
/* Seat marker: a little clay chip in that seat's colour */
.who .dot {
  width: 2.3vmin; height: 2.3vmin; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle, var(--seat-color) 0 50%, transparent 51%),
    repeating-conic-gradient(var(--ivory) 0 11deg, var(--seat-color) 11deg 45deg);
  box-shadow: 0 .2vmin .35vmin rgba(0, 0, 0, .5), inset 0 0 0 .1vmin rgba(0, 0, 0, .3);
}
.seat.empty .who .name { font-family: var(--serif); font-style: italic; color: var(--gold-ink); letter-spacing: 0; }
.seat.empty .who .dot { background: transparent; border: .2vmin dashed var(--gold-faint); box-shadow: none; }

.badges { display: flex; gap: .7vmin; align-items: center; }
.badge {
  font-family: var(--ui); font-size: 1.55vmin; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-ink); border: .14vmin solid var(--gold-faint); border-radius: .5vmin; padding: .2vmin .8vmin;
  white-space: nowrap;
}
/* The dealer button is an object: an ivory puck */
.badge.dealer {
  color: var(--paper-ink); border: 0; border-radius: 99px; padding: .45vmin 1.1vmin; letter-spacing: .12em;
  background: radial-gradient(circle at 40% 30%, #fffaf0, #e2d7bd);
  box-shadow: 0 .3vmin .5vmin rgba(0, 0, 0, .5), inset 0 -.2vmin .2vmin rgba(0, 0, 0, .15);
}
.badge.maker {
  color: var(--card-black); border: 0; background: var(--stock); text-transform: none; letter-spacing: .02em;
  font-family: var(--serif); font-size: 1.9vmin; padding: .15vmin .8vmin; box-shadow: 0 .2vmin .4vmin rgba(0, 0, 0, .4);
}
.badge.maker.red { color: var(--card-red); }
.badge.alone { color: #f2b49a; border-color: rgba(242, 180, 154, .45); }
.badge.off { color: rgba(218, 188, 118, .5); border-style: dashed; }
.badge.lost { color: #f0a7a2; border-color: rgba(240, 167, 162, .5); }

.meta {
  margin-top: .5vmin; font-size: 1.95vmin; letter-spacing: .06em; color: var(--gold-ink);
  display: flex; gap: 2vmin; justify-content: center; align-items: center;
}
.meta b { color: var(--ivory); font-family: var(--num); font-weight: 400; font-size: 1.3em; letter-spacing: 0; }
.pips { display: inline-flex; gap: .8vmin; }
.pips i { width: 1.2vmin; height: 1.2vmin; transform: rotate(45deg); border: .16vmin solid var(--gold-faint); }
.pips i.on { background: var(--brass); border-color: var(--brass); }

.seat-actions { display: none; gap: 1vmin; justify-content: center; margin-top: .9vmin; }
.seat-actions button {
  display: none;
  font-family: var(--ui); font-size: 1.6vmin; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .5vmin 1.3vmin; border-radius: .5vmin; cursor: pointer;
  background: transparent; color: var(--gold-ink); border: .14vmin solid var(--gold-faint);
}
.seat-actions button:hover { color: var(--brass-hi); border-color: var(--gold-ink); }
body.in-lobby .seat.empty .addbot,
body.in-lobby .seat.filled .kick,
body.in-game .seat.joinable .addbot,
body.in-game .seat.lost .takeover { display: inline-block; }
body.in-lobby .seat-actions, body.in-game .seat.lost .seat-actions, body.in-game .seat.joinable .seat-actions { display: flex; }
body.in-game .seat.empty { opacity: .38; }
body.in-game .seat.empty .meta { display: none; }
body.in-game .seat.empty .fan { display: none; }

.fan { height: calc(5.5vmin * 1.4); display: flex; justify-content: center; align-items: flex-end; }
.fan .card { --cw: 5.5vmin; margin-left: -3.4vmin; transition: transform .3s; }
.fan .card:first-child { margin-left: 0; }
.seat.out .fan, .seat.out .plate { opacity: .42; }

/* Announcements: a paper slip set down in front of the player */
.bubble {
  position: absolute;
  top: -1.6vmin;
  left: 50%;
  transform: translate(-50%, .8vmin) rotate(-1.5deg);
  opacity: 0;
  padding: .7vmin 2vmin .9vmin;
  border-radius: .4vmin;
  background: var(--stock);
  color: var(--paper-ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.9vmin;
  white-space: nowrap;
  box-shadow: 0 .5vmin 1.4vmin rgba(0, 0, 0, .45);
  pointer-events: none;
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), opacity .25s;
  z-index: 5;
}
.bubble.show { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }
body.upright .seat.side-2 .bubble { top: auto; bottom: -1.6vmin; }

/* ---------- centre of the table ---------- */
#watermark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 44vmin; line-height: 1; color: var(--brass); opacity: .1; pointer-events: none;
  transition: opacity .6s;
}
#watermark.red { color: var(--card-red); opacity: .16; }

#center { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 3; }
#trick .card, #kitty .card {
  --cw: var(--trick-cw);
  position: absolute; left: 0; top: 0;
  transition: transform .5s cubic-bezier(.2, .85, .25, 1), opacity .5s, box-shadow .3s;
  will-change: transform;
}
#felt .card.win { box-shadow: 0 0 0 .3vmin var(--brass-hi), 0 0 4.5vmin rgba(255, 222, 150, .6); z-index: 3; }
#trick .card.gone { opacity: 0; }

/* ---------- lobby ---------- */
#lobby {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: none; flex-direction: column; align-items: center; gap: 1.6vmin; z-index: 4;
}
body.in-lobby #lobby { display: flex; }
.lobby-main { display: flex; align-items: center; gap: 5vmin; }

/* The join card: an ivory table tent */
.tent {
  width: 31vmin; padding: 2.2vmin 2.2vmin 1.8vmin; text-align: center; color: var(--paper-ink);
  border-radius: .8vmin;
  background:
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .03) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, #fbf7ec, var(--stock) 60%, #ebe2cb);
  box-shadow: 0 1.2vmin 3.5vmin rgba(0, 0, 0, .45), 0 0 0 .1vmin rgba(40, 30, 10, .3);
  transform: rotate(-1.2deg);
}
#qr { width: 100%; aspect-ratio: 1; }
#qr svg { width: 100%; height: 100%; display: block; }
#qr svg path, #qr svg rect[fill="black"] { fill: var(--paper-ink); }
.tent-cap { margin: 1.4vmin 0 .2vmin; font-family: var(--display); font-weight: 600; font-size: 2.6vmin; letter-spacing: .01em; white-space: nowrap; }
.tent-room { margin: 0; font-size: 1.6vmin; letter-spacing: .2em; text-transform: uppercase; color: #7a6c58; }
.tent-note { margin: .8vmin 0 0; font-family: var(--serif); font-style: italic; font-size: 1.6vmin; color: #7a6c58; }
.tent-room b { font-family: var(--num); font-weight: 400; font-size: 3.6vmin; letter-spacing: .16em; color: var(--paper-ink); text-transform: none; }

.lobby-info { max-width: 50vmin; }
.eyebrow { margin: 0 0 .8vmin; font-size: 1.6vmin; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-ink); }
.gamepick { display: flex; flex-direction: column; gap: .2vmin; margin-bottom: 1.6vmin; }
.gp {
  display: grid; grid-template-columns: 2.6vmin auto; column-gap: 1vmin; align-items: baseline; padding: .5vmin 0; text-align: left; cursor: pointer;
  background: none; border: 0; color: var(--gold-ink);
}
.gp::before { content: '◇'; font-size: 1.8vmin; color: var(--gold-faint); grid-row: span 2; }
.gp b { font-family: var(--display); font-weight: 400; font-size: 4.2vmin; line-height: 1.05; white-space: nowrap; color: var(--ivory); opacity: .5; transition: opacity .25s; }
.gp small { grid-column: 2; font-size: 1.6vmin; letter-spacing: .05em; opacity: .75; margin-top: .2vmin; }
.gp:hover b { opacity: .8; }
.gp.on::before { content: '◆'; color: var(--brass); }
.gp.on b { opacity: 1; }

.settings { display: flex; gap: 2.4vmin; font-size: 1.9vmin; letter-spacing: .04em; color: var(--gold-ink); margin: 0 0 1.8vmin 3.4vmin; align-items: center; flex-wrap: wrap; }
.settings label { display: inline-flex; align-items: center; gap: .8vmin; }
.settings select {
  font: inherit; letter-spacing: 0; color: var(--ivory); background: transparent; border: 0;
  border-bottom: .14vmin solid var(--gold-faint); padding: .2vmin .4vmin; cursor: pointer;
}
.settings select option { color: #111; }
.settings input { width: 2.2vmin; height: 2.2vmin; accent-color: var(--brass); margin: 0; }
.url { margin: 0 0 1.4vmin 3.4vmin; font-size: 1.55vmin; color: rgba(218, 188, 118, .55); word-break: break-all; }
.warn { margin: 0 0 1.4vmin 3.4vmin; font-size: 1.8vmin; color: #f2c6b4; border-left: .3vmin solid #c46a4c; padding-left: 1.2vmin; }
.lobby-info #startBtn { margin-left: 3.4vmin; }
.mirror { transform: rotate(180deg); font-size: 2.2vmin; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); }
.mirror b { font-family: var(--num); font-weight: 400; font-size: 1.6em; color: var(--ivory); letter-spacing: .16em; }
body.upright .mirror, body.many-seats .mirror { display: none; }
body.many-seats .tent { width: 26vmin; padding: 1.8vmin; }
body.many-seats .gp b { font-size: 3.5vmin; }
body.many-seats .lobby-main { gap: 4vmin; }

/* Brass plate button */
button.big {
  font-family: var(--ui); font-size: 1.75vmin; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; white-space: nowrap;
  padding: 1.9vmin 4.4vmin; border-radius: .3vmin; cursor: pointer;
  color: #17130c;
  background: linear-gradient(180deg, var(--champagne-hi), var(--champagne) 60%, #b89c6c);
  border: 0;
  box-shadow: 0 1vmin 3vmin rgba(205, 180, 135, .14), 0 .3vmin .8vmin rgba(0, 0, 0, .45);
}
button.big:hover { filter: brightness(1.05); }
button.big:active { transform: translateY(.2vmin); box-shadow: 0 .2vmin .5vmin rgba(0, 0, 0, .45); }
button.big:disabled {
  background: transparent; color: var(--gold-ink); border: .14vmin solid var(--gold-faint); box-shadow: none; cursor: default; filter: none;
}
button.big.ghost { background: transparent; color: inherit; border: .14vmin solid currentColor; box-shadow: none; opacity: .75; }

/* ---------- end-of-hand / game-over: a scoring slip ---------- */
#overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-.8deg);
  min-width: 46vmin; max-width: 62vmin; padding: 3.4vmin 5vmin 3vmin; text-align: center;
  color: var(--paper-ink);
  border-radius: .6vmin;
  background:
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .03) 0 1px, transparent 1px 3px),
    linear-gradient(170deg, #fcf8ee, var(--stock) 60%, #ece3cc);
  box-shadow: 0 2vmin 5vmin rgba(0, 0, 0, .5), 0 0 0 .1vmin rgba(40, 30, 10, .3);
  animation: settle .45s cubic-bezier(.2, .9, .3, 1);
  z-index: 10;
}
@keyframes settle { from { transform: translate(-50%, -46%) rotate(-3deg); opacity: 0; } }
#overlay h2 { margin: 0 0 1vmin; font-family: var(--display); font-weight: 600; font-size: 5.6vmin; color: #6e1f28; letter-spacing: .02em; }
#overlay p { margin: .8vmin 0; font-family: var(--serif); font-size: 2.7vmin; }
#overlay .scoreline { font-family: var(--ui); font-size: 2.6vmin; letter-spacing: .02em; margin: 2vmin 0; padding-top: 1.6vmin; border-top: .14vmin solid rgba(42, 35, 32, .2); }
#overlay .scoreline b { font-family: var(--num); font-weight: 400; font-size: 1.5em; }
#overlay .buttons { display: flex; gap: 2vmin; justify-content: center; margin-top: 2.4vmin; }
#overlay .hint { font-family: var(--ui); font-size: 1.8vmin; color: #7a6c58; }
#overlay .tool { color: var(--paper-ink); border-color: rgba(42, 35, 32, .35); }
#overlay .scores { list-style: none; margin: 1.8vmin auto 0; padding: 1.4vmin 0 0; max-width: 40vmin; border-top: .14vmin solid rgba(42, 35, 32, .2); font-family: var(--ui); font-size: 2.2vmin; }
#overlay .scores li { display: flex; align-items: baseline; gap: 1vmin; padding: .3vmin 0; }
#overlay .scores li::after { content: ''; order: 1; flex: 1; border-bottom: .14vmin dotted rgba(42, 35, 32, .35); }
#overlay .scores li b { order: 2; font-family: var(--num); font-weight: 400; font-size: 1.3em; }

/* ---------- toolbar ---------- */
#toolbar {
  position: absolute; right: calc(var(--rail) + 1.6vmin); bottom: calc(var(--rail) + 1.4vmin);
  display: flex; flex-direction: column; gap: .7vmin; align-items: flex-end; z-index: 20;
  opacity: .6; transition: opacity .3s;
}
#toolbar:hover { opacity: 1; }
.pill { font-size: 1.5vmin; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.pill.ok::before { content: '● '; color: #86c294; }
.pill.bad::before { content: '● '; color: #d98a6c; }
.tool {
  font-family: var(--ui); font-size: 1.5vmin; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: .5vmin 1.2vmin; border-radius: .5vmin; cursor: pointer;
  background: transparent; color: var(--gold-ink); border: .14vmin solid var(--gold-faint);
}

/* ---------- Hold'em pieces ---------- */
.chips-count { display: inline-flex; align-items: center; gap: .8vmin; }
.chip-dot, .bet .stack i {
  --chip: #a8323a;
  display: inline-block; width: 2.2vmin; height: 2.2vmin; border-radius: 50%;
  background:
    radial-gradient(circle, var(--chip) 0 40%, rgba(245, 238, 221, .9) 41% 45%, var(--chip) 46% 60%, transparent 61%),
    repeating-conic-gradient(var(--ivory) 0 12deg, var(--chip) 12deg 45deg);
  box-shadow: 0 .15vmin .3vmin rgba(0, 0, 0, .55), inset 0 0 0 .1vmin rgba(0, 0, 0, .3);
}
.bet, .pot-label, .hole-card, .hand-label, .board-card, .cc-pile, .cc-fly {
  position: absolute; left: 0; top: 0;
  transition: transform .55s cubic-bezier(.2, .85, .25, 1), opacity .5s;
}
.bet { display: flex; flex-direction: column; align-items: center; gap: .3vmin; z-index: 4; pointer-events: none; }
.bet .stack { position: relative; width: 4vmin; height: calc(4vmin + 6 * .7vmin); }
.bet .stack i { position: absolute; left: 0; bottom: calc(var(--i) * .7vmin); width: 4vmin; height: 4vmin; }
.bet .stack i:nth-child(3n+2) { --chip: #294b7e; }
.bet .stack i:nth-child(3n+3) { --chip: #211e21; }
.bet b { font-family: var(--num); font-weight: 400; font-size: 2.5vmin; color: var(--ivory); text-shadow: 0 .2vmin .5vmin rgba(0, 0, 0, .7); }
.bet.gone, .hole-card.gone, .hand-label.gone, .board-card.gone { opacity: 0; }
.bet.payout b { color: var(--brass-hi); }

/* Printed pot line (and the Veto colour line) */
.pot-label {
  transform: translate(-50%, -50%) rotate(var(--r)) translateY(var(--dy, 9vmin));
  font-family: var(--display); font-size: 2.7vmin; letter-spacing: .1em; color: var(--gold-ink); white-space: nowrap;
}
.pot-label:empty { display: none; }
.pot-label.big {
  font-family: var(--serif); font-style: italic; letter-spacing: 0; color: var(--paper-ink); background: var(--stock);
  padding: .5vmin 1.8vmin .7vmin; border-radius: .4vmin; box-shadow: 0 .5vmin 1.4vmin rgba(0, 0, 0, .45);
}
body.upright .mirror-label { display: none; }

#felt .board-card.dimmed { filter: brightness(.55) saturate(.7); }
.hole-card { z-index: 3; }
.hand-label {
  font-family: var(--serif); font-style: italic; font-size: 2vmin; white-space: nowrap; padding: .3vmin 1.3vmin .5vmin;
  border-radius: .4vmin; background: rgba(8, 26, 18, .7); color: var(--ivory); z-index: 5;
}
.hand-label:empty { display: none; }
.hand-label.winner { background: var(--stock); color: var(--card-red); box-shadow: 0 .4vmin 1vmin rgba(0, 0, 0, .4); }

/* ---------- Veto pieces ---------- */
.cc-ring {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size);
  transform: translate(-50%, -50%); color: var(--gold-faint); pointer-events: none;
  transition: transform .8s cubic-bezier(.4, .1, .2, 1);
}
.cc-ring.rev { transform: translate(-50%, -50%) scaleX(-1); }
.cc-ring svg { width: 100%; height: 100%; display: block; }
.cc-halo {
  position: absolute; left: 0; top: 0; width: var(--size); height: var(--size); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 60%, transparent) 0%, transparent 62%);
  transition: background .6s;
}
.cc-draw { position: absolute; left: 0; top: 0; }
.cc-draw .card { position: absolute; left: 0; top: 0; }

/* ---------- lobby heading (game chosen in the catalog) ---------- */
.back { display: inline-block; text-decoration: none; margin: 0 0 1.2vmin; }
.back:hover { color: var(--brass-hi); }
.game-title { margin: 0; font-family: var(--display); font-weight: 500; font-size: 7.2vmin; line-height: 1; color: var(--ivory); letter-spacing: .03em; white-space: nowrap; }
.game-blurb { margin: 1vmin 0 2.2vmin; font-family: var(--serif); font-style: italic; font-size: 2.3vmin; color: var(--gold-ink); }
.lobby-info .settings, .lobby-info .url, .lobby-info .warn, .lobby-info #startBtn { margin-left: 0; }
body.many-seats .game-title { font-size: 5.4vmin; }

/* =====================================================================
   Table themes: each game has its own table.
   ===================================================================== */
#decor { display: none; position: absolute; inset: 0; pointer-events: none; }

/* Texas Hold'em: deep navy casino felt */
body[data-game="holdem"] {
  --baize-hi: #2c5888;
  --baize: #1c3c64;
  --baize-deep: #0b1b33;
}

/* Veto: a warm wooden game-night table */
body[data-game="veto"] {
  --gold-ink: rgba(255, 238, 212, .82);
  --gold-faint: rgba(255, 238, 212, .34);
}
body[data-game="veto"] #felt {
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255, 222, 170, .16), transparent 72%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(30, 12, 2, .55) 100%),
    repeating-linear-gradient(90deg, rgba(40, 18, 4, .45) 0 .22vmin, transparent .22vmin 17vmin),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.25 .006' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .12 0 0 0 0 .04 0 0 0 1.1 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #9a6438, #87532c);
}
body[data-game="veto"] #felt::before { opacity: .12; }
body[data-game="veto"] #rail::before {
  background:
    linear-gradient(180deg, rgba(255, 230, 190, .08), transparent 25%, transparent 75%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 9px),
    #4a2a15;
}
body[data-game="veto"] #rail .stitch { display: none; }

/* Go Fish: the table is a pond */
body[data-game="gofish"] {
  --gold-ink: rgba(226, 244, 240, .8);
  --gold-faint: rgba(226, 244, 240, .32);
}
body[data-game="gofish"] #felt {
  background:
    radial-gradient(ellipse 55% 45% at 50% 50%, rgba(140, 220, 225, .2), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, #1f7380 0%, #145867 45%, #08303d 100%);
}
body[data-game="gofish"] #felt::before {
  opacity: .5;
  mix-blend-mode: soft-light;
  background-size: 640px 640px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='turbulence' baseFrequency='.012 .02' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -2.6 1.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
  animation: drift 60s linear infinite;
}
@keyframes drift { to { background-position: 640px 320px; } }
body[data-game="gofish"] #rail::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 30%, transparent 70%, rgba(0, 0, 0, .3)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .36 0 0 0 0 .24 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E"),
    #4b5a3c;
}
body[data-game="gofish"] #rail::after { border-color: #2c3322; box-shadow: inset 0 0 0 .18vmin #5b6a45, inset 0 0 0 .5vmin rgba(0, 0, 0, .35); }
body[data-game="gofish"] #rail .stitch { display: none; }
body[data-game="gofish"] #rail .brass { border: .4vmin solid rgba(20, 30, 18, .7); box-shadow: inset 0 0 0 .2vmin rgba(160, 220, 225, .25), inset 0 2vmin 5vmin rgba(0, 25, 35, .55), inset 0 0 10vmin rgba(0, 25, 35, .4); }
body[data-game="gofish"] #lamp { background: radial-gradient(circle, rgba(220, 250, 255, .22) 0%, rgba(200, 245, 255, .08) 32%, transparent 62%); }
body[data-game="gofish"] #decor { display: block; }

/* Lily pads (with one flower), tucked into the corners away from the seats */
.pad {
  position: absolute; width: 11vmin; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #7bbd62 0%, #4c8d3f 55%, #2f6a2c 100%);
  -webkit-mask: conic-gradient(from 25deg, transparent 0 28deg, #000 28deg);
  mask: conic-gradient(from 25deg, transparent 0 28deg, #000 28deg);
  box-shadow: inset 0 0 0 .3vmin rgba(255, 255, 255, .08);
  filter: drop-shadow(0 .6vmin .8vmin rgba(0, 25, 30, .45));
  animation: padbob 9s ease-in-out infinite;
}
.pad.p1 { left: 6vmin; top: 6vmin; }
.pad.p2 { right: 7vmin; top: 9vmin; width: 8vmin; rotate: 140deg; animation-delay: -3s; }
.pad.p3 { left: 9vmin; bottom: 7vmin; width: 9vmin; rotate: 260deg; animation-delay: -6s; }
.pad.p4 { left: 15vmin; top: 15vmin; width: 5vmin; rotate: 60deg; animation-delay: -2s; }
.pad b {
  position: absolute; left: 50%; top: 50%; width: 3.6vmin; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(circle, #ffe69a 0 18%, #f6b7c8 20% 55%, #e486a3 56% 70%, transparent 71%);
  border-radius: 50%;
}
@keyframes padbob { 50% { transform: translate(.5vmin, -.4vmin) rotate(4deg); } }

/* ---------- Go Fish pieces ---------- */
.floater {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r));
  animation: bob 6s ease-in-out infinite; animation-delay: var(--d);
  transition: opacity .7s;
}
@keyframes bob {
  50% { transform: translate(-50%, -50%) translate(calc(var(--x) + .7vmin), calc(var(--y) - .5vmin)) rotate(calc(var(--r) + 5deg)); }
}
.floater .card { opacity: .78; filter: brightness(.8) saturate(.75) hue-rotate(-10deg); box-shadow: 0 0 0 .25vmin rgba(220, 250, 255, .12), 0 .8vmin 1.6vmin rgba(0, 25, 35, .5); }
.floater.sink { opacity: 0; }
.splash { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 5; pointer-events: none; }
.splash::before, .splash::after {
  content: ''; position: absolute; left: -3vmin; top: -2vmin; width: 6vmin; height: 4vmin; border-radius: 50%;
  border: .3vmin solid rgba(230, 252, 255, .85); animation: ripple 1.3s ease-out forwards;
}
.splash::after { animation-delay: .18s; border-width: .2vmin; }
.splash.big::before, .splash.big::after { border-width: .45vmin; animation-duration: 1.4s; }
@keyframes ripple { from { transform: scale(.25); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.gf-move, .gf-catch { position: absolute; left: 0; top: 0; z-index: 6; transition: transform .8s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.gf-catch.reel { transition: transform 1s cubic-bezier(.2, 1.35, .4, 1), opacity .5s; filter: drop-shadow(0 0 1.4vmin rgba(200, 245, 255, .7)); }
.books { position: absolute; left: 0; top: 0; z-index: 2; transition: transform .5s; }
.books .card { position: absolute; left: 0; top: 0; translate: -50% -50%; }
body[data-game="gofish"] #print { display: none; }

/* ---------- Go Fish pond: rocky shore, koi, lily pads ---------- */
body[data-game="gofish"] #rail { display: none; }
body[data-game="gofish"] .plate { background: rgba(4, 38, 46, .5); }
#decor .koi-layer { position: absolute; inset: 0; }
.koi {
  position: absolute; left: 0; top: 0;
  offset-rotate: auto;
  animation: swim 40s linear infinite;
  opacity: .92;
  filter: drop-shadow(.8vmin 1.4vmin .7vmin rgba(0, 25, 30, .45));
}
.koi svg { width: 100%; display: block; }
.koi .tail { transform-box: view-box; transform-origin: 24px 24px; animation: wag .7s ease-in-out infinite alternate; }
@keyframes swim { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes wag { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
#decor .pad { translate: -50% -50%; }
.shore .rock {
  position: absolute; translate: -50% -50%;
  background: radial-gradient(circle at 34% 28%, var(--hi) 0%, var(--mid) 48%, var(--lo) 100%);
  box-shadow:
    inset -.5vmin -.8vmin 1.3vmin rgba(0, 0, 0, .42),
    inset .3vmin .4vmin .6vmin rgba(255, 255, 255, .2),
    0 .6vmin 1.1vmin rgba(0, 25, 30, .6);
}
.shore .rock.moss { background: radial-gradient(circle at 34% 28%, #9bb07a 0%, #627548 32%, var(--mid) 62%, var(--lo) 100%); }

/* ---------- the motion switch: a little wooden sign on the shore ---------- */
.switch {
  position: absolute; left: 4vmin; bottom: 4vmin; z-index: 21; width: 21vmin;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "track state" "label label";
  align-items: center; gap: .9vmin 1.2vmin; padding: 1.2vmin 1.5vmin 1.3vmin; text-align: left; cursor: pointer;
  font-family: var(--ui); color: #f8f0dd;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .1) 0 .2vmin, transparent .2vmin 1.4vmin),
    linear-gradient(180deg, #93603a, #6c4325);
  border: .25vmin solid #3c2513; border-radius: .9vmin;
  box-shadow: 0 .7vmin 1.6vmin rgba(0, 0, 0, .55), inset 0 .2vmin 0 rgba(255, 255, 255, .22);
}
.switch[hidden] { display: none; }
.switch .track { grid-area: track; position: relative; width: 6.2vmin; height: 3.3vmin; border-radius: 99px; background: rgba(0, 0, 0, .45); transition: background .25s; }
.switch .knob { position: absolute; top: .45vmin; left: .45vmin; width: 2.4vmin; height: 2.4vmin; border-radius: 50%; background: #f8f0dd; box-shadow: 0 .2vmin .4vmin rgba(0, 0, 0, .45); transition: transform .25s; }
.switch.on .track { background: #3fa86b; }
.switch.on .knob { transform: translateX(2.9vmin); }
.switch b { grid-area: state; font-family: var(--display); font-weight: 400; font-size: 3vmin; }
.switch .sw-label { grid-area: label; display: flex; flex-direction: column; font-size: 2vmin; font-weight: 700; line-height: 1.15; }
.switch .sw-label small { font-size: 1.45vmin; font-weight: 500; opacity: .85; margin-top: .2vmin; }

/* =====================================================================
   Chess: an inlaid board on a dark walnut table
   ===================================================================== */
body[data-game="chess"] #felt, body[data-game="powerup"] #felt {
  --seat-w: min(23vmin, 260px);
  --seat-h: 22vmin;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255, 220, 170, .1), transparent 72%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(10, 4, 0, .6) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .22' numOctaves='3' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .05 0 0 0 0 .02 0 0 0 1.1 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #4b2a17, #3a1f10);
}
body[data-game="chess"] #print, body[data-game="powerup"] #print { display: none; }
body[data-game="chess"] .fan, body[data-game="powerup"] .fan { display: none; }
body[data-game="chess"] .who .name, body[data-game="powerup"] .who .name { font-size: 3.4vmin; max-width: 15vmin; }
body[data-game="chess"] .meta, body[data-game="powerup"] .meta { flex-direction: column; gap: .6vmin; }
body[data-game="chess"] .plate, body[data-game="powerup"] .plate { min-width: 92%; }

.clock { font-family: var(--num); font-size: 4.6vmin; line-height: 1; color: var(--ivory); letter-spacing: .02em; padding: .3vmin 1.2vmin; border-radius: .6vmin; }
.clock.running { background: rgba(255, 228, 168, .14); box-shadow: inset 0 0 0 .15vmin var(--gold-ink); }
.clock.low { color: #ff9d8a; }
.caps { display: flex; flex-wrap: wrap; justify-content: center; max-width: 20vmin; }
.cap { font-style: normal; font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', serif; font-size: 2.6vmin; line-height: 1; margin: 0 -.2vmin; }
.cap.w { color: #f8f1e0; -webkit-text-stroke: .08vmin #2a2018; }
.cap.b { color: #1d1a1a; -webkit-text-stroke: .08vmin rgba(245, 235, 215, .6); }

#chessboard { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); z-index: 2; }
.cb-frame {
  position: relative; padding: var(--frame);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.3 .01' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 .15 0 0 0 0 .07 0 0 0 0 .02 0 0 0 1 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #6e3f1f, #4a2711);
  border-radius: .8vmin;
  box-shadow: 0 2vmin 5vmin rgba(0, 0, 0, .6), inset 0 .2vmin 0 rgba(255, 220, 170, .25), inset 0 -.3vmin .6vmin rgba(0, 0, 0, .5);
}
.cb-squares {
  display: grid; grid-template-columns: repeat(8, var(--S)); grid-template-rows: repeat(8, var(--S));
  box-shadow: 0 0 0 .3vmin #c9a55a, 0 0 0 .5vmin #2a1608;
}
.sq { position: relative; cursor: pointer; }
.sq.light { background: linear-gradient(135deg, #ecd6a8, #dcc08b); }
.sq.dark { background: linear-gradient(135deg, #9a6438, #80502b); }
.sq.light, .sq.dark { background-blend-mode: multiply; }
.sq.last { box-shadow: inset 0 0 0 999px rgba(255, 210, 80, .32); }
.sq.sel { box-shadow: inset 0 0 0 .5vmin #f6d27a, inset 0 0 0 999px rgba(255, 210, 80, .28); }
.sq.check { background: radial-gradient(circle, rgba(230, 40, 30, .85) 0%, rgba(230, 40, 30, .35) 45%, transparent 75%), linear-gradient(135deg, #ecd6a8, #dcc08b); }
.sq.dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; translate: -50% -50%; border-radius: 50%; background: rgba(30, 60, 20, .45); }
.sq.hit::after { content: ''; position: absolute; inset: 6%; border-radius: 50%; border: .5vmin solid rgba(30, 60, 20, .5); }
.cb-pieces { position: absolute; left: var(--frame); top: var(--frame); width: calc(var(--S) * 8); height: calc(var(--S) * 8); pointer-events: none; }
.pc {
  position: absolute; left: 0; top: 0; width: var(--S); height: var(--S);
  display: grid; place-items: center;
  font-family: 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Symbols', serif; font-size: calc(var(--S) * .8); line-height: 1;
  transition: transform .38s cubic-bezier(.3, .9, .3, 1), opacity .35s;
}
.pc.w { color: #faf3e3; -webkit-text-stroke: calc(var(--S) * .018) #2a2018; text-shadow: 0 calc(var(--S) * .05) calc(var(--S) * .07) rgba(0, 0, 0, .55); }
.pc.b { color: #1c1918; -webkit-text-stroke: calc(var(--S) * .014) rgba(245, 232, 205, .6); text-shadow: 0 calc(var(--S) * .05) calc(var(--S) * .07) rgba(0, 0, 0, .55); }
.pc.taken { opacity: 0; }
.coords { position: absolute; display: grid; font-family: var(--num); font-size: calc(var(--frame) * .55); color: var(--brass-hi); pointer-events: none; }
.coords i { font-style: normal; display: grid; place-items: center; }
.coords.files { left: var(--frame); width: calc(var(--S) * 8); height: var(--frame); grid-template-columns: repeat(8, 1fr); }
.coords.files.bottom { bottom: 0; }
.coords.files.top { top: 0; transform: rotate(180deg); }
.coords.ranks { top: var(--frame); height: calc(var(--S) * 8); width: var(--frame); grid-template-rows: repeat(8, 1fr); }
.coords.ranks.left { left: 0; }
.coords.ranks.right { right: 0; }
.coords.ranks.right i { transform: rotate(180deg); }
#chessboard.upright .coords.files.top { transform: none; }
.cb-promo {
  position: absolute; left: var(--frame); top: var(--frame); width: var(--S); z-index: 4;
  display: grid; grid-template-columns: 1fr; background: var(--stock); border-radius: .6vmin; box-shadow: 0 1vmin 3vmin rgba(0, 0, 0, .6);
}
.cb-promo[hidden] { display: none; }
.cb-promo button { position: relative; width: var(--S); height: var(--S); border: 0; background: none; cursor: pointer; }
.cb-promo button:hover { background: rgba(201, 165, 90, .3); }
.who { flex-wrap: wrap; row-gap: .5vmin; } .who .name { flex-shrink: 0; }

/* ---------- card size slider (table corner) ---------- */
#felt { --trick-cw: calc(10.5vmin * var(--card-scale, 1)); }
.fan .card { --cw: calc(5.5vmin * var(--card-scale, 1)); margin-left: calc(-3.4vmin * var(--card-scale, 1)); }
body.many-seats .fan .card { --cw: calc(4.8vmin * var(--card-scale, 1)); margin-left: calc(-3.2vmin * var(--card-scale, 1)); }
.fan { height: calc(5.5vmin * 1.4 * var(--card-scale, 1)); }
.sizer {
  display: flex; align-items: center; gap: 1vmin; padding: .5vmin 1.2vmin; border-radius: .5vmin;
  border: .14vmin solid var(--gold-faint); color: var(--gold-ink);
  font-family: var(--ui); font-size: 1.5vmin; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.sizer input { width: 14vmin; accent-color: var(--brass); cursor: pointer; }
body[data-game="chess"] .sizer, body[data-game="powerup"] .sizer { display: none; }
/* Seats grow with the card size so the bigger face-down hands don't push names off the edge. */
#felt { --seat-h: calc(25vmin + 7.7vmin * (var(--card-scale, 1) - 1)); }
body.many-seats #felt { --seat-h: calc(21vmin + 6.7vmin * (var(--card-scale, 1) - 1)); }
body[data-game="chess"] #felt, body[data-game="powerup"] #felt { --seat-h: 22vmin; }

/* PowerUp Chess: absorbed pieces ride in a little strip under the piece on top. */
.pc .stk { position: absolute; left: 50%; bottom: -2%; translate: -50% 0; display: flex; padding: 0 calc(var(--S) * .05); border-radius: calc(var(--S) * .2);
  font-size: calc(var(--S) * .24); line-height: 1.05; -webkit-text-stroke: 0; text-shadow: none;
  background: rgba(20, 14, 8, .82); box-shadow: 0 0 0 calc(var(--S) * .02) rgba(227, 200, 140, .75), 0 0 calc(var(--S) * .15) rgba(227, 200, 140, .45); }
.pc .stk i { font-style: normal; }
.pc .stk { color: #e9d4a2; gap: calc(var(--S) * .02); align-items: center; }
.pc .stk b { font-family: var(--num); font-weight: 400; font-size: .8em; color: #fff3d6; margin-left: calc(var(--S) * .03); }

/* In-game rejoin QR, tucked above the room code */
#toolbar { opacity: 1; }
#toolbar > :not(#qrMini) { opacity: .6; transition: opacity .3s; }
#toolbar:hover > * { opacity: 1; }
#qrMini { display: none; flex-direction: column; align-items: center; gap: .5vmin; padding: .9vmin; border-radius: .8vmin; background: #fbf7ec; box-shadow: 0 .6vmin 1.8vmin rgba(0, 0, 0, .45); }
body.in-game #qrMini { display: flex; }
#qrMini .qr { width: 11vmin; height: 11vmin; }
#qrMini .qr svg { width: 100%; height: 100%; display: block; }
#qrMini .qr svg path, #qrMini .qr svg rect[fill="black"] { fill: #1d1b1a; }
#qrMini span { font-family: var(--ui); font-size: 1.2vmin; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #3a3029; white-space: nowrap; }
#qrMini b { font-family: var(--num); font-weight: 400; font-size: 1.3em; letter-spacing: .12em; }

/* ---------- Dough: the winners' banner ---------- */
#doughBanner {
  position: fixed; left: 50%; top: 6vmin; z-index: 80; transform: translate(-50%, -260%); transition: transform .55s cubic-bezier(.2, 1.3, .4, 1);
  display: flex; align-items: center; gap: 1.6vmin; padding: 1.4vmin 3.4vmin 1.4vmin 2.4vmin; border-radius: 99px; pointer-events: none;
  font-family: var(--ui); color: #3a2400; background: linear-gradient(180deg, #ffe7a0, #e8b44a); box-shadow: 0 1.2vmin 3vmin rgba(0, 0, 0, .45), inset 0 -.4vmin 0 rgba(120, 70, 0, .25);
}
#doughBanner.show { transform: translate(-50%, 0); }
#doughBanner b { font-family: var(--num); font-size: 3.6vmin; font-weight: 400; white-space: nowrap; }
#doughBanner span { font-size: 2.3vmin; font-weight: 800; }

/* ---------------------------------------------------------------- How to play (lobby card button + rules panel) */
.rules-btn {
  display: inline-flex; align-items: center; gap: 1vmin; margin: -.8vmin 0 2.2vmin; padding: 1vmin 2.2vmin 1vmin 1.6vmin; cursor: pointer;
  font: 700 1.6vmin/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--champagne, #cdb487);
  background: rgba(255, 248, 230, .05); border: .15vmin solid var(--gold-faint, rgba(205, 180, 135, .35)); border-radius: 99px;
}
.rules-btn svg { width: 2.2vmin; height: 2.2vmin; flex: none; }
.rules-btn:hover, .rules-btn:focus-visible { background: rgba(255, 248, 230, .12); outline: none; }
.rules-btn[hidden] { display: none; }
.rules-panel {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 3vmin;
  background: rgba(6, 4, 3, .62); backdrop-filter: blur(4px);
}
.rules-panel[hidden] { display: none; }
.rules-card {
  width: min(96vmin, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
  color: var(--ivory, #f3ead8); background: var(--onyx-2, #16130f); border: .2vmin solid var(--gold-faint, rgba(205, 180, 135, .35));
  border-radius: 2.4vmin; box-shadow: 0 4vmin 9vmin rgba(0, 0, 0, .6); animation: rulesIn .28s cubic-bezier(.2, .7, .2, 1);
}
@keyframes rulesIn { from { opacity: 0; transform: translateY(2vmin) scale(.98); } }
.rules-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2vmin; padding: 3vmin 3.4vmin 2vmin; border-bottom: .15vmin solid rgba(255, 255, 255, .08); }
.rules-eyebrow { margin: 0 0 .8vmin; font: 800 1.5vmin/1 var(--ui); letter-spacing: .24em; text-transform: uppercase; color: var(--champagne, #cdb487); }
.rules-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 5vmin; line-height: 1.05; }
.rules-players { margin: .8vmin 0 0; font: 600 1.8vmin/1.3 var(--ui); color: var(--gold-ink, #b9a98a); }
.rules-x { flex: none; width: 5.6vmin; height: 5.6vmin; border-radius: 50%; cursor: pointer; font-size: 2.2vmin; color: inherit; background: rgba(255, 255, 255, .06); border: .15vmin solid rgba(255, 255, 255, .15); }
.rules-body { overflow-y: auto; padding: 2.4vmin 3.4vmin; display: flex; flex-direction: column; gap: 2.4vmin; }
.rules-body section { margin: 0; }
.rules-body h3 { margin: 0 0 1vmin; font: 800 1.6vmin/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--champagne, #cdb487); }
.rules-body p, .rules-body li { font: 500 2.25vmin/1.45 var(--ui); margin: 0; }
.rules-goal p { font-size: 2.6vmin; font-weight: 700; }
.rules-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 1.2vmin; }
.rules-steps li { counter-increment: step; position: relative; padding-left: 5vmin; }
.rules-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -.1vmin; width: 3.4vmin; height: 3.4vmin; border-radius: 50%;
  display: grid; place-items: center; font: 800 1.7vmin/1 var(--ui); color: #17130c; background: var(--champagne, #cdb487);
}
.rules-win { padding: 1.8vmin 2.2vmin; border-radius: 1.6vmin; background: rgba(255, 248, 230, .05); border: .15vmin solid rgba(255, 255, 255, .1); }
.rules-tips { margin: 0; padding-left: 2.6vmin; display: flex; flex-direction: column; gap: .8vmin; }
.rules-foot { display: flex; justify-content: flex-end; padding: 2vmin 3.4vmin 2.6vmin; border-top: .15vmin solid rgba(255, 255, 255, .08); }

/* ---------- lobby: keep everything clear of the seat tiles ----------
   The seats sit in a band along each edge of the table. table.js measures how far the tiles reach
   in from each edge (--edge-t/-b/-l/-r); in the lobby the game panel and the corner controls stay
   inside the free middle, so they never cover an Open seat, a name or an Add a bot button.
   (During a game the controls go back to the corner, where the rejoin QR joins them.) */
#felt { --edge-t: 21vmin; --edge-b: 21vmin; --edge-l: 21vmin; --edge-r: 21vmin; --tb-row: 4.6vmin; --mirror-h: 5.6vmin; --tent-span: 39vmin; --info-pad-x: 0px; --info-w: 50vmin; }
body.many-seats #felt, body.upright #felt { --mirror-h: 0px; }
body.many-seats #felt { --tent-span: 33vmin; }
/* Four seats down a side (Words 4 Fun, Field Agents): narrower tiles so neighbours don't touch. */
body.crowded-sides #felt { --seat-w: 17vmin; }
body.crowded-sides .seat:is(.side-1, .side-3) .plate { padding-inline: 1vmin; min-width: 0; }
body.crowded-sides .seat:is(.side-1, .side-3) .who .name { font-size: 2.35vmin; max-width: 12.5vmin; }
body.crowded-sides .seat:is(.side-1, .side-3) .meta { flex-wrap: wrap; text-align: center; }

/* The lobby is centred in the space between the seat tiles above and below it (and above the
   controls row when that sits under it): table.js works out --lob-t and --lob-b. */
body.in-lobby #lobby { top: calc((var(--lob-t, var(--edge-t)) + var(--lob-b, calc(100% - var(--edge-b) - var(--tb-row)))) / 2); width: max-content; max-width: calc(100vw - var(--edge-l) - var(--edge-r)); }
/* The game panel never grows past that space; a long settings list scrolls inside it. */
body.in-lobby .lobby-info {
  box-sizing: border-box; display: flex; flex-direction: column; min-height: 0;
  max-height: calc((var(--lob-b, 100vh) - var(--lob-t, 0px) - var(--mirror-h) - 2.4vmin) / var(--lz, 1));
  max-width: calc(min(var(--info-w) + var(--info-pad-x), calc(100vw - var(--edge-l) - var(--edge-r) - var(--tent-span))) / var(--lz, 1));
}
body.in-lobby .lobby-info > * { flex: none; }
body.in-lobby .lobby-info .settings { flex: 0 1 auto; min-height: 5.6vmin; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }

/* The corner controls sit in one row: in the corner when no seat is there, else at the inner
   corner of the seat tiles (table.js picks, --tb-right / --tb-bottom). */
body.in-lobby #toolbar {
  right: var(--tb-right, calc(var(--edge-r) + .8vmin)); bottom: var(--tb-bottom, calc(var(--edge-b) + .6vmin));
  flex-direction: row; align-items: center; gap: 1vmin;
}
body.in-lobby #toolbar .pill { white-space: nowrap; }
/* A settings list that scrolls: room inside the box so nothing touches its edges or rounded corners,
   and whole settings snap into view (table.js trims the box to end between two settings). */
body.in-lobby .lobby-info .settings { box-sizing: border-box; padding: .9vmin 1vmin; scroll-padding: .9vmin; scroll-snap-type: y proximity; }
html[data-style="vibrant"] body.in-lobby .lobby-info .settings { padding: 1.4vmin 2vmin; scroll-padding: 1.4vmin; }
body.in-lobby .lobby-info .settings > * { scroll-snap-align: start; }
/* Seat names clip long names with "…"; give the clip box room above and below so letter tails
   (p, g, y) and accents are never shaved off. The negative margin keeps the layout the same. */
.who .name { padding-block: .16em; margin-block: -.16em; }

/* A long settings list (six or more): each name sits above its choice and the settings wrap
   side by side across a wider panel, so the whole list fits without scrolling. */
body.many-settings #felt, body.wide-panel #felt { --info-w: 100vmin; }
body.many-settings.in-lobby .lobby-info .settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2vmin 2.4vmin; }
body.many-settings.in-lobby .lobby-info .settings > :not(label) { flex-basis: 100%; }
body.many-settings.in-lobby .lobby-info .settings > label:not(:has(input[type="checkbox"])) { flex-direction: column; align-items: stretch; gap: .5vmin; }

/* Long game names wrap onto a second line instead of running past the panel. */
body.in-lobby .game-title { white-space: normal; text-wrap: balance; overflow-wrap: break-word; }
/* The narrow seats on the two-player boards: "Open seat" fits whole instead of ending in "…". */
body:is([data-game="chess"], [data-game="powerup"], [data-game="checkers"], [data-game="backgammon"]) .seat.empty .who .name { font-size: 2.9vmin; }
/* Upright, the top seats' tiles sit against the table edge in the lobby (their card fan is empty). */
body.in-lobby.upright .seat.side-2 { justify-content: flex-end; }
/* When nothing else makes the lobby card fit, table.js shrinks it a little (--lz, never below 72%). */
body.in-lobby .lobby-main { zoom: var(--lz, 1); }
