/* BidChess web client. Dark by default; light via html[data-theme="light"]. No external fonts. */
:root {
  --bg: #0d1020;
  --bg2: #141933;
  --card: #181e3a;
  --card2: #1f2647;
  --line: #2b3360;
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --idle: #6b7280;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  /* Board theme (overridden by [data-board]) */
  --sq-light: #e9edcc;
  --sq-dark: #779556;
  --sq-sel: rgba(124, 92, 255, .55);
  --sq-last: rgba(250, 204, 21, .42);
  --dot: rgba(13, 16, 32, .35);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f4f5fb;
  --bg2: #e9ecf8;
  --card: #ffffff;
  --card2: #f1f3fb;
  --line: #d8dcef;
  --text: #151a33;
  --muted: #5b6386;
  --shadow: 0 10px 30px rgba(30, 40, 90, .12);
  color-scheme: light;
}
html[data-board="classic"] { --sq-light: #f0d9b5; --sq-dark: #b58863; }
html[data-board="green"] { --sq-light: #e9edcc; --sq-dark: #779556; }
html[data-board="ocean"] { --sq-light: #dee3e6; --sq-dark: #6f8fa8; }
html[data-board="neon"] { --sq-light: #3a3f63; --sq-dark: #23274a; --sq-last: rgba(34, 211, 238, .35); --dot: rgba(255, 255, 255, .35); }
html[data-board="rose"] { --sq-light: #f6e3e8; --sq-dark: #c0717f; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, .22), transparent 60%),
              radial-gradient(900px 500px at 110% 0%, rgba(34, 211, 238, .14), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--accent2); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
.muted { color: var(--muted); }
.noscript { padding: 16px; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: rgba(13, 16, 32, .72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .8); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 16px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn, .user-btn {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; font: inherit; cursor: pointer;
}
.icon-btn:hover, .user-btn:hover { border-color: var(--accent); }
.user-menu { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu button, .menu a {
  text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--card2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.menu .danger { color: var(--bad); }
.conn { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warn); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); animation: pulse-amber 1.2s infinite; }

/* ------------------------------------------------------------------ layout */
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 11px; padding: 9px 16px;
  font: inherit; font-weight: 650; cursor: pointer; color: var(--text); background: var(--card2);
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #5b8cff); color: #fff; box-shadow: 0 6px 18px rgba(124, 92, 255, .35); }
.btn.secondary { background: linear-gradient(135deg, #0ea5b7, var(--accent2)); color: #06202a; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: rgba(239, 68, 68, .5); color: #fca5a5; }
html[data-theme="light"] .btn.danger-ghost { color: #b91c1c; }
.btn.big { padding: 12px 20px; font-size: 16px; width: 100%; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.form-error { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
.form-error:empty { min-height: 0; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%; padding: 11px 12px; margin-top: 5px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
label { display: block; font-weight: 600; font-size: 14px; }
.hint { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent2); animation: spin .8s linear infinite; vertical-align: -2px;
}

/* ------------------------------------------------------------------ auth */
.auth { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; min-height: calc(100vh - 100px); }
.auth-hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 850; letter-spacing: -.5px; }
.auth-hero p { color: var(--muted); font-size: 17px; max-width: 520px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tab { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: 9px; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--card2); color: var(--text); }
.form { display: flex; flex-direction: column; gap: 12px; }
.guest-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.guest-box p { margin: 0; font-size: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.guest-badge {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(34, 211, 238, .18); color: var(--accent2); vertical-align: 1px;
}
.guest-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.beta summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.beta label { margin-top: 8px; }

/* ------------------------------------------------------------------ lobby */
.hello { font-size: 24px; margin: 6px 0 16px; }
.lobby-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.action-card { display: flex; flex-direction: column; gap: 8px; }
.action-card p { margin: 0 0 6px; }
.action-icon { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--card2); }
.qm { background: linear-gradient(160deg, rgba(124, 92, 255, .25), var(--card) 55%); }
.searching { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font: 800 30px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 6px;
  background: var(--bg2); border: 1px dashed var(--accent); border-radius: 12px; padding: 12px 14px;
}
.join-form { display: flex; gap: 8px; }
.join-form input { margin-top: 0; text-transform: uppercase; letter-spacing: 4px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; border-color: var(--good); }
.history-card { margin-bottom: 16px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.history li:first-child { border-top: 0; }
.res { font-weight: 700; }
.res.win { color: var(--good); }
.res.loss { color: var(--bad); }
.res.draw { color: var(--muted); }
.rules summary { cursor: pointer; font-weight: 700; }
.rules ul { margin: 10px 0 0; padding-left: 20px; }
.rules li { margin: 6px 0; }

/* ------------------------------------------------------------------ game */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 10px; max-width: min(100%, calc(100vh - 250px)); width: 100%; margin: 0 auto; min-width: 280px; }
.side-col { display: flex; flex-direction: column; gap: 12px; }

.player-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 54px;
}
.player-bar.active { border-color: var(--good); box-shadow: 0 0 0 1px var(--good), 0 0 22px rgba(34, 197, 94, .25); }
.light { width: 12px; height: 12px; border-radius: 50%; background: var(--idle); flex: none; }
.light.move { background: var(--good); animation: pulse-green 1.1s infinite; }
.light.bid { background: var(--warn); animation: pulse-amber 1.6s infinite; }
.light.wait { background: var(--idle); }
.pname { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pside { font-size: 12px; color: var(--muted); }
.pinfo { display: flex; flex-direction: column; min-width: 0; }
.pstatus { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pstatus.move { color: var(--good); }
.pstatus.bid { color: var(--warn); }
.pright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ptime { font: 700 14px/1 ui-monospace, Consolas, monospace; color: var(--muted); }
.ptime.low { color: var(--bad); }
.star { color: #facc15; font-size: 20px; text-shadow: 0 0 10px rgba(250, 204, 21, .6); }
.points { font: 800 22px/1 ui-monospace, Consolas, monospace; min-width: 46px; text-align: right; }
.points small { font-size: 11px; color: var(--muted); font-weight: 600; }
.offline { font-size: 11px; color: var(--bad); border: 1px solid var(--bad); border-radius: 6px; padding: 1px 5px; }

.board-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; container-type: inline-size; }
.board {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); user-select: none; touch-action: manipulation;
}
.sq { position: relative; display: grid; place-items: center; cursor: default; }
.sq.l { background: var(--sq-light); }
.sq.d { background: var(--sq-dark); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: var(--sq-last); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: var(--sq-sel); }
.sq.can { cursor: pointer; }
.sq.target { cursor: pointer; }
.sq.target::after {
  content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: var(--dot); pointer-events: none;
}
.sq.target.cap::after { width: 86%; height: 86%; background: transparent; border: 5px solid var(--dot); }
.sq.check { background-image: radial-gradient(circle, rgba(239, 68, 68, .95) 0%, rgba(239, 68, 68, .55) 40%, transparent 72%); }
.pc {
  position: relative; z-index: 1; font-size: 9.2cqw; line-height: 1; pointer-events: none;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "DejaVu Sans", "Apple Symbols", sans-serif;
  transition: transform .12s ease;
}
@supports not (font-size: 1cqw) { .pc { font-size: min(8.5vw, 8.5vh); } }
.pc.w { color: #fbfbff; -webkit-text-stroke: .6px #1d1d1d; text-shadow: 0 2px 2px rgba(0, 0, 0, .35); }
.pc.b { color: #18181b; -webkit-text-stroke: .5px #e5e5e5; text-shadow: 0 2px 2px rgba(0, 0, 0, .25); }
.sq.sel .pc { transform: scale(1.08); }
.coord { position: absolute; font-size: 2.1cqw; font-weight: 700; z-index: 1; opacity: .8; pointer-events: none; }
.coord.f { right: 4%; bottom: 2%; }
.coord.r { left: 4%; top: 2%; }
.sq.l .coord { color: var(--sq-dark); }
.sq.d .coord { color: var(--sq-light); }
html.nocoords .coord { display: none; }
.board.myturn { box-shadow: 0 0 0 3px var(--good), 0 0 30px rgba(34, 197, 94, .35); }

/* reveal + banner overlays */
.reveal { pointer-events: none; position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; background: rgba(8, 10, 22, .45); border-radius: 10px; animation: fade-in .2s ease; }
.reveal-cards { display: flex; align-items: center; gap: 4cqw; transform: translateY(-14%); }
.vs { font-weight: 900; font-size: 4cqw; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.bid-card { width: 24cqw; height: 32cqw; perspective: 800px; }
.bid-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.bid-card.flip .bid-card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.face.back { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 12cqw; font-weight: 900; }
.face.front { background: var(--card); border: 2px solid var(--line); transform: rotateY(180deg); color: var(--text); }
.bid-card.won .face.front { border-color: var(--good); box-shadow: 0 0 30px rgba(34, 197, 94, .5); }
.face .who { font-size: 2.6cqw; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.face .amt { font-size: 9cqw; font-weight: 900; font-family: ui-monospace, Consolas, monospace; }
.face .amt .star { font-size: 5cqw; }
.face .auto { font-size: 2.4cqw; color: var(--warn); }
.banner {
  pointer-events: none;
  position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%); z-index: 6;
  padding: 2.4cqw 4cqw; border-radius: 16px; font-weight: 850; font-size: clamp(16px, 4.2cqw, 30px); text-align: center;
  color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); white-space: nowrap; max-width: 94%;
}
.banner.good { background: linear-gradient(135deg, #16a34a, #22c55e); }
.banner.warn { background: linear-gradient(135deg, #d97706, #f59e0b); }
.banner.info { background: linear-gradient(135deg, var(--accent), #5b8cff); }
.banner.bad { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.banner small { display: block; font-size: .55em; font-weight: 600; opacity: .9; margin-top: 2px; }
.promo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7; display: flex; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow);
}
.promo button { width: 14cqw; height: 14cqw; font-size: 10cqw; border-radius: 10px; border: 1px solid var(--line); background: var(--sq-light); cursor: pointer; display: grid; place-items: center; padding: 0; }
.promo button .pc { font-size: 10cqw; }

/* side panel */
.phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.phase-title { font-weight: 800; font-size: 17px; }
.phase-time { font: 800 24px/1 ui-monospace, Consolas, monospace; }
.phase-time.low { color: var(--bad); animation: blink 1s steps(2) infinite; }
.timebar { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
.timebar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 4px; }
.timebar-fill.low { background: var(--bad); }
.phase-sub { margin: 0; color: var(--muted); font-size: 14px; min-height: 1.2em; }
.bid-row { display: flex; gap: 8px; align-items: center; }
.bid-row input { margin: 0; text-align: center; font: 800 26px/1 ui-monospace, Consolas, monospace; padding: 8px; }
.btn.step { width: 48px; height: 48px; font-size: 24px; padding: 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { flex: 1 0 auto; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 8px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.star-toggle { margin: 4px 0 12px; font-size: 13.5px; }
.locked { text-align: center; }
.locked-amt { font: 900 34px/1.1 ui-monospace, Consolas, monospace; }
.draw-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-color: var(--accent2); flex-wrap: wrap; }
.over { text-align: center; border-color: var(--accent); }
.over-title { font-size: 26px; font-weight: 900; }
.over-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.rematch-offer { margin-top: 10px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.moves-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.moves-head h3 { margin: 0; font-size: 15px; }
.game-actions { display: flex; gap: 6px; }
.moves { list-style: none; margin: 10px 0 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: 13.5px; }
.moves li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; padding: 5px 6px; border-radius: 6px; }
.moves li:nth-child(odd) { background: var(--bg2); }
.moves .rn { color: var(--muted); }
.moves .san { font-weight: 700; }
.moves .bids { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent2); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); animation: slide-up .25s ease; pointer-events: auto; }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }

/* dialogs */
.dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); padding: 20px; width: min(92vw, 440px); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(5, 7, 15, .6); backdrop-filter: blur(3px); }
.dialog form { display: flex; flex-direction: column; gap: 12px; }
.dialog fieldset { border: 1px solid var(--line); border-radius: 10px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-opt { border: 2px solid transparent; border-radius: 10px; padding: 3px; background: none; cursor: pointer; color: var(--text); font: inherit; font-size: 11px; }
.theme-opt.active { border-color: var(--accent); }
.theme-swatch { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; border-radius: 6px; overflow: hidden; margin-bottom: 3px; }
.theme-swatch span { display: block; }

/* animations */
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .8); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes pulse-amber { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .7); } 70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .55; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .game { grid-template-columns: 1fr; gap: 12px; }
  .board-col { max-width: min(100%, 640px); }
  .side-col { max-width: 640px; width: 100%; margin: 0 auto; }
  .lobby-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .auth { grid-template-columns: 1fr; gap: 18px; min-height: 0; }
  .auth-hero p { font-size: 15px; }
  .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: 10px 8px; }
  .topbar { padding: 8px 10px; }
  .card { padding: 13px; }
  .player-bar { padding: 8px 10px; min-height: 48px; }
  .points { font-size: 19px; }
  .phase-time { font-size: 20px; }
  .user-btn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .board { border-radius: 6px; }
}
