:root {
  --bg: #0e1714; --panel: #16231f; --panel2: #1d2e28; --line: #2c423a; --ink: #f3efe4; --muted: #9db0a6;
  --gold: #e2b65c; --gold-ink: #2a1d04; --red: #d9604f; --green: #58b98a; --felt: #1b5d49; --felt2: #123f33;
  --accent: #e2b65c; --danger: #f2a498; --ok: #58b98a; --field: #0b1310; --plate: #0c1512f2; --plate-win: #33290f; --on-felt: #d4e3da; --shade: #050a08c9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
[data-theme=light] {
  --bg: #f4f1e8; --panel: #fffdf7; --panel2: #ece7d9; --line: #d3ccb9; --ink: #1c2620; --muted: #5d675f;
  --accent: #805a0c; --danger: #a8321f; --ok: #1f7a50; --field: #ffffff; --plate: #fffdf7f5; --plate-win: #fbe9bd; --shade: #2b2a2480;
  --red: #c24a38; --green: #2f9467;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.3rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1.15rem; }
p { margin: .4rem 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--muted); font-size: .8rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; }
.center { text-align: center; }
.warn { color: var(--accent); font-weight: 700; }
.pos { color: var(--ok); } .neg { color: var(--danger); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35em; min-height: 42px; padding: 0 1.1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--ink); font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: var(--red); color: var(--danger); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 .75rem; font-size: .85rem; border-radius: 8px; }
.btn.big { min-height: 52px; min-width: 110px; font-size: 1.05rem; }
.btn.wide { width: 100%; margin-top: .6rem; }
.icon { border: 0; background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
.icon:hover { color: var(--ink); background: var(--panel2); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: .5rem .7rem; width: 100%; min-height: 42px; }
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold); flex: none; margin: 2px 0 0; }
input[type=range] { accent-color: var(--gold); padding: 0; min-height: 34px; border: 0; background: none; }
input:disabled { opacity: .6; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.tag { display: inline-block; padding: .05rem .5rem; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font: 600 .72rem/1.5 var(--sans); margin-left: .4rem; }
.tag.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.tag.red { background: var(--red); border-color: var(--red); color: #fff; }
.badge { background: var(--red); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .4rem; line-height: 1.5; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 700; color: #fff; }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }
.avatar.xl { width: 92px; height: 92px; font-size: 2.2rem; }
.card { aspect-ratio: 5 / 7; border-radius: 5%; display: block; user-select: none; }

/* Shell */
.top { display: flex; align-items: center; gap: 1.4rem; padding: .7rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font: 600 1.3rem var(--serif); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; }
.top nav { display: flex; gap: .3rem; flex: 1; }
.top nav a { color: var(--muted); padding: .4rem .8rem; border-radius: 8px; font-weight: 600; }
.top nav a.on { color: var(--ink); background: var(--panel2); }
.top-right { display: flex; align-items: center; gap: .8rem; }
.me { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 600; max-width: 200px; }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locale { width: auto; min-height: 34px; padding: .2rem .5rem; font-size: .85rem; }
main { max-width: 1080px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.4rem) clamp(1rem, 4vw, 2rem) 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 2.4rem 1rem; text-align: center; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem; margin: 1.4rem 0; }
.panel h2 { margin-top: 0; }
.panel > .row { margin-top: 1rem; }
.tabs { display: flex; gap: .25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: .25rem; margin-bottom: 1.2rem; }
.tabs button, .tabs a { flex: 1; border: 0; background: none; color: var(--muted); font: 600 .92rem var(--sans); padding: .55rem .8rem; border-radius: 8px; cursor: pointer; text-align: center; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs .on { background: var(--panel2); color: var(--ink); }
.tabs.inline { overflow-x: auto; }
.form-error { color: var(--danger); min-height: 1.4em; font-size: .92rem; }
#toasts { position: fixed; inset: auto 0 1.2rem; display: grid; justify-items: center; gap: .5rem; z-index: 100; pointer-events: none; padding: 0 1rem; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: .6rem 1rem; border-radius: 9px; box-shadow: 0 8px 24px #0008; transition: opacity .3s; }
.toast.error { border-left-color: var(--red); } .toast.ok { border-left-color: var(--green); } .toast.out { opacity: 0; }
.dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); padding: 0; width: min(760px, calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); }
.dialog:not(:has(.settings)):not(:has(.rules)) { width: min(440px, calc(100vw - 2rem)); }
.dialog::backdrop { background: var(--shade); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.dialog h2 { margin: 0; }
.dialog-body { padding: .4rem 1.2rem 1.2rem; overflow-y: auto; }
.dialog > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line); }

/* Signing in */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100dvh; }
.auth-hero { color: #f3efe4; background: radial-gradient(ellipse at 50% 35%, var(--felt), var(--felt2) 75%); display: grid; align-content: center; justify-items: center; text-align: center; padding: 2rem; gap: 1rem; overflow: hidden; }
.auth-hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); max-width: 14ch; }
.auth-hero p { max-width: 42ch; color: #d4e3da; }
.fan { display: flex; height: clamp(150px, 24vw, 250px); align-items: center; justify-content: center; margin-bottom: 1.2rem; }
.fan .card { width: clamp(84px, 12vw, 140px); margin: 0 -2.6vw; transform-origin: 50% 130%; box-shadow: -4px 4px 14px #0006; }
.fan .card:nth-child(1) { transform: rotate(-20deg); } .fan .card:nth-child(2) { transform: rotate(-10deg); }
.fan .card:nth-child(4) { transform: rotate(10deg); } .fan .card:nth-child(5) { transform: rotate(20deg); }
.auth-panel { display: grid; align-content: center; justify-items: center; gap: 1.4rem; padding: 2rem 1.2rem; }
.auth-box { width: min(380px, 100%); }
.auth-box form { display: grid; gap: .8rem; }
.auth-box label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.auth-box h2 { margin: 0; }
.auth-panel > .hint { max-width: 380px; }
input.code { font-size: 1.9rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* Lobby */
.rooms { display: grid; gap: .8rem; }
.room-code { width: 150px; text-transform: uppercase; }
.room-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; }
.room-main { min-width: 0; }
.room-main h3 { overflow-wrap: anywhere; }
.room-side { display: flex; align-items: center; gap: 1rem; flex: none; }
.seats-left { color: var(--muted); font-size: .9rem; }
.seats-left strong { color: var(--ink); font-size: 1.1rem; }
.status { font-size: .85rem; color: var(--muted); }
.status.running { color: var(--ok); } .status.waiting { color: var(--accent); }

/* Settings */
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 1.1rem; padding: .4rem 1.2rem 1.2rem; background: var(--panel); min-width: 0; }
legend { font: 600 1.1rem var(--serif); padding: 0 .5rem; }
fieldset > .fields { margin-top: .5rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem 1.2rem; align-items: start; }
.field { display: grid; gap: .25rem; }
.field.full { grid-column: 1 / -1; }
.lbl { font-weight: 600; font-size: .88rem; }
.field.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; font-weight: 600; padding-top: .3rem; }
.field.check small { display: block; font-weight: 400; }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.2rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.bots { display: grid; gap: .5rem; }
.stepper { display: flex; align-items: center; gap: .7rem; }
.stepper output { font: 700 1.3rem var(--sans); min-width: 1.5em; text-align: center; }
.bot-row { display: grid; grid-template-columns: 60px 1fr 1fr 36px; gap: .6rem; align-items: center; }

/* Tables and tiles */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-size: .78rem; font-weight: 600; white-space: nowrap; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--panel2); }
.user-cell { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 600; overflow-wrap: normal; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; display: grid; align-content: start; gap: .1rem; }
.tile > span { color: var(--muted); font-size: .85rem; }
.tile strong { font: 600 1.5rem var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.wide-tile { grid-column: span 2; }
.mini-cards { display: flex; gap: 3px; }
.mini-cards .card { width: 30px; }
.profile-head { display: flex; gap: 1.3rem; align-items: center; margin-bottom: 1rem; overflow-wrap: anywhere; }
.filters { margin-bottom: .9rem; flex-wrap: wrap; }
.filters input { flex: 1 1 220px; } .filters select { width: auto; }
.pager { display: flex; gap: .7rem; align-items: center; padding: .8rem 0; }
.bar-cell { display: flex; gap: .6rem; align-items: center; }
.bar-cell i { height: 12px; background: var(--green); border-radius: 0 4px 4px 0; display: block; }
code { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: .7rem 1rem; margin: .6rem 0; }
summary { cursor: pointer; }
.hand summary { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.hand .table-wrap { margin-top: .8rem; }
.hand-log { columns: 2 220px; font-size: .88rem; padding-left: 1.6rem; }
.rules { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1.2rem; margin: 0; }
.rules dt { color: var(--muted); } .rules dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.ranking { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.ranking li { display: flex; gap: .8rem; padding: .55rem .9rem; background: var(--panel2); border-radius: 9px; }
.ranking .first { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.seat-info { display: grid; justify-items: center; text-align: center; gap: .3rem; }

/* Poker table */
.room { display: grid; grid-template: auto auto 1fr auto / minmax(0, 1fr) 320px; grid-template-areas: "top top" "net net" "stage side" "act side"; height: 100vh; height: 100dvh; overflow: hidden; }
.room-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: .6rem 1.2rem; padding: .5rem .9rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.room-title { display: grid; line-height: 1.2; min-width: 0; }
.room-title strong { max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-chip { border: 0; background: none; color: var(--accent); font: 600 .78rem var(--sans); letter-spacing: .08em; padding: 0; text-align: left; cursor: pointer; }
.room-info { display: flex; gap: 1.2rem; color: var(--muted); font-size: .88rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.room-info strong, .room-info time { color: var(--ink); }
.net { grid-area: net; background: var(--red); color: #fff; text-align: center; padding: .25rem; font-size: .9rem; }
.chat-toggle, .side-close { display: none; }
.stage { grid-area: stage; display: grid; place-items: center; padding: 10px; min-width: 0; min-height: 0; container-type: size; }
.table { position: relative; width: min(100cqw, 172cqh); height: min(100cqh, 66cqw); max-width: 1250px; --card: clamp(46px, min(8.4cqw, 13.2cqh), 124px); }
.felt { position: absolute; inset: 11% 8%; border-radius: 50% / 50%; background: radial-gradient(ellipse at 50% 42%, #23745b, var(--felt) 45%, var(--felt2)); border: clamp(6px, 1.3cqw, 15px) solid #3a2616; box-shadow: inset 0 0 50px #0007, 0 0 0 2px #5a3d22, 0 18px 44px #0009; }
.felt::after { content: ""; position: absolute; inset: 7%; border: 1px solid #ffffff1f; border-radius: 50%; }
.center { --gap: 5px; }
.table .center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .45rem; z-index: 1; width: max-content; max-width: 70%; }
.pot { min-height: 1.5em; text-align: center; color: var(--on-felt); }
.pot strong { color: var(--gold); font-size: 1.15rem; }
.pot small { display: block; color: #bcd0c5; }
.board { display: flex; gap: 5px; min-height: calc(var(--card) * 1.4); }
.board .card, .board .slot { width: var(--card); aspect-ratio: 5 / 7; }
.board .slot { border: 1px dashed #ffffff26; border-radius: 6px; }
.card.dim { filter: brightness(.55); }
.card.best { box-shadow: 0 0 0 3px var(--gold), 0 0 18px #e2b65c99; border-radius: 6px; }
.card.rabbit { opacity: .5; }
.flip-card { position: relative; perspective: 700px; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 5%; backface-visibility: hidden; box-shadow: 0 2px 6px #0005; }
.face.back { transform: rotateY(180deg); }
.table-msg { display: grid; justify-items: center; gap: .5rem; text-align: center; }
.table-msg p { color: var(--on-felt); font-size: .95rem; }
.seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; z-index: 2; width: clamp(96px, 15cqw, 158px); transition: opacity .2s; }
.seat.is-folded .plate { opacity: .5; }
.empty-seat { gap: .3rem; font-size: .85rem; }
.hole { display: flex; justify-content: center; margin-bottom: calc(var(--card) * -.36); pointer-events: none; }
.hole .card { width: calc(var(--card) * .86); }
.hole .card + .card { margin-left: calc(var(--card) * -.22); }
.hole .card:first-child { transform: rotate(-4deg); } .hole .card:last-child { transform: rotate(4deg); }
.is-me .hole .card { width: calc(var(--card) * 1.06); }
.is-me .hole .card + .card { margin-left: 2px; }
.is-me .hole { margin-bottom: -14px; }
.is-me { transform: translate(-50%, -66%); }
.hole.folded { opacity: .35; }
.plate { position: relative; display: flex; align-items: center; gap: .45rem; width: 100%; padding: .3rem .5rem; background: var(--plate); border: 2px solid var(--line); border-radius: 12px; color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.plate .avatar { width: 34px; height: 34px; }
.who { display: grid; min-width: 0; line-height: 1.2; }
.nm { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack { font-weight: 700; color: var(--accent); font-size: .95rem; font-variant-numeric: tabular-nums; }
.turn .plate { border-color: var(--gold); box-shadow: 0 0 20px #e2b65c66; }
.winner .plate { border-color: var(--gold); background: var(--plate-win); }
.timer { position: absolute; left: 0; bottom: 0; width: 100%; height: 5px; background: var(--green); transform-origin: left; transition: transform .16s linear; }
.timer.bank { background: #5aa7e0; } .timer.low { background: var(--red); }
.seat > .tag { margin: 3px 0 0; background: var(--plate); color: var(--ink); }
.seat > .tag.gold { background: var(--gold); color: var(--gold-ink); } .seat > .tag.red { background: var(--red); }
.seat > .tag.act-raise, .seat > .tag.act-bet { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.seat > .tag.act-fold { color: var(--muted); }
.cat { font-size: .78rem; color: var(--ink); background: var(--plate); border-radius: 99px; padding: 0 .6rem; margin-top: 2px; white-space: nowrap; }
.bet { position: absolute; transform: translate(-50%, -50%); color: #fff; background: #0009; border-radius: 99px; padding: .05rem .6rem .05rem .25rem; font: 700 .85rem var(--sans); display: flex; align-items: center; gap: .35rem; z-index: 1; font-variant-numeric: tabular-nums; }
.bet.pop { animation: pop .25s ease-out; }
@keyframes pop { from { scale: .5; opacity: 0; } }
.chips { display: inline-flex; align-items: flex-end; gap: 2px; vertical-align: bottom; }
.chip-col { display: flex; flex-direction: column-reverse; filter: drop-shadow(0 1px 1px #0007); }
.chip-col i { display: block; width: 17px; height: 5px; margin-top: -1px; border-radius: 4px; border-bottom: 1px solid #0007; background: repeating-linear-gradient(90deg, var(--c) 0 4px, #fff 4px 6px); box-shadow: inset 0 1px #ffffff4d; }
.chip-col.c0 { --c: #20262b; } .chip-col.c1 { --c: #2f6d4d; } .chip-col.c2 { --c: #b8402f; } .chip-col.c3 { --c: #35609c; }
.seat-chips { position: absolute; transform: translate(-50%, -50%); z-index: 0; opacity: .92; pointer-events: none; }
.pot .chips { display: flex; justify-content: center; margin-bottom: 3px; }
.dealer { position: absolute; transform: translate(-50%, -50%); width: 25px; height: 25px; border-radius: 50%; background: #f3efe4; color: #111; font: 800 .8rem/25px var(--sans); text-align: center; z-index: 3; box-shadow: 0 2px 5px #0008; }
.dock { grid-area: act; min-height: 118px; padding: .5rem 1rem max(.7rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; gap: .6rem; min-width: 0; }
.quick { display: flex; justify-content: safe center; gap: .5rem; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.quick .btn { flex: none; border-radius: 99px; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: .6rem; }
.act-main, .act-raise { display: flex; gap: .6rem; align-items: center; justify-content: center; width: 100%; }
.act-raise input[type=range] { max-width: 300px; } .act-raise input[type=number] { width: 120px; min-height: 36px; }
.my-hand { color: var(--accent); font: 600 1rem var(--serif); min-width: 6em; display: grid; justify-items: end; line-height: 1.3; }
.odds { display: flex; align-items: center; gap: .5rem; color: var(--muted); font: 500 .85rem var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.odds meter { width: 64px; height: 12px; }
.emoji { width: 1.35em; height: 1.35em; vertical-align: -.3em; margin: 0 .05em; }
.emoji-btn .emoji { width: 24px; height: 24px; vertical-align: middle; }
.emoji-panel { position: absolute; left: 0; right: 0; bottom: 100%; max-height: min(300px, 46vh); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; box-shadow: 0 -6px 24px #0005; z-index: 5; }
.emoji-head { font-size: .78rem; font-weight: 600; color: var(--muted); margin: .2rem .2rem .3rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; margin-bottom: .4rem; }
.emoji-grid button { border: 0; background: none; border-radius: 8px; padding: 5px; cursor: pointer; line-height: 0; }
.emoji-grid button:hover { background: var(--panel2); }
.emoji-grid .emoji { width: 26px; height: 26px; margin: 0; }
.theme-btn { font-size: 1.2rem; }
.fields.one { grid-template-columns: 1fr; }
.quick-edit .field { gap: .4rem; } .quick-edit { background: none; }
.choose { position: relative; display: flex; gap: .6rem; padding-bottom: 12px; overflow: hidden; }
.choose .timer { border-radius: 4px; }
.btn.pre.on { border-color: var(--gold); color: var(--accent); }
.side { grid-area: side; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; padding: .7rem; }
.side .tabs { margin-bottom: .6rem; flex: none; }
.feed { flex: 1; overflow-y: auto; font-size: .9rem; min-height: 0; }
.feed p { margin: 0 0 .4rem; overflow-wrap: anywhere; line-height: 1.4; }
.feed time { color: var(--muted); font-size: .75rem; margin-right: .4rem; }
.feed strong { margin-right: .4rem; color: var(--accent); }
.feed .mine strong { color: var(--ok); }
.feed .log-hand { color: var(--muted); border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .5rem; }
.feed .log-win, .feed .log-champion { color: var(--accent); font-weight: 600; }
.chat-form { position: relative; align-items: center; display: flex; gap: .4rem; padding-top: .6rem; flex: none; }

@media (max-width: 1100px) {
  .room { grid-template: auto auto 1fr auto / minmax(0, 1fr); grid-template-areas: "top" "net" "stage" "act"; }
  .side { position: fixed; inset: 0 0 0 auto; width: min(340px, 100vw); z-index: 50; transform: translateX(102%); visibility: hidden; transition: transform .2s, visibility .2s; box-shadow: -10px 0 40px #0009; padding-bottom: max(.7rem, env(safe-area-inset-bottom)); }
  .side-open .side { transform: none; visibility: visible; }
  .chat-toggle { display: inline-flex; } .side-close { display: block; }
  .side .tabs .side-close { flex: none; padding: 0; font-size: 1.4rem; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.4rem 1rem; } .auth-hero p { display: none; }
  .fan { height: 130px; margin: 0; } .fan .card { margin: 0 -18px; width: 78px; }
  .top { gap: .6rem; } .top nav { order: 3; flex-basis: 100%; } .top nav a { flex: 1; text-align: center; padding: .4rem; }
  .top-right { margin-left: auto; } .me span:last-child { display: none; }
  .room-card { flex-direction: column; align-items: stretch; } .room-side { justify-content: space-between; }
  .bot-row { grid-template-columns: 1fr 1fr 36px; } .bot-row > .muted { grid-column: 1 / -1; }
  .wide-tile { grid-column: 1 / -1; }
  .hide-s { display: none; }
  .room-top { padding: .4rem .5rem; } .room-top .btn.sm { padding: 0 .55rem; min-height: 32px; font-size: .8rem; }
  .room-top .row { gap: .35rem; }
  .room-top .row.end { width: 100%; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .room-top .row.end .btn { flex: none; } .room-top .chat-toggle { order: -1; }
  .table.many { --card: clamp(34px, 12.4cqw, 60px); } .many .seat { width: 84px; } .many .is-me .hole .card { width: var(--card); }
  .is-me { transform: translate(-50%, -62%); } .seat.is-me > .tag:not(.gold) { display: none; }
  .room-info { order: 3; width: 100%; justify-content: center; }
  .table { width: 100cqw; height: min(100cqh, 165cqw); --card: clamp(42px, 15.2cqw, 76px); }
  .felt { inset: 8% 11%; border-radius: 46% / 30%; } .felt::after { border-radius: 46% / 30%; }
  .table .center { max-width: 100%; }
  .seat { width: 94px; }
  .plate { padding: .2rem .35rem; gap: .3rem; } .plate .avatar { width: 26px; height: 26px; font-size: .75rem; } .nm { font-size: .72rem; } .stack { font-size: .84rem; }
  .hole .card { width: calc(var(--card) * .74); } .is-me .hole .card { width: calc(var(--card) * 1.08); }
  .board { gap: 3px; } .chip-col i { width: 12px; height: 4px; }
  .dock { min-height: 140px; padding: .4rem .5rem max(.5rem, env(safe-area-inset-bottom)); gap: .4rem; } .quick { justify-content: flex-start; }
  .act-main { flex-wrap: wrap; gap: .4rem; } .my-hand { width: 100%; display: flex; justify-content: center; gap: .8rem; font-size: .9rem; }
  .btn.big { flex: 1; min-width: 0; padding: 0 .4rem; min-height: 48px; font-size: .95rem; }
  .act-raise input[type=range] { min-width: 0; }
  .act-raise { gap: .35rem; flex-wrap: wrap; } .act-raise .btn { flex: 1; padding: 0 .3rem; } .act-raise input[type=range] { order: 3; flex: 1; } .act-raise input[type=number] { order: 4; width: 96px; }
}
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
