/* Vazirmatn, served locally */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/vazirmatn-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/vazirmatn-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Saboteur cavern palette: deep stone, warm lantern amber, miner emerald, saboteur crimson */
:root {
  --bg: #0e0c0a;
  --panel: #1a1612;
  --panel2: #241f19;
  --line: rgba(255, 240, 210, 0.12);
  --text: #f5efe6;
  --muted: #b0a391;
  --gold: #e8a43a;
  --green: #5fbf73;
  --red: #e04a5a;
  --top-h: 36px;
  --side-w: 290px;
  --app-height: 100dvh;
  --app-width: 100vw;
  --card-w: 64px;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img { user-select: none; -webkit-user-drag: none; }
button, input { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------- buttons (table) ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 14px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, filter .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #f3c161, var(--gold)); color: #261804; border-color: transparent; }
.btn-ghost { background: rgba(255, 255, 255, .06); }
.btn-danger { background: rgba(224, 74, 90, .20); border-color: rgba(224, 74, 90, .55); color: #ffd6da; }

/* ---------------- splash ---------------- */
.sb-splash-logo { width: 84px; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .65); }
.sb-splash-title { font-size: 26px; font-weight: 900; color: var(--bh-game); }

/* ---------------- BoardBazi bar ---------------- */
.bb-bar {
  display: flex; align-items: center; gap: 10px;
  height: 44px;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  box-sizing: content-box;
  background: rgba(14, 18, 29, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #f8fafc; font-size: 14px;
  position: sticky; top: 0; z-index: 20;
}
.bb-brand, .bb-chip { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.bb-mark { width: 24px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, #6366f1, #06b6d4); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.bb-spacer { flex: 1; }
.bb-avatar { width: 24px; height: 24px; border-radius: 50%; background: #334155; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.bb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.bb-level { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.bb-xp { width: 48px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); overflow: hidden; flex-shrink: 0; }
.bb-xp-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #06b6d4); }
.bb-logout { background: none; border: 1px solid rgba(255, 255, 255, .15); color: #94a3b8; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 13px; }
@media (max-width: 420px) { .bb-word { display: none; } .bb-name { max-width: 90px; } }
body.in-game .bb-bar { display: none; }

/* ---------------- lobby extras (game prefix sb-, shared bh- variables) ---------------- */
.sb-center { flex: 1; justify-content: center; }
.sb-auth-card { width: 100%; }
.sb-wait { text-align: center; margin: 10px 0 0; }
.sb-results { display: flex; flex-direction: column; gap: 16px; }
.sb-results-sheet, .sb-rules-sheet { max-height: calc(var(--app-height) * .92); overflow-y: auto; }
.sb-rules p { margin: 0 0 10px; line-height: 1.8; }
.sb-rules h3 { margin: 16px 0 8px; }
.rules-cards { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.rules-cards li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.rules-cards img { width: 42px; aspect-ratio: 260 / 404; object-fit: cover; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .18); flex-shrink: 0; }

/* ================= GAME ================= */
body.in-game { overflow: hidden; background: radial-gradient(1200px 700px at 30% 20%, #221c15, var(--bg) 72%); }
.app-root { position: relative; min-height: 100dvh; }
body.in-game .app-root { height: var(--app-height); min-height: 0; overflow: hidden; }
body.in-game #bh-root { background: transparent; }
#game-root { font-family: 'Vazirmatn', Tahoma, sans-serif; line-height: 1.45; color: var(--text); }

/* Keep grid spatial layout stable across fa/en while text inherits page dir */
.g-screen {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  height: var(--app-height);
  width: 100%;
  gap: 0 8px;
  padding: 0 max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}
html[dir="rtl"] .g-top,
html[dir="rtl"] .g-players,
html[dir="rtl"] .g-side,
html[dir="rtl"] .g-paused,
html[dir="rtl"] .sheet,
html[dir="rtl"] .toasts { direction: rtl; }

.g-top {
  grid-row: 1; grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  min-width: 0; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.g-icon {
  flex-shrink: 0; width: 32px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text);
  cursor: pointer; font-size: 14px; display: grid; place-items: center; padding: 0;
}
.g-conn { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.g-conn.lost { background: var(--red); animation: blink 1s infinite; }
.g-round { color: var(--muted); flex-shrink: 0; white-space: nowrap; font-size: 12px; }
.g-phase { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.g-phase.mine { color: var(--gold); }
.g-grow { flex: 1; }
.g-deck { color: var(--muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.g-timebar { width: 64px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; flex-shrink: 0; }
.g-timebar-fill { height: 100%; background: var(--muted); transition: width .25s linear; }
.g-timebar-fill.mine { background: var(--gold); }
.g-timebar-fill.urgent { background: var(--red); }
.g-timer { font-variant-numeric: tabular-nums; flex-shrink: 0; color: var(--muted); font-size: 12px; }
.g-timer.urgent { color: var(--red); font-weight: 700; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------------- main stage: players bar + mine board ---------------- */
.g-main {
  grid-row: 2; grid-column: 1;
  display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 6px; padding-top: 6px;
}

.g-players {
  display: flex; align-items: stretch; gap: 6px;
  overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; flex-shrink: 0;
}
.p-chip {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  min-width: 96px; max-width: 170px; flex: 0 0 auto;
  padding: 5px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(26, 22, 18, .92);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer; text-align: start;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.p-chip.active { border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 164, 58, .35); }
.p-chip.me { background: rgba(232, 164, 58, .09); }
.p-chip.offline { opacity: .65; }
.p-chip.selectable { border-color: var(--gold); box-shadow: 0 0 14px rgba(232, 164, 58, .55); animation: pulse 1.3s ease-in-out infinite; }
.p-chip.selected { border-color: #fff; background: rgba(232, 164, 58, .28); animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(232, 164, 58, .2); } }

.p-av {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: var(--panel2); border: 1px solid rgba(255, 255, 255, .14);
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.p-av.miner { background: rgba(95, 191, 115, .24); border-color: var(--green); color: #d5ffe0; }
.p-av.saboteur { background: rgba(224, 74, 90, .28); border-color: var(--red); color: #ffd4d9; }
.p-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.p-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.p-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.p-tools { display: flex; align-items: center; gap: 2px; font-size: 11px; }
.p-tool-bad { display: inline-grid; place-items: center; padding: 0 3px; border-radius: 4px; background: rgba(224, 74, 90, .28); border: 1px solid rgba(224, 74, 90, .6); font-size: 10px; line-height: 14px; }
.p-grace { color: #ffb4a8; font-variant-numeric: tabular-nums; }
.p-ready { color: var(--green); font-weight: 800; }

/* ---------------- interactive mine board ---------------- */
.g-board-wrap {
  position: relative; flex: 1; min-width: 0; min-height: 0;
  border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 45%, #1d1914 0%, #120f0c 70%, #0b0907 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .7);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: default;
}
.g-board-wrap.pannable { cursor: grab; }
.g-board-wrap.pannable.dragging { cursor: grabbing; }
.g-viewport {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.g-grid { position: relative; direction: ltr; }

.g-paused {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 6px 14px; border-radius: 10px;
  background: rgba(26, 22, 18, .94); border: 1px solid rgba(232, 164, 58, .5);
  font-size: 12px; max-width: 90%;
}

.g-zoom-bar {
  position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 12;
  display: flex; gap: 4px;
  background: rgba(18, 15, 12, .88); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.g-zoom-btn {
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .07); color: var(--text);
  font-size: 16px; font-weight: 800; cursor: pointer; display: grid; place-items: center;
}
.g-zoom-btn:hover { background: rgba(255, 255, 255, .14); }
.g-zoom-btn:disabled { opacity: .35; cursor: default; }

/* Cells inside g-grid (260x404 card ratio -> 52x80 logical units, scaled cleanly by viewport) */
.cell {
  position: absolute;
  width: 52px; height: 80px;
  border-radius: 5px;
  overflow: hidden;
  padding: 0; border: 0; background: none;
}
.cell img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  border-radius: 5px;
}
.cell.rot180 img { transform: rotate(180deg); }
.cell.placed { box-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.cell.last-placed { outline: 2px solid rgba(232, 164, 58, .85); outline-offset: -1px; z-index: 2; }
.cell.slot {
  border: 2px dashed rgba(232, 164, 58, .72);
  background: rgba(232, 164, 58, .12);
  cursor: pointer; z-index: 3;
}
.cell.slot:hover { background: rgba(232, 164, 58, .24); }
.cell.preview {
  outline: 2.5px solid #fff;
  box-shadow: 0 0 18px rgba(232, 164, 58, .75);
  z-index: 4;
}
.cell.preview img { opacity: .92; }
.cell.rock-target {
  outline: 2.5px solid var(--red);
  box-shadow: 0 0 16px rgba(224, 74, 90, .7);
  cursor: pointer; z-index: 4;
}
.cell.rock-target.selected { outline: 3px solid #fff; filter: brightness(1.15); }
.cell.map-target {
  outline: 2.5px solid var(--gold);
  box-shadow: 0 0 16px rgba(232, 164, 58, .75);
  cursor: pointer; z-index: 4;
}
.cell-peek-badge {
  position: absolute; inset: auto 4px 4px 4px; z-index: 5;
  padding: 2px 4px; border-radius: 4px; text-align: center;
  font-size: 9px; font-weight: 900; line-height: 1.2;
  background: rgba(14, 12, 10, .9); border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; pointer-events: none;
}
.cell-peek-badge.gold { border-color: var(--gold); color: #ffd97a; }
.cell-peek-badge.coal { border-color: #9ca3af; color: #d1d5db; }

/* ---------------- side control panel ---------------- */
.g-side {
  grid-row: 2; grid-column: 2;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0; padding: 6px 0; overflow-y: auto; scrollbar-width: thin;
}
.g-me {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
}
.me-role-btn {
  position: relative; width: 44px; height: 66px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .24); border-radius: 7px;
  background: #0e0c0a; cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.me-role-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-text { min-width: 0; flex: 1; }
.me-label { font-size: 11px; color: var(--muted); }
.me-role { font-weight: 800; font-size: 14px; line-height: 1.25; }
.me-role.miner { color: #8be89f; }
.me-role.saboteur { color: #ff9ba5; }
.me-gold { font-size: 12px; color: var(--gold); font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; }
.me-hide {
  margin-inline-start: auto; flex-shrink: 0; align-self: flex-start;
  padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); color: var(--muted);
  font: inherit; font-size: 11px; cursor: pointer;
}
.me-hide.on { color: var(--gold); border-color: rgba(232, 164, 58, .55); }

.g-prompt { font-size: 13px; line-height: 1.5; padding: 0 2px; }
.g-prompt p { margin: 0 0 4px; }
.g-prompt .alert { color: #ffb4bd; font-weight: 700; }

.hand-title { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.hand-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.card {
  position: relative; width: var(--card-w); aspect-ratio: 260 / 404;
  padding: 0; border: 2px solid rgba(255, 255, 255, .16); border-radius: 8px;
  background: #14110e; cursor: pointer; color: #fff; overflow: hidden; flex-shrink: 0;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.card.rot180 img { transform: rotate(180deg); }
.card.selected { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 6px 18px rgba(232, 164, 58, .42); }
.card.dim { opacity: .48; }
.card-tag {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 2px 3px; font-size: 9px; font-weight: 800; line-height: 1.15;
  text-align: center; background: rgba(14, 12, 10, .82); color: #f5efe6;
}

.g-actions { display: flex; flex-direction: column; gap: 6px; }
.g-actions .btn { width: 100%; }
.tool-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-picks .btn { flex: 1 1 0; min-height: 38px; font-size: 13px; }
.g-log { display: none; }

/* ---------------- in-game sheets & toasts ---------------- */
.sheet-backdrop { position: absolute; inset: 0; z-index: 50; background: rgba(5, 4, 3, .66); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  position: relative; width: min(560px, 96%); max-height: 88%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px 16px 0 0;
  padding: 14px 16px 16px; box-shadow: 0 -10px 40px rgba(0, 0, 0, .6);
  font-size: 14px; color: var(--text);
}
.sheet-sm { width: min(420px, 96%); }
.sheet-title { margin: 0 0 8px; font-size: 16px; }
.sheet-close { position: absolute; top: 6px; inset-inline-end: 8px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.menu-list { display: grid; gap: 8px; }
.reveal-big { display: flex; gap: 14px; align-items: center; }
.reveal-big > img { width: 92px; aspect-ratio: 260 / 404; object-fit: cover; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .2); flex-shrink: 0; }
.reveal-name { font-size: 18px; font-weight: 800; }
.round-roles { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.round-roles li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.gold-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gold-row img { width: 52px; aspect-ratio: 300 / 466; object-fit: cover; border-radius: 6px; border: 1px solid rgba(232, 164, 58, .55); }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.log-list li, .g-log li { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.log-list li.private, .g-log li.private { font-weight: 800; color: #ffe39a; }
.log-r { display: inline-block; min-width: 18px; margin-inline-end: 6px; color: var(--muted); font-size: 11px; }

.toasts { position: absolute; top: calc(var(--top-h) + 6px); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; width: min(460px, 90%); }
.toast { pointer-events: auto; background: rgba(26, 22, 18, .97); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .55); animation: up .2s ease-out; }
.toast.warn { border-color: rgba(224, 74, 90, .65); }
.toast.good { border-color: rgba(95, 191, 115, .65); }
@keyframes up { from { transform: translateY(-6px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .p-chip.selectable { animation: none; } .toast { animation: none; } }

/* ---------------- phone upright (portrait): players strip + spacious mine on top, control sheet at bottom ---------------- */
body.g-phone.in-game .app-root { zoom: var(--app-zoom, 1); }
body.g-portrait { --card-w: min(62px, 16vw); }
body.g-portrait .g-screen {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr) auto;
  gap: 0; padding: 0;
}
body.g-portrait .g-top { padding: 0 max(6px, env(safe-area-inset-left)); }
body.g-portrait .g-main { grid-row: 2; grid-column: 1; padding: 4px 6px 6px; gap: 4px; }
body.g-portrait .p-chip { min-width: 84px; padding: 4px 6px; font-size: 11px; }
body.g-portrait .p-av { width: 22px; height: 22px; font-size: 11px; }
body.g-portrait .g-side {
  grid-row: 3; grid-column: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 5px;
  max-height: clamp(208px, calc(var(--app-height) * .36), 275px);
  overflow-y: auto;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .5);
}
body.g-portrait .g-me { padding: 4px 7px; gap: 7px; }
body.g-portrait .me-role-btn { width: 32px; height: 48px; }
body.g-portrait .me-role { font-size: 13px; }
body.g-portrait .me-hide-txt { display: none; }
body.g-portrait .g-prompt { font-size: 12px; }
body.g-portrait .hand-title { display: none; }
body.g-portrait .hand-cards { flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 2px 1px; scrollbar-width: thin; }
body.g-portrait .g-actions { flex-direction: row; flex-wrap: wrap; }
body.g-portrait .g-actions .btn { flex: 1 1 0; width: auto; min-height: 40px; padding: 4px 8px; font-size: 12.5px; }
@media (max-height: 700px) {
  body.g-portrait { --card-w: min(56px, 15vw); }
  body.g-portrait .g-side { max-height: clamp(190px, calc(var(--app-height) * .37), 240px); padding-top: 6px; }
}

/* ---------------- compact landscape phones ---------------- */
body.g-tight { --top-h: 30px; --card-w: 50px; }
body.g-tight .g-top { font-size: 12px; gap: 6px; }
body.g-tight .g-me { padding: 4px 6px; }
body.g-tight .me-role-btn { width: 30px; height: 44px; }
body.g-tight .g-prompt { font-size: 12px; }
body.g-tight .btn { min-height: 36px; font-size: 12px; padding: 4px 8px; }
body.g-narrow .g-round, body.g-narrow .g-deck { display: none; }

/* ---------------- desktop and laptop mode ---------------- */
body.g-desktop { --top-h: 46px; --card-w: 94px; }
body.g-desktop .g-screen { max-width: 1760px; margin: 0 auto; gap: 0 16px; padding: 0 16px 14px; }
body.g-desktop .g-top { font-size: 15px; gap: 12px; }
body.g-desktop .g-icon { width: 36px; height: 32px; font-size: 16px; }
body.g-desktop .g-timebar { width: 140px; }
body.g-desktop .g-main { gap: 10px; padding-top: 10px; }
body.g-desktop .p-chip { min-width: 118px; padding: 7px 10px; font-size: 13px; }
body.g-desktop .p-av { width: 30px; height: 30px; font-size: 13px; }
body.g-desktop .g-side { gap: 10px; padding-top: 10px; }
body.g-desktop .g-me { padding: 10px 12px; }
body.g-desktop .me-role-btn { width: 54px; height: 82px; }
body.g-desktop .me-role { font-size: 16px; }
body.g-desktop .g-prompt { font-size: 14px; }
body.g-desktop .hand-cards { gap: 8px; }
body.g-desktop .card-tag { font-size: 10px; }
body.g-desktop .g-log {
  display: block; list-style: none; margin: 0; padding: 8px 10px;
  flex: 1; min-height: 110px; overflow-y: auto; font-size: 12.5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: #dcd2c4;
}
body.g-desktop .sheet-backdrop { align-items: center; }
body.g-desktop .sheet { border-radius: 16px; }
