@font-face { font-family: 'Outfit'; src: url(../fonts/outfit.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --felt-1: #10543e;
  --felt-2: #07301f;
  --felt-3: #031a11;
  --ink: #f5f1e6;
  --ink-2: rgba(245, 241, 230, .68);
  --ink-3: rgba(245, 241, 230, .42);
  --gold: #f4c55b;
  --gold-2: #e09b2d;
  --red: #ff4d61;
  --red-2: #d81f3f;
  --green: #3ddc84;
  --blue: #66b7ff;
  --panel: rgba(255, 255, 255, .065);
  --panel-2: rgba(255, 255, 255, .11);
  --line: rgba(255, 255, 255, .12);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --w: 70px;            /* hand card width (set by JS) */
  --pw: 60px;           /* pile card width */
  --r: 16px;
  --spring: cubic-bezier(.2, 1.25, .35, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --back-img: url(../cards/classic/back.webp);
  color-scheme: dark;
}
:root[data-deck="nights"] { --back-img: url(../cards/nights/back.webp); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--felt-3);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app {
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 38%, var(--felt-1) 0%, var(--felt-2) 55%, var(--felt-3) 100%);
  overflow: hidden;
}
#app::before { /* felt grain */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding-top: var(--sat);
  opacity: 0; pointer-events: none; visibility: hidden;
  transform: scale(1.03);
  transition: opacity .38s var(--ease), transform .5s var(--ease), visibility 0s .4s;
}
.screen.active { opacity: 1; pointer-events: auto; visibility: visible; transform: none; transition: opacity .38s var(--ease), transform .5s var(--ease), visibility 0s; }
.screen.behind { transform: scale(.96); }

.bar { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 10px; flex: none; }
.bar-title { font-weight: 700; letter-spacing: .02em; font-size: 17px; opacity: .9; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: background .2s, transform .2s var(--spring); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.88); background: var(--panel-2); }
@media (hover: hover) { .icon-btn:hover { background: var(--panel); } }

.pill-btn { padding: 10px 16px; border-radius: 999px; background: var(--panel-2); font-weight: 600; font-size: 14px; transition: transform .2s var(--spring), background .2s; }
.pill-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.pill-btn:active { transform: scale(.94); }

.big-btn {
  width: 100%; min-height: 58px; border-radius: 18px; padding: 10px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--panel-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(0,0,0,.18);
  transition: transform .22s var(--spring), filter .2s, opacity .2s;
}
.big-btn b { font-size: 18px; font-weight: 700; }
.big-btn small { font-size: 12.5px; opacity: .7; }
.big-btn.primary { background: linear-gradient(180deg, #ffd36e, var(--gold-2)); color: #2b1a00; box-shadow: 0 8px 24px rgba(240, 170, 40, .35), inset 0 1px 0 rgba(255,255,255,.5); }
.big-btn.bots { background: linear-gradient(180deg, rgba(102,183,255,.28), rgba(102,183,255,.12)); box-shadow: inset 0 0 0 1px rgba(102,183,255,.35); }
.big-btn:active { transform: scale(.96); }
.big-btn:disabled { opacity: .45; filter: grayscale(.4); pointer-events: none; }

.panel { background: var(--panel); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- home ---------- */
#home { align-items: center; padding: calc(var(--sat) + 4px) 18px calc(var(--sab) + 14px); overflow-y: auto; gap: 14px; }
#home > * { width: 100%; max-width: 440px; }
.home-top { display: flex; justify-content: space-between; align-items: center; }
.hero { text-align: center; position: relative; padding-top: 6px; }
.hero-cards { position: relative; height: 128px; margin: 0 auto 2px; width: 200px; }
.hc {
  position: absolute; left: 50%; bottom: 0; width: 76px; height: 106px; margin-left: -38px; border-radius: 7px;
  background-size: cover; box-shadow: 0 10px 24px rgba(0,0,0,.45); transform-origin: 50% 110%;
  animation: heroIn 1s var(--spring) both;
}
.hc.c1 { --rot: -20deg; --tx: -26px; animation-delay: .05s; }
.hc.c2 { --rot: 0deg; --tx: 0; animation-delay: .15s; z-index: 2; }
.hc.c3 { --rot: 20deg; --tx: 26px; animation-delay: .25s; }
.hc { transform: translateX(var(--tx)) rotate(var(--rot)); }
@keyframes heroIn { from { transform: translateY(60px) rotate(0) scale(.6); opacity: 0; } }
.hero:hover .hc.c1, .hero:active .hc.c1 { transform: translateX(-34px) rotate(-28deg); transition: transform .4s var(--spring); }
.hero:hover .hc.c3, .hero:active .hc.c3 { transform: translateX(34px) rotate(28deg); transition: transform .4s var(--spring); }
.logo { margin: 0; font-size: 64px; line-height: .95; font-weight: 900; letter-spacing: -.03em; }
.logo span { background: linear-gradient(180deg, #fff6d8, var(--gold) 60%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.logo em { color: var(--red); font-style: normal; display: inline-block; transform: rotate(12deg); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotate(4deg) translateY(-4px); } }
.tagline { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }

.profile { padding: 14px; display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.field input, .join-row input {
  height: 50px; border-radius: 14px; border: 0; padding: 0 16px; font-size: 18px; font-weight: 600;
  background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1.5px var(--line); outline: none; transition: box-shadow .2s;
}
.field input:focus, .join-row input:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.avatars { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -4px; scroll-snap-type: x proximity; }
.avatars::-webkit-scrollbar { display: none; }
.avatars button { flex: none; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; display: grid; place-items: center; background: rgba(0,0,0,.2); transition: transform .25s var(--spring), box-shadow .2s, background .2s; scroll-snap-align: center; }
.avatars button[aria-checked="true"] { background: rgba(244,197,91,.2); box-shadow: 0 0 0 2.5px var(--gold); transform: scale(1.08); }
.avatars button:active { transform: scale(.9); }

.home-actions { display: grid; gap: 10px; }
.join-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.join-row input { text-align: center; letter-spacing: .4em; text-transform: uppercase; font-size: 22px; font-weight: 800; min-width: 0; }
.solo-opts { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); padding: 0 4px; }
.stepper { display: flex; align-items: center; background: var(--panel); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 36px; height: 34px; font-size: 20px; font-weight: 600; }
.stepper output { min-width: 18px; text-align: center; font-weight: 800; color: var(--ink); }
.seg { display: inline-flex; background: rgba(0,0,0,.25); border-radius: 999px; padding: 3px; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: background .25s var(--ease), color .2s; }
.seg button.on { background: var(--ink); color: #0b2a1e; }
.seg.readonly { pointer-events: none; opacity: .75; }
.foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: auto 0 0; }

/* ---------- lobby ---------- */
.lobby-body { flex: 1; overflow-y: auto; padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lobby-body > * { width: 100%; max-width: 480px; }
.code-card { text-align: center; padding: 16px; border-radius: 22px; background: linear-gradient(160deg, rgba(244,197,91,.18), rgba(244,197,91,.04)); box-shadow: inset 0 0 0 1px rgba(244,197,91,.3); }
.code-card > span { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.code { font-size: 54px; font-weight: 900; letter-spacing: .18em; margin: 2px 0 10px; padding-left: .18em; color: var(--gold); text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.code-actions { display: flex; gap: 8px; justify-content: center; }
.seats-list { display: grid; gap: 8px; }
.seat-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); animation: rowIn .45s var(--spring) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.seat-row .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: rgba(0,0,0,.25); flex: none; }
.seat-row .nm { flex: 1; min-width: 0; }
.seat-row .nm b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-row .nm small { color: var(--ink-3); font-size: 12.5px; }
.seat-row .x { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); font-size: 18px; color: var(--ink-2); }
.seat-row.offline { opacity: .5; }
.seat-row.empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); border: 0; opacity: .5; animation: none; }
.seat-row.empty .av { background: transparent; box-shadow: inset 0 0 0 1.5px dashed var(--line); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.12); margin-left: 6px; vertical-align: 2px; }
.tag.host { background: rgba(244,197,91,.25); color: var(--gold); }
.add-bot { justify-self: center; align-self: center; width: auto !important; }
.settings-panel { padding: 6px 14px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 15px; font-weight: 600; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting.col { flex-direction: column; align-items: stretch; }
.lobby-foot { padding: 8px 18px calc(var(--sab) + 16px); display: grid; gap: 8px; justify-items: center; }
.lobby-foot > * { max-width: 480px; }
.hint { color: var(--ink-3); font-size: 13.5px; text-align: center; margin: 0; min-height: 1em; }

/* ---------- table ---------- */
#table { padding-bottom: 0; }
.table-bar { position: relative; z-index: 5; }
.table-bar .bar-title { font-size: 13px; letter-spacing: .14em; color: var(--ink-3); }
.felt { position: relative; flex: 1; min-height: 0; }
.felt::after { /* table rim */
  content: ''; position: absolute; left: 50%; top: 50%; width: min(118vw, 1100px); aspect-ratio: 1.6; transform: translate(-50%, -54%);
  border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.04), inset 0 0 80px rgba(0,0,0,.25); pointer-events: none;
}
.seats { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.seat {
  position: absolute; width: 84px; margin-left: -42px; margin-top: -40px; display: flex; flex-direction: column; align-items: center;
  transition: left .6s var(--ease), top .6s var(--ease), transform .4s var(--spring), opacity .3s; pointer-events: auto;
}
.seat .av-wrap { position: relative; width: 56px; height: 56px; }
.seat .av { position: absolute; inset: 4px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.22), rgba(0,0,0,.3)); box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .35s var(--spring); }
.seat .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.seat .ring circle { stroke-width: 3.5; fill: none; }
.seat .ring .track { stroke: rgba(255,255,255,.12); }
.seat .ring .prog { stroke: var(--gold); stroke-dasharray: 163.4; stroke-dashoffset: 0; opacity: 0; transition: opacity .3s; }
.seat.turn .ring .prog { opacity: 1; }
.seat.turn .av { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(244,197,91,.35), 0 0 28px rgba(244,197,91,.5); }
.seat .nm { margin-top: 3px; font-size: 13px; font-weight: 700; max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.seat .cnt { position: absolute; right: -6px; bottom: -2px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: #0b2a1e; font-weight: 800; font-size: 13px; box-shadow: 0 3px 8px rgba(0,0,0,.35); transition: transform .3s var(--spring); }
.seat .cnt.bump { animation: bump .5s var(--spring); }
.seat .cnt.low { background: var(--red); color: #fff; }
@keyframes bump { 40% { transform: scale(1.45); } }
.seat .bot-tag { position: absolute; left: -4px; top: -2px; font-size: 13px; }
.seat.away .av { filter: grayscale(1) brightness(.7); }
.seat.away .nm::after { content: ' · away'; color: var(--ink-3); font-weight: 500; }
.seat .fan { position: absolute; top: 6px; left: 50%; width: 0; height: 0; z-index: -1; }
.seat .fan i { position: absolute; width: 22px; height: 31px; left: -11px; top: -6px; border-radius: 3px; background: var(--back-img) center/cover; box-shadow: 0 1px 3px rgba(0,0,0,.4); transform-origin: 50% 120%; transition: transform .4s var(--spring); }
.bubble {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; white-space: nowrap;
  padding: 5px 11px; border-radius: 12px; background: var(--ink); color: #13261d; font-weight: 800; font-size: 13.5px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35); pointer-events: none; z-index: 3;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.bubble.show { animation: bubble 1.9s var(--spring) forwards; }
.bubble.pass { background: #c9d4ce; }
.bubble.bs { background: var(--red); color: #fff; font-size: 16px; }
@keyframes bubble { 0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.5); } 14% { opacity: 1; transform: translateX(-50%) scale(1); } 80% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.9); } }

.center { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1; }
.rank-chip { display: flex; flex-direction: column; align-items: center; line-height: 1; padding: 5px 18px 6px; min-width: 130px; border-radius: 14px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px var(--line); transition: transform .4s var(--spring), background .3s; }
.rank-chip small { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.rank-chip b { font-size: 20px; font-weight: 900; margin-top: 2px; white-space: nowrap; color: var(--gold); letter-spacing: .02em; }
.rank-chip.pop { animation: chipPop .6s var(--spring); }
.rank-chip.open b { color: var(--ink); }
@keyframes chipPop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } }
.pile-wrap { position: relative; width: calc(var(--pw) * 2.1); height: calc(var(--pw) * 1.9); display: grid; place-items: center; }
.pile-ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); opacity: 0; transition: opacity .3s; }
.pile-ring circle { stroke: var(--red); stroke-width: 2.5; stroke-dasharray: 289; fill: none; }
.pile-wrap.window .pile-ring { opacity: 1; }
.pile { position: relative; width: var(--pw); height: calc(var(--pw) * 1.4); }
.pile .pc { position: absolute; inset: 0; border-radius: calc(var(--pw) * .08); background: var(--back-img) center/cover; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pile:empty { border-radius: calc(var(--pw) * .1); box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
.pile:empty::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 2px dashed rgba(255,255,255,.12); }
.pile-count { position: absolute; right: 4px; bottom: 2px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: rgba(0,0,0,.55); font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); transition: transform .3s var(--spring); }
.pile-count.zero { opacity: 0; }
.claim { min-height: 22px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-align: center; white-space: nowrap; }
.claim b { color: var(--ink); }
.pass-dots { display: flex; gap: 6px; min-height: 8px; }
.pass-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.16); transition: background .3s, transform .35s var(--spring); }
.pass-dots i.on { background: var(--ink-2); transform: scale(1.25); }

.bs-btn {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--sab) + 8px); height: 62px; z-index: 6; border-radius: 20px; overflow: hidden;
  max-width: 440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #ff6b7b, var(--red) 50%, var(--red-2));
  box-shadow: 0 10px 30px rgba(255, 50, 80, .45), inset 0 -3px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateY(30px) scale(.8); opacity: 0; pointer-events: none;
  transition: transform .45s var(--spring), opacity .2s;
}
.trust-btn {
  position: absolute; left: 16px; bottom: calc(var(--sab) + 8px); width: 92px; height: 62px; z-index: 6; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  transform: translateY(30px) scale(.8); opacity: 0; pointer-events: none; transition: transform .45s var(--spring) .05s, opacity .2s;
}
.trust-btn small { font-size: 12px; font-weight: 700; margin-top: 3px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.trust-btn.show { transform: none; opacity: 1; pointer-events: auto; }
.trust-btn.show:active { transform: scale(.92); }
.bs-btn.show ~ .x, .me .trust-btn.show + .bs-btn { left: 118px; }
@media (min-width: 560px) { .trust-btn { left: calc(50% - 230px); } .me .trust-btn.show + .bs-btn { left: calc(50% - 128px); right: auto; width: 358px; margin: 0; } }
.bs-btn .bs-bar { position: absolute; inset: 0; background: rgba(255,255,255,.22); transform-origin: left; transform: scaleX(var(--p, 1)); }
.bs-btn span { position: relative; font-weight: 900; font-size: 30px; letter-spacing: -.01em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.bs-btn small { position: relative; font-weight: 700; font-size: 13px; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: .08em; }
.bs-btn.show { transform: none; opacity: 1; pointer-events: auto; animation: bsPulse 1.1s ease-in-out .45s infinite; }
.bs-btn.show:active { transform: scale(.95); animation: none; }
@keyframes bsPulse { 50% { box-shadow: 0 10px 40px rgba(255, 50, 80, .75), inset 0 -3px 0 rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.35); transform: scale(1.025); } }

.me { flex: none; position: relative; z-index: 4; padding-bottom: calc(var(--sab) + 8px); background: linear-gradient(180deg, transparent, rgba(0,0,0,.25) 40%); }
.status { display: flex; justify-content: center; align-items: center; gap: 8px; height: 26px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.status.mine { color: var(--gold); }
.status .timer { font-variant-numeric: tabular-nums; min-width: 2ch; padding: 1px 8px; border-radius: 8px; background: rgba(0,0,0,.3); font-size: 13px; }
.status .timer:empty { display: none; }
.status .timer.urgent { background: var(--red); color: #fff; animation: bump .5s; }
.hand { position: relative; margin: 0 auto; width: min(100%, 980px); touch-action: none; transition: height .35s var(--ease); }
.hand.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.actions { display: flex; gap: 10px; justify-content: center; padding: 6px 16px 0; height: 62px; }
.act { flex: 1; max-width: 210px; height: 54px; border-radius: 16px; font-weight: 800; font-size: 17px; transition: transform .25s var(--spring), opacity .25s, background .25s; }
.act:active { transform: scale(.94); }
.act.pass { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); max-width: 130px; }
.act.play { background: linear-gradient(180deg, #ffd36e, var(--gold-2)); color: #2b1a00; box-shadow: 0 6px 20px rgba(240,170,40,.3); }
.act:disabled { opacity: .35; pointer-events: none; }
.actions.off .act { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* ---------- cards ---------- */
.card { position: absolute; left: 0; top: 0; width: var(--w); height: calc(var(--w) * 1.4); transform-style: preserve-3d; will-change: transform; }
.card .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.card.down .inner { transform: rotateY(180deg); }
.card .face, .card .back { position: absolute; inset: 0; border-radius: calc(var(--w) * .075); backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: cover; background-position: center; box-shadow: 0 0 0 .5px rgba(0,0,0,.25), 0 3px 10px rgba(0,0,0,.28); overflow: hidden; }
.card .back { transform: rotateY(180deg); background-image: var(--back-img); }
.card .joker-tag { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); font-size: calc(var(--w) * .13); font-weight: 900; letter-spacing: .1em; color: #fff; background: rgba(0,0,0,.65); padding: 1px 6px; border-radius: 4px; }
.hand .card { transition: transform .42s var(--spring), filter .2s; cursor: pointer; }
.hand .card.drag { transition: none; }
.hand .card .face::after { content: ''; position: absolute; inset: 0; border-radius: inherit; transition: box-shadow .2s, background .2s; }
.hand .card.sel .face::after { box-shadow: inset 0 0 0 3px var(--gold); background: rgba(244,197,91,.12); }
.hand .card.sel .face { box-shadow: 0 0 0 1px var(--gold), 0 10px 22px rgba(0,0,0,.4), 0 0 18px rgba(244,197,91,.45); }
.hand .card.match:not(.sel) .face { box-shadow: 0 0 0 2px rgba(61,220,132,.85), 0 3px 10px rgba(0,0,0,.28); }
.hand .card.new .face { animation: newGlow 1.8s ease-out; }
.hand.dim .card:not(.sel) { filter: brightness(.82); }
@keyframes newGlow { 0%, 40% { box-shadow: 0 0 0 3px var(--red), 0 0 22px var(--red); } }
.hand .card.enter { animation: cardEnter .5s var(--spring) both; }
@keyframes cardEnter { from { opacity: 0; } }

.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; perspective: 1200px; }
.fx .card { --w: var(--fw, 60px); }
.stamp { position: absolute; right: -8px; top: -10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 900; color: #fff; transform: translateZ(2px) scale(0); animation: stamp .45s var(--spring) forwards; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.stamp.ok { background: var(--green); }
.stamp.no { background: var(--red); }
@keyframes stamp { to { transform: translateZ(2px) scale(1); } }

.banner { position: absolute; left: 50%; top: 66%; z-index: 40; transform: translate(-50%, -50%) scale(.4); opacity: 0; pointer-events: none; text-align: center; white-space: nowrap; }
.banner.show { animation: banner 1.7s var(--spring) forwards; }
.banner b { display: block; font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -.02em; text-shadow: 0 5px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.4); }
.banner small { display: block; font-size: 16px; font-weight: 700; margin-top: 6px; color: var(--ink); text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.banner.red b { color: var(--red); }
.banner.green b { color: var(--green); }
.banner.gold b { color: var(--gold); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); } 28% { transform: translate(-50%, -50%) scale(1) rotate(0); } 82% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.96); } }
.screen-shake { animation: scrShake .5s; }
@keyframes scrShake { 10%, 50%, 90% { transform: translate(-5px, 2px); } 30%, 70% { transform: translate(5px, -2px); } }

.emote-float { position: fixed; z-index: 60; font-size: 40px; pointer-events: none; animation: emoteUp 1.8s var(--ease) forwards; }
@keyframes emoteUp { 0% { transform: translate(-50%, 0) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -20px) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -120px) scale(1); opacity: 0; } }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-wrap.open { opacity: 1; visibility: visible; transition: opacity .3s; }
.sheet { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: linear-gradient(180deg, #17402f, #0c281d); border-radius: 26px 26px 0 0; padding: 8px 20px calc(var(--sab) + 22px); box-shadow: 0 -10px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1); transform: translateY(105%); transition: transform .45s var(--spring); touch-action: pan-y; }
.sheet-wrap.open .sheet { transform: none; }
.center-sheet { align-items: center; }
.center-sheet .sheet { border-radius: 24px; margin: 20px; transform: scale(.8); padding: 20px; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.sheet .sub { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.rank-grid button { aspect-ratio: .78; border-radius: 12px; background: linear-gradient(180deg, #fffdf6, #e9e2cf); color: #1b1b1b; font-size: 26px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 4px 10px rgba(0,0,0,.3); transition: transform .25s var(--spring); position: relative; }
.rank-grid button small { font-size: 10.5px; font-weight: 700; color: #6c6555; text-transform: uppercase; letter-spacing: .04em; }
.rank-grid button.best { box-shadow: 0 0 0 3px var(--green), 0 4px 14px rgba(61,220,132,.4); }
.rank-grid button .n { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--green); color: #05301b; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.rank-grid button:active { transform: scale(.9); }
.rank-grid button:disabled { opacity: .25; pointer-events: none; }
.menu-list { display: grid; gap: 8px; }
.menu-code { margin: 0 0 12px; text-align: center; font-weight: 800; letter-spacing: .14em; color: var(--ink-3); font-size: 13px; }
.menu-code:empty { display: none; }
.menu-list button { height: 54px; border-radius: 14px; background: var(--panel); text-align: left; padding: 0 18px; font-weight: 600; font-size: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.menu-list .danger { color: var(--red); }
.emotes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.emotes button { height: 64px; font-size: 36px; border-radius: 16px; background: var(--panel); transition: transform .25s var(--spring); }
.emotes button:active { transform: scale(.85); }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.toggle input { display: none; }
.toggle i { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.18); position: relative; transition: background .25s; flex: none; }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); transition: transform .3s var(--spring); }
.toggle input:checked + i { background: var(--green); }
.toggle input:checked + i::after { transform: translateX(20px); }
.deck-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.deck-pick button { position: relative; height: 150px; border-radius: 16px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; transition: box-shadow .2s, transform .25s var(--spring); }
.deck-pick button.on { box-shadow: inset 0 0 0 2.5px var(--gold), 0 0 20px rgba(244,197,91,.25); }
.deck-pick button:active { transform: scale(.96); }
.deck-pick i { position: absolute; top: 14px; width: 62px; height: 87px; border-radius: 6px; background-size: cover; box-shadow: 0 4px 12px rgba(0,0,0,.4); transition: transform .4s var(--spring); }
.deck-pick .dp-back { left: calc(50% - 50px); transform: rotate(-10deg); }
.deck-pick .dp-back.classic { background-image: url(../cards/classic/back.webp); }
.deck-pick .dp-back.nights { background-image: url(../cards/nights/back.webp); }
.deck-pick .dp-face { left: calc(50% - 12px); transform: rotate(8deg); }
.deck-pick button.on .dp-back { transform: rotate(-16deg) translateX(-4px); }
.deck-pick button.on .dp-face { transform: rotate(14deg) translateX(4px) translateY(-3px); }
.deck-pick b { position: absolute; left: 0; right: 0; bottom: 12px; font-size: 14px; }
.credits { font-size: 12px; color: var(--ink-3); margin: 14px 0 0; }
.rules p, .rules li { color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.rules b { color: var(--ink); }
.rules h4 { margin: 18px 0 4px; }
.rules ul { padding-left: 20px; margin: 0; }
.red { color: var(--red); font-weight: 800; }

/* ---------- results ---------- */
.results { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 20px; animation: fadeIn .4s; }
.results[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.results-card { width: 100%; max-width: 380px; text-align: center; padding: 22px 20px 18px; border-radius: 28px; background: linear-gradient(180deg, #1b4a37, #0c281d); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.12); animation: resIn .7s var(--spring); }
@keyframes resIn { from { transform: translateY(40px) scale(.85); opacity: 0; } }
.trophy { font-size: 64px; line-height: 1; animation: bob 2s ease-in-out infinite; }
.results h2 { margin: 6px 0 12px; font-size: 30px; font-weight: 900; }
.standings { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; text-align: left; }
.standings li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--panel); animation: rowIn .5s var(--spring) both; }
.standings li:first-child { background: rgba(244,197,91,.18); box-shadow: inset 0 0 0 1px rgba(244,197,91,.4); }
.standings .pos { width: 20px; font-weight: 800; color: var(--ink-3); }
.standings .av { font-size: 22px; }
.standings .nm { flex: 1; font-weight: 700; }
.standings .left { font-size: 13px; color: var(--ink-2); }
.res-actions { display: grid; gap: 8px; justify-items: center; }

.zoom { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.45); pointer-events: none; animation: fadeIn .2s; }
.zoom[hidden] { display: none; }
.zoom-card { width: min(64vw, 300px); aspect-ratio: 1/1.4; border-radius: 14px; background-size: cover; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: zoomIn .35s var(--spring); }
@keyframes zoomIn { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }

.toasts { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 58px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 420px; padding: 10px 16px; border-radius: 14px; background: rgba(12, 30, 22, .94); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14.5px; text-align: center; animation: toastIn .45s var(--spring); }
.toast.err { background: rgba(120, 20, 35, .95); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.92); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.confetti { position: fixed; inset: 0; z-index: 66; pointer-events: none; }

/* ---------- larger screens ---------- */
@media (min-width: 760px) {
  .seat { width: 130px; margin-left: -65px; margin-top: -52px; }
  .seat .av-wrap { width: 84px; height: 84px; }
  .seat .av { font-size: 42px; inset: 5px; }
  .seat .cnt { min-width: 30px; height: 30px; font-size: 15px; border-radius: 15px; }
  .bubble { font-size: 16px; top: -38px; }
  .seat .ring circle { stroke-width: 3; }
  .seat .fan i { width: 34px; height: 48px; left: -17px; top: -16px; }
  .seat .nm { font-size: 16px; max-width: 130px; }
  .rank-chip b { font-size: 24px; }
  .table-bar { height: 64px; }
  .claim { font-size: 17px; }
  .actions { height: 68px; }
}
@media (max-height: 760px) {
  #home { gap: 10px; }
  .hero-cards { height: 84px; width: 160px; } .hc { width: 52px; height: 73px; margin-left: -26px; }
  .logo { font-size: 46px; } .tagline { font-size: 14px; margin-top: 2px; }
  .profile { padding: 12px; gap: 10px; } .field input { height: 46px; }
  .big-btn { min-height: 52px; } .big-btn b { font-size: 17px; }
  .foot { display: none; }
}

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .05s !important; }
@media (prefers-reduced-motion: reduce) { .bs-btn.show, .logo em, .trophy { animation: none; } }

/* =====================================================================
   POLISH LAYER — table, liquid glass, event feed
   ===================================================================== */
@property --sx { syntax: '<length>'; inherits: true; initial-value: 50vw; }
@property --sy { syntax: '<length>'; inherits: true; initial-value: 50vh; }

:root {
  --glass: linear-gradient(145deg, rgba(255,255,255,.17) 0%, rgba(255,255,255,.07) 45%, rgba(255,255,255,.04) 100%);
  --glass-strong: linear-gradient(145deg, rgba(255,255,255,.24) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.06) 100%);
  --glass-blur: blur(22px) saturate(185%);
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(255,255,255,.07), inset 0 0 0 .6px rgba(255,255,255,.22);
  --glass-shadow: 0 10px 30px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.18);
}

/* soft colour behind glass so it actually refracts something */
.orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: orb 18s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { width: 58vmax; height: 58vmax; left: -18vmax; top: -16vmax; background: radial-gradient(circle, #1fa776, transparent 65%); }
.orbs i:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 18vh; background: radial-gradient(circle, #e4a93a, transparent 65%); opacity: .32; animation-duration: 23s; }
.orbs i:nth-child(3) { width: 50vmax; height: 50vmax; left: 10vw; bottom: -24vmax; background: radial-gradient(circle, #d8405a, transparent 65%); opacity: .26; animation-duration: 27s; }
@keyframes orb { to { transform: translate(6vmax, 5vmax) scale(1.12); } }
#table.active ~ .orbs, body:has(#table.active) .orbs { opacity: .35; }
.screen { z-index: 1; }

/* ---------- universal glass surfaces ---------- */
.icon-btn, .pill-btn, .big-btn, .panel, .code-card, .seat-row, .seg, .stepper, .rank-chip, .act, .trust-btn,
.menu-list button, .emotes button, .toast, .results-card, .feed, .standings li, .deck-pick button, .pile-count, .seat .stag.on {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
.icon-btn { position: relative; overflow: hidden; }
.icon-btn::after, .big-btn::after, .act::after, .pill-btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 30% -10%, rgba(255,255,255,.35), transparent 55%);
  opacity: .7; mix-blend-mode: screen;
}
.big-btn, .act, .pill-btn { position: relative; overflow: hidden; }
.icon-btn:active, .pill-btn:active, .big-btn:active, .act:active { filter: brightness(1.15); }

/* tinted glass variants */
.big-btn.primary, .act.play {
  background: linear-gradient(160deg, rgba(255,222,140,.92), rgba(240,170,55,.82) 60%, rgba(214,135,30,.85));
  color: #2b1a00;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 6px rgba(150,80,0,.25), inset 0 0 0 .6px rgba(255,255,255,.4), 0 10px 28px rgba(240,170,40,.38);
}
.big-btn.bots { background: linear-gradient(160deg, rgba(120,190,255,.32), rgba(80,150,240,.14)); box-shadow: var(--glass-edge), 0 10px 28px rgba(60,130,230,.22); }
.bs-btn {
  background: linear-gradient(160deg, rgba(255,120,135,.95), rgba(240,60,85,.9) 55%, rgba(200,25,55,.92));
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 0 .6px rgba(255,255,255,.35), 0 12px 34px rgba(255,50,80,.45);
}
.bs-btn .bs-bar { background: linear-gradient(90deg, rgba(255,255,255,.28), rgba(255,255,255,.12)); }

.panel, .code-card, .seat-row { border-radius: 22px; }
.code-card { background: linear-gradient(160deg, rgba(255,215,120,.22), rgba(255,255,255,.05)); }
.field input, .join-row input {
  background: rgba(0,0,0,.18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.25), inset 0 0 0 .6px rgba(255,255,255,.18);
}
.field input:focus, .join-row input:focus { box-shadow: inset 0 1px 2px rgba(0,0,0,.25), 0 0 0 2px rgba(244,197,91,.85); }

/* segmented control & stepper (iOS style) */
.seg { padding: 3px; gap: 0; border-radius: 999px; }
.seg button { color: var(--ink); opacity: .78; }
.seg button.on { opacity: 1; color: #10261c; background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(235,240,236,.88)); box-shadow: 0 3px 10px rgba(0,0,0,.25), inset 0 1px 0 #fff; }
.stepper { border-radius: 999px; }
.avatars button { background: var(--glass); box-shadow: var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.avatars button[aria-checked="true"] { background: linear-gradient(160deg, rgba(255,220,130,.45), rgba(255,255,255,.08)); box-shadow: var(--glass-edge), 0 0 0 2px rgba(244,197,91,.9), 0 6px 18px rgba(244,197,91,.3); }

/* sheets: frosted glass */
.sheet-wrap { background: rgba(0,10,6,.32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet {
  background: linear-gradient(180deg, rgba(40,70,58,.62), rgba(14,34,26,.72));
  -webkit-backdrop-filter: blur(34px) saturate(190%); backdrop-filter: blur(34px) saturate(190%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 .6px rgba(255,255,255,.16), 0 -20px 60px rgba(0,0,0,.4);
  border-radius: 32px 32px 0 0; margin: 0 6px;
}
@media (min-width: 560px) { .sheet { margin-bottom: 14px; border-radius: 32px; } }
.grab { background: rgba(255,255,255,.4); }
.menu-list button { border-radius: 18px; }
.emotes button { border-radius: 20px; }
.toggle { border-top-color: rgba(255,255,255,.1); }
.toggle i { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 .6px rgba(255,255,255,.2); }
.toggle i::after { background: linear-gradient(180deg, #fff, #eef1ef); box-shadow: 0 3px 8px rgba(0,0,0,.3), inset 0 0 0 .5px rgba(0,0,0,.05); }
.toggle input:checked + i { background: linear-gradient(180deg, #4be08f, #2fbf6f); }
.toast { background: linear-gradient(145deg, rgba(40,70,58,.7), rgba(14,34,26,.75)); border-radius: 18px; }
.toast.err { background: linear-gradient(145deg, rgba(170,40,60,.8), rgba(110,20,35,.8)); }
.results { background: rgba(0,0,0,.35); }
.results-card { background: linear-gradient(170deg, rgba(60,100,80,.55), rgba(14,34,26,.7)); -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%); border-radius: 34px; }
.standings li { border-radius: 16px; }
.standings li:first-child { background: linear-gradient(160deg, rgba(255,215,120,.3), rgba(255,255,255,.06)); }
.deck-pick button { border-radius: 22px; }
.deck-pick button.on { box-shadow: var(--glass-edge), 0 0 0 2.5px rgba(244,197,91,.9), 0 0 24px rgba(244,197,91,.25); }

/* ---------- the table ---------- */
.table-bar { padding: 4px 12px 0; height: 62px; }
.feed { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; max-width: min(calc(100% - 24px), 460px); }
.feed .fl.new { animation-name: feedIn; }
.center { top: 51%; }
@media (min-width: 760px) { .feed { bottom: auto; top: calc(47% + var(--pw) * 1.25); } .center { top: 45%; } }
.rank-chip { border-radius: 18px; padding: 6px 20px 7px; transition: transform .5s var(--spring), box-shadow .4s; }
.rank-chip.pop { animation: chipPop .8s var(--spring); box-shadow: var(--glass-edge), 0 0 0 2px rgba(244,197,91,.6), 0 0 26px rgba(244,197,91,.35); }
.felt::after { display: none; }
.table-surface {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  width: min(96%, 1080px); height: 90%; z-index: 0;
  border-radius: 50% / 46%;
  border: 12px solid transparent;
  background:
    radial-gradient(70% 60% at 50% 45%, #1a7a58 0%, #11583f 45%, #0a3b2a 80%, #072a1e 100%) padding-box,
    linear-gradient(180deg, #4a3322 0%, #2a1b11 40%, #160e08 100%) border-box;
  box-shadow:
    0 30px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.6),
    inset 0 0 0 1.5px rgba(255,220,160,.12), inset 0 16px 40px rgba(0,0,0,.45), inset 0 -10px 30px rgba(0,0,0,.35);
}
.table-surface::before { /* felt weave + subtle rail sheen */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.table-surface::after { /* moving spotlight on the active player */
  content: ''; position: absolute; inset: -12px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px 220px at calc(var(--sx) - 2%) var(--sy), rgba(255,236,170,.22), transparent 70%);
  opacity: 0; transition: opacity .6s, --sx .9s var(--ease), --sy .9s var(--ease);
}
.felt { --sx: 50%; --sy: 50%; transition: --sx .9s var(--ease), --sy .9s var(--ease); }
.felt.lit .table-surface::after { opacity: 1; }
.inlay { /* engraved centre ring under the pile */
  position: absolute; left: 50%; top: 50%; width: min(62%, 420px); aspect-ratio: 1.55; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.06), rgba(255,255,255,.015) 70%, transparent);
  box-shadow: inset 0 0 0 1.5px rgba(244,197,91,.16), 0 0 0 7px rgba(244,197,91,.035), inset 0 0 0 9px rgba(0,0,0,.06);
}
.center { gap: 10px; }
.pile .pc { box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 14px rgba(0,0,0,.25); transition: box-shadow .6s; }
.pile .pc.fresh { box-shadow: 0 0 0 2px rgba(244,197,91,.9), 0 0 22px rgba(244,197,91,.55), 0 6px 14px rgba(0,0,0,.25); }
.pile:empty { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); background: rgba(0,0,0,.08); }
.pile-count { min-width: 30px; height: 30px; border-radius: 15px; font-size: 14px; }
.pile-ring circle { stroke: #ff6b7d; stroke-width: 3; filter: drop-shadow(0 0 6px rgba(255,80,100,.6)); }

/* seats: glass medallions */
.seat .av { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge), 0 8px 20px rgba(0,0,0,.4); }
.seat.turn .av { transform: scale(1.14); box-shadow: var(--glass-edge), 0 0 0 3px rgba(244,197,91,.55), 0 0 34px rgba(244,197,91,.6); }
.seat.turn .nm { color: var(--gold); }
.seat .nm { padding: 2px 9px; border-radius: 10px; background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); margin-top: 5px; transition: color .3s; }
.seat .cnt { box-shadow: 0 3px 10px rgba(0,0,0,.4), inset 0 1px 0 #fff; }
.seat .stag { margin-top: 5px; height: 0; opacity: 0; transform: scale(.6) translateY(-6px); padding: 0 10px; border-radius: 11px; font-size: 12.5px; font-weight: 800; line-height: 22px; white-space: nowrap; overflow: hidden;
  transition: opacity .35s, transform .5s var(--spring), height .3s; }
.seat .stag.on { height: 22px; opacity: 1; transform: none; }
.seat .stag.claim { color: #fff; background: linear-gradient(160deg, rgba(255,215,120,.45), rgba(255,255,255,.08)); }
.seat .stag.pass { color: var(--ink-2); }
@media (min-width: 760px) { .seat .stag { font-size: 14px; } .seat .stag.on { height: 26px; line-height: 26px; } }

/* event feed (replaces the single claim line) */
.feed {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 210px; max-width: min(92vw, 460px);
  padding: 8px 16px; border-radius: 18px; text-align: center; min-height: 34px; cursor: pointer;
}
.feed:empty { display: none; }
.feed .fl { display: block; font-size: 14px; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; transition: opacity .4s, font-size .3s; }
.feed .fl.a1 { opacity: .55; font-size: 12.5px; }
.feed .fl.a2 { opacity: .3; font-size: 12px; }
.feed .fl.new { animation: feedIn .6s var(--spring); }
.feed b { font-weight: 800; }
.feed .hl { color: var(--gold); }
.feed .good, .log-list .good { color: var(--green); }
.feed .bad, .log-list .bad { color: #ff7a8a; }
.feed .dim, .log-list .dim { color: var(--ink-3); }
.feed .fl.red.a0 { color: #ffd0d6; }
@keyframes feedIn { from { opacity: 0; transform: translateY(8px) scale(.92); } }
@media (min-width: 760px) { .feed .fl { font-size: 16px; } .feed .fl.a1 { font-size: 14px; } }
.log-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.log-list li { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 .6px rgba(255,255,255,.1); font-size: 14.5px; }
.log-list li.red { background: rgba(255,77,97,.12); }
.log-list li.gold { background: rgba(244,197,91,.12); }
.log-list li.green { background: rgba(61,220,132,.1); }
.log-list time { font-size: 12px; color: var(--ink-3); flex: none; }

/* hand & action bar */
.me { background: linear-gradient(180deg, transparent, rgba(0,0,0,.18) 30%, rgba(0,0,0,.32)); }
.status { height: 30px; }
.status-text { padding: 3px 14px; border-radius: 999px; transition: background .3s, color .3s; }
.status.mine .status-text { background: linear-gradient(160deg, rgba(255,215,120,.28), rgba(255,255,255,.06)); box-shadow: var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: #ffe7b0; }
.act { border-radius: 20px; }
.trust-btn { border-radius: 20px; }

/* calmer motion everywhere */
.hand .card { transition: transform .55s var(--spring), filter .25s; }
.bubble.show { animation-duration: 2.6s; }
.banner.show { animation-duration: 2.4s; }
.banner b { font-size: 50px; }
.banner small { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 999px; font-size: 15px;
  background: linear-gradient(145deg, rgba(20,40,30,.6), rgba(10,25,18,.7)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--glass-edge); text-shadow: none; }
.seat { transition: left .8s var(--ease), top .8s var(--ease), transform .5s var(--spring), opacity .4s; }
.banner { top: 47%; }
@media (max-width: 759px) { .banner { top: 50%; } .banner small { display: none; } .banner b { font-size: 46px; } }

/* ---------- home v2 ---------- */
#home { gap: 12px; }
.hero-cards { height: 104px; width: 180px; }
.hc { width: 62px; height: 87px; margin-left: -31px; }
.logo { font-size: 54px; }
.profile { padding: 14px 14px 10px; gap: 10px; }
.profile-row { display: flex; align-items: center; gap: 12px; }
.profile-row .field { flex: 1; min-width: 0; }
.me-av { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 36px;
  background: linear-gradient(160deg, rgba(255,220,130,.4), rgba(255,255,255,.06)); box-shadow: var(--glass-edge), 0 0 0 2px rgba(244,197,91,.8), 0 8px 20px rgba(0,0,0,.3); }
.me-av.pop { animation: chipPop .6s var(--spring); }
.avatars-wrap { margin: 0 -14px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.avatars { gap: 8px; padding: 7px 18px 8px; margin: 0; }
.avatars button { width: 44px; height: 44px; font-size: 25px; }
.avatars button[aria-checked="true"] { transform: scale(1.06); box-shadow: var(--glass-edge), 0 0 0 2px rgba(244,197,91,.9); }
.mode { padding: 14px; display: grid; gap: 12px; }
.mode-head { display: flex; align-items: center; gap: 12px; }
.mode-head b { display: block; font-size: 17px; font-weight: 800; }
.mode-head small { color: var(--ink-2); font-size: 13px; }
.mode-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 .6px rgba(255,255,255,.2); }
.mode .big-btn { min-height: 52px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.join-row { grid-template-columns: 1fr 96px; }
.join-row input { height: 52px; border-radius: 16px; }
.join-row .big-btn { min-height: 52px; }
.solo-opts { display: grid; gap: 10px; padding: 0; }
.solo-opts .opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.foot { margin-top: 2px; }
#home > * { flex: none; }
.field input { width: 100%; min-width: 0; }

/* ---------- lobby v2 ---------- */
.lobby-body > * { flex: none; }
.seat-row.empty { min-height: 58px; padding: 8px 12px; opacity: .65; background: transparent; box-shadow: inset 0 0 0 1.2px rgba(255,255,255,.14); -webkit-backdrop-filter: none; backdrop-filter: none; }
.seat-row.empty .av { width: 38px; height: 38px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18); font-size: 20px; color: var(--ink-2); }
.seat-row.add { width: 100%; text-align: left; opacity: .9; cursor: pointer; transition: transform .25s var(--spring), background .2s; }
.seat-row.add .nm b { font-size: 15px; color: var(--ink); }
.seat-row.add .av { color: var(--gold); box-shadow: inset 0 0 0 1.5px rgba(244,197,91,.5); }
.seat-row.add:active { transform: scale(.97); background: rgba(255,255,255,.06); }
.seat-row.add ~ .seat-row.add { opacity: .5; }

/* ---------- table shape: a proper card table, not a circle ---------- */
.table-surface { border-radius: clamp(70px, 24vw, 120px); width: min(95%, 1080px); height: 86%; top: 51%; }
@media (min-width: 760px) { .table-surface { border-radius: 999px; height: 84%; width: min(92%, 1180px); } }
@media (orientation: landscape) and (max-height: 600px) { .table-surface { border-radius: 999px; } }
.profile, .mode { grid-template-columns: minmax(0, 1fr); } .profile-row, .avatars-wrap { min-width: 0; }
.solo-opts { justify-content: stretch; grid-template-columns: minmax(0, 1fr); }

/* =====================================================================
   v10 — wide table, info area, nicer action buttons
   ===================================================================== */
.felt { --th: 300px; }
.table-surface { top: 6px; transform: translateX(-50%); height: var(--th); width: min(95%, 1180px); border-radius: clamp(56px, 18vw, 96px); }
@media (min-width: 760px) { .table-surface { border-radius: 999px; } }
.inlay { top: calc(6px + var(--th) * .52); width: min(54%, 420px); aspect-ratio: 1.9; }
.center { top: calc(6px + var(--th) * .52); }
.felt.lit .table-surface::after { opacity: 1; }

/* feed sits centred in the space under the table */
.feed {
  top: calc(var(--th) + (100% - var(--th)) / 2 + 4px); bottom: auto; transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 440px); max-width: none; padding: 12px 18px; gap: 5px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.04));
}
.feed .fl { font-size: 15px; }
.feed .fl.a0 { font-size: 16.5px; }
.feed .fl.a1 { font-size: 13.5px; opacity: .6; }
.feed .fl.a2 { font-size: 12.5px; opacity: .35; }
@media (min-width: 760px) { .feed { top: auto; bottom: 12px; transform: translateX(-50%); } }
@media (max-height: 700px) { .feed .fl.a2 { display: none; } }

/* status pill above the hand */
.status { height: 34px; }
.status-text { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; font-size: 14px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 .6px rgba(255,255,255,.12); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.status-text:empty { display: none; }
.status.mine .status-text::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: dotPulse 1.4s ease-in-out infinite; }
@keyframes dotPulse { 50% { transform: scale(.6); opacity: .6; } }

/* action bar: lower, bigger, nicer */
.me { padding-bottom: calc(var(--sab) * .55 + 6px); }
.actions { height: 66px; gap: 12px; padding: 4px 16px 0; max-width: 480px; margin: 0 auto; }
.act { display: flex; align-items: center; justify-content: center; gap: 8px; height: 58px; border-radius: 22px; font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.act svg { width: 20px; height: 20px; stroke-width: 2.4; flex: none; }
.act.pass { flex: 0 0 34%; max-width: 150px; color: var(--ink); }
.act.play { flex: 1; max-width: none; }
.act.play:disabled { opacity: 1; color: var(--ink-3); background: var(--glass); box-shadow: var(--glass-edge), var(--glass-shadow); }
.act.play:disabled svg { opacity: .5; }
.act.play.ready { animation: readyGlow 2.2s ease-in-out infinite; }
@keyframes readyGlow { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 0 0 .6px rgba(255,255,255,.4), 0 10px 34px rgba(240,170,40,.6); } }
.act.pass:disabled { opacity: .35; }
.actions.off .act { transform: translateY(24px) scale(.96); }

.trust-btn, .bs-btn { bottom: calc(var(--sab) * .55 + 10px); height: 58px; border-radius: 22px; }
.trust-btn { width: 92px; gap: 2px; }
.trust-btn .ico { font-size: 22px; line-height: 1; }
.trust-btn small { margin-top: 2px; font-size: 11px; }
.bs-btn { gap: 12px; left: 16px; right: 16px; max-width: 480px; }
.me .trust-btn.show + .bs-btn { left: 120px; }
.bs-btn span { font-size: 28px; }
.bs-btn small { font-size: 12px; letter-spacing: .12em; }
.bs-btn .bs-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); }
.bs-btn.show .bs-shine { animation: shine 2.2s ease-in-out .6s infinite; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (min-width: 560px) {
  .trust-btn { left: calc(50% - 240px); }
  .me .trust-btn.show + .bs-btn { left: calc(50% - 136px); right: auto; width: 376px; margin: 0; }
  .bs-btn { left: calc(50% - 240px); right: auto; width: 480px; margin: 0; }
}
/* info stack (event feed + status) centred in the space under the table */
.info { position: absolute; left: 50%; top: calc(6px + var(--th) + (100% - 6px - var(--th)) / 2); transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 440px); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 3; }
.info .feed { position: static; transform: none; width: 100%; top: auto; bottom: auto; left: auto; }
.info .status { height: auto; min-height: 32px; }
.info .status-text { font-size: 15px; padding: 7px 16px; }
@media (min-width: 760px) { .info { top: auto; bottom: 10px; transform: translateX(-50%); gap: 8px; } }
.actions.off .act { opacity: 0 !important; pointer-events: none; }
.me { padding-top: 6px; }
@media (max-width: 759px) { .center { top: calc(6px + var(--th) * .6); } .inlay { top: calc(6px + var(--th) * .6); } }

/* v11 — table lower, plain messages, buttons spaced from cards */
.felt { --tt: 26px; }
.table-surface { top: var(--tt); }
.center, .inlay { top: calc(var(--tt) + var(--th) * .52); }
@media (max-width: 759px) { .center, .inlay { top: calc(var(--tt) + var(--th) * .6); } }
.info { top: calc(var(--tt) + var(--th) + (100% - var(--tt) - var(--th)) / 2); }
.feed, .info .feed {
  background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  padding: 0; border-radius: 0; gap: 6px;
}
.feed .fl { text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.status-text, .status.mine .status-text, .info .status-text {
  background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; padding: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
.status.mine .status-text { color: var(--gold); }
.actions { padding-top: 20px; height: 84px; }
.me { padding-top: 4px; }

/* v12 — true full screen in the installed iOS app; table inlay centred */
/* Lock the document so iOS can't leave the page scrolled after the keyboard closes. */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; background: var(--felt-2); }
#app { position: fixed; inset: 0; }
/* The inlay lives inside the table, so centre it relative to the table itself. */
.inlay, .table-surface .inlay { top: 50% !important; left: 50%; transform: translate(-50%, -50%); }
/* Pile: centre the card stack itself (the pass dots hang below it). */
.center { top: calc(var(--tt) + var(--th) * .5 + 9px) !important; }

/* =====================================================================
   v14 — app-like screens (no scrolling) + bottom colour match
   ===================================================================== */
:root { --bottom: #0b2118; }
html, body { background: var(--bottom) !important; }
#app { background:
  linear-gradient(180deg, transparent 62%, var(--bottom) 100%),
  radial-gradient(120% 80% at 50% 34%, var(--felt-1) 0%, var(--felt-2) 58%, var(--bottom) 100%); }
.me { background: none; }

/* ---- home: fits on one screen ---- */
#home { overflow: hidden; gap: clamp(8px, 1.5vh, 14px); padding: calc(var(--sat) + 2px) 16px calc(var(--sab) + 10px); justify-content: flex-start; }
#home > * { flex: none; }
.home-top { height: 44px; }
.hero { flex: 1 1 auto !important; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.hero-cards { height: clamp(54px, 9vh, 96px); width: clamp(120px, 20vh, 170px); }
.hc { width: clamp(38px, 6.2vh, 62px); height: clamp(53px, 8.7vh, 87px); margin-left: clamp(-31px, -3.1vh, -19px); }
.logo { font-size: clamp(36px, 6.4vh, 56px); }
.tagline { font-size: clamp(12.5px, 1.7vh, 15px); margin-top: 2px; }
.profile { padding: 12px 12px 8px; gap: 6px; }
.me-av { width: 52px; height: 52px; font-size: 29px; }
.field span { font-size: 11px; }
.field input { height: 44px; font-size: 17px; }
.avatars { padding: 6px 18px 6px; }
.avatars button { width: 40px; height: 40px; font-size: 22px; }
.mode { padding: 12px; gap: 10px; }
.mode-head { gap: 10px; }
.mode-ico { width: 34px; height: 34px; font-size: 19px; border-radius: 11px; }
.mode-head b { font-size: 16px; }
.mode-head small { font-size: 12.5px; }
.mode .big-btn, .join-row input, .join-row .big-btn { min-height: 48px; height: 48px; }
.join-row input { font-size: 19px; }
.or { font-size: 11px; margin: -2px 0; }
.solo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.solo-row .stepper { height: 40px; }
.solo-row .stepper .cap { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin: 0 2px 0 -2px; }
.solo-row .stepper button { width: 34px; height: 40px; }
.solo-row .seg button { padding: 8px 12px; font-size: 13.5px; }
@media (max-height: 720px) {
  .tagline { display: none; }
  .mode-head small { display: none; }
  .mode-ico { width: 30px; height: 30px; font-size: 17px; }
}
@media (max-height: 640px) { .hero-cards { display: none; } }

/* ---- lobby: fits on one screen ---- */
.lobby-body { overflow-y: auto; gap: 12px; padding: 2px 16px 10px; justify-content: flex-start; }
.code-card { padding: 12px 14px 14px; border-radius: 24px; }
.code { font-size: clamp(36px, 5.6vh, 48px); margin: 0 0 8px; }
.code-actions .pill-btn { padding: 8px 14px; font-size: 13.5px; }
.seats-list { grid-template-columns: 1fr 1fr; gap: 8px; }
.seat-row { padding: 8px 10px; gap: 8px; border-radius: 18px; min-height: 56px; }
.seat-row .av { width: 36px; height: 36px; font-size: 20px; }
.seat-row .nm b { font-size: 14.5px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.seat-row .nm b .tag { margin-left: 2px; font-size: 9.5px; padding: 1px 5px; vertical-align: 0; }
.seat-row .nm small { font-size: 11.5px; }
.seat-row .x { width: 26px; height: 26px; font-size: 13px; flex: none; }
.seat-row.add { opacity: 1 !important; background: linear-gradient(160deg, rgba(255,215,120,.16), rgba(255,255,255,.03)); box-shadow: inset 0 0 0 1.2px rgba(244,197,91,.45); }
.seat-row.add .av { color: var(--gold); box-shadow: inset 0 0 0 1.5px rgba(244,197,91,.6); font-size: 20px; background: none; }
.seat-row.add .nm b { color: var(--gold); }
.seat-row.empty { min-height: 56px; }
.settings-panel { padding: 2px 14px; }
.settings-panel .setting { padding: 8px 0; font-size: 14px; }
.settings-panel .seg button { padding: 7px 10px; font-size: 13px; }
.lobby-foot { padding: 6px 16px calc(var(--sab) + 10px); gap: 6px; }
.lobby-foot .big-btn { min-height: 54px; }

/* v15 — lobby: players up top, room settings docked above Start */
.lobby-body { gap: 10px; }
.code-card { display: grid; justify-items: center; }
.code { cursor: pointer; transition: transform .3s var(--spring); }
.code:active { transform: scale(.95); }
.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.sec-head span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sec-head b { font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 .6px rgba(255,255,255,.18); color: var(--ink-2); }
.lobby-foot { display: grid; justify-items: stretch; gap: 10px; padding: 8px 16px calc(var(--sab) + 12px);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.18) 30%); }
.lobby-foot > * { max-width: 480px; width: 100%; justify-self: center; }
.settings-panel { padding: 4px 14px; border-radius: 22px; }
.settings-panel .setting { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; padding: 9px 0; }
.settings-panel .setting > span { display: grid; font-size: 14.5px; font-weight: 700; line-height: 1.15; }
.settings-panel .setting > span small { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.settings-panel .seg { display: flex; width: 100%; }
.settings-panel .seg button { flex: 1; padding: 8px 0; font-size: 13.5px; text-align: center; }
.settings-panel.guest .seg { opacity: .7; }
.settings-panel.guest::before { content: 'Set by the host'; display: block; padding: 8px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.lobby-foot .hint { min-height: 0; font-size: 13px; }
.lobby-foot .hint:empty { display: none; }
@media (max-height: 700px) { .settings-panel .setting > span small { display: none; } .settings-panel .setting { padding: 6px 0; } }
/* v16 — info stack anchored just below the fixed-size table (doesn't drift as the hand grows) */
.info { top: calc(var(--tt) + var(--th) + clamp(14px, 3.2vh, 34px)); transform: translateX(-50%); }
@media (min-width: 760px) { .info { top: calc(var(--tt) + var(--th) + 18px); bottom: auto; } }
@media (max-height: 800px) { .feed .fl.a2 { display: none; } }

/* v17 — while a BS window is open and you've picked cards: small BS on the left, Play on the right */
.bs-btn { transition: transform .45s var(--spring), opacity .25s, width .45s var(--spring), left .45s var(--spring), right .45s var(--spring); }
.me.bs-compact .trust-btn { opacity: 0; pointer-events: none; transform: translateY(20px) scale(.8); }
.me.bs-compact .bs-btn, .me.bs-compact .trust-btn.show + .bs-btn { left: 16px !important; right: auto !important; width: 112px !important; margin: 0 !important; gap: 0; }
.me.bs-compact .bs-btn small { display: none; }
.me.bs-compact .bs-btn span { font-size: 24px; }
.actions.queue-mode { padding-left: 140px; }
.actions.queue-mode .act.pass { display: none; }
.actions.queue-mode .act.play:disabled { color: var(--ink-3); }
@media (min-width: 560px) {
  .me.bs-compact .bs-btn, .me.bs-compact .trust-btn.show + .bs-btn { left: calc(50% - 240px) !important; }
  .actions.queue-mode { padding-left: 140px; }
}

/* v18 — wide desktop only: event feed + status in a side column (mobile untouched) */
@media (min-width: 1100px) {
  .felt.side-info .table-surface { width: var(--tw); }
  .felt.side-info .info {
    left: auto; right: 32px; top: calc(var(--tt) + var(--th) / 2); bottom: auto; transform: translateY(-50%);
    width: 270px; align-items: flex-start; gap: 16px;
  }
  .felt.side-info .feed { align-items: flex-start; text-align: left; gap: 8px; }
  .felt.side-info .feed .fl { white-space: normal; font-size: 15px; line-height: 1.35; }
  .felt.side-info .feed .fl.a0 { font-size: 17px; }
  .felt.side-info .feed .fl.a2 { display: block; }
  .felt.side-info .status { justify-content: flex-start; }
  .felt.side-info .status-text { font-size: 15px; }
}

/* ---------- waking-up-the-server screen ---------- */
.wake { position: fixed; inset: 0; z-index: 85; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,10,6,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.wake.open { opacity: 1; }
.wake-card { width: 100%; max-width: 380px; text-align: center; background: linear-gradient(180deg, #17402f, #0c281d); border-radius: 24px; padding: 26px 20px 18px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: center; gap: 10px; transform: translateY(12px) scale(.97); transition: transform .4s var(--spring); }
.wake.open .wake-card { transform: none; }
.wake-card h3 { margin: 6px 0 0; font-size: 20px; font-weight: 800; }
.wake-card .sub { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.wake-card .big-btn { width: 100%; margin-top: 6px; }
.wake-bar { width: 100%; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin-top: 6px; }
.wake-bar span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .3s linear; }
.wake-time { margin: 0; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wake-cards { position: relative; width: 70px; height: 62px; }
.wake-cards i { position: absolute; left: 50%; top: 4px; width: 38px; height: 54px; margin-left: -19px; border-radius: 6px; background: var(--back-img) center / cover, #7a1d2c; box-shadow: 0 4px 10px rgba(0,0,0,.35); animation: wake-shuffle 1.6s var(--ease) infinite; }
.wake-cards i:nth-child(2) { animation-delay: .2s; }
.wake-cards i:nth-child(3) { animation-delay: .4s; }
@keyframes wake-shuffle {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-22px) rotate(-14deg); }
  50% { transform: translateX(0) rotate(0); }
  75% { transform: translateX(22px) rotate(14deg); }
}
@media (prefers-reduced-motion: reduce) { .wake-cards i { animation: none; } .wake-cards i:nth-child(1) { transform: rotate(-10deg); } .wake-cards i:nth-child(3) { transform: rotate(10deg); } }
.wake[hidden] { display: none; }
