/* Wizard table. Card size comes from --cw (set by wizard.js). */
.wz { --cw: 78px; min-height: 100dvh; max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 10px calc(env(safe-area-inset-bottom) + 8px); }
.wz-top { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.wz-round { flex: none; white-space: nowrap; }
.wz-top > .row { flex: 0 1 auto; min-width: 0; }
.wz-top .row { flex-wrap: wrap; justify-content: flex-end; }
.wz-round b { font-family: var(--serif); font-size: 20px; }
.wz-trump { flex: 1 1 0; min-width: 0; overflow: hidden; justify-content: center; max-width: 220px; display: flex; align-items: center; gap: 8px; margin: 0 auto; padding: 4px 12px 4px 6px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; min-height: 40px; }
.wz-trump .mini { --cw: 28px; }
.wz-trump .pill { font-weight: 700; }
.pill { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--c); }


.hint { color: var(--muted); font-size: 13px; text-align: center; }

.wz-status { backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 12px; border-radius: 12px; background: var(--panel); font-size: 15px; }
.wz-status.mine { background: rgba(242, 193, 78, .22); font-weight: 700; }

.bidbox { padding: 10px 12px; border-radius: 14px; background: rgba(8, 9, 30, .5); border: 1px solid var(--panel-line); display: grid; gap: 8px; }
.bidgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.bidbtn { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--panel-line); background: var(--panel); font-weight: 700; font-size: 18px; }
.bidbtn.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.bidbtn:disabled { opacity: .3; text-decoration: line-through; }
.suitbtn { flex: 1 1 40%; min-height: 48px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .8); color: #fff; background: var(--c); font-weight: 700; font-size: 16px; }
.suitbtn.suit-Y { color: #3b2c00; }

.hand { overflow-x: auto; overflow-y: hidden; padding: 20px 0 6px; scrollbar-width: thin; }
.hand-in { display: flex; width: max-content; min-width: 100%; justify-content: center; padding: 0 4px; }

/* ---- cards */
.suit-R { --c: linear-gradient(160deg, #e85d5d, #b02a2a); }
.suit-Y { --c: linear-gradient(160deg, #f6d04d, #d9a514); color: #3b2c00; }
.suit-G { --c: linear-gradient(160deg, #3fae67, #1f7a43); }
.suit-B { --c: linear-gradient(160deg, #3d8bff, #1f5fd6); }
.pill.suit-Y { color: #3b2c00; }
.card {
  position: relative; flex: none; display: block; padding: 0; width: var(--cw); height: calc(var(--cw) * 1.45);
  border-radius: calc(var(--cw) * .13); border: 2px solid rgba(255, 255, 255, .9); background: var(--c);
  color: #fff; font-family: var(--serif); font-weight: 700; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); user-select: none;
  transition: transform .14s, opacity .14s, box-shadow .14s;
}
.card.suit-Y { color: #3b2c00; }
.card.wizard { --c: linear-gradient(160deg, #7b4bd0, #2a1666); }
.card.jester { --c: linear-gradient(160deg, #f3913f, #c2452a); }
.card .rk { position: absolute; top: 4%; left: 9%; font-size: calc(var(--cw) * .27); line-height: 1; text-align: center; }
.card .rk i { display: block; font-style: normal; font-size: .62em; margin-top: 1px; }
.card .rk.br { top: auto; left: auto; bottom: 4%; right: 9%; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .58); opacity: .92; }
.card.wizard .pip, .card.jester .pip { font-size: calc(var(--cw) * .5); }

button.card { cursor: pointer; }
.hc { margin-left: calc(var(--cw) * -.05); }
.hc.playable { box-shadow: 0 0 0 2px rgba(242, 193, 78, .8), 0 6px 14px rgba(0, 0, 0, .45); }
.hc.dim { filter: brightness(.55) saturate(.7); }
.hc.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--gold), 0 12px 20px rgba(0, 0, 0, .5); z-index: 2; }
@media (hover: hover) { .hc.playable:hover { transform: translateY(-8px); } }
.pop { animation: pop .28s ease-out; }
@keyframes pop { from { transform: translateY(40px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } .card { transition: none; } }


/* ---- foresight + hidden card */
.chip.hasfs { padding-right: 44px; }
.chip .fs { --cw: 30px; position: absolute; right: 6px; top: 6px; }
.card.back { background: repeating-linear-gradient(45deg, #3a2a7a 0 6px, #4b3a96 6px 12px); }
.card.back .pip { font-size: calc(var(--cw) * .5); opacity: .8; }

/* ---- 29 */
.t29-strip { display: flex; align-items: stretch; gap: 8px; }
.tbox { flex: 1; display: grid; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-line); line-height: 1.15; }
.tbox b { font-size: 22px; font-family: var(--serif); }
.tbox small { color: var(--muted); font-size: 11px; }
.tbox.us { border-color: rgba(123, 224, 160, .5); }
.tbox.them { border-color: rgba(255, 122, 107, .4); }
.bidinfo { align-self: center; text-align: center; font-size: 12px; color: var(--gold); max-width: 110px; }
.wz-players.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 480px) { .wz-players.four { grid-template-columns: repeat(2, 1fr); } }
.chip.tus { border-left: 4px solid rgba(123, 224, 160, .8); }
.chip.tthem { border-left: 4px solid rgba(255, 122, 107, .8); }
.cpts { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); min-width: calc(var(--cw) * .26); text-align: center; font-family: var(--sans); font-size: calc(var(--cw) * .17); line-height: 1.5; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; padding: 0 4px; }
.card.suit-Y .cpts { background: rgba(0, 0, 0, .55); }

/* =====================================================================
   Poker table
   ===================================================================== */
.wz { --av: 56px; }
.pt { --pt-min: 330px; --seat-h: calc(var(--av) + 66px); position: relative; flex: 1; width: 100%; min-height: var(--pt-min); /* seats are centred on % positions: keep half a seat of room above and below so none sits under the bars around the table */ margin-block: max(0px, calc(var(--seat-h) / 2 - var(--pt-min) * .12)); }
.pt-felt {
  position: absolute; inset: 8% 3%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .12), transparent 55%),
    radial-gradient(ellipse at 50% 55%, #184e3d 0%, #103428 55%, #081d16 100%);
  border: clamp(7px, 1.4vw, 12px) solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 clamp(7px, 1.4vw, 12px) rgba(52, 211, 153, .22), 0 0 0 clamp(9px, 1.7vw, 14px) rgba(5, 18, 13, .95), inset 0 0 70px rgba(0, 0, 0, .55), 0 24px 50px rgba(0, 0, 0, .6), 0 0 70px rgba(16, 185, 129, .2);
}
.pt-felt::after { content: ''; position: absolute; inset: 9%; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .1); }
.pt-info { position: absolute; left: 1%; bottom: 1%; z-index: 1; display: grid; gap: 2px; font-size: 12px; color: rgba(255, 255, 255, .7); pointer-events: none; }
.pt-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; display: grid; justify-items: center; gap: 5px; text-align: center; max-width: 34%; pointer-events: none; }
.pt-corner { position: absolute; right: 1%; top: 1%; z-index: 2; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, .28); pointer-events: none; }
.pt-corner .tcard { --cw: calc(var(--cw0, 62px) * .6); }
.pt-corner .cap { font-size: 11px; color: rgba(255, 255, 255, .85); line-height: 1.25; }
.pt-corner .cap b { color: var(--gold); }
.pt-center .tcard { --cw: calc(var(--cw0, 62px) * .72); }
.pt-center .cap { font-size: 12px; color: rgba(255, 255, 255, .78); line-height: 1.25; }
.pt-center .cap b { color: var(--gold); }
.pt { --card-push: 16px; } /* a played card is nudged away from its seat's name plate, further on the larger desktop plates */
@media (min-width: 900px) { .pt { --card-push: 36px; } }
.pt-card { position: absolute; transform: translate(-50%, -50%); z-index: 2; --cw: var(--tcw, 62px); }
.pt-card.win .card { box-shadow: 0 0 0 3px var(--gold), 0 0 22px 6px rgba(242, 193, 78, .65); }
.pt-card .pop { animation: fly .38s cubic-bezier(.2, .8, .3, 1); }
@keyframes fly { from { transform: translate(var(--fx), var(--fy)) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

.pt-seat { position: absolute; transform: translate(-50%, -50%); z-index: 3; width: 104px; }
.pseat { display: grid; justify-items: center; gap: 3px; position: relative; }
.av {
  position: relative; width: var(--av); height: var(--av); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--avbg) 70%, #fff), var(--avbg));
  border: 3px solid rgba(255, 255, 255, .88); box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.av .face { font-size: calc(var(--av) * .56); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); font-weight: 700; }
.pseat.me .av { border-color: var(--gold); }
.pseat.team0 .av { box-shadow: 0 0 0 3px rgba(123, 224, 160, .75), 0 4px 10px rgba(0, 0, 0, .5); }
.pseat.team1 .av { box-shadow: 0 0 0 3px rgba(255, 122, 107, .75), 0 4px 10px rgba(0, 0, 0, .5); }
.pseat.turn .av { box-shadow: 0 0 0 4px var(--gold), 0 0 20px 8px rgba(242, 193, 78, .55); animation: ring 1.3s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 30px 14px rgba(242, 193, 78, .3); } }
.dealer { display: none; }
.badges { display: flex; gap: 4px; min-height: 17px; justify-content: center; }
.bdg { font: 800 9.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.bdg.d { background: #fff; color: #1a1a40; }
.bdg.f { background: var(--first); color: #052b25; }
.bdg.l { background: var(--gold, #f2c14e); color: var(--gold-ink, #3b2c00); }
.pseat.first .av { border-color: var(--first); }
.pseat:not(.turn):not(.me) .av { opacity: .88; }
.pseat.turn .plate::before { content: '▶ '; color: var(--gold); }
.pseat.turn .plate { background: linear-gradient(135deg, #3a2f00, #594500); border-color: var(--gold); }
.plate { max-width: 112px; padding: 3px 9px; border-radius: 10px; text-align: center; line-height: 1.15; background: rgba(14, 15, 46, .82); border: 1px solid rgba(255, 255, 255, .2); }
.pseat.turn .plate { border-color: var(--gold); }
.plate b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate span { display: block; font-size: 11px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av .fs { --cw: 30px; position: absolute; left: calc(100% - 4px); top: -6px; z-index: 2; transform: rotate(8deg); }
.av .fs .card { box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }

/* reactions floating over a seat */
.emote-pop { position: fixed; z-index: 70; font-size: 34px; pointer-events: none; transform: translate(-50%, -50%); animation: emote 2.4s ease-out forwards; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
@keyframes emote { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); } 12% { opacity: 1; transform: translate(-50%, -80%) scale(1.25); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.emote-bar { position: fixed; z-index: 65; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 10px); transform: translateX(-50%); display: flex; gap: 4px; padding: 6px 8px; border-radius: 999px; background: rgba(14, 15, 46, .96); border: 1px solid var(--panel-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.emote-bar button { border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 4px 5px; border-radius: 10px; cursor: pointer; }
.emote-bar button:hover { background: var(--panel); }

/* responsive sizing of avatars / table */
@media (max-width: 520px) {
  .bdg { font-size: 8.5px; padding: 2px 5px; }
  .wz { --av: 44px; }
  .pt { --pt-min: 300px; }
  .pt-seat { width: 84px; }
  .plate { max-width: 86px; padding: 2px 6px; }
  .plate b { font-size: 12px; }
  .plate span { font-size: 10px; }
  .pt-info { display: none; }
  .wc-name { display: none; }
}
/* Short phones (about 640px high or less): spend less height on the table so the hand and the bid or bet controls stay on screen */
@media (max-width: 520px) and (max-height: 700px) { .wz { --av: 38px; } .pt { --pt-min: 250px; } }
@media (max-width: 520px) and (max-height: 600px) { .pt { --pt-min: 215px; } }
/* on those short screens the 4-seat corner label is just the card, so it clears the right-hand seat */
@media (max-width: 520px) and (max-height: 700px) { .pt:not(:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"])) .pt-corner .cap { display: none; } }
@media (min-width: 900px) { .wz { --av: 66px; } .pt-seat { width: 130px; } .plate b { font-size: 14px; } .plate span { font-size: 12px; } }

/* =====================================================================
   Wizard cards (authentic original design, see wizard-cards.js)
   ===================================================================== */
.card.wc {
  padding: 0;
  overflow: hidden;
  background: #0b0c10;
  border-radius: calc(var(--cw) * .12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .6), 0 2px 5px rgba(0, 0, 0, .4);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  position: relative;
}
.wc.suit-R { --f: #991b1b; --e: #ef4444; --tx: #f87171; }
.wc.suit-Y { --f: #854d0e; --e: #eab308; --tx: #facc15; }
.wc.suit-G { --f: #065f46; --e: #10b981; --tx: #34d399; }
.wc.suit-B { --f: #1e40af; --e: #3b82f6; --tx: #60a5fa; }
.wc.wizard { --f: #6d28d9; --e: #f1c40f; --tx: #ffeaa7; } /* purple + gold: clearly apart from the blue suit */
.wc.jester { --f: #064e3b; --e: #eab308; --tx: #84cc16; }

.wc-in {
  position: absolute;
  inset: 4.5%;
  border-radius: calc(var(--cw) * .08);
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
  overflow: hidden;
}

/* Original illustration containers */
.wc.wizard .wc-in, .wc.jester .wc-in {
  background: #000;
}
.wc.wizard .art, .wc.jester .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}

/* Middle scene on numbered suit cards matching original cards */
.wc-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wc-scene.suit-R {
  background: radial-gradient(circle at 50% 50%, #450a0a 0%, #1c0404 70%, #000000 100%);
}
.wc-scene.suit-Y {
  background: radial-gradient(circle at 50% 50%, #422006 0%, #1c0d02 70%, #000000 100%);
}
.wc-scene.suit-G {
  background: radial-gradient(circle at 50% 50%, #022c22 0%, #01140f 70%, #000000 100%);
}
.wc-scene.suit-B {
  background: radial-gradient(circle at 50% 50%, #172554 0%, #09112a 70%, #000000 100%);
}
.wc-scene .big {
  position: absolute;
  width: 54%;
  height: auto;
  color: var(--e);
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, .8)) drop-shadow(0 0 4px var(--e));
  opacity: .95;
}

/* Corner Ranks matching authentic original edition (Z, N, numbers) */
.wc-rk {
  position: absolute;
  top: 4%;
  left: 6%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Cinzel', 'Times New Roman', Georgia, serif;
  font-weight: 900;
  font-size: calc(var(--cw) * .23);
  line-height: 0.95;
  color: var(--tx, #fff);
  text-shadow: 0 0 4px #000, 0 2px 4px #000, 0 0 2px #000;
}
.wc-rk .orig-corner {
  font-size: calc(var(--cw) * .26);
  color: #ffeaa7;
  text-shadow: 0 0 6px #000, 0 2px 4px #000;
}
.wc.jester .wc-rk .orig-corner {
  color: #84cc16;
}
.wc-rk .orig-rk {
  font-size: calc(var(--cw) * .23);
}
.wc-rk .em {
  width: calc(var(--cw) * .18);
  height: calc(var(--cw) * .18);
  color: var(--e);
  margin-top: 2px;
  filter: drop-shadow(0 0 3px #000);
}
.wc-rk.br {
  top: auto;
  left: auto;
  bottom: 4%;
  right: 6%;
  transform: rotate(180deg);
}

/* Bottom banner displaying card name/suit */
.wc-banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3%;
  z-index: 3;
  text-align: center;
  font: 800 calc(var(--cw) * .09) var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 2px #000;
  opacity: .92;
}
.wc.wizard .wc-banner {
  color: #fde047;
  letter-spacing: .18em;
  text-shadow: 0 0 6px #000;
}
.wc.jester .wc-banner {
  color: #a3e635;
  letter-spacing: .16em;
  text-shadow: 0 0 6px #000;
}

/* Card Back */
.wc.back {
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .7);
}
.wc.back .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sico { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.pill .sico { color: #fff; }
.score-badge { position: absolute; left: -8px; bottom: -4px; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font: 700 11px var(--sans); background: rgba(14, 15, 46, .96); color: var(--gold); border: 1.5px solid rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.t29-strip { margin-bottom: 2px; }

/* =====================================================================
   v3: bids strip, trick highlight + sweep, turn timer, chat, spectators
   ===================================================================== */
.muted { color: var(--muted); }
.wz-bids { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 5px 12px; border-radius: 10px; background: var(--panel); font-size: 13px; }
.wz-bids b { color: var(--gold); }
.wz-bids b.neg { color: var(--danger); }

/* the card that is winning the trick right now / the winner of a finished trick */
.pt-card.lead::after, .pt-card.win::after {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 1px 8px; border-radius: 999px;
  font: 800 9px/1.5 var(--sans); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.pt-card.lead::after { content: 'Leading'; background: #7be0a0; color: #06301b; }
.pt-card.win::after { content: '👑 Winner'; background: var(--gold); color: var(--gold-ink); }
.pt-card.lead .card { box-shadow: 0 0 0 3px #7be0a0, 0 0 16px 4px rgba(123, 224, 160, .55); }
.pt-card.win .card { animation: winpulse .9s ease-in-out 2; }
@keyframes winpulse { 50% { transform: scale(1.08); } }
.pt-card.sweep { animation: sweep .45s cubic-bezier(.5, 0, .8, .4) forwards; }
.pt-card.sweep::after { display: none; }
@keyframes sweep { to { left: var(--tx); top: var(--ty); opacity: 0; transform: translate(-50%, -50%) scale(.35); } }
@media (prefers-reduced-motion: reduce) { .pt-card.sweep { animation: none; opacity: .5; } .pt-card.win .card { animation: none; } }

/* turn countdown */
.ct-timer { flex: none; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .32); color: var(--gold); }
.ct-timer[hidden] { display: none; }
.ct-timer.warn { background: var(--danger); color: #2a0600; animation: tpulse 1s ease-in-out infinite; }
@keyframes tpulse { 50% { transform: scale(1.1); } }

/* chat */
.chat-btn { position: relative; }
.cb { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #2a0600; font: 800 11px/18px var(--sans); text-align: center; }
.cb[hidden] { display: none; }
.chat { position: fixed; z-index: 55; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 10px); width: min(380px, calc(100vw - 20px)); height: min(55dvh, 420px); display: flex; flex-direction: column; background: linear-gradient(160deg, #1d1c55, #11123a); border: 1px solid var(--panel-line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); overflow: hidden; }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--panel-line); }
.chat-watch { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-x { border: 0; background: transparent; font-size: 18px; padding: 2px 6px; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px; display: grid; gap: 8px; align-content: start; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.mav { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 15px; font-weight: 700; color: #fff; }
.mb { background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 5px 10px; min-width: 0; }
.msg.mine .mb { background: rgba(255, 201, 77, .18); }
.mb b { font-size: 12px; color: var(--muted); }
.mb i { font-style: normal; }
.mb p { margin: 1px 0 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.msg.sys { margin: 0 auto; max-width: 100%; font-size: 12px; color: var(--muted); text-align: center; }
.mod-actions { display: inline-flex; gap: 8px; margin-top: 2px; }
.mod-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; min-height: 28px; }
.mod-btn:focus-visible { outline: 2px solid var(--accent, #ffc94d); outline-offset: 2px; }
.report-menu { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.report-menu .mod-btn { text-decoration: none; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 4px 10px; }
.chat-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--panel-line); }
.chat-form input { flex: 1; min-width: 0; font-size: 16px; }

/* spectators */
.watchers { position: fixed; z-index: 20; left: 10px; top: calc(env(safe-area-inset-top) + 118px); max-width: 60vw; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(14, 15, 46, .85); color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 36px; text-align: center; }
.watchers[hidden] { display: none; }
/* Phones: the round label gets its own line and the six controls share the line under it evenly, so nothing wraps unevenly or runs off the side. */
@media (max-width: 520px) {
  .wz-trump { display: none; }
  .wz-top { flex-wrap: wrap; gap: 4px 6px; }
  .wz-round { flex: 1 1 auto; }
  .wz-top > .row { flex: 1 1 100%; flex-wrap: nowrap; justify-content: space-between; gap: 4px; }
  .wz-top .row .btn.small { flex: 1 1 auto; min-width: 40px; padding: 6px 6px; justify-content: center; white-space: nowrap; }
}

/* wider than a phone the header already names the trump suit, so the corner shows just the turned-up card */
@media (min-width: 521px) { .pt-corner .cap { display: none; } }
@media (max-width: 520px) { .pt-corner { padding: 4px 6px; gap: 2px; max-width: min(38%, 140px); } .pt-corner .cap { overflow-wrap: anywhere; } .pt-corner .tcard { --cw: calc(var(--cw0, 62px) * .5); } }
/* Three, five or more players: the ring of seats reaches the table's top corners, so the trump card moves into a strip above the table instead of sitting on a seat. */
.pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]):has(.pt-corner) { margin-top: 68px; }
.pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]) .pt-corner { max-width: none; top: -68px; right: 0; grid-auto-flow: column; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; }
.pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]) .pt-corner .tcard { --cw: 30px; }
.pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]) .pt-corner .cap br { display: none; }
/* 320x568: the trump strip needs a little more room above the ring of seats */
@media (max-width: 520px) and (max-height: 600px) {
  .pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]):has(.pt-corner) { margin-top: 76px; }
  .pt:is([data-n="3"], [data-n="5"], [data-n="6"], [data-n="7"], [data-n="8"]) .pt-corner { top: -76px; }
}
/* 7 or 8 players on a very narrow phone: narrower seat plates so neighbours do not overlap */
@media (max-width: 360px) { .pt:is([data-n="7"], [data-n="8"]) .pt-seat { width: 62px; } .pt:is([data-n="7"], [data-n="8"]) .plate b { font-size: 11px; } }
@media (max-width: 360px) { .pt:is([data-n="7"], [data-n="8"]) { --pt-min: 300px; } }

/* Floating "what just happened" messages (public/feed.js) */
.cf-feed { position: absolute; left: 0; right: 0; z-index: 4; display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.cf-feed[data-pos="upper"] { top: 30%; } .cf-feed[data-pos="mid"] { top: 44%; } .cf-feed[data-pos="bottom"] { bottom: 6%; }
.cf-msg { margin: 0; max-width: 88%; padding: 5px 10px; border-radius: 999px; background: rgba(20, 24, 22, .88); color: #fff; font-size: clamp(11px, 2.9vw, 15px); font-weight: 700; line-height: 1.25; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); animation: cf-float 4200ms ease-out both; }
.cf-msg i { font-style: normal; margin-right: 5px; }
.cf-msg.k-rent, .cf-msg.k-tax, .cf-msg.k-debt, .cf-msg.k-bankrupt, .cf-msg.k-mistake, .cf-msg.k-capture, .cf-msg.k-snake, .cf-msg.k-fold { background: rgba(150, 40, 40, .92); }
.cf-msg.k-buy, .cf-msg.k-salary, .cf-msg.k-win, .cf-msg.k-build, .cf-msg.k-ladder, .cf-msg.k-home, .cf-msg.k-star, .cf-msg.k-marriage { background: rgba(30, 110, 70, .94); }
@keyframes cf-float { 0% { opacity: 0; transform: translateY(14px); } 8% { opacity: 1; transform: translateY(0); } 80% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 0; transform: translateY(-22px); } }
@media (prefers-reduced-motion: reduce) { .cf-msg { animation-name: cf-fade; } @keyframes cf-fade { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } } }
/* A bot is playing for someone who left or went offline (marked on their seat or list row until they come back) */
.standin { font-size: 15px; line-height: 1; padding: 2px 3px; border-radius: 999px; background: rgba(8, 9, 30, .92); border: 1px solid var(--gold, #f2c14e); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.pseat .av .standin { position: absolute; right: -6px; bottom: -4px; z-index: 4; font-size: calc(var(--av) * .36); }
li .standin { margin-left: 6px; vertical-align: middle; flex: 0 0 auto; font-size: 12px; padding: 1px 3px; }
