:root {
  --gold: #e6c46a;
  --gold-2: #b8913a;
  --ink: #f3efe6;
  --muted: #a9a293;
  --glass: rgba(14, 16, 20, 0.72);
  --glass-2: rgba(24, 27, 33, 0.82);
  --line: rgba(230, 196, 106, 0.18);
  --red: #e0485a;
  --green: #3ec27a;
  --blue: #5aa6ff;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --sans: Inter, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: radial-gradient(ellipse at 50% 40%, #1b1512 0%, #0a0808 55%, #030304 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
input { font: inherit; color: inherit; }
kbd {
  font: 600 10px var(--sans);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  opacity: 0.6;
  margin-left: 4px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ------------------------------------------------ Buttons */
.primary {
  background: linear-gradient(180deg, #f1d68a, #c99a3a);
  color: #1d1406;
  border: 0;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(201, 154, 58, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.12s, filter 0.12s;
}
.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.primary.big { font-size: 17px; padding: 14px 34px; }
.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 7px 12px;
}
.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.ghost.small { padding: 4px 9px; font-size: 12px; }
.icon {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.icon:hover { background: rgba(255, 255, 255, 0.12); }
.icon svg { width: 19px; height: 19px; fill: currentColor; }
.icon.off { color: var(--red); }

/* ------------------------------------------------ Top bar */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
  z-index: 130; /* above the lobby/results overlays (tools stay usable) and the toasts (open menu) */
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: italic 700 20px var(--serif); color: var(--gold); white-space: nowrap; }
.brand .logo { display: block; width: 28px; height: 32px; flex: none; }
.levelinfo {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}
.levelinfo .lv { color: var(--gold); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; }
.levelinfo .blinds-now { font-weight: 700; font-size: 15px; }
.levelinfo .clock { font-weight: 700; }
.levelinfo .paused { background: var(--red); color: white; font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 6px; letter-spacing: 0.1em; }
.tools { margin-left: auto; display: flex; gap: 8px; position: relative; }
/* Language picker (top bar + splash) */
.lang-pick {
  display: inline-flex; align-self: center; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.lang-pick button {
  border: 0; background: none; color: var(--muted); font: 700 11px/1 Inter, sans-serif; letter-spacing: 0.08em;
  padding: 7px 9px; border-radius: 999px; cursor: pointer;
}
.lang-pick button:hover { color: var(--ink); }
.lang-pick button.active { background: rgba(230, 196, 106, 0.18); color: var(--gold); }
.splash-card { position: relative; }
.splash-card .lang-pick { position: absolute; top: 14px; right: 14px; }
.menu {
  position: absolute; right: 0; top: 44px; min-width: 190px;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; }
.menu button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
/* phone-only menu entries (mirrors of the top bar tools) */
.menu .m-only { display: none; }
.menu .m-item { align-items: center; gap: 10px; }
.menu .m-item svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.menu .m-lang { padding: 6px 8px 8px; }
.menu .m-item.off { color: #ff9aa6; }
.menu hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); margin: 4px 6px; }

/* Personal settings panel (⋮ → Settings) */
#settings {
  position: fixed; top: 64px; right: 16px; z-index: 40; width: min(340px, calc(100vw - 32px));
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 12px;
  backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: pop 0.2s ease-out;
}
#settings .set-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#settings h3 { margin: 0; font: italic 700 19px var(--serif); color: var(--gold); }
#settings .set-close { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 4px 6px; border-radius: 8px; }
#settings .set-close:hover { background: rgba(255, 255, 255, 0.08); color: inherit; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); cursor: pointer; }
.set-row span { display: flex; flex-direction: column; gap: 2px; }
.set-row b { font-weight: 700; font-size: 14px; }
.set-row small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.set-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
/* on/off switch */
input.switch {
  appearance: none; flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.18); transition: background 0.2s, border-color 0.2s;
}
input.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #e9e4d8; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.2s;
}
input.switch:checked { background: rgba(230, 196, 106, 0.55); border-color: var(--gold); }
input.switch:checked::after { transform: translateX(18px); background: #fff7df; }
input.switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------ Nameplates */
#plates { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.plate {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 6px;
  min-width: 150px;
  background: linear-gradient(180deg, rgba(28, 30, 36, 0.9), rgba(12, 13, 16, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.3s;
  will-change: transform;
  --speak: 0;
}
.plate .avatar {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 35% 30%, #4a4f5c, #1b1d23);
  font-weight: 800; letter-spacing: 0.02em;
  box-shadow: 0 0 0 calc(2px + var(--speak) * 4px) rgba(62, 194, 122, calc(var(--speak) * 0.9));
  transition: box-shadow 0.08s;
}
.plate .timer { position: absolute; inset: 0; transform: rotate(-90deg); z-index: 2; }
/* all avatar contents share one grid cell – otherwise the empty .speak element adds a second
   row and pushes the initials (or the bot's robot) into the upper half of the circle */
.plate .avatar > * { grid-area: 1 / 1; }
.plate .ini { line-height: 1; }
/* Live video in the avatar: slightly larger, sticks out of the pill */
.plate .avatar video { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 50%; object-fit: cover; background: #111; }
.plate .avatar video.mirror { transform: scaleX(-1); }
.plate .avatar video.waiting-video { opacity: 0; }
.plate.has-video .avatar {
  width: 78px; height: 78px; margin: -20px 0 -20px -6px;
  pointer-events: auto; cursor: zoom-in;
  transition: width 0.25s, height 0.25s, margin 0.25s, box-shadow 0.08s;
}
.plate.has-video .ini { display: none; }
.plate.has-video.zoom { z-index: 10; }
.plate.has-video.zoom .avatar { width: 190px; height: 190px; margin: -76px 0 -76px -12px; cursor: zoom-out; }
/* zoomed video: the action tag (Folded, Call …) moves under the name instead of over the face */
.plate.has-video.zoom .act { left: calc(var(--zoom-video) - var(--zoom-shift) + 6px); transform: translateY(-4px); }
.plate.has-video.zoom .act.show { transform: none; }
.plate.has-video.zoom { --zoom-video: 190px; --zoom-shift: 12px; }
.plate .timer circle { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 126; stroke-dashoffset: 126; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.plate.hurry .timer circle { stroke: var(--red); }
.plate .meta { line-height: 1.2; min-width: 0; }
.plate .name { font-weight: 700; display: flex; align-items: center; gap: 5px; max-width: 130px; }
.plate .name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .mic svg { width: 13px; height: 13px; fill: var(--red); display: block; }
.plate .stack { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.plate .stack .allin { color: var(--red); letter-spacing: 0.06em; }
.plate .tag { position: absolute; top: -9px; right: 10px; display: flex; gap: 4px; }
.plate .tag b {
  font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
  background: #2d3140; border: 1px solid rgba(255, 255, 255, 0.15);
}
.plate .tag .t-d { background: #f3efe6; color: #111; }
.plate .tag .t-away { background: #5a2530; }
.plate .act {
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%) translateY(-4px);
  white-space: nowrap; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.75); border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.plate .act.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.plate .act.a-raise, .plate .act.a-bet { color: #ffb86b; }
.plate .act.a-call { color: #9fd0ff; }
.plate .act.a-check { color: #b8f0c8; }
.plate .act.win { color: #1d1406; background: linear-gradient(180deg, #f1d68a, #c99a3a); border: 0; }
.plate.turn { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(230, 196, 106, 0.35), 0 0 28px rgba(230, 196, 106, 0.35); }
.plate.me { background: linear-gradient(180deg, rgba(48, 40, 22, 0.92), rgba(18, 15, 10, 0.94)); border-color: rgba(230, 196, 106, 0.45); }
.plate.folded, .plate.out { opacity: 0.55; }
/* with video: only dim name/stack, the face stays bright */
.plate.has-video.folded, .plate.has-video.out { opacity: 1; }
.plate.has-video.folded > :not(.avatar), .plate.has-video.out > :not(.avatar) { opacity: 0.55; }
.plate.offline .avatar { filter: grayscale(1) brightness(0.6); }
.plate.winner { border-color: var(--gold); box-shadow: 0 0 36px rgba(230, 196, 106, 0.55); }
.plate .sit { display: none; }
.plate.empty { min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.plate.empty > :not(.sit) { display: none; }
.plate.can-sit .sit {
  display: block; pointer-events: auto;
  background: rgba(10, 12, 14, 0.7); border: 1px dashed rgba(230, 196, 106, 0.55); color: var(--gold);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; backdrop-filter: blur(6px);
}
.plate.can-sit .sit:hover { background: rgba(230, 196, 106, 0.15); }
body.in-lobby .plate.can-sit .sit { display: none; }

.betlabel, .potlabel {
  position: absolute; left: 0; top: 0;
  font-weight: 800; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(230, 196, 106, 0.3);
  padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--ink);
  white-space: nowrap;
}
.potlabel { font-size: 15px; padding: 5px 14px; text-align: center; color: var(--gold); }
.potlabel span { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-right: 4px; }
.potlabel small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------ Voice */
#voice {
  position: fixed; top: 64px; right: 16px; z-index: 15;
  min-width: 300px; max-width: calc(100vw - 32px);
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; backdrop-filter: blur(10px);
}
.vhead { display: flex; align-items: center; gap: 8px; }
.vhead > * { flex: none; }
.vtitle { margin-left: auto; padding-left: 4px; white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.vhead .vcollapse { width: 30px; height: 30px; padding: 0; background: none; border-color: transparent; color: var(--muted); }
.vhead .vcollapse:hover { color: inherit; background: rgba(255, 255, 255, 0.08); }
.vhead .vcollapse svg { width: 20px; height: 20px; }
/* minimized: only the mic button (icon) and the expand button */
#voice.collapsed { min-width: 0; padding: 6px; }
#voice.collapsed .vlist, #voice.collapsed .vtitle, #voice.collapsed #btn-cam, #voice.collapsed #btn-deaf, #voice.collapsed .mic-btn span { display: none; }
#voice.collapsed .vhead { gap: 4px; }
.mic-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; border: 0; font-weight: 700; font-size: 13px; white-space: nowrap;
  background: rgba(62, 194, 122, 0.18); color: #8ff0b8;
}
.mic-btn svg { width: 17px; height: 17px; fill: currentColor; }
.mic-btn.off { background: rgba(224, 72, 90, 0.2); color: #ff9aa6; }
.vlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.vlist li {
  --lvl: 0;
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(62, 194, 122, calc(var(--lvl) * 0.45)) calc(var(--lvl) * 100%), transparent 0);
  font-size: 13px;
}
.vlist .dot { width: 7px; height: 7px; border-radius: 50%; background: #777; flex: none; }
.vlist .st-connected .dot { background: var(--green); }
.vlist .st-connecting .dot, .vlist .st-new .dot { background: #e8b04a; }
.vlist .st-failed .dot, .vlist .st-disconnected .dot { background: var(--red); }
.media-play { margin-top: 8px; width: 100%; }
.media-status { max-width: 280px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.vlist .vn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlist .vm svg { width: 14px; height: 14px; fill: var(--muted); display: block; }
.vlist .vm.cam svg { fill: var(--green); }
.icon.on { color: var(--green); }
.vlist li.muted .vm svg { fill: var(--red); }

/* ------------------------------------------------ Log */
#log {
  position: fixed; left: 16px; bottom: 16px; z-index: 15;
  width: 320px; max-width: calc(100vw - 32px);
}
.log-toggle {
  display: flex; align-items: center; gap: 7px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px;
  backdrop-filter: blur(10px); font-weight: 600;
}
.log-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.log-toggle .badge { background: var(--red); color: white; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.log-body { display: none; margin-top: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(10px); overflow: hidden; }
#log.open .log-body { display: block; }
.log-list { list-style: none; margin: 0; padding: 8px 10px; max-height: 220px; overflow-y: auto; font-size: 12.5px; line-height: 1.45; user-select: text; }
.log-list li { padding: 1px 0; color: #d6d0c3; }
.log-list time { color: #6f6a60; margin-right: 6px; font-variant-numeric: tabular-nums; }
.log-list .k-win { color: var(--gold); font-weight: 600; }
.log-list .k-level { color: #9fd0ff; font-weight: 600; }
.log-list .k-bust { color: #ff9aa6; }
.log-list .k-chat { color: #fff; }
.log-list .k-system { color: var(--muted); font-style: italic; }
.chat { display: flex; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.chat input { flex: 1; background: transparent; border: 0; padding: 10px 12px; outline: none; user-select: text; }
.chat button { background: none; border: 0; color: var(--gold); font-weight: 700; padding: 0 12px; }

/* ------------------------------------------------ Actions */
/* positioned every frame on the bottom edge of your own cards (hud.js) */
#strength {
  position: fixed; left: 0; top: 0;
  z-index: 11; pointer-events: none;
  font: italic 700 16px var(--serif); color: var(--gold);
  background: rgba(12, 10, 8, 0.82); border: 1px solid rgba(230, 196, 106, 0.4);
  padding: 6px 16px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); animation: fade-in 0.3s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
/* with large print cards: plain and slim, so it fits under the big suit symbol */
#strength.compact { font: 700 12.5px/1.25 Inter, sans-serif; letter-spacing: 0.01em; padding: 2px 11px 3px; }
/* centred at the bottom of the screen, right under your own name plate */
#actions {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 16;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; backdrop-filter: blur(12px); box-shadow: var(--shadow);
  width: min(460px, calc(100vw - 32px));
  animation: pop-centered 0.2s ease-out;
}
#actions.waiting { width: auto; padding: 8px 14px; }
#actions .pre { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
#actions .pre input { accent-color: var(--gold); width: 16px; height: 16px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
@keyframes pop-centered { from { transform: translate(-50%, 10px); opacity: 0; } }
.timebar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-bottom: 10px; }
.timebar i { display: block; height: 100%; background: var(--gold); transform-origin: left; transition: transform 0.25s linear; }
.timebar.hurry i { background: var(--red); }
.raise-box { margin-bottom: 10px; }
.raise-box .presets { display: flex; gap: 6px; margin-bottom: 8px; }
.raise-box .presets button {
  flex: 1; padding: 6px 0; border-radius: 8px; font-weight: 600; font-size: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
}
.raise-box .presets button:hover { background: rgba(230, 196, 106, 0.15); border-color: rgba(230, 196, 106, 0.4); }
.slider-row { display: flex; gap: 10px; align-items: center; }
.slider-row input[type=range] { flex: 1; accent-color: var(--gold); }
.slider-row input[type=number] {
  width: 110px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px;
  padding: 7px 9px; font-weight: 700; text-align: right; user-select: text;
}
.btns { display: flex; gap: 8px; }
.btns button {
  flex: 1; border: 0; border-radius: 11px; padding: 13px 8px; font-weight: 800; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s, filter 0.1s;
}
.btns button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btns .fold { background: linear-gradient(180deg, #8c2a36, #5d1621); }
.btns .call { background: linear-gradient(180deg, #2f6fb8, #1b4a82); }
.btns .raise { background: linear-gradient(180deg, #f1d68a, #c99a3a); color: #1d1406; }
.btns .call .shot {
  width: 20px; height: 26px; vertical-align: -7px; margin-right: 5px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  transform-origin: 50% 90%;
  animation: shot-wobble 2.4s ease-in-out infinite;
}
@keyframes shot-wobble {
  0%, 70%, 100% { transform: rotate(0deg); }
  78% { transform: rotate(-9deg); }
  86% { transform: rotate(7deg); }
  93% { transform: rotate(-3deg); }
}
.btns .raise kbd { border-color: rgba(0, 0, 0, 0.3); }

#away {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 16px; align-items: center;
  background: var(--glass-2); border: 1px solid rgba(224, 72, 90, 0.5); border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ------------------------------------------------ Banner */
#banner {
  position: fixed; left: 50%; top: 64px; transform: translate(-50%, -10px) scale(0.96);
  z-index: 12; pointer-events: none; text-align: center;
  opacity: 0; transition: opacity 0.35s, transform 0.35s;
}
#banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#banner .line {
  display: inline-block; margin: 4px; padding: 10px 22px; border-radius: 14px;
  background: rgba(8, 8, 10, 0.78); border: 1px solid rgba(230, 196, 106, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(230, 196, 106, 0.18);
  font-size: 16px;
}
#banner b { color: var(--gold); }
#banner .amt { font-weight: 800; }
#banner .hn { font: italic 700 18px var(--serif); color: var(--gold); margin-top: 2px; }

/* ------------------------------------------------ All-in runout */
/* positioned every frame right under the community cards, like the Rabbit Cam button (hud.js) */
#reveal {
  position: fixed; left: 0; top: 0; z-index: 17;
  animation: fade-in 0.2s ease-out;
}
#reveal button {
  position: relative; overflow: hidden;
  padding: 13px 28px 15px; border-radius: 999px; border: 0;
  font-weight: 800; font-size: 16px; letter-spacing: 0.02em;
  color: #1d1406; background: linear-gradient(180deg, #f1d68a, #c99a3a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 28px rgba(230, 196, 106, 0.45);
}
#reveal button:hover { filter: brightness(1.08); }
#reveal .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(29, 20, 6, 0.55); transform-origin: left; transition: transform 0.25s linear;
}
/* Dramatic river: darken the edges */
#vignette::after {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
  background: radial-gradient(ellipse at 50% 50%, transparent 22%, rgba(0, 0, 0, 0.88) 78%);
}
body.drama #vignette::after { opacity: 1; }
body.drama #plates, body.drama #voice, body.drama #log, body.drama #topbar { opacity: 0.35; transition: opacity 0.8s; }

/* ------------------------------------------------ Rabbit Cam */
/* positioned every frame right under the community cards (hud.js) */
#rabbit {
  position: fixed; left: 0; top: 0; z-index: 17;
  animation: fade-in 0.2s ease-out;
}
#rabbit button {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 22px 13px; border-radius: 999px; font-weight: 800; font-size: 15px;
  color: #eaf2ff; background: linear-gradient(180deg, #3b5f9e, #243d6b);
  border: 1px solid rgba(160, 200, 255, 0.5); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 24px rgba(120, 170, 255, 0.35);
}
#rabbit button:hover { filter: brightness(1.12); }
#rabbit .bunny { font-size: 20px; }
#rabbit .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: #a9ccff; transform-origin: left; transition: transform 0.25s linear;
}
.rabbitlabel {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-weight: 700; font-size: 12px; color: #cfe1ff;
  background: rgba(20, 32, 60, 0.8); border: 1px solid rgba(160, 200, 255, 0.45);
  padding: 3px 10px; border-radius: 999px;
}

/* ------------------------------------------------ Runout odds (heads-up all-in) */
.odds {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px 7px; border-radius: 14px; border: 2px solid var(--gold);
  background: rgba(10, 11, 13, 0.88); color: var(--gold); white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55); animation: fade-in 0.3s ease-out;
}
.odds b { font: 800 30px/1 Inter, sans-serif; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.odds small { font-weight: 700; font-size: 12.5px; opacity: 0.9; }
.odds.lead { border-color: #3fca73; color: #7ef0a4; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 18px rgba(63, 202, 115, 0.35); }
.odds.trail { border-color: #f0734f; color: #ffb199; }

/* ------------------------------------------------ Show cards after an uncontested win */
/* where the action panel usually sits, so your own cards and plate stay visible */
#showcards {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 17;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 12px 14px; border-radius: 16px; overflow: hidden;
  background: var(--glass); border: 1px solid rgba(230, 196, 106, 0.45); backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); animation: pop-centered 0.2s ease-out;
}
#showcards .sc-title { font-weight: 700; font-size: 13px; color: var(--gold); letter-spacing: 0.02em; }
#showcards .sc-opts { display: flex; gap: 8px; }
#showcards button {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: inherit;
}
#showcards button:hover { background: rgba(230, 196, 106, 0.18); border-color: rgba(230, 196, 106, 0.6); }
#showcards button em { font-style: normal; font-weight: 700; font-size: 13px; margin-left: 4px; }
#showcards .mini {
  display: inline-grid; place-items: center; min-width: 30px; height: 40px; padding: 0 3px;
  background: #f7f3ea; color: #15130f; border-radius: 5px; font-weight: 800; font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
#showcards .mini.s-h, #showcards .mini.s-d { color: #c0262d; }
/* four-colour deck (personal setting): same colours as on the cards */
body.four-color #showcards .mini { -webkit-text-stroke: 0.6px rgba(27, 28, 34, 0.85); paint-order: stroke fill; }
body.four-color #showcards .mini.s-s { color: #000000; }
body.four-color #showcards .mini.s-h { color: #B36200; }
body.four-color #showcards .mini.s-d { color: #F0E442; }
body.four-color #showcards .mini.s-c { color: #56B4E9; }
#showcards .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--gold); transform-origin: left; transition: transform 0.25s linear;
}

/* ------------------------------------------------ Tournament starting */
body.starting #lobby { display: none !important; }
#starting {
  position: fixed; inset: 0; z-index: 26; display: grid; place-items: center;
  background: rgba(5, 6, 8, 0.45); backdrop-filter: blur(3px); animation: fade-in 0.2s ease-out;
}
.starting-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px 40px 24px; border-radius: 18px; background: var(--glass-2);
  border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop 0.25s ease-out;
}
.starting-card .suits { display: flex; gap: 12px; font-size: 30px; line-height: 1; color: #e9e4d8; }
.starting-card .suits .red { color: #d8434b; }
.starting-card .suits span { animation: suit-hop 1.2s ease-in-out infinite; }
.starting-card .suits span:nth-child(2) { animation-delay: 0.15s; }
.starting-card .suits span:nth-child(3) { animation-delay: 0.3s; }
.starting-card .suits span:nth-child(4) { animation-delay: 0.45s; }
@keyframes suit-hop { 0%, 60%, 100% { transform: translateY(0); opacity: 0.55; } 30% { transform: translateY(-9px); opacity: 1; } }
.starting-text { font: italic 700 22px var(--serif); color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .starting-card .suits span { animation: none; opacity: 1; } }

/* ------------------------------------------------ Phones: portrait only */
#rotate {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, #1a1d22, #07090b);
}
.rotate-card { text-align: center; max-width: 360px; }
.rotate-card h2 { margin: 12px 0 6px; font: italic 700 24px var(--serif); color: var(--gold); }
.rotate-card p { margin: 0; color: var(--muted); font-size: 14px; }
.rotate-icon { font-size: 54px; display: inline-block; animation: turn-upright 2.4s ease-in-out infinite; }
@keyframes turn-upright { 0%, 25% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-icon { animation: none; } }

/* ------------------------------------------------ Lobby */
#lobby {
  position: fixed; inset: 0; z-index: 25;
  /* anchored to the top: when the card grows (more seats, structure editor) it only grows
     downwards, so the controls under the mouse do not jump */
  display: grid; place-items: start center;
  padding: max(72px, 9vh) 16px 16px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6));
}
.lobby-card, .results-card, .splash-card {
  width: min(760px, 100%);
  background: linear-gradient(180deg, rgba(22, 24, 29, 0.92), rgba(12, 13, 16, 0.94));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 28px; box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.lobby-card h1, .results-card h1, .splash-card h1 { font: 700 30px var(--serif); margin: 0 0 4px; color: var(--gold); }
.lobby-card h2 { font: 700 18px var(--serif); margin: 0; }
.sub { color: var(--muted); margin: 0 0 18px; }
.row { display: flex; gap: 12px; margin-bottom: 14px; }
.row.three > label { flex: 1; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
label input, .blinds input {
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 9px;
  padding: 9px 11px; font-size: 14px; color: var(--ink); outline: none; user-select: text; width: 100%;
}
label input:focus, .blinds input:focus { border-color: var(--gold); }
.name-row label { flex: 1; text-align: center; }
.name-row input {
  font: 800 30px/1.1 Inter, sans-serif; letter-spacing: 0.02em; text-align: center;
  padding: 12px 16px; border-radius: 12px;
}
.name-row input::placeholder { font-weight: 700; color: rgba(255, 255, 255, 0.22); }
.gadget-row { display: grid; gap: 7px; margin-bottom: 22px; }
.gadget-row .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.gadget-row .lbl em { font-style: normal; font-weight: 500; opacity: 0.75; }
.gadget-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gadget-opt {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px;
  border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
  font-weight: 700; font-size: 13px; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.gadget-opt .gi { font-size: 20px; line-height: 1; }
.gadget-opt:hover { background: rgba(230, 196, 106, 0.08); }
.gadget-opt.active { border-color: var(--gold); color: var(--gold); background: rgba(230, 196, 106, 0.13); transform: translateY(-1px); }
.seat .sg { font-size: 14px; }
.seats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.seats-head .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.seat-count {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
}
.seat-count button {
  min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: 700 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; cursor: pointer;
}
.seat-count button:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.seat-count button.active { background: rgba(230, 196, 106, 0.2); color: var(--gold); }
.seat-count button:disabled { opacity: 0.3; cursor: default; }
.bots-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 13px; color: var(--ink); cursor: pointer; }
.bots-row input { width: 16px; height: 16px; accent-color: var(--gold); }
.bots-row em { font-style: normal; font-size: 12px; color: var(--muted); }
.seatgrid { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 8px; margin-bottom: 16px; }
.seat {
  display: grid; gap: 4px; justify-items: center; text-align: center;
  padding: 12px 6px; border-radius: 12px; min-height: 92px; align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03);
}
.seat .no { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.1em; }
.seat .sn { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.free { border-style: dashed; border-color: rgba(230, 196, 106, 0.4); }
.seat.free .sn { color: var(--muted); font-weight: 500; }
.seat.free .cta { color: var(--gold); font-weight: 700; font-size: 12px; }
.seat.free:hover { background: rgba(230, 196, 106, 0.08); }
.seat.taken { background: rgba(62, 194, 122, 0.08); border-color: rgba(62, 194, 122, 0.35); }
.seat.mine { background: rgba(230, 196, 106, 0.12); border-color: var(--gold); }
.seat.offline { opacity: 0.6; }
.seat em { font-size: 11px; color: var(--red); }
.struct { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; }
.title-row label { flex: 1; }
.look-row { flex-wrap: wrap; gap: 16px; }
.look { display: grid; gap: 6px; }
.look .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.look-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.look-opts button {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 12.5px; font-weight: 600;
}
.look-opts button.active { border-color: var(--gold); color: var(--gold); background: rgba(230, 196, 106, 0.1); }
.look-opts.backs button { padding: 3px; border-radius: 7px; }
.look-opts.backs img { display: block; width: 30px; height: 42px; border-radius: 4px; }
.sw { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.sw-green { background: radial-gradient(circle at 35% 35%, #1f8a5a, #0b4f31); }
.sw-red { background: radial-gradient(circle at 35% 35%, #b02a36, #641118); }
.sw-blue { background: radial-gradient(circle at 35% 35%, #2466a8, #0d355c); }
.sw-purple { background: radial-gradient(circle at 35% 35%, #7a3aa6, #3a1655); }
.sw-wood { background: repeating-linear-gradient(100deg, #6b3219 0 3px, #4e220f 3px 5px, #7a3b1e 5px 8px); }
.sw-marbleDark { background: linear-gradient(135deg, #1c1d20 40%, #d6ccba 46%, #1c1d20 52%, #2a2a2e 75%, #9d968a 78%, #1c1d20 81%); }
.sw-marbleLight { background: linear-gradient(135deg, #ece9e3 40%, #7a7a80 45%, #ece9e3 50%, #d9d7d2 75%, #9a9aa0 78%, #ece9e3 81%); }
.title-row input { font: italic 700 18px var(--serif); color: var(--gold); }
.struct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; }
.chip-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(230, 196, 106, 0.1); }
.blinds-wrap { max-height: 240px; overflow-y: auto; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; margin-bottom: 12px; }
.blinds { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.blinds th { position: sticky; top: 0; background: #16181d; font-size: 11px; color: var(--muted); text-align: left; padding: 8px 8px; font-weight: 600; z-index: 1; }
.blinds td { padding: 3px 6px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.blinds td:first-child { color: var(--gold); font-weight: 700; padding-left: 12px; width: 50px; }
.blinds input { padding: 6px 8px; font-size: 13px; }
.blinds .t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.blinds .del { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 0 6px; }
.blinds .del:hover { color: var(--red); }
.struct-foot { align-items: center; flex-wrap: wrap; }
.struct-summary { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.struct-sum { color: var(--muted); font-size: 13px; display: grid; gap: 3px; }
.struct-sum b { color: var(--ink); }
.struct-editor { margin-bottom: 12px; }
.struct-editor .presets { margin: 0 0 12px; }
.struct-editor h3 { font: 700 15px var(--serif); margin: 4px 0 10px; }
.estimate { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.estimate b { color: var(--gold); }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
#lobby:not(.readonly) .readonly-hint { display: none; }
.lobby-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; margin-top: 18px; }
.lobby-foot .who { color: var(--muted); }
.lobby-foot .primary { margin-left: auto; }

#lobby > .lobby-card { width: min(620px, 100%); }
#lobby h1 { margin-bottom: 22px; }
#lobby .name-row { margin-bottom: 22px; }
#lobby .name-row label { text-align: left; }
#lobby .name-row input { font-size: 20px; text-align: left; min-height: 50px; }
#lobby .name-row input::placeholder { color: var(--muted); font-weight: 500; }
.lobby-players-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 10px 18px; min-height: 36px; align-items: center; }
.lobby-player { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; font-size: 14px; font-weight: 600; }
.lobby-player > span:not(.player-initial) { overflow-wrap: anywhere; }
.player-initial { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; color: var(--gold); background: rgba(230, 196, 106, 0.12); font-size: 11px; }
.lobby-player.offline { color: var(--muted); }
.lobby-player small, .lobby-empty { color: var(--muted); font-size: 12px; font-weight: 400; }
#lobby .bots-row { justify-content: space-between; flex-wrap: nowrap; gap: 16px; margin: 0; min-height: 64px; font-size: 14px; }
#lobby #in-bots { flex: none; width: 44px; height: 26px; }
.lobby-options { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.lobby-options > summary { display: flex; align-items: center; gap: 10px; min-height: 58px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.lobby-options > summary::-webkit-details-marker { display: none; }
.lobby-options > summary small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; text-align: right; }
.lobby-options > summary svg { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.lobby-options[open] > summary svg { transform: rotate(180deg); }
.lobby-options > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.lobby-options-body { padding: 12px 0 8px; }
#lobby .seat-count { flex-wrap: wrap; border-radius: 12px; }
#lobby .seat-count button { min-width: 40px; height: 44px; border-radius: 8px; }
#lobby .lobby-foot { margin-top: 0; padding-top: 18px; }
#lobby .lobby-foot .who { font-size: 13px; }
#lobby .lobby-foot .primary { min-height: 48px; }
#lobby button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 480px) {
  #lobby h1 { font-size: 28px; }
  #lobby .lobby-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  #lobby .lobby-foot .primary { margin-left: 0; width: 100%; }
  #lobby .seat-count { width: 100%; }
  #lobby .seat-count button { flex: 1; }
}

/* ------------------------------------------------ Trophy tooltip */
#trophy-tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; max-width: 260px;
  display: grid; gap: 3px; padding: 9px 12px; border-radius: 12px;
  background: rgba(14, 15, 18, 0.94); border: 1px solid rgba(230, 196, 106, 0.45); box-shadow: var(--shadow);
  font-size: 12.5px; color: var(--ink);
}
#trophy-tip b { color: var(--gold); font-size: 13.5px; }
#trophy-tip small { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------ Late registration */
#join {
  position: fixed; inset: 0; z-index: 27; display: grid; place-items: center; padding: 72px 16px 16px;
  overflow-y: auto; background: rgba(0, 0, 0, 0.5);
}
.join-card { width: min(560px, 100%); }
.join-seats { display: flex; flex-wrap: wrap; gap: 6px; }
.join-seats .chip-btn { min-width: 44px; padding: 7px 12px; font-size: 14px; }
#join .lobby-foot { justify-content: flex-end; gap: 10px; }
#join-cta {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 18;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap;
}

/* ------------------------------------------------ Results */
#results { position: fixed; inset: 0; z-index: 26; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.results-card { width: min(440px, 100%); text-align: center; animation: pop 0.4s ease-out; }
.results-card .trophy { font-size: 56px; filter: drop-shadow(0 6px 20px rgba(230, 196, 106, 0.5)); }
.results-card ol { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; }
.results-card li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.results-card li:nth-child(1) { background: rgba(230, 196, 106, 0.14); color: var(--gold); font-size: 17px; }
.results-card li:nth-child(odd):not(:first-child) { background: rgba(255, 255, 255, 0.03); }
.results-card .pl { width: 28px; text-align: center; }

/* ------------------------------------------------ Splash */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 8, 6, 0.55), rgba(0, 0, 0, 0.92));
  backdrop-filter: blur(6px);
  transition: opacity 0.5s;
}
#splash.leaving { opacity: 0; pointer-events: none; }
.splash-card { width: min(480px, 100%); text-align: center; padding: 36px 30px; }
.splash-logo { display: block; width: 64px; height: 72px; margin: 0 auto 14px; }
.splash-card h1 { font-size: 46px; font-style: italic; }
.splash-card p { color: #cfc8b8; }
.splash-card .fine { font-size: 12px; color: var(--muted); margin-top: 20px; line-height: 1.5; }
.suits { font-size: 28px; letter-spacing: 10px; color: #ddd; }
.suits .r { color: var(--red); }

/* ------------------------------------------------ Toasts & Offline */
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  background: var(--glass-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 600; opacity: 0; transform: translateY(-8px); transition: all 0.3s;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: rgba(224, 72, 90, 0.6); color: #ffb3bc; }
.toast.level { border-color: rgba(90, 166, 255, 0.6); color: #cfe4ff; }
#offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200; text-align: center; padding: 8px;
  background: var(--red); color: white; font-weight: 700; transform: translateY(-100%); transition: transform 0.3s;
}
body.disconnected #offline { transform: none; }

/* ------------------------------------------------ Phases */
body[data-phase='lobby'] #actions,
body.dealing-me #actions,
body[data-phase='lobby'] #strength { display: none !important; }

/* ------------------------------------------------ Mobile */
@media (max-width: 800px) {
  body { font-size: 13px; }
  .brand { display: none; }
  #topbar { padding: 8px; gap: 8px; }
  /* only the menu button stays in the top bar; the rest lives in the menu */
  .tools > .lang-pick, #btn-invite, #btn-pause, #btn-sfx { display: none; }
  .menu { min-width: 230px; top: 44px; }
  .menu button { padding: 11px 12px; font-size: 14px; }
  .menu .m-only { display: block; }
  .menu .m-item { display: flex; }
  /* room for the chat button (fixed, left of the menu button) – as a margin, not as padding of
     .tools, which would catch the taps meant for the chat button */
  .levelinfo { margin-right: 50px; }
  .levelinfo { padding: 5px 12px; gap: 8px; font-size: 12px; }
  .levelinfo .hand-no { display: none; }
  /* voice controls live in the ⋮ menu on phones (the panel was covered by the action buttons) */
  #voice { display: none; }
  /* the chat button sits in the top bar row, left of the menu button */
  #log { left: auto; right: 52px; bottom: auto; top: max(8px, env(safe-area-inset-top)); width: auto; }
  #log .log-toggle span { display: none; }
  #log.open { width: min(320px, calc(100vw - 32px)); }
  #actions { left: 8px; right: 8px; bottom: 8px; width: auto; transform: none; animation-name: pop; }
  #actions.waiting { left: auto; right: 16px; bottom: 16px; }
  #showcards { bottom: max(128px, 36vh); }
  #strength { font-size: 13px; padding: 4px 12px; }
  #strength.compact { font-size: 11.5px; padding: 2px 9px 3px; }
  /* long result tags (e.g. "+388 · Two Pair, Jacks and Fours") would run into the neighbour:
     at most plate width, wrapped, and the winner's amount on its own line */
  .plate .act { top: calc(100% + 4px); bottom: auto; width: max-content; max-width: 150px; white-space: normal; text-align: center; line-height: 1.25; }
  .plate .act.win { border-radius: 12px; padding: 3px 10px 4px; }
  .plate .act.win .amt, .plate .act.win .hn { display: block; }
  .plate .act.win .sep { display: none; }
  .plate .act.win .hn { font-size: 11px; font-weight: 700; }
  .odds { padding: 4px 10px 5px; }
  .odds b { font-size: 22px; }
  .odds small { font-size: 11px; }
  .plate { min-width: 0; padding: 4px 10px 4px 4px; gap: 6px; }
  .plate .avatar { width: 34px; height: 34px; font-size: 12px; }
  .plate.has-video .avatar { width: 56px; height: 56px; margin: -14px 0 -14px -4px; }
  .plate.has-video.zoom .avatar { width: 130px; height: 130px; margin: -50px 0 -50px -8px; }
  .plate.has-video.zoom { --zoom-video: 130px; --zoom-shift: 8px; }
  .plate .name { max-width: 80px; font-size: 12px; }
  .seatgrid { grid-template-columns: repeat(3, 1fr); }
  .gadget-opts { grid-template-columns: repeat(3, 1fr); }
  .row.three { flex-direction: column; }
  .lobby-card { padding: 18px; }
  .potlabel { font-size: 12px; padding: 3px 9px; }
  #away { bottom: 72px; width: calc(100vw - 32px); gap: 10px; padding: 10px 12px; font-size: 12.5px; }
  #away .primary { padding: 9px 12px; white-space: nowrap; }
}

.plate.bot .ini { font-size: 1.45em; line-height: 1; }
