/* ============ Game table (also used by the landing-page demo) ============ */
:root {
  --g-bg: #ffffff;
  --g-text: #1e1530;
  --g-muted: #6e6685;
  --g-blue: #8b5cf6;
  --g-blue-dark: #7c3aed;
  --g-table: #ede9fe;
  --g-card-empty: #e8e5f0;
  --g-face: #ffffff;
  --g-border: #e4e0ee;
  --g-panel: #ffffff;
  --g-hover: #f4f2f9;
  --g-shadow: 0 16px 50px rgba(30, 21, 48, .18);
  --g-bar: #1e1530;
  --sb-thumb: rgba(30, 21, 48, .2);
  --sb-thumb-hover: rgba(30, 21, 48, .38);
}
:root[data-theme="dark"] {
  --g-bg: #1e1530; --g-text: #f6f4fb; --g-muted: #b1a8c8; --g-table: #3b2d5c; --g-card-empty: #3d3354;
  --g-face: #1e1530; --g-border: #3a3050; --g-panel: #241b38; --g-hover: #2d2343; --g-shadow: 0 16px 50px rgba(0,0,0,.5); --g-bar: #f6f4fb; --sb-thumb: rgba(196, 181, 253, .3); --sb-thumb-hover: rgba(196, 181, 253, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-bg: #1e1530; --g-text: #f6f4fb; --g-muted: #b1a8c8; --g-table: #3b2d5c; --g-card-empty: #3d3354;
    --g-face: #1e1530; --g-border: #3a3050; --g-panel: #241b38; --g-hover: #2d2343; --g-shadow: 0 16px 50px rgba(0,0,0,.5); --g-bar: #f6f4fb; --sb-thumb: rgba(196, 181, 253, .3); --sb-thumb-hover: rgba(196, 181, 253, .55);
  }
}

body.game-body {
  margin: 0; min-height: 100vh; font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--g-bg); color: var(--g-text); -webkit-font-smoothing: antialiased; transition: background .3s, color .3s;
  overflow-x: hidden;
}
.game-body button, .game-body input, .game-body select { font-family: inherit; }
.game-body .logo { color: var(--g-text); }
.game-body .logo-text small { color: var(--g-muted); }

.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 8px; padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .12s, box-shadow .2s, color .15s; white-space: nowrap; text-decoration: none; }
.g-btn:active { transform: scale(.96); }
.g-primary { background: var(--g-blue); color: #fff; }
.g-primary:hover { background: var(--g-blue-dark); box-shadow: 0 6px 18px rgba(139, 92, 246,.35); }
.g-outline { background: transparent; color: var(--g-blue); border: 2px solid var(--g-blue); padding: 8px 16px; }
.g-outline:hover { background: rgba(139, 92, 246,.08); }
.g-ghost { background: transparent; color: var(--g-text); padding: 8px 10px; }
.g-ghost:hover { background: var(--g-hover); }
.g-icon { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border: none; background: none; color: var(--g-text); border-radius: 12px; font-size: 18px; cursor: pointer; transition: color .15s, transform .12s; }
.g-icon:hover { color: var(--g-blue); }
.g-icon:active { transform: scale(.92); }
.g-icon:focus:not(:focus-visible) { outline: none; }
.g-me.static { cursor: default; }
.g-me.static:hover { background: transparent; }

/* ---------- layout ---------- */
.g-app { min-height: 100vh; display: flex; flex-direction: column; }
.g-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; position: relative; z-index: 5; }
.g-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.g-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 18px; cursor: pointer; padding: 6px 10px; border-radius: 8px; min-width: 0; border: none; background: none; color: var(--g-text); }
.g-title:hover { background: var(--g-hover); }
.g-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.g-title .chev { font-size: 12px; color: var(--g-muted); transition: transform .2s; }
.g-right { display: flex; align-items: center; gap: 8px; }
.g-me { display: flex; align-items: center; gap: 8px; border: none; background: transparent; color: var(--g-text); font-weight: 600; font-size: 15px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; }
.g-me:hover { background: var(--g-hover); }
/* Avatar: soft top-to-bottom gradient of the player's colour with rounded initials. */
.g-avatar {
  --c: #8e8e93;
  width: 36px; height: 36px; border-radius: 50%; color: #fff; display: grid; place-items: center; flex: none;
  font-family: 'Quicksand', 'SF Pro Rounded', ui-rounded, 'Nunito', system-ui, sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .3px; line-height: 1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, #fff) 0%, color-mix(in srgb, var(--c) 85%, #fff) 30%, color-mix(in srgb, var(--c) 72%, #000) 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: background .3s;
}
.g-avatar-lg { width: 76px; height: 76px; font-size: 30px; letter-spacing: 1px; }
.pf-preview { display: flex; justify-content: center; margin: -4px 0 18px; }
.g-count { font-size: 13px; font-weight: 600; color: var(--g-muted); background: var(--g-hover); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.g-status { width: 9px; height: 9px; border-radius: 50%; background: #2ecc71; flex: none; box-shadow: 0 0 0 3px rgba(46,204,113,.2); }
.g-status.bad { background: #f39c12; box-shadow: 0 0 0 3px rgba(243,156,18,.2); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.g-main { flex: 1; display: flex; min-height: 0; }
.g-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-board { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }

.g-issue-banner { text-align: center; margin: -6px auto 0; padding: 0 16px; min-height: 26px; }
.g-issue-banner span { display: inline-flex; gap: 8px; align-items: center; background: var(--g-hover); padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; animation: dropIn .4s cubic-bezier(.3,1.4,.5,1); max-width: 100%; }
.g-issue-banner em { font-style: normal; color: var(--g-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- table ---------- */
.t-grid { display: grid; grid-template-areas: "left top right" "left table right" "left bottom right"; grid-template-columns: auto auto auto; gap: 24px 36px; align-items: center; }
.t-row { display: flex; justify-content: center; gap: 36px; min-height: 100px; }
.t-row.top { grid-area: top; align-items: flex-end; }
.t-row.bottom { grid-area: bottom; align-items: flex-start; }
.t-col { display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.t-col.left { grid-area: left; } .t-col.right { grid-area: right; }
.t-table {
  grid-area: table; min-width: 338px; min-height: 150px; background: var(--g-table); border-radius: 28px;
  display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; transition: background .3s, box-shadow .4s;
}
.t-table.ready { animation: tableGlow 2s ease-in-out infinite; }
@keyframes tableGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(139, 92, 246,0); } 50% { box-shadow: 0 0 0 10px rgba(139, 92, 246,.14); } }
.t-msg { font-size: 18px; font-weight: 500; text-align: center; animation: fadeUp .35s; }
.t-msg small { display: block; color: var(--g-muted); font-size: 14px; margin-top: 4px; }
.t-msg a { color: var(--g-blue); font-weight: 600; text-decoration: none; cursor: pointer; }
.t-table .g-btn { animation: popIn .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.t-count { font-size: 56px; font-weight: 800; color: var(--g-blue); animation: countPop .65s cubic-bezier(.3,1.6,.5,1); }
@keyframes countPop { 0% { transform: scale(2.2); opacity: 0; } 40% { opacity: 1; } 100% { transform: scale(1); } }

/* ---------- players ---------- */
.p { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 76px; position: relative; animation: seatIn .45s cubic-bezier(.3,1.5,.5,1) backwards; }
@keyframes seatIn { from { opacity: 0; transform: scale(.4) translateY(10px); } }
.p-name { font-weight: 700; font-size: 15px; max-width: 140px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.p-name .crown { font-size: 12px; }
.p .throw { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 6px) scale(.9); background: var(--g-panel); border-radius: 999px; box-shadow: var(--g-shadow); padding: 4px; display: flex; gap: 2px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s; z-index: 6; border: 1px solid var(--g-border); }
.p.can-throw:hover .throw, .p.can-throw.touch-open .throw { opacity: 1; pointer-events: auto; transform: translate(-50%, -4px) scale(1); }
.p .throw button { border: none; background: none; font-size: 20px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; transition: transform .15s, background .15s; padding: 0; }
.p .throw button:hover { transform: scale(1.25); background: var(--g-hover); }
.p.hit { animation: hit .45s; }
@keyframes hit { 25% { transform: translateX(-6px) rotate(-8deg); } 50% { transform: translateX(5px) rotate(6deg); } 75% { transform: translateX(-3px) rotate(-3deg); } }

.c { width: 36px; height: 60px; perspective: 600px; }
.c-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.4,.2,.2,1); transform-style: preserve-3d; }
.c.flipped .c-in { transform: rotateY(180deg); }
.c-back, .c-front { position: absolute; inset: 0; border-radius: 7px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.c-back { background: var(--g-card-empty); transition: background .25s; }
.c.voted .c-back { background: var(--g-blue); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 3px, transparent 3px 8px); animation: cardDrop .4s cubic-bezier(.3,1.6,.5,1); }
@keyframes cardDrop { 0% { transform: translateY(-18px) scale(1.1); } 100% { transform: none; } }
.c-front { transform: rotateY(180deg); background: var(--g-face); border: 2px solid var(--g-blue); color: var(--g-blue); font-weight: 800; font-size: 18px; }
.c.spectator .c-back { background: transparent; font-size: 26px; }
.c.thinking .c-back::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--g-muted); border-top-color: transparent; animation: spin 1s linear infinite; opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- deck ---------- */
.g-footer { padding: 8px 16px 28px; display: flex; flex-direction: column; align-items: center; min-height: 180px; justify-content: flex-end; }
.d-label { font-size: 16px; margin-bottom: 18px; animation: fadeUp .4s; }
.d-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.d-card {
  width: 50px; height: 82px; border-radius: 9px; border: 2px solid var(--g-blue); background: var(--g-face); color: var(--g-blue);
  font-weight: 800; font-size: 19px; display: grid; place-items: center; padding: 0; cursor: pointer;
  transition: transform .18s cubic-bezier(.3,1.6,.5,1), background .15s, color .15s, box-shadow .2s;
  animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: calc(var(--i) * 35ms);
}
@keyframes dealIn { from { opacity: 0; transform: translateY(40px) rotate(8deg); } }
.d-card:hover { transform: translateY(-6px); background: rgba(139, 92, 246,.08); }
.d-card.sel { background: var(--g-blue); color: #fff; transform: translateY(-12px); box-shadow: 0 10px 22px rgba(139, 92, 246,.4); }
.d-card:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- results ---------- */
.r-wrap { display: flex; align-items: center; gap: 52px; flex-wrap: wrap; justify-content: center; animation: fadeUp .5s; }
.r-bars { display: flex; gap: 26px; align-items: flex-end; }
.r-item { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: fadeUp .45s backwards; animation-delay: calc(var(--i) * 90ms); }
.r-track { width: 8px; height: 84px; background: var(--g-card-empty); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.r-fill { width: 100%; background: var(--g-bar); border-radius: 4px; animation: grow .8s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
@keyframes grow { from { height: 0 !important; } }
.r-card { width: 46px; height: 72px; border: 2px solid var(--g-text); border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.r-item.top .r-card { border-color: var(--g-blue); color: var(--g-blue); }
.r-votes { font-size: 13px; color: var(--g-muted); }
.r-stats { display: flex; gap: 40px; align-items: center; }
.r-stat { text-align: center; }
.r-stat-label { color: var(--g-muted); font-size: 15px; }
.r-stat-value { font-size: 34px; font-weight: 800; }
.r-ring { position: relative; width: 76px; height: 76px; margin: 4px auto 0; }
.r-ring svg { transform: rotate(-90deg); }
.r-ring circle.arc { animation: ring 1s cubic-bezier(.2,.8,.2,1) backwards .3s; }
@keyframes ring { from { stroke-dasharray: 0 999; } }
.r-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; animation: popIn .5s cubic-bezier(.3,1.6,.5,1) backwards .9s; }

/* ---------- issues drawer ---------- */
.g-drawer { width: 0; overflow: hidden; transition: width .35s cubic-bezier(.2,.8,.2,1); border-left: 1px solid transparent; flex: none; }
.g-drawer.open { width: 360px; border-left-color: var(--g-border); }
.g-drawer-in { width: 360px; height: 100%; padding: 6px 20px 20px; display: flex; flex-direction: column; }
.g-drawer h3 { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 4px; font-size: 20px; }
.g-drawer .sub { color: var(--g-muted); font-size: 14px; margin-bottom: 16px; }
.iss-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 2px; flex: 1; }
.iss { background: var(--g-hover); border-radius: 12px; padding: 14px; border: 2px solid transparent; transition: border-color .2s, transform .2s; animation: fadeUp .3s; position: relative; }
.iss.cur { border-color: var(--g-blue); background: rgba(139, 92, 246,.08); }
.iss-title { font-weight: 600; font-size: 15px; margin-bottom: 10px; word-break: break-word; padding-right: 22px; }
.iss-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.iss-foot .g-btn { padding: 6px 12px; font-size: 13px; }
.iss-pts { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; background: var(--g-panel); border: 1px solid var(--g-border); display: grid; place-items: center; font-weight: 800; }
.iss-del { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--g-muted); cursor: pointer; font-size: 16px; opacity: 0; transition: opacity .15s; }
.iss:hover .iss-del { opacity: 1; }
.iss-add { display: flex; gap: 8px; margin-top: 14px; }
.iss-add input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--g-border); background: var(--g-bg); color: var(--g-text); font-size: 15px; }
.iss-add input:focus { outline: none; border-color: var(--g-blue); }
.iss-empty { text-align: center; color: var(--g-muted); padding: 30px 10px; font-size: 14px; }
.iss-empty div { font-size: 38px; margin-bottom: 8px; }

/* ---------- menus / modals ---------- */
.g-menu { position: absolute; top: calc(100% + 6px); background: var(--g-panel); border: 1px solid var(--g-border); border-radius: 12px; box-shadow: var(--g-shadow); padding: 6px; min-width: 230px; z-index: 30; animation: menuIn .18s cubic-bezier(.2,.8,.2,1); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.g-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none; color: var(--g-text); padding: 10px 12px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.g-menu button:hover { background: var(--g-hover); }
.g-menu hr { border: none; border-top: 1px solid var(--g-border); margin: 6px 0; }

.g-overlay { position: fixed; inset: 0; background: rgba(10, 6, 20, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .2s; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.g-modal { background: var(--g-panel); color: var(--g-text); border-radius: 18px; box-shadow: var(--g-shadow); width: 100%; max-width: 460px; padding: 30px; animation: modalIn .3s cubic-bezier(.3,1.3,.5,1); max-height: calc(100vh - 32px); overflow-y: auto; }
@keyframes modalIn { from { transform: translateY(20px) scale(.96); opacity: 0; } }
.g-modal h2 { margin: 0 0 20px; font-size: 22px; }
.g-field { margin-bottom: 18px; }
.g-field > label { display: block; font-size: 13px; color: var(--g-muted); margin-bottom: 6px; font-weight: 500; }
.g-input { width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 8px; border: 2px solid var(--g-border); background: var(--g-bg); color: var(--g-text); transition: border-color .15s; }
.g-input:focus { outline: none; border-color: var(--g-blue); }
.g-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.g-copy { display: flex; gap: 8px; } .g-copy input { flex: 1; min-width: 0; }
.g-code { font-size: 38px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 4px 0 18px; color: var(--g-blue); }
.g-code span { display: inline-block; animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: calc(var(--i) * 60ms); }
.g-avatars { display: flex; gap: 6px; flex-wrap: wrap; }
.g-avatars button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform .15s; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 72%, #000)); background-clip: padding-box; box-shadow: 0 0 0 1px var(--g-border); }
.g-avatars button:hover { transform: scale(1.12); }
.g-avatars button.sel { border-color: var(--g-text); }
.g-switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--g-border); }
.g-switch-row b { display: block; font-size: 15px; } .g-switch-row span { font-size: 13px; color: var(--g-muted); }
.g-body-switch { position: relative; width: 44px; height: 24px; flex: none; }
.g-body-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.g-body-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--g-card-empty); cursor: pointer; transition: background .2s; }
.g-body-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.g-body-switch input:checked + i { background: var(--g-blue); }
.g-body-switch input:checked + i::after { transform: translateX(20px); }

/* ---------- effects ---------- */
.fx-proj { position: fixed; z-index: 80; font-size: 34px; pointer-events: none; will-change: transform; }
.fx-splat { position: fixed; z-index: 79; pointer-events: none; font-size: 22px; animation: splat .7s ease-out forwards; }
@keyframes splat { from { transform: translate(-50%,-50%) scale(.4); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; z-index: 90; pointer-events: none; animation: confetti linear forwards; border-radius: 2px; }
@keyframes confetti { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

.g-connecting { flex: 1; display: grid; place-items: center; color: var(--g-muted); }
.g-connecting .ring { width: 34px; height: 34px; border: 3px solid var(--g-card-empty); border-top-color: var(--g-blue); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 14px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .g-drawer.open { position: fixed; right: 0; top: 0; bottom: 0; background: var(--g-bg); z-index: 40; box-shadow: var(--g-shadow); width: min(360px, 100vw); }
  .g-drawer-in { width: min(360px, 100vw); padding-top: 20px; }
}
@media (max-width: 640px) {
  .g-header { padding: 10px 12px; }
  .g-hide-sm { display: none !important; }
  .g-title span { max-width: 38vw; }
  .t-table { min-width: 0; width: 100%; min-height: 120px; }
  .t-grid { gap: 16px 12px; }
  .t-row { gap: 14px; min-height: 88px; }
  .t-col { gap: 16px; }
  .p { min-width: 56px; }
  .p-name { font-size: 13px; max-width: 84px; }
  .d-card { width: 40px; height: 66px; font-size: 16px; }
  .d-row { gap: 8px; }
  .r-wrap { gap: 26px; }
  .r-bars { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- multiple tables ---------- */
.g-issue-banner:empty { display: none; }

.tp-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 6px 0 4px; }
/* Role options use the same card look as the voting deck: violet outline, name in the middle */
.tp {
  width: 120px; aspect-ratio: 5 / 8; flex: none; display: grid; place-items: center; padding: 8px; text-align: center; cursor: pointer;
  border-radius: 14px; border: 2px solid var(--g-blue); background: var(--g-face); color: var(--g-blue);
  font-family: inherit; font-weight: 800; font-size: 15px;
  transition: transform .18s cubic-bezier(.3,1.6,.5,1), background .15s, color .15s, box-shadow .2s;
  animation: dealIn .4s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: calc(var(--i) * 60ms);
}
.tp:hover { transform: translateY(-6px); background: rgba(139, 92, 246, .08); }
.tp.sel { background: var(--g-blue); color: #fff; transform: translateY(-12px); box-shadow: 0 10px 22px rgba(139, 92, 246, .4); }
@media (max-width: 520px) {
  .tp-grid { gap: 10px; }
  .tp { width: calc((100% - 20px) / 3); font-size: 13px; }
}
/* The join screen and role picker: buttons centred under the cards */
.g-join .g-actions, .g-modal .tp-grid + .g-actions { justify-content: center; }

/* Several tables side by side, all voting on the same question */
.mt-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px 44px; max-width: 1200px; }
.mt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 18px 8px; border-radius: 24px; border: 1.5px dashed transparent; transition: border-color .3s, background .3s; animation: fadeUp .45s backwards; animation-delay: calc(var(--i) * 70ms); }
.mt.mine { border-color: color-mix(in srgb, var(--g-blue) 45%, transparent); background: color-mix(in srgb, var(--g-blue) 4%, transparent); }
.mt-label { min-height: 18px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--g-blue); display: flex; gap: 8px; align-items: center; }
.mt .t-grid { gap: 14px 20px; }
.mt .t-row { gap: 20px; min-height: 92px; }
.mt .t-table { min-width: 190px; min-height: 104px; border-radius: 22px; padding: 12px; }
.mt .t-count { font-size: 40px; }
.mt-progress, .mt-result { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: popIn .35s cubic-bezier(.3,1.6,.5,1); }
.mt-progress b { font-size: 24px; font-weight: 800; }
.mt-progress small, .mt-result small { font-size: 12px; color: var(--g-muted); }
.mt-result span { font-size: 30px; font-weight: 800; color: var(--g-blue); }
.mt-empty { font-size: 13px; color: var(--g-muted); }
.g-actions-bar { display: flex; justify-content: center; padding: 4px 16px 10px; min-height: 52px; }
.g-actions-bar .t-msg { font-size: 15px; }
.r-all { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.r-tables { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.r-table { display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--g-hover); animation: fadeUp .4s backwards; animation-delay: calc(var(--i) * 80ms + 200ms); }
.r-table-name { font-size: 13px; font-weight: 700; }
.r-table b { font-size: 18px; color: var(--g-blue); }
.r-table small { font-size: 12px; color: var(--g-muted); }
@media (max-width: 640px) {
  .mt-grid { gap: 18px; }
  .mt { padding: 10px 8px 6px; }
  .mt .t-table { min-width: 140px; }
}

/* Tables side by side: every table keeps the same seat rows, so the tables line up */
.mt .t-row { min-height: 92px; }

/* ---------- theme toggle (top right) ---------- */
.g-theme svg { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.g-theme:hover svg { transform: rotate(-20deg) scale(1.08); }

/* ---------- join screen: always on the dark site background ---------- */
.g-overlay.g-join {
  --g-bg: #1a1329; --g-face: #1a1329; --g-text: #f6f4fb; --g-muted: #b1a8c8; --g-card-empty: #3d3354; --g-border: #3a3050;
  --g-panel: #1e1630; --g-hover: #2d2343; --g-shadow: 0 30px 80px rgba(0,0,0,.55);
  background: radial-gradient(1000px 600px at 20% -10%, rgba(139, 92, 246, .28), transparent 60%),
              radial-gradient(800px 500px at 110% 110%, rgba(192, 38, 211, .2), transparent 60%), #0c0816;
  backdrop-filter: none;
}
.g-join .g-modal { border: 1px solid rgba(196, 181, 253, .14); max-width: 500px; }
.g-join .g-ghost { color: var(--g-text); }
.jm-sub { margin: -10px 0 18px; color: var(--g-muted); font-size: 14px; }
.jm-sub b { color: var(--g-text); }
.jm-loading { display: flex; align-items: center; gap: 10px; color: var(--g-muted); font-size: 14px; padding: 14px 0; }
.jm-loading .ring { width: 18px; height: 18px; border: 2px solid var(--g-card-empty); border-top-color: var(--g-blue); border-radius: 50%; animation: spin .9s linear infinite; }
#pf-roles.need { animation: shake .4s; }
#pf-roles.need .tp { border-color: #ef4444; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- after the reveal: one friendly line instead of a stats panel ---------- */
.r-note { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--g-text); animation: fadeUp .45s; }
.r-note span { font-size: 30px; display: inline-block; animation: popIn .6s cubic-bezier(.3,1.6,.5,1) .1s backwards; }
.mt-result.solo { gap: 10px; }
.mt-result.solo > span { font-size: 40px; line-height: 1; }

/* ---------- a few emojis floating in the background, like the homepage ---------- */
.g-floaties { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.g-floaties .floaty { opacity: .28; font-size: 30px; filter: none; }
.g-app { position: relative; z-index: 1; }
@media (max-width: 1200px) { .g-floaties { display: none; } }

/* Nothing in the game is selectable or highlights unless you can actually click it */
.game-body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.game-body input, .game-body textarea { -webkit-user-select: text; user-select: text; }
.game-body .g-title:hover { background: none; }
.game-body .g-left .logo:hover .logo-svg { transform: none; }
.game-body .g-me.static, .game-body .g-me.static:hover { background: none; cursor: default; }
