/* PickPoker100 — dark green theme */
:root {
  /* greens, darkest to lightest */
  --g-1000: #020a06;
  --g-950: #04110a;
  --g-900: #07180f;
  --g-850: #0a2015;
  --g-800: #0e2a1c;
  --g-700: #153a28;
  --g-600: #1d4d35;
  --g-500: #27694a;
  --g-400: #38905f;
  --g-300: #55b883;
  --g-200: #8ed9b0;
  --g-100: #c4efd8;

  --bg: var(--g-950);
  --surface: var(--g-900);
  --surface-2: var(--g-850);
  --surface-3: var(--g-800);
  --line: #17382a;
  --line-strong: #24523b;
  --text: #e9f4ed;
  --text-2: #b4cabd;
  --muted: #7b9787;
  --accent: #5fd498;
  --accent-strong: #7fe5b1;
  --accent-ink: #03130a;
  --danger: #e2605f;
  --danger-soft: #3a1618;
  --warn: #f0b84f;

  --radius: 12px;
  --radius-sm: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 80% -10%, #0d3a25 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #0a2a1b 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
button, input, select { font: inherit; color: inherit; }
b { font-weight: 650; }
em { font-style: normal; }
code { background: var(--surface-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; color: var(--accent-strong); letter-spacing: .08em; font-size: .92em; }
.muted { color: var(--muted); }
small { color: var(--muted); }
.small { font-size: .82em; }
.icon { flex: none; vertical-align: middle; }
.icon.inline { display: inline-block; vertical-align: -3px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--g-700); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--g-600); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- controls ---------- */
.btn {
  border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text);
  padding: .6em 1.05em; border-radius: 10px; cursor: pointer; font-weight: 600; letter-spacing: .005em;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s, filter .15s;
}
.btn:hover:not(:disabled) { background: var(--g-700); border-color: var(--g-500); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-strong), var(--accent)); color: var(--accent-ink); border-color: #8ceabb; box-shadow: 0 6px 18px -8px rgba(95, 212, 152, .6); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #9cf0c6, var(--accent-strong)); border-color: #a8f2cb; }
.btn.danger { background: var(--danger-soft); border-color: #6b2a2c; color: #ffb3b2; }
.btn.danger:hover:not(:disabled) { background: #4a1c1f; border-color: #8a3436; }
.btn.ghost { background: transparent; }
.btn.lg { padding: .85em 1.4em; font-size: 1.02em; border-radius: 12px; }
.btn.sm { padding: .35em .75em; font-size: .85em; border-radius: 8px; font-weight: 600; }
.btn kbd { opacity: .6; font: 600 .68em ui-monospace, 'SF Mono', Menlo, monospace; border: 1px solid currentColor; border-radius: 4px; padding: 0 .35em; margin-left: .25em; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--text-2); cursor: pointer; transition: .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; margin-left: 4px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: #ffb3b2; border-color: #6b2a2c; }

input[type=text], input[type=number], select {
  background: var(--g-950); border: 1px solid var(--line-strong); border-radius: 9px; padding: .55em .75em; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #4f6b5c; }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--g-500); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(95, 212, 152, .18); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:disabled, select:disabled { opacity: .55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b9787' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75em center; padding-right: 2.2em; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field .lbl { font-size: .76em; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; color: var(--text-2); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
h1, h2, h3, h4 { margin: 0; }
h4 { margin: 20px 0 8px; color: var(--muted); font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, var(--g-600), var(--g-800)); color: var(--accent-strong); border: 1px solid var(--g-500); box-shadow: 0 8px 22px -10px rgba(95, 212, 152, .5), inset 0 1px 0 rgba(255, 255, 255, .08); }
.wordmark { font-size: 1.22em; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.wordmark em { color: var(--accent); margin-left: 1px; font-weight: 600; }
.brand.sm .logo-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand.sm .wordmark { font-size: 1.05em; }

/* ---------- lobby ---------- */
.lobby { max-width: 1120px; margin: 0 auto; padding: 22px 22px 70px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 38px; }
.lobby-main { display: block; }
.hero { max-width: 720px; margin-bottom: 34px; }
.eyebrow { display: inline-block; font-size: .72em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); background: rgba(95, 212, 152, .08); border: 1px solid rgba(95, 212, 152, .22); padding: 5px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -.03em; font-weight: 750; margin: 18px 0 14px; }
.lead { color: var(--text-2); font-size: 1.1em; max-width: 56ch; margin: 0 0 26px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.feat-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--accent); flex: none; }
.features b { display: block; font-size: .95em; }
.features span:not(.feat-ico) { color: var(--muted); font-size: .88em; }
.lobby-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.lobby-side { display: flex; flex-direction: column; gap: 22px; }
.surface { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .03); }
.card-head { margin-bottom: 18px; }
.card-head h2 { font-size: 1.15em; font-weight: 700; letter-spacing: -.01em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: .9em; }
.group { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
.group legend { padding: 0; margin: 18px 0 10px; font-size: .72em; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.group:first-of-type legend { margin-top: 0; }
.preview { display: block; margin: -4px 0 12px; }
.lobby-form .lg { width: 100%; margin-top: 18px; }
.join .row { margin: 0; }
.connecting { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- game frame ---------- */
.game { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.game > .topbar { grid-column: 1 / -1; }
body.panel-open .game { grid-template-columns: 1fr 360px; }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 10px 18px; background: rgba(4, 17, 10, .8); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.room-name { color: var(--muted); font-size: .85em; padding-left: 14px; border-left: 1px solid var(--line-strong); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blinds { text-align: center; line-height: 1.3; }
.blinds-main { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.blinds-main .lbl { font-size: .72em; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.blinds-main b { font-size: 1.15em; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.blinds .next { font-size: .8em; color: var(--muted); display: block; }
.blinds .next b { color: var(--text-2); }
.pending { color: var(--accent); font-size: .82em; }
.top-right { display: flex; gap: 8px; align-items: center; justify-self: end; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 11px; font-size: .8em; color: var(--text-2); font-weight: 600; }
.badge.pause { color: var(--warn); border-color: rgba(240, 184, 79, .4); }
.code-badge { cursor: pointer; color: var(--accent-strong); border-color: rgba(95, 212, 152, .4); letter-spacing: .08em; }
.code-badge:hover { background: var(--g-700); }

/* ---------- table ---------- */
.table-root { flex: 1; min-height: 0; position: relative; container-type: size; }
.table-wrap {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(96cqw, 178cqh); height: min(54cqw, 96cqh);
  font-size: clamp(8px, min(1.55cqw, 2.9cqh), 17px);
}
.felt {
  position: absolute; inset: 7% 4%; border-radius: 50% / 50%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .06), transparent 55%),
    radial-gradient(ellipse at 50% 45%, #1d6b49 0%, #135239 55%, #0c3a27 100%);
  border: .75em solid var(--g-1000);
  box-shadow: 0 0 0 1px var(--g-600), inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 0 5em rgba(0, 0, 0, .55), 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 90px -30px rgba(95, 212, 152, .25);
}
.felt::before { content: ''; position: absolute; inset: 1.1em; border-radius: 50% / 50%; border: 1px solid rgba(255, 255, 255, .07); pointer-events: none; }
.felt::after { content: 'PickPoker100'; position: absolute; left: 0; right: 0; bottom: 21%; text-align: center; font-size: 1.9em; font-weight: 700; letter-spacing: .3em; color: rgba(255, 255, 255, .045); text-transform: uppercase; pointer-events: none; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9em; }
.pot { height: 2.3em; display: flex; align-items: center; gap: .55em; font-weight: 700; background: rgba(2, 10, 6, .6); border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; padding: 0 1.1em 0 1em; font-variant-numeric: tabular-nums; }
.pot .lbl { font-size: .72em; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); font-weight: 700; }
.pot .amt { font-size: 1.15em; }
.pot:empty { visibility: hidden; }
.chip-ico { display: inline-block; width: 1.15em; height: 1.15em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cfe6d9 70%); border: .2em dashed var(--g-500); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); flex: none; }
.board { display: flex; gap: .55em; }
.board .card { width: 4.5em; height: 6.3em; }
.card.slot { background: rgba(0, 0, 0, .18); border: 1px dashed rgba(255, 255, 255, .13); box-shadow: none; }
.banner { min-height: 3.2em; display: flex; align-items: flex-start; justify-content: center; }
.hint { color: var(--text-2); background: rgba(2, 10, 6, .55); border: 1px solid rgba(255, 255, 255, .07); padding: .45em 1.1em; border-radius: 999px; font-size: 1em; }
.win-banner { background: rgba(2, 10, 6, .82); border: 1px solid rgba(95, 212, 152, .55); border-radius: .9em; padding: .55em 1.2em; text-align: center; animation: pop .3s ease-out; box-shadow: 0 0 40px -10px rgba(95, 212, 152, .4); }
.win-line { font-size: 1.08em; }
.win-line b { color: var(--accent-strong); }
.win-line .hand { color: var(--text); }
.boards { display: flex; flex-direction: column; align-items: center; gap: .15em; }
.board-label { font-size: .75em; color: var(--text-2); letter-spacing: .1em; text-transform: uppercase; line-height: 1; font-weight: 700; }
.center.twice { gap: .35em; }
.center.twice .board .card { width: 3.3em; height: 4.6em; }
.center.twice .card .r { font-size: 1.3em; }
.center.twice .card .suit { width: 1.15em; height: 1.15em; }
.center.twice .banner { min-height: 0; }
.center.twice .win-banner { padding: .3em .9em; }
.center.twice .win-line { font-size: .95em; }

/* ---------- playing cards ---------- */
.card {
  width: 3.3em; height: 4.7em; background: linear-gradient(180deg, #fbfcfa, #eef2ee); color: #151a17; border-radius: .5em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05em; line-height: 1;
  font-weight: 750; box-shadow: 0 .2em .55em rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .06); position: relative; flex: none; user-select: none;
}
.card .r { font-size: 1.7em; letter-spacing: -.06em; font-variant-numeric: lining-nums; }
.card .suit { width: 1.55em; height: 1.55em; }
.card.s-h, .card.s-d { color: #d12f3b; }
body.four .card.s-d { color: #2563c9; }
body.four .card.s-c { color: #1a8a50; }
.mini { display: inline-flex; align-items: center; gap: 1px; font-weight: 700; padding: 0 3px; color: var(--text); }
.mini .suit { width: .95em; height: .95em; }
.mini.s-h, .mini.s-d { color: #ff7d86; }
body.four .mini.s-d { color: #6aa5ff; }
body.four .mini.s-c { color: #5fd698; }
.card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 .3em, transparent .3em .6em),
    linear-gradient(145deg, #1f6b48, #0f3d29);
  border: .22em solid #e8f2ec; box-shadow: 0 .2em .55em rgba(0, 0, 0, .55);
}
.card.dim { opacity: .35; filter: grayscale(.5); }
.card.dealt { animation: dealIn .38s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes dealIn { from { transform: translateY(-2.5em) scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- seats ---------- */
.seat { position: absolute; transform: translate(-50%, -50%); width: 11.5em; z-index: 3; text-align: center; }
.seat.empty { width: auto; }
.sit-btn {
  background: rgba(2, 10, 6, .55); border: 1px dashed rgba(255, 255, 255, .28); color: var(--text-2); border-radius: 999px; cursor: pointer;
  padding: .5em 1.15em; display: inline-flex; gap: .45em; align-items: center; font-size: 1em; font-weight: 600; transition: .15s;
}
.sit-btn:hover { background: rgba(95, 212, 152, .15); border-color: var(--accent); color: var(--accent-strong); }
.plate {
  position: relative; z-index: 2; display: flex; align-items: center; gap: .65em; text-align: left;
  background: linear-gradient(180deg, rgba(10, 32, 21, .96), rgba(4, 17, 10, .96)); border: 1px solid var(--line-strong); border-radius: 1.1em; padding: .4em 1.1em .4em .4em;
  box-shadow: 0 .4em 1.2em rgba(0, 0, 0, .6); overflow: hidden; min-width: 9.4em;
}
.avatar { width: 2.6em; height: 2.6em; border-radius: .8em; display: grid; place-items: center; font-weight: 700; font-size: 1.05em; flex: none; background: hsl(var(--h, 150) 34% 30%); color: hsl(var(--h, 150) 70% 88%); border: 1px solid hsl(var(--h, 150) 35% 42%); }
.info { min-width: 0; line-height: 1.2; }
.name { font-weight: 650; font-size: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 7.2em; }
.stack { color: var(--accent-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.seat.me .plate { border-color: var(--g-400); }
.seat.acting .plate { border-color: var(--accent); box-shadow: 0 0 0 .2em rgba(95, 212, 152, .22), 0 0 1.8em rgba(95, 212, 152, .45); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .35em rgba(95, 212, 152, .1), 0 0 2.4em rgba(95, 212, 152, .55); } }
.seat.folded .plate { opacity: .5; }
.seat.folded .hole { opacity: .3; }
.seat.out .plate { opacity: .5; filter: grayscale(.6); }
.seat.winner .plate { border-color: var(--accent-strong); box-shadow: 0 0 0 .22em rgba(127, 229, 177, .3), 0 0 2.2em rgba(127, 229, 177, .6); }
.timer { position: absolute; left: 0; right: 0; bottom: 0; height: .28em; background: rgba(0, 0, 0, .45); }
.timer i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .25s linear; }
.timer.low i { background: var(--danger); }
.cards-wrap { position: relative; display: flex; justify-content: center; height: 4.1em; margin-bottom: -.3em; z-index: 1; pointer-events: none; }
.cards-wrap > * { pointer-events: auto; }
.hole { display: flex; gap: .15em; }
.hole .card { width: 3em; height: 4.2em; }
.hole .card .r { font-size: 1.45em; }
.hole .card .suit { width: 1.3em; height: 1.3em; }
.hole .card:first-child { transform: rotate(-6deg); }
.hole .card.second { transform: rotate(6deg) translateY(.1em); }
.seat.me .hole .card { width: 3.6em; height: 5em; }
.seat.me .cards-wrap { height: 4.9em; }
.peek { position: absolute; right: -1.6em; top: 1em; background: rgba(2, 10, 6, .85); border: 1px solid var(--line-strong); color: var(--text); border-radius: 50%; width: 2.4em; height: 2.4em; cursor: pointer; display: grid; place-items: center; touch-action: none; }
.peek:active { background: var(--accent); color: var(--accent-ink); }
.tags { display: flex; gap: .3em; justify-content: center; margin-top: .4em; flex-wrap: wrap; }
.tag { font-size: .7em; font-weight: 700; padding: .15em .55em; border-radius: 999px; background: rgba(255, 255, 255, .1); letter-spacing: .05em; text-transform: uppercase; }
.tag.sb { background: rgba(95, 170, 255, .22); color: #b9d8ff; }
.tag.bb { background: rgba(240, 184, 79, .22); color: #ffdca0; }
.tag.allin { background: var(--danger); color: #fff; }
.tag.out { background: rgba(255, 255, 255, .12); color: var(--text-2); }
.tag.strength { background: rgba(2, 10, 6, .8); color: var(--accent-strong); text-transform: none; letter-spacing: 0; font-size: .78em; border: 1px solid rgba(95, 212, 152, .3); }
.bubble { position: absolute; left: 50%; top: -3.3em; transform: translateX(-50%); z-index: 5; font-size: .85em; font-weight: 700; padding: .22em .85em; border-radius: 999px; background: rgba(2, 10, 6, .92); border: 1px solid var(--line-strong); white-space: nowrap; animation: pop .25s ease-out; letter-spacing: .02em; }
.bubble.fold { color: #ff9c9b; }
.bubble.raise, .bubble.bet { color: var(--accent-strong); border-color: rgba(95, 212, 152, .5); }
.bubble.call, .bubble.check { color: var(--text-2); }
.bubble.win { background: #0e3a25; border-color: var(--accent); color: var(--g-100); font-size: 1em; display: flex; flex-direction: column; align-items: center; line-height: 1.15; top: -4.2em; }
.bubble small { color: var(--g-200); font-size: .75em; font-weight: 600; }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: .4em; font-weight: 700; background: rgba(2, 10, 6, .75); border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; padding: .15em .75em .15em .35em; z-index: 2; animation: pop .2s ease-out; font-variant-numeric: tabular-nums; }
.dealer-btn { position: absolute; transform: translate(-50%, -50%); width: 2.1em; height: 2.1em; border-radius: 50%; background: linear-gradient(145deg, #fff, #d8e6dd); color: #0b2a1b; font-weight: 800; display: grid; place-items: center; z-index: 2; box-shadow: 0 .15em .45em rgba(0, 0, 0, .6); border: .15em solid var(--g-300); }
.dealer-btn.dead { opacity: .5; filter: grayscale(.6); }

/* ---------- action bar ---------- */
.actionbar { min-height: 96px; padding: 12px 18px 16px; background: linear-gradient(180deg, rgba(4, 17, 10, .85), rgba(2, 10, 6, .95)); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: center; }
.status { color: var(--text-2); font-size: 1.02em; }
.status b { color: var(--text); }
.who { width: 100%; text-align: center; margin-bottom: 2px; color: var(--text-2); }
.peek-big { margin-left: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--accent-strong); border-radius: 999px; padding: .3em 1em; cursor: pointer; touch-action: none; display: inline-flex; align-items: center; gap: .45em; }
.peek-big:active { background: var(--accent); color: var(--accent-ink); }
.act-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; justify-content: center; width: 100%; }
.act-row .btn:not(.chip-btn) { min-width: 112px; min-height: 52px; font-size: 1.02em; border-radius: 12px; }
.btn.fold { background: var(--danger-soft); border-color: #6b2a2c; color: #ffb3b2; }
.btn.fold:hover:not(:disabled) { background: #4a1c1f; border-color: #8a3436; }
.btn.call { background: var(--g-700); border-color: var(--g-500); }
.btn.call:hover:not(:disabled) { background: var(--g-600); border-color: var(--g-400); }
.btn.raise { background: linear-gradient(180deg, var(--accent-strong), var(--accent)); color: var(--accent-ink); border-color: #8ceabb; min-width: 150px; box-shadow: 0 8px 22px -10px rgba(95, 212, 152, .7); }
.btn.raise:hover:not(:disabled) { background: linear-gradient(180deg, #9cf0c6, var(--accent-strong)); }
.raise-box { display: flex; flex-direction: column; gap: 7px; min-width: min(340px, 100%); flex: 1; max-width: 520px; justify-content: center; }
.presets { display: flex; gap: 6px; flex-wrap: nowrap; }
.chip-btn { padding: .28em .65em; font-size: .8em; border-radius: 8px; flex: 1; font-weight: 600; background: var(--surface-3); }
.chip-btn.allin { border-color: #6b2a2c; color: #ffb3b2; background: var(--danger-soft); }
.slider-row { display: flex; gap: 10px; align-items: center; }
.raise-slider { flex: 1; accent-color: var(--accent); }
.raise-input { width: 8.5em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.turn-line { width: 100%; text-align: center; color: var(--muted); font-size: .85em; }
.spectator { width: 100%; text-align: center; color: var(--accent-strong); background: rgba(95, 212, 152, .07); border: 1px solid rgba(95, 212, 152, .25); border-radius: 10px; padding: 7px 12px; font-size: .92em; }
.self-actions { width: 100%; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.request { width: 100%; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; background: rgba(240, 184, 79, .08); border: 1px solid rgba(240, 184, 79, .3); border-radius: 10px; padding: 7px 12px; }
.rit { width: 100%; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rit-title { font-weight: 700; font-size: 1.1em; color: var(--accent-strong); }
.rit-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.rit-row .btn { min-width: 140px; min-height: 46px; }

/* ---------- side panel ---------- */
.panel { display: none; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); min-height: 0; overflow: hidden; }
body.panel-open .panel { display: flex; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: transparent; border: 1px solid transparent; padding: 8px 6px; color: var(--muted); cursor: pointer; font-weight: 600; border-radius: 9px; transition: .15s; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.on { color: var(--accent-strong); background: var(--surface-3); border-color: var(--line-strong); }
.dot { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72em; font-weight: 800; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 20px; display: flex; flex-direction: column; }
.log-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.log-list { flex: 1; overflow-y: auto; font-size: .87em; display: flex; flex-direction: column; gap: 2px; }
.log-row { padding: 3px 8px; border-radius: 7px; color: var(--text-2); }
.log-row.sys { color: var(--muted); }
.log-row.fold { color: #c98b8a; }
.log-row.raise { color: var(--accent-strong); }
.log-row.win { color: var(--g-200); font-weight: 650; }
.log-row.level { color: #9bc8ff; }
.log-row.street { color: var(--text); background: var(--surface-3); margin-top: 5px; }
.log-row.chat { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.log-row.chat b { color: var(--accent-strong); }
.empty-note { color: var(--muted); padding: 12px 4px; }
.chat-form { display: flex; gap: 6px; }
.ledger { width: 100%; border-collapse: collapse; font-size: .9em; }
.ledger th { text-align: left; color: var(--muted); font-weight: 700; font-size: .75em; text-transform: uppercase; letter-spacing: .08em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ledger td { padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .pos { color: var(--accent-strong); }
.ledger .neg { color: #ff9c9b; }
.ledger tr.gone { opacity: .55; }
.pname { display: inline-flex; align-items: center; gap: 6px; }
.row-actions { white-space: nowrap; text-align: right; }
.code-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px dashed rgba(95, 212, 152, .5); color: var(--accent-strong); border-radius: 9px; padding: 5px 12px; font-weight: 700; letter-spacing: .14em; cursor: pointer; }
.code-chip:hover { background: var(--g-700); }
.invite { margin: 8px 0; }
.req-box { background: rgba(240, 184, 79, .07); border: 1px solid rgba(240, 184, 79, .28); border-radius: 10px; padding: 6px 12px 10px; margin-bottom: 12px; }
.req-box h4 { margin-top: 8px; }
.req-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.req-row .btn { margin-left: 4px; }

/* ---------- modal and toast ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(1, 6, 3, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong); border-radius: 16px; padding: 22px; width: min(430px, 100%); box-shadow: 0 40px 100px rgba(0, 0, 0, .7); }
.modal h3 { font-size: 1.1em; margin-bottom: 14px; letter-spacing: -.01em; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--g-850); border: 1px solid var(--line-strong); border-left: 3px solid var(--danger); color: var(--text); padding: 10px 16px; border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); animation: pop .2s; max-width: min(92vw, 440px); }
.conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 70; background: #5e2326; color: #ffd9d8; text-align: center; padding: 7px; font-weight: 650; }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  body.panel-open .game { grid-template-columns: 1fr; }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(92vw, 390px); z-index: 20; box-shadow: -24px 0 70px rgba(0, 0, 0, .7); }
  .room-name { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .lobby-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .table-wrap { width: min(98cqw, 100cqh); height: min(98cqw, 100cqh); font-size: clamp(7px, min(2.3cqw, 1.9cqh), 14px); }
  .felt { inset: 8% 6%; }
  .seat { width: 9.6em; }
  .plate { min-width: 7.8em; }
  .name { max-width: 5.4em; }
  .act-row .btn:not(.chip-btn) { min-width: 92px; min-height: 48px; }
  .topbar { padding: 8px 12px; grid-template-columns: 1fr auto; }
  .blinds { order: 3; grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .lobby { padding: 16px 14px 60px; }
  .surface { padding: 18px; }
}
