:root {
  --bg: #06281b;
  --felt: #0b4a31;
  --felt-2: #0e5a3b;
  --panel: rgba(4, 22, 15, 0.72);
  --naija: #008751;
  --naija-2: #00a463;
  --gold: #f2b632;
  --orange: #e8692a;
  --indigo: #233d7b;
  --wood: #7a4520;
  --wood-dark: #4a2812;
  --maroon: #7a1020;
  --cream: #fdf6ea;
  --ink: #fbf7ef;
  --muted: #b5cbbf;
  --danger: #ef5350;
  --radius: 16px;
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: 'Lilita One', 'Arial Black', 'Segoe UI', sans-serif;
  /* Ankara-style print used behind the app and on the table */
  --ankara: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke-width='3'%3E%3Ccircle cx='24' cy='24' r='15' stroke='%23e8692a'/%3E%3Ccircle cx='24' cy='24' r='8' stroke='%23f2b632'/%3E%3Ccircle cx='72' cy='72' r='15' stroke='%23e8692a'/%3E%3Ccircle cx='72' cy='72' r='8' stroke='%23f2b632'/%3E%3C/g%3E%3Cg fill='%23233d7b'%3E%3Cpath d='M72 8l14 16-14 16-14-16z'/%3E%3Cpath d='M24 56l14 16-14 16-14-16z'/%3E%3C/g%3E%3Cg fill='%23f2b632'%3E%3Ccircle cx='24' cy='24' r='3'/%3E%3Ccircle cx='72' cy='72' r='3'/%3E%3Ccircle cx='72' cy='24' r='3'/%3E%3Ccircle cx='24' cy='72' r='3'/%3E%3C/g%3E%3Cg fill='%23008751'%3E%3Ccircle cx='0' cy='48' r='4'/%3E%3Ccircle cx='96' cy='48' r='4'/%3E%3Ccircle cx='48' cy='0' r='4'/%3E%3Ccircle cx='48' cy='96' r='4'/%3E%3Ccircle cx='48' cy='48' r='5'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
/* No overflow on html/body: on iOS Safari it breaks taps. Clip inside sections instead. */
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at top, rgba(0, 135, 81, 0.55), transparent 65%),
    linear-gradient(rgba(6, 40, 27, 0.85), rgba(6, 40, 27, 0.9)),
    var(--ankara) 0 0 / 96px 96px,
    var(--bg);
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
a, button, input, select, textarea, label { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
input { font: inherit; }

.screen { min-height: 100dvh; max-width: 720px; margin: 0 auto; padding: 0 16px; overflow-x: clip; }

/* ------------------------------------------------ buttons */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 800;
  color: var(--ink); background: rgba(255, 255, 255, 0.1); text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; text-align: center;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn.primary { background: var(--naija); box-shadow: 0 4px 0 #005a36; }
.btn.primary:hover:not(:disabled) { background: var(--naija-2); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 #005a36; transform: translateY(3px); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.2); }
.btn.big { padding: 15px 22px; font-size: 1.05rem; width: 100%; }
.btn.small { padding: 7px 13px; font-size: 0.85rem; }
.btn.whatsapp { background: #25d366; color: #063d1f; box-shadow: 0 4px 0 #128c4a; }
.btn.last { background: rgba(242, 182, 50, 0.18); border: 2px dashed var(--gold); color: var(--gold); }
.btn.last.on { background: var(--gold); color: #3a2a00; border-style: solid; animation: pulse 1s infinite; }
.link { background: none; border: 0; padding: 0; color: var(--gold); font-weight: 800; text-decoration: underline; font-size: inherit; }

/* ------------------------------------------------ logo */
.logo { font-family: var(--display); font-weight: 400; margin: 0; line-height: 0.9; display: grid; justify-items: center; }
.logo-whot {
  font-size: 4.2rem; color: var(--gold); letter-spacing: 0.02em;
  text-shadow: 0 4px 0 var(--maroon), 0 7px 0 rgba(0, 0, 0, 0.35);
}
.logo-naija {
  font-size: 1.6rem; letter-spacing: 0.45em; padding-left: 0.45em; margin-top: 8px;
  color: var(--cream);
}
.logo.small { display: flex; align-items: baseline; gap: 6px; }
.logo.small { flex-shrink: 0; }
.logo.small .logo-whot { font-size: 1.55rem; text-shadow: 0 2px 0 var(--maroon); }
.logo.small .logo-naija { font-size: 0.75rem; letter-spacing: 0.25em; padding: 0; margin: 0; color: #6ee7a8; }
.flag-stripe { display: flex; width: 96px; height: 7px; margin: 14px auto 0; border-radius: 4px; overflow: hidden; }
.flag-stripe i { flex: 1; background: var(--naija); }
.flag-stripe i:nth-child(2) { background: #fff; }

/* ------------------------------------------------ welcome */
#welcome { display: grid; place-items: center; }
.welcome-card { width: 100%; max-width: 380px; text-align: center; padding: 28px 0 32px; }
.card-fan { position: relative; height: 120px; margin-bottom: 14px; }
.card-fan .card {
  position: absolute; left: 50%; top: 4px; width: 72px; margin-left: -36px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4)); transform-origin: 50% 120%;
  animation: fan-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.card-fan .card:nth-child(1) { transform: rotate(-18deg) translateX(-14px); }
.card-fan .card:nth-child(2) { z-index: 1; animation-delay: 0.08s; }
.card-fan .card:nth-child(3) { transform: rotate(18deg) translateX(14px); z-index: 2; animation-delay: 0.16s; }
.tag { color: var(--muted); margin: 14px 0 22px; font-size: 1rem; }
#welcome-form { display: grid; gap: 10px; text-align: left; }
label { font-size: 0.85rem; color: var(--muted); }
#welcome-form input, .sheet input {
  padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3); color: var(--ink); outline: none; font-size: 16px; width: 100%;
}
#welcome-form input:focus, .sheet input:focus { border-color: var(--gold); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; margin: 18px 0 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.15); }
.google-slot { display: flex; justify-content: center; margin-top: 10px; min-height: 0; }
.google-slot:empty { display: none; }
.fine { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.welcome-card > .fine { margin-top: 14px; }

/* ------------------------------------------------ lobby */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 10px; }
.top-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .icon-btn { width: 36px; height: 36px; font-size: 1rem; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.18); flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08); color: var(--ink); font-size: 1.1rem; display: grid; place-items: center; padding: 0;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 34px; height: 34px; font-size: 0.95rem; }
.chip {
  display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 112px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.18); color: var(--ink); font-weight: 800; font-size: 0.85rem;
}
.chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.guest { padding: 8px 12px; background: var(--gold); border-color: var(--gold); color: #3a2a00; }
.chip.premium { border-color: var(--gold); }
.hello-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.hello { color: var(--muted); margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hello strong { color: var(--ink); }
.live { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); flex-shrink: 0; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); animation: live 1.8s infinite; }
.live b { color: var(--ink); }
.beta-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: 0.86rem; font-weight: 700;
  background: linear-gradient(90deg, rgba(242, 182, 50, 0.2), rgba(232, 105, 42, 0.15)); border: 1px solid rgba(242, 182, 50, 0.4);
}
h2 { font-family: var(--display); font-weight: 400; font-size: 1.25rem; margin: 0 0 10px; letter-spacing: 0.01em; }
h3 { font-size: 0.95rem; margin: 0 0 10px; }

.play { display: grid; gap: 10px; margin-bottom: 18px; }
.size-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.92rem; font-weight: 800; }
#size-seg button { min-width: 46px; font-size: 0.95rem; }
.play .fine { margin: 0; text-align: center; }
.play-btn {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: 20px; color: var(--ink);
  border: 0; position: relative; overflow: hidden; transition: transform 0.12s ease, box-shadow 0.12s;
}
.play-btn::after {
  content: ''; position: absolute; inset: 0; background: var(--ankara) 0 0 / 64px 64px; opacity: 0.12; pointer-events: none;
}
.play-btn:active { transform: translateY(3px); }
.play-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16);
}
.play-text { display: grid; gap: 2px; position: relative; z-index: 1; }
.play-btn.online { background: linear-gradient(135deg, var(--naija-2), #006b40); box-shadow: 0 5px 0 #004a2c; }
.play-btn.online:active { box-shadow: 0 2px 0 #004a2c; }
.play-btn.online.locked { background: rgba(255, 255, 255, 0.06); box-shadow: none; }
.play-btn.online.locked .play-title { color: var(--muted); }
.play-btn.friends { background: linear-gradient(135deg, var(--orange), #b4441a); box-shadow: 0 5px 0 #7c2d0f; }
.play-btn.friends:active { box-shadow: 0 2px 0 #7c2d0f; }
.play-btn.bot { background: linear-gradient(135deg, #2c4f9b, var(--indigo)); box-shadow: 0 5px 0 #16264d; }
.play-btn.bot:active { box-shadow: 0 2px 0 #16264d; }
.play-title { font-family: var(--display); font-size: 1.4rem; font-weight: 400; letter-spacing: 0.01em; }
.play-sub { font-size: 0.82rem; opacity: 0.9; font-weight: 700; }
.play .ad-note { color: var(--gold); }
.play .ad-note:empty { display: none; }

.panel { background: var(--panel); border-radius: 20px; padding: 16px; margin-bottom: 14px; border: 1px solid rgba(255, 255, 255, 0.08); }
.premium { border: 1px solid rgba(242, 182, 50, 0.35); }
.premium.glow { animation: glow 1.6s ease-out 2; }
.perks { margin: 0 0 12px; padding-left: 18px; line-height: 1.6; font-size: 0.9rem; }
.premium-status { color: #6ee7a8; font-weight: 800; font-size: 0.88rem; margin: 0 0 10px; }
.passes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pass {
  position: relative; display: grid; gap: 2px; justify-items: start; text-align: left; padding: 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); color: var(--ink);
}
.pass.best { border-color: var(--gold); background: rgba(242, 182, 50, 0.1); }
.pass b { font-size: 0.9rem; }
.pass span { font-size: 1.35rem; font-weight: 900; color: var(--gold); }
.pass small { color: var(--muted); font-size: 0.75rem; }
.pass em {
  position: absolute; top: -9px; right: 10px; font-style: normal; font-size: 0.68rem; font-weight: 900;
  background: var(--gold); color: #3a2a00; padding: 2px 8px; border-radius: 999px;
}
.premium .fine { margin: 10px 0 0; }
.stats { display: flex; gap: 22px; }
.stats div { display: grid; }
.stats b { font-family: var(--display); font-weight: 400; font-size: 1.8rem; color: var(--gold); }
.stats span { font-size: 0.75rem; color: var(--muted); }
.panel .stats + .fine { margin: 10px 0 0; }

/* avatars */
.avatar {
  --av: var(--maroon);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex-shrink: 0;
  background: var(--av); border: 2px solid var(--gold); color: #fff; font-family: var(--display); font-size: 1.05rem;
}
.avatar.tiny { width: 26px; height: 26px; font-size: 0.8rem; border-width: 1.5px; }
.avatar.big { width: 56px; height: 56px; font-size: 1.5rem; }
.avatar.empty { background: transparent; border: 2px dashed rgba(255, 255, 255, 0.3); color: var(--muted); }

/* who's online */
.people-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.people-head h2 { margin: 0; }
#people-search {
  width: 140px; min-width: 0; padding: 8px 12px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3); color: var(--ink); outline: none; font-size: 16px;
}
#people-search:focus { border-color: var(--gold); }
.people { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.person:last-child { border-bottom: 0; }
.person-text { flex: 1; min-width: 0; display: grid; }
.person-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-tag { font-size: 0.68rem; color: var(--muted); font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 0 5px; }
.status { font-size: 0.75rem; color: var(--muted); }
.status::before { content: '● '; }
.status.st-free::before { color: #3ddc84; }
.status.st-table::before, .status.st-searching::before { color: var(--gold); }
.status.st-playing::before { color: var(--orange); }
.empty { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }

/* private table */
.table-panel { border: 2px solid var(--orange); background: linear-gradient(160deg, rgba(232, 105, 42, 0.18), var(--panel)); }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.table-head h2 { margin: 0; }
.code { font-family: var(--font); font-weight: 900; font-size: 0.85rem; letter-spacing: 0.15em; background: rgba(0, 0, 0, 0.35); padding: 3px 8px; border-radius: 8px; vertical-align: middle; }
.table-seats { display: flex; gap: 10px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.tseat { display: grid; justify-items: center; gap: 4px; width: 68px; font-size: 0.75rem; text-align: center; }
.tseat span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tseat .avatar { width: 46px; height: 46px; }
.tseat:not(.filled) { color: var(--muted); }
.tseat.filled .avatar { animation: pop 0.3s ease-out; }
.table-panel .fine { text-align: center; margin: 4px 0 12px; }
.table-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

/* ------------------------------------------------ sheets (settings, account) */
.overlay.sheet-overlay { place-items: end center; padding: 0; }
.sheet {
  background: #0b3a27; width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  border-radius: 22px 22px 0 0; border: 1px solid rgba(255, 255, 255, 0.15); border-bottom: 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: slide-up 0.25s ease-out;
}
@media (min-width: 600px) {
  .overlay.sheet-overlay { place-items: center; padding: 16px; }
  .sheet { border-radius: 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 1.4rem; }
.sheet-text { color: var(--muted); font-weight: 600; margin: 0 0 14px; line-height: 1.45; }
.sheet-text b { color: var(--ink); }
.auth-step { display: grid; gap: 8px; }
.auth-step .btn.big { margin-top: 8px; }
.code-input { font-size: 1.6rem !important; letter-spacing: 0.5em; text-align: center; font-weight: 900; }
.auth-links { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.85rem; }
.auth-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(239, 83, 80, 0.15); border: 1px solid var(--danger); color: #ffb4b2; font-size: 0.88rem; }
.dev-code { margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(242, 182, 50, 0.12); color: var(--gold); font-size: 0.85rem; }
.me-card { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.me-card div { display: grid; min-width: 0; }
.me-card b { font-size: 1.15rem; }
.me-card small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; background: rgba(0, 0, 0, 0.3); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.tabs button {
  flex: 1; border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 999px; font-weight: 800; font-size: 0.88rem;
}
.tabs button.on { background: rgba(255, 255, 255, 0.14); color: var(--ink); }
.settings-note {
  margin: 0 0 8px; font-size: 0.82rem; color: var(--gold); background: rgba(242, 182, 50, 0.1);
  border-radius: 10px; padding: 8px 10px;
}
.rule-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.rule-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.rule-row b { font-size: 0.92rem; }
.rule-row small { color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.seg { display: flex; background: rgba(0, 0, 0, 0.35); border-radius: 999px; padding: 3px; flex-shrink: 0; }
.seg button {
  border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg button.on { background: var(--gold); color: #3a2a00; }
.seg.locked button:disabled { opacity: 1; cursor: default; }
.seg.locked button:not(.on) { opacity: 0.4; }
@media (max-width: 420px) {
  .rule-row { flex-direction: column; align-items: stretch; }
  .rule-row .seg button { flex: 1; }
}
.tab-panel .fine { margin: 10px 0 0; }
.howto { padding-left: 18px; margin: 0; line-height: 1.6; font-size: 0.9rem; font-weight: 600; }

/* ------------------------------------------------ game */
#game { display: flex; flex-direction: column; padding-bottom: 8px; }
.game-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 8px; gap: 8px; }
.game-top-right { display: flex; align-items: center; gap: 6px; }
.pot { font-family: var(--display); color: var(--gold); text-align: center; font-size: 1.05rem; }
.timer { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.timer-fill { height: 100%; width: 0; background: var(--gold); transition: width 0.2s linear; }
.timer-fill.mine { background: #3ddc84; }
.timer-fill.urgent { background: var(--danger); }

.opponents { padding: 12px 0 4px; display: grid; gap: 8px; }
.opponents.n2 { grid-template-columns: repeat(2, 1fr); }
.opponents.n3 { grid-template-columns: repeat(3, 1fr); }
.seat {
  position: relative; min-width: 0; padding: 8px 6px; border-radius: 14px;
  background: var(--panel); border: 1.5px solid transparent; transition: border-color 0.2s, opacity 0.2s;
}
.opponents.solo .seat { background: none; padding: 0; border: 0; }
.opponents:not(.solo) .seat.turn { border-color: var(--gold); }
.seat.out { opacity: 0.4; }
.seat-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.opponents:not(.solo) .seat-info { flex-direction: column; gap: 4px; text-align: center; }
.seat-text { min-width: 0; max-width: 100%; }
.opponents:not(.solo) .avatar { width: 32px; height: 32px; font-size: 0.9rem; }
.seat.turn .avatar { box-shadow: 0 0 0 4px rgba(242, 182, 50, 0.35); animation: pulse 1.2s infinite; }
.opp-name { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opponents:not(.solo) .opp-name { font-size: 0.8rem; }
.opp-count { font-size: 0.8rem; color: var(--muted); }
.opponents:not(.solo) .opp-count { font-size: 0.7rem; }
.seat.last .opp-count { color: var(--gold); font-weight: 900; }
.opp-hand { display: flex; justify-content: center; height: 64px; margin-top: 8px; }
.opp-hand .card { width: 44px; margin-left: -26px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.opp-hand .card:first-child { margin-left: 0; }
.opponents:not(.solo) .opp-hand { height: 38px; margin-top: 6px; }
.opponents:not(.solo) .opp-hand .card { width: 26px; margin-left: -18px; }
.opponents:not(.solo) .opp-hand .card:first-child { margin-left: 0; }
.opp-status { text-align: center; color: var(--gold); font-size: 0.85rem; margin-top: 4px; }

.bubble {
  background: var(--cream); color: #222; padding: 6px 10px; border-radius: 12px; font-size: 0.85rem; font-weight: 800;
  animation: pop 0.25s ease-out; white-space: nowrap;
}
.seat .bubble { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 0.75rem; }
.opponents.solo .seat .bubble { left: 160px; top: 2px; transform: none; font-size: 0.85rem; }
.bubble.mine { position: absolute; right: 50px; bottom: 4px; }

/* The table: green felt over Ankara cloth, with a wooden rim. */
.table {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 30px; min-height: 190px; margin: 10px 0 6px;
  position: relative; border-radius: 34px; overflow: hidden;
  background:
    radial-gradient(ellipse at center, #13734b, var(--felt) 70%) padding-box,
    repeating-linear-gradient(97deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 13px) border-box,
    linear-gradient(180deg, #9a5a2c, var(--wood) 40%, #5e3216) border-box;
  border: 9px solid transparent;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 12px 30px rgba(0, 0, 0, 0.4), 0 6px 0 var(--wood-dark), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.table::before {
  content: ''; position: absolute; inset: 0; background: var(--ankara) 0 0 / 80px 80px; opacity: 0.07; pointer-events: none;
}
.market {
  background: none; border: 0; padding: 0; display: grid; justify-items: center; gap: 6px; color: var(--ink); position: relative; z-index: 1;
}
.card-back-stack {
  width: 78px; height: 112px; border-radius: 9px; position: relative;
  background: var(--ankara) center / 48px 48px, var(--maroon);
  border: 3px solid var(--cream); box-shadow: 3px 3px 0 var(--cream), 6px 6px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.card-back-stack::after {
  content: 'WHOT'; position: absolute; left: 6px; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--maroon); border: 1.5px solid var(--gold); border-radius: 999px; padding: 3px 0;
  color: var(--cream); font-family: var(--display); text-align: center; letter-spacing: 0.08em; font-size: 0.95rem;
}
.market:not(:disabled):hover .card-back-stack { transform: translateY(-3px); }
.market:disabled { opacity: 1; }
.market.ready .card-back-stack { box-shadow: 3px 3px 0 var(--cream), 6px 6px 0 rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(242, 182, 50, 0.55); animation: nudge 1.2s infinite; }
.market-label { font-size: 0.85rem; font-weight: 900; color: var(--gold); }
.market.danger .market-label { color: #ffb4b2; }
.market-count { font-size: 0.72rem; color: var(--muted); }
.pile-wrap { display: grid; justify-items: center; gap: 8px; position: relative; z-index: 1; }
.pile .card { width: 92px; animation: drop 0.28s ease-out; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4)); }
.called {
  display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 900;
  background: rgba(0, 0, 0, 0.45); padding: 4px 10px; border-radius: 999px;
}
.called svg { width: 18px; height: 18px; }

.status-line { text-align: center; font-weight: 900; min-height: 24px; margin: 4px 0; }
.status-line.mine { color: #6ee7a8; }
.status-line.alert { color: #ffb4b2; animation: pop 0.3s ease-out; }
.toasts { position: fixed; top: 34%; left: 0; right: 0; display: grid; justify-items: center; gap: 6px; pointer-events: none; z-index: 20; }
.toast {
  background: rgba(6, 24, 16, 0.94); border: 2px solid var(--gold); color: var(--ink); padding: 10px 18px;
  border-radius: 999px; font-weight: 900; animation: toast 2.2s ease forwards; max-width: calc(100vw - 32px); text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.me { position: relative; }
.me-actions { display: flex; justify-content: space-between; align-items: center; min-height: 40px; gap: 8px; }
.me-actions #chat-btn { margin-left: auto; }
.chat-menu {
  position: absolute; right: 0; bottom: 100%; background: rgba(6, 24, 16, 0.98); border-radius: var(--radius);
  padding: 6px; display: grid; gap: 2px; z-index: 10; border: 1px solid rgba(255, 255, 255, 0.15);
}
.chat-menu button { background: none; border: 0; color: var(--ink); text-align: left; padding: 8px 12px; border-radius: 8px; font-weight: 800; }
.chat-menu button:hover { background: rgba(255, 255, 255, 0.08); }

.hand {
  display: flex; gap: 6px; overflow-x: auto; padding: 16px 4px 10px; scroll-snap-type: x proximity;
  min-height: 140px; scrollbar-width: none;
}
.hand::-webkit-scrollbar { display: none; }
.hand button { background: none; border: 0; padding: 0; flex: 0 0 auto; scroll-snap-align: start; transition: transform 0.15s ease; }
.hand .card { width: clamp(56px, calc((100vw - 64px) / 5.3), 74px); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35)); }
.hand button.playable { transform: translateY(-10px); }
.hand button.playable .card { filter: drop-shadow(0 0 7px rgba(242, 182, 50, 0.9)); }
.hand button.playable:hover { transform: translateY(-16px); }
.hand button.dim { opacity: 0.55; }
.hand button.shake { animation: shake 0.3s; }

.card { display: block; height: auto; }

/* ------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal {
  background: #0b3a27; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 22px; padding: 24px;
  width: 100%; max-width: 360px; text-align: center; animation: pop 0.25s ease-out; position: relative; overflow: hidden;
}
.modal h3 { font-size: 1.15rem; }
.modal p { color: var(--muted); }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--gold); animation: spin 0.9s linear infinite;
}
.shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0; }
.shapes button {
  background: var(--cream); border: 0; border-radius: 10px; padding: 8px 4px; display: grid; justify-items: center; gap: 4px;
  font-size: 0.65rem; font-weight: 900; color: var(--maroon);
}
.shapes button.suggest { outline: 3px solid var(--gold); }
.shapes svg { width: 30px; height: 30px; }
.result-modal h2 { font-size: 2.2rem; margin: 0 0 6px; position: relative; }
.result-modal.win { border: 2px solid var(--gold); background: linear-gradient(180deg, #14603f, #0b3a27); }
.result-modal.win h2 { color: var(--gold); text-shadow: 0 3px 0 var(--maroon); }
.result-modal.win .result-burst {
  position: absolute; inset: -40%; pointer-events: none; opacity: 0.25;
  background: repeating-conic-gradient(from 0deg, var(--gold) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite;
}
.result-modal > *:not(.result-burst) { position: relative; }
.result-hands { display: grid; gap: 8px; margin-bottom: 16px; }
.result-hand-row { display: grid; gap: 4px; }
.result-hand-row span { font-size: 0.75rem; color: var(--muted); }
.result-hand { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.result-hand .card { width: 36px; }
.seats-found { display: flex; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.seats-found span {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 900;
  border: 2px dashed rgba(255, 255, 255, 0.25); color: var(--muted);
}
.seats-found span.filled { border: 2px solid var(--gold); background: rgba(242, 182, 50, 0.15); color: var(--gold); animation: pop 0.25s ease-out; }
.result-modal .fine { margin: 0 0 14px; }
.result-modal .fine:empty { display: none; }
.result-actions { display: grid; gap: 8px; }
.ad-modal { display: grid; gap: 12px; }
.ad-label { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.2em; color: var(--muted); }
.ad-slot { min-height: 250px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); display: grid; place-items: center; overflow: hidden; }
.ad-placeholder { display: grid; gap: 6px; padding: 16px; border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: 10px; margin: 16px; }
.ad-placeholder b { font-size: 1.2rem; }
.ad-placeholder span { color: var(--muted); font-size: 0.8rem; }
.ad-progress { height: 5px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
#ad-fill { height: 100%; width: 0; background: var(--gold); transition: width 0.25s linear; }
#ad-premium { justify-self: center; }

/* Invite pop-up: slides down from the top, never blocks the rest of the screen. */
.invite-pop {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 55;
  width: min(420px, calc(100vw - 24px)); background: #0b3a27; border: 2px solid var(--orange); border-radius: 18px;
  padding: 14px 14px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: drop-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3); overflow: hidden;
}
.invite-body { display: flex; align-items: center; gap: 12px; }
.invite-body div { display: grid; min-width: 0; }
.invite-body small { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.invite-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 0; }
.invite-bar { height: 4px; margin: 0 -14px; background: rgba(255, 255, 255, 0.1); }
.invite-bar i { display: block; height: 100%; width: 100%; background: var(--orange); }

.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--danger); text-align: center; padding: 6px; font-size: 0.85rem; font-weight: 800; z-index: 50; }
.toast-global {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #2a0d12; border: 1.5px solid var(--danger);
  padding: 10px 16px; border-radius: 14px; z-index: 60; font-weight: 800; max-width: calc(100vw - 32px); text-align: center;
}
.toast-global.good { background: #0d2a1c; border-color: #3ddc84; }

/* ------------------------------------------------ motion */
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drop { from { transform: translateY(-24px) rotate(-8deg) scale(1.08); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes drop-in { from { transform: translate(-50%, -120%); } to { transform: translate(-50%, 0); } }
@keyframes toast { 0% { transform: scale(0.8); opacity: 0; } 10% { transform: scale(1.06); opacity: 1; } 15% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(242, 182, 50, 0.12); } }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }
@keyframes nudge { 50% { transform: translateY(-4px); } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(242, 182, 50, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(242, 182, 50, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes fan-in { from { opacity: 0; transform: translateY(30px) rotate(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
#voice-row.off { opacity: 0.45; }
#voice-test { margin-top: 14px; }
.voice-status { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); font-size: 0.85rem; }
