/* ---------- Setup ---------- */
.game-head { padding-block: 28px; }
.game-head p { font-size: 18px; }
.setup { padding-block: 22px 56px; display: grid; gap: 14px; max-width: 720px; }
.quick { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.btn-play { font-size: 20px; padding-block: 16px; }
.btn-line { background: #fff; border-color: var(--blue-line); color: var(--ink); }
.btn-small { padding: 8px 14px; font-size: 15px; }
.muse-status { margin: 0; font-size: 15px; color: var(--muted); }
.muse-status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b8c2d6; margin-right: 8px; vertical-align: 2px; }
.muse-status.on::before { background: var(--green); }
.setup-title { font-size: 24px; margin-top: 10px; }
.setup-sub { margin: -6px 0 0; font-size: 16px; color: var(--muted); }
.seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid var(--blue-line); border-radius: 14px; background: #fff; }
.seat .who { display: grid; min-width: 0; }
.seat input { font: inherit; font-size: 17px; font-weight: 600; width: 100%; border: 0; border-bottom: 1.5px dashed transparent; padding: 2px 0; color: var(--ink); background: transparent; }
.seat input:hover { border-bottom-color: var(--blue-line); }
.seat input:focus { outline: none; border-bottom-color: var(--blue); }
.seat .persona { font-size: 13.5px; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--blue-line); border-radius: 999px; overflow: hidden; }
.mode button { font: inherit; font-size: 14px; font-weight: 700; padding: 7px 12px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.mode button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.rules { border: 1.5px solid var(--blue-line); border-radius: 12px; padding: 10px 16px; background: var(--blue-soft); }
.rules summary { cursor: pointer; font-weight: 700; color: var(--blue-ink); }
.rules ul { margin: 10px 0 4px; padding-left: 20px; display: grid; gap: 4px; font-size: 16px; }
.rules p { font-size: 16px; margin: 10px 0; }
.proxy-row { display: grid; gap: 4px; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.proxy-row input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1.5px solid var(--blue-line); border-radius: 10px; width: 100%; }

.resume { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); border: 2px solid var(--yellow); }
.resume-info { display: grid; min-width: 0; line-height: 1.3; }
.resume-info span { font-size: 14px; color: var(--muted); }
.level-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.level-label { font-weight: 700; color: var(--blue-ink); }
.level { display: inline-grid; grid-template-columns: repeat(3, auto); border: 1.5px solid var(--blue-line); border-radius: 999px; overflow: hidden; }
.level button { font: inherit; font-size: 15px; font-weight: 700; padding: 7px 16px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.level button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.level-hint { font-size: 14px; color: var(--muted); flex-basis: 100%; }


.join { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.join input { font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; width: 7.5em; padding: 6px 10px; border: 1.5px solid var(--blue-line); border-radius: 10px; }
.join input:focus { border-color: var(--blue); outline: none; }

/* lobby */
.lobby { padding-block: 16px 56px; display: grid; gap: 14px; max-width: 720px; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; }
.net { font-size: 14px; font-weight: 600; color: var(--muted); }
.net.online { color: var(--green); }
.net.offline { color: var(--red); }
.code-card { display: grid; justify-items: center; gap: 6px; padding: 18px; border-radius: 18px; background: var(--blue-deep); color: #fff; text-align: center; }
.code-label { font-size: 14px; color: #c9d6f2; }
.code { font-family: var(--display); font-size: 44px; letter-spacing: .25em; line-height: 1; padding-left: .25em; }
.share { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.share .btn-line { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.name-row { display: grid; gap: 4px; font-weight: 700; color: var(--blue-ink); }
.name-row input { font: inherit; font-size: 17px; padding: 10px 12px; border: 1.5px solid var(--blue-line); border-radius: 12px; }
.name-row input:focus { border-color: var(--blue); outline: none; }
.lobby-seats .seat { grid-template-columns: auto minmax(0, 1fr) auto; }
.lobby-seats .who b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-actions { display: flex; gap: 6px; }
.seat.empty .avatar { --c: #c4cbd8; }
.tag-host { font-size: 11px; font-weight: 800; text-transform: uppercase; background: var(--yellow); color: var(--blue-ink); padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.level button:disabled { cursor: default; }
.lobby-status { margin: 0; font-size: 15px; color: var(--muted); }
.btn-play:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.strip .take { font: inherit; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--blue-line); background: var(--yellow-soft); cursor: pointer; margin-top: 2px; }
.strip li.away { opacity: .6; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(440px, calc(100% - 32px)); background: var(--blue-ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); }

.btn-daily { grid-column: 1 / -1; }
.btn-daily .done { font-weight: 600; color: var(--green); }
.record { display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--blue-line); background: #fff; }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.record-head b { font-family: var(--display); font-size: 19px; color: var(--blue-ink); }
.record-head span { font-size: 14px; color: var(--muted); }
.record-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.record-nums div { background: var(--blue-soft); border-radius: 12px; padding: 8px 4px; line-height: 1.15; }
.record-nums b { display: block; font-family: var(--display); font-size: 22px; color: var(--blue-ink); }
.record-nums small { font-size: 12.5px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--yellow-soft); border: 1px solid #f0d27a; color: var(--blue-ink); }
.badge.locked { background: #f3f5f9; border-color: #e1e6ef; color: #9aa3b5; filter: grayscale(1); }
.win-extra { display: grid; gap: 10px; }
.win-extra:empty { display: none; }
.win-extra .badges { justify-content: center; }
.win-extra .newbadge { animation: badge-in .5s ease both; }
@keyframes badge-in { from { transform: scale(.4); opacity: 0; } }
.win-extra .note { font-weight: 700; color: var(--green); margin: 0; }
.share-row { display: grid; grid-template-columns: 1fr; gap: 8px; }

/* tutorial */
.tutorial { text-align: left; }
.tutorial h2 { text-align: center; }
.tut-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: s; }
.tut-steps li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; font-size: 16px; line-height: 1.35; }
.tut-ill { display: grid; place-items: center; height: 56px; border-radius: 12px; background: var(--blue-soft); }
.card.mini { width: 34px; height: 46px; font-size: 14px; color: #c0262d; cursor: default; }
.cell.mini { width: 36px; height: 36px; font-size: 12px; line-height: 1.05; color: #c0262d; }
.chips5 { display: flex; gap: 2px; }
.chips5 i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.tut-note { font-size: 14.5px; color: var(--muted); }
.tutorial .btn { justify-self: center; }

/* sequence highlight and confetti */
.cell.seqflash { animation: seqflash 1.6s ease; z-index: 3; }
@keyframes seqflash { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 3px var(--gold), 0 0 18px 6px rgba(255,214,90,.9); transform: scale(1.08); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); } }
@media (prefers-reduced-motion: reduce) { .cell.seqflash, .confetti, .win-extra .newbadge { animation: none !important; } .confetti { display: none; } }

.install { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14.5px; color: var(--muted); }

.daily-best { grid-column: 1 / -1; margin: -4px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.daily-best:empty { display: none; }
.reactions { display: flex; justify-content: center; gap: 6px; }
.reactions button { font-size: 20px; line-height: 1; width: 42px; height: 38px; border-radius: 12px; border: 1.5px solid var(--blue-line); background: #fff; cursor: pointer; }
.reactions button:active { transform: scale(.92); }
.float-emoji { position: absolute; z-index: 75; font-size: 34px; transform: translate(-50%, 0); pointer-events: none; animation: float-up 1.8s ease-out forwards; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }
.lb-box { display: grid; gap: 8px; text-align: left; background: var(--blue-soft); border-radius: 14px; padding: 12px; }
.lb-box h3 { font-size: 17px; text-align: center; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lb li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 14.5px; background: #fff; border-radius: 8px; padding: 4px 8px; }
.lb li.me { outline: 2px solid var(--yellow); }
.lb li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li em { font-style: normal; color: var(--muted); font-size: 13px; }
.lb-note, .lb-empty { margin: 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.lb-form { display: flex; gap: 6px; }
.lb-form input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 6px 10px; border: 1.5px solid var(--blue-line); border-radius: 10px; }
.cell:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; z-index: 4; }
@media (prefers-reduced-motion: reduce) { .float-emoji { animation-duration: .01s; } }

.privacy-link { margin: 0; font-size: 14px; text-align: right; }
.privacy-link a { color: var(--muted); }

/* avatars */
.avatar { --c: var(--blue); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--c); color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1; position: relative; }
.avatar.t1 { --c: var(--green); }
.avatar.t2 { --c: #c62f2f; }
.avatar.ai::after { content: "AI"; position: absolute; right: -5px; bottom: -4px; font: 700 9px/1 var(--body); background: var(--yellow); color: var(--blue-ink); padding: 2px 3px; border-radius: 4px; }
.avatar.big { width: 64px; height: 64px; font-size: 30px; margin: 0 auto; }

/* ---------- Play mode: hide site chrome so the table fills the screen ---------- */
body.playing .site-header, body.playing .page-head, body.playing .site-footer,
body.playing .callbar, body.playing .dot-root, body.playing .setup, body.playing .lobby { display: none !important; }
body.playing { background: #f4f1ea; }

.table { --felt: #5b3b22; max-width: 1080px; margin: 0 auto; padding: 0 12px 24px; position: relative; }
.tbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 8px; }
.tbtn { font: inherit; font-size: 15px; font-weight: 700; color: var(--blue-ink); background: #fff; border: 1.5px solid var(--blue-line); border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.tbtn:hover { border-color: var(--blue); }
.scores { display: flex; gap: 6px; }
.tsound { padding-inline: 10px; }
.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; background: #fff; border-radius: 999px; padding: 5px 12px; border: 1.5px solid var(--blue-line); white-space: nowrap; }
.score i { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
.score.s1 i { background: var(--green); }
.score.s2 i { background: #c62f2f; }
.score b { font-size: 18px; }
.score em { font-style: normal; }

.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.strip li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: #fff; border: 2px solid transparent; min-width: 0; transition: border-color .2s, transform .2s; }
.strip li.now { border-color: var(--yellow); box-shadow: 0 6px 16px -10px rgba(0,0,0,.4); transform: translateY(-2px); }
.strip .meta { display: grid; min-width: 0; line-height: 1.2; }
.strip b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip li.now small { color: #9a6400; font-weight: 700; }
.dots::after { content: "…"; display: inline-block; animation: dots 1s steps(4) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } }

.bubble { position: absolute; z-index: 20; top: 108px; left: 12px; right: 12px; margin-inline: auto; max-width: 460px; background: #fff; border-radius: 16px; padding: 10px 14px; font-size: 16px; line-height: 1.35; box-shadow: 0 14px 30px -12px rgba(0,0,0,.45); border: 2px solid var(--yellow); animation: bubble-in .25s ease; }
.bubble b { color: var(--blue-ink); }
.bubble::before { content: ""; position: absolute; top: -9px; left: var(--x, 50%); width: 14px; height: 14px; background: #fff; border-left: 2px solid var(--yellow); border-top: 2px solid var(--yellow); transform: translateX(-50%) rotate(45deg); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-6px); } }

.stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 10px; }
.board-col { display: grid; gap: 10px; justify-items: center; min-width: 0; }
.banner { min-width: 0; width: 100%; max-width: 640px; display: grid; text-align: center; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--blue-line); min-height: 58px; align-content: center; line-height: 1.3; }
.banner b { font-size: 17px; color: var(--blue-ink); }
.banner span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.banner { position: relative; }
.banner.mine { background: var(--yellow); border-color: #e6ad00; }
.clock { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 800; font-size: 14px; color: var(--blue-ink); background: rgba(255,255,255,.75); border-radius: 999px; padding: 2px 8px; }
.clock.low { background: #c62f2f; color: #fff; animation: clock-pulse 1s ease-in-out infinite; }
@keyframes clock-pulse { 50% { transform: translateY(-50%) scale(1.12); } }
.banner.mine span { color: var(--blue-ink); }

.board { --size: min(100%, max(300px, calc(100svh - 330px)), 640px); width: var(--size); display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; padding: 6px; border-radius: 14px; background: var(--felt); aspect-ratio: 1; box-shadow: 0 18px 36px -18px rgba(60,35,10,.7); }
.cell { position: relative; border: 0; border-radius: 4px; background: #fffdf7; padding: 0; display: grid; place-items: center; align-content: center; font-family: var(--body); font-weight: 700; color: #1b2233; font-size: clamp(9px, 2.1vmin, 15px); line-height: 1; cursor: default; min-width: 0; transition: opacity .2s; }
.cell .s { font-size: 1.2em; margin-top: 1px; }
.cell.red { color: #c0262d; }
.cell.free { background: #ffe9a8; color: #8a5a00; font-size: clamp(13px, 3vmin, 22px); }
.cell .chip { position: absolute; inset: 10%; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.4); }
.cell .chip.t0 { background: radial-gradient(circle at 35% 30%, #5b8ce0, var(--blue) 62%); }
.cell .chip.t1 { background: radial-gradient(circle at 35% 30%, #5ad888, var(--green) 62%); }
.cell .chip.t2 { background: radial-gradient(circle at 35% 30%, #f07a6e, #c62f2f 62%); }
/* a shape on each colour, so the chips can be told apart without colour */
.cell .chip::before { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); font-size: .9em; line-height: 1; }
.cell .chip.t1::before { content: "■"; font-size: .75em; }
.cell .chip.t2::before { content: "▲"; font-size: .8em; }
.cell.locked .chip::before { content: none; }
.cell.locked .chip { box-shadow: 0 0 0 3px var(--gold), 0 2px 4px rgba(0,0,0,.4); }
.cell.locked .chip::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 1.1em; }
.cell.last::before { content: ""; position: absolute; inset: -2px; border-radius: 6px; border: 3px solid #ff7a00; z-index: 2; pointer-events: none; animation: ping 1.2s ease-out 2; }
.cell.recent::before { content: ""; position: absolute; inset: 0; border-radius: 5px; border: 2px dashed #ff9a3d; z-index: 2; pointer-events: none; }
@keyframes ping { 0% { transform: scale(1.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }
.board.picking .cell:not(.legal) { opacity: .45; }
.cell.legal { cursor: pointer; z-index: 1; background: #fff3b8; box-shadow: 0 0 0 3px var(--yellow); }
.board.few .cell.legal { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 3px #ff9f00, 0 0 14px 4px rgba(255,159,0,.85); } }
.cell.legal:hover, .cell.legal:focus-visible { background: var(--yellow); outline: none; }
.cell.legal.remove .chip { opacity: .6; }
.cell.legal.remove::after { content: "✕"; position: absolute; color: #fff; font-size: 1.5em; text-shadow: 0 1px 3px #000; }
.cell.peek { box-shadow: 0 0 0 2px #ff9f00; }
.cell.flash .chip { animation: pop .45s ease; }
@keyframes pop { 0% { transform: translateY(-140%) scale(1.25); opacity: 0; } 55% { transform: translateY(0) scale(1.08); opacity: 1; } 75% { transform: scale(.94); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cell.legal, .cell.flash .chip, .cell.last::before, .dots::after { animation: none !important; } }

.hand { max-width: 640px; width: 100%; display: flex; justify-content: center; align-items: flex-start; gap: 6px; padding-top: 8px; }
.card { flex: 0 1 64px; min-width: 0; aspect-ratio: 5 / 7; border-radius: 9px; border: 1.5px solid #c9d2e3; background: #fff; display: grid; place-items: center; align-content: center; gap: 3px; font: inherit; font-weight: 700; font-size: clamp(16px, 4.5vw, 22px); line-height: 1; color: #1b2233; cursor: pointer; box-shadow: 0 2px 0 #c9d2e3, 0 6px 12px -8px rgba(0,0,0,.4); padding: 0; transition: transform .15s; }
.card small { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: #fff; background: var(--blue); padding: 2px 4px; border-radius: 4px; }
.card small.dead { background: #8b93a5; }
.card.red { color: #c0262d; }
.card:not(:disabled):hover { transform: translateY(-4px); }
.card[aria-pressed="true"] { border-color: #e6ad00; background: #fff6d6; box-shadow: 0 0 0 3px var(--yellow); transform: translateY(-8px); }
.card:disabled { cursor: default; }
.hand.waiting .card { opacity: .75; }
.card.back { background: repeating-linear-gradient(45deg, var(--blue) 0 6px, var(--blue-deep) 6px 12px); border-color: var(--blue-deep); }

.side { display: grid; gap: 10px; align-content: start; min-width: 0; }
.side-title { font-size: 18px; }
.feed { list-style: none; margin: 0; padding: 10px 12px; height: 260px; overflow-y: auto; display: grid; align-content: start; gap: 6px; font-size: 14.5px; line-height: 1.4; background: #fff; border: 1.5px solid var(--blue-line); border-radius: 14px; }
.feed li.say { background: var(--blue-soft); border-radius: 12px; padding: 6px 10px; }
.feed li.say b { color: var(--blue-ink); }
.feed li.sys { color: var(--muted); }
.feed li.big { font-weight: 700; color: var(--blue-ink); }
.feed .src { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 1px 5px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); margin-left: 4px; }
.chat { display: flex; gap: 8px; }
.chat input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 8px 12px; border: 1.5px solid var(--blue-line); border-radius: 999px; }
.chat input:focus { border-color: var(--blue); outline: none; }
.speed { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.speed select { font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--blue-line); background: #fff; }

.cover { position: fixed; inset: 0; z-index: 60; background: rgba(6,20,50,.72); display: grid; place-items: center; padding: 16px; }
.cover-card { background: #fff; border-radius: 22px; padding: 26px; width: min(400px, 100%); display: grid; gap: 12px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.cover-card p { margin: 0; }
.cover-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trophy { font-size: 56px; line-height: 1; }

@media (min-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .side { position: sticky; top: 12px; }
  .feed { height: min(460px, calc(100svh - 260px)); }
  .bubble { left: auto; right: 344px; }
}
@media (max-width: 360px) {
  .score em { display: none; }
  .card small { font-size: 8px; padding: 1px 3px; }
}
@media (max-width: 560px) {
  .quick { grid-template-columns: 1fr; }
  .record-nums b { font-size: 19px; }
  .resume { grid-template-columns: 1fr 1fr; }
  .lobby-seats .seat { grid-template-columns: auto minmax(0, 1fr); }
  .seat-actions { grid-column: 1 / -1; }
  .seat-actions .btn { flex: 1; }
  .code { font-size: 36px; }
  .resume-info { grid-column: 1 / -1; }
  .seat { grid-template-columns: auto minmax(0, 1fr); }
  .seat .mode { grid-column: 1 / -1; }
  .tbtn span { display: none; }
  .strip li { padding: 5px; gap: 5px; flex-direction: column; text-align: center; }
  .strip .meta { justify-items: center; width: 100%; }
  .strip b { font-size: 13px; max-width: 100%; }
  .strip small { font-size: 11px; max-width: 100%; }
  .avatar { width: 30px; height: 30px; font-size: 15px; }
  .bubble { top: 120px; }
  .board { gap: 2px; padding: 4px; }
  .cell { border-radius: 3px; }
  .score { padding: 4px 10px; font-size: 14px; }
}
body.in-lobby .page-head, body.in-lobby .callbar, body.in-lobby .dot-root, body.in-lobby .site-footer { display: none !important; }

/* Dark table: the game screen follows the phone's dark mode (the rest of the site stays light) */
@media (prefers-color-scheme: dark) {
  body.playing { background: #0f1420; color: #e7ecf5; }
  body.playing .tbtn, body.playing .score, body.playing .strip li, body.playing .banner,
  body.playing .feed, body.playing .chat input, body.playing .speed select, body.playing .reactions button {
    background: #1a2233; color: #e7ecf5; border-color: #2c3850;
  }
  body.playing .strip small, body.playing .banner span, body.playing .feed li.sys, body.playing .speed { color: #9fb0cc; }
  body.playing .strip li.now { border-color: var(--yellow); }
  body.playing .banner.mine { background: var(--yellow); color: var(--blue-ink); border-color: #e6ad00; }
  body.playing .banner b, body.playing .side-title, body.playing .feed li.say b, body.playing .feed li.big, body.playing .bubble b { color: #ffffff; }
  body.playing .banner.mine b, body.playing .banner.mine span { color: var(--blue-ink); }
  body.playing .feed li.say { background: #23304a; }
  body.playing .feed .src { background: #23304a; color: #9fc0ff; }
  body.playing .bubble { background: #1a2233; color: #e7ecf5; }
  body.playing .bubble::before { background: #1a2233; }
  body.playing .card { border-color: #3a4763; box-shadow: 0 2px 0 #3a4763, 0 6px 12px -8px rgba(0,0,0,.8); }
  body.playing .board { box-shadow: 0 18px 36px -18px rgba(0,0,0,.9); }
  body.playing .cover-card, body.playing .lb li { background: #1a2233; color: #e7ecf5; }
  body.playing .cover-card h2 { color: #fff; }
  body.playing .lb-box { background: #23304a; }
  body.playing .btn-line { background: #1a2233; color: #e7ecf5; border-color: #3a4763; }
}
