/* ─────────────────────────────────────────────
 * 한봇 오늘의 그림 (2026-11-12) — SPEC §7 디자인 토큰
 * 소재: 모눈 도안지와 도안 연필. 판(종이)은 밝은·어두운 화면 모두 같은 색, 바깥 패널은 사이트 토큰을 그대로 쓴다.
 * 도안지 #EDF3F7 · 모눈선 #B5C9D6(5칸마다 #6F8CA0) · 먹남색 #1F3147 · 지우개 회색 #93A3B1 · 한봇 호박 #F5B70A · 한봇 하늘 #45C4F5
 * 시그니처(하나): 완성하는 순간 칠한 칸이 가운데에서 바깥으로 원본 그림 색으로 물들고(.gr-bleed), 모눈이 걷히며 원본 그림이 놓인다(.gr-shown).
 * ───────────────────────────────────────────── */
.gr-root, .chat-fab, .chat-panel {
    --gr-paper: #EDF3F7;
    --gr-rule: #B5C9D6;
    --gr-rule-5: #6F8CA0;
    --gr-ink: #1F3147;
    --gr-cross: #93A3B1;
    --gr-amber: #F5B70A;
    --gr-sky: #45C4F5;
    --gr-amber-ink: #231800;        /* 호박 바탕 위 글자 */
}

.gr-root {
    background: var(--bg-base);
    color: var(--text-sub);
    min-height: calc(100vh - var(--topbar-h, 0px));
}
.gr-root [hidden] { display: none !important; }
.gr-root :focus-visible, .chat-panel :focus-visible { outline: 2px solid var(--gr-sky); outline-offset: 2px; }
.gr-root .wrap { max-width: min(96%, 2400px); margin: 0 auto; padding: 12px 16px 90px; }
.gr-root .top-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.gr-root .page-title {
    font-family: "hb-games-display", var(--font-sans); font-weight: 400; color: var(--text-main); margin: 0;
    font-size: clamp(1.4rem, 1.1rem + 0.8vw, 2.2rem);
}
.gr-root .page-sub { font-size: 0.82rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.gr-root .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gr-admin-link { margin-left: auto; }
.gr-root .back-btn { display: inline-flex; align-items: center; font-size: 0.82rem; color: var(--text-dim); text-decoration: none; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.gr-root .back-btn:hover { color: var(--text-main); border-color: var(--border-strong); }

/* 버튼 — 주 행동은 한봇 호박 */
.gr-root .big-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
    background: var(--gr-amber); border: 1.5px solid var(--gr-amber); border-radius: var(--radius);
    color: var(--gr-amber-ink); font-family: inherit; font-size: 0.92rem; font-weight: 800; padding: 10px 20px; cursor: pointer;
}
.gr-root .big-btn:hover:not(:disabled) { filter: brightness(1.06); }
.gr-root .big-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gr-root .mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-sub); font-family: inherit; font-size: 0.8rem; padding: 7px 11px; cursor: pointer; white-space: nowrap; }
.gr-root .mini-btn:hover:not(:disabled) { color: var(--text-main); border-color: var(--gr-amber); }
.gr-root .mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gr-root .chip-btn { display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 0.78rem; color: var(--text-sub); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 13px; cursor: pointer; white-space: nowrap; }
.gr-root .chip-btn:hover { color: var(--text-main); }
.gr-root .chip-btn.on { color: var(--text-main); border-color: var(--gr-amber); background: color-mix(in srgb, var(--gr-amber) 20%, var(--bg-card)); font-weight: 700; }
.gr-root .filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.gr-tag { display: inline-block; font-size: 0.68rem; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--text-dim); vertical-align: 1px; }
.gr-root .title-chip { font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; background: rgba(var(--fg-rgb), 0.08); color: var(--text-sub); }
.gr-ico { width: 1.25em; height: 1.25em; object-fit: contain; flex: none; }

/* 머리 줄 — 판 고르기 · 연속 */
.gr-kinds { display: inline-flex; gap: 6px; }
.gr-kmark { font-weight: 800; color: var(--text-main); }
.gr-streak { display: inline-flex; align-items: center; gap: 5px; font-size: 0.84rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.gr-closed { margin: 12px 0 0; padding: 12px 16px; border: 1px solid rgba(var(--warn-rgb, 255, 143, 69), 0.45); border-radius: var(--radius); color: var(--text-main); font-size: 0.9rem; background: var(--bg-card); }
.gr-carry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--gr-amber); border-radius: var(--radius); font-size: 0.84rem; color: var(--text-main); background: color-mix(in srgb, var(--gr-amber) 10%, var(--bg-card)); }

/* 탭 */
.gr-tabs { margin: 12px 0 10px; }
.gr-root .tab-pane { display: none; }
.gr-root .tab-pane.on { display: block; }

/* ── 배치: 가운데 도안지 한 장, 그 옆(휴대폰은 아래)에 도구와 기록 ── */
.gr-stage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 640px); gap: clamp(12px, 1.2vw, 28px); align-items: start; }
.gr-col { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ── 도안지 ──
 * --gr-u = 칸 수 + 행 단서 폭(칸 단위), --gr-v = 칸 수 + 열 단서 높이(칸 단위) — geurim-page.js가 판마다 넣는다.
 * 좁은 화면은 가로가 크기를 정하고(칸 44px 상한), PC는 남은 높이 --gr-bh에 맞춘다(칸 18~44px). */
.gr-boardbox {
    --gr-u: 10; --gr-v: 10; --gr-zoom: 1;
    position: relative; width: min(100%, calc(44px * var(--gr-u)));
    background: var(--gr-paper); border: 1px solid var(--gr-rule-5); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 961px) {
    .gr-boardbox { width: clamp(calc(18px * var(--gr-u)), min(100%, calc(var(--gr-bh, 70vh) * var(--gr-u) / var(--gr-v))), calc(44px * var(--gr-u))); }
}
.gr-scroll { width: 100%; aspect-ratio: var(--gr-u) / var(--gr-v); overflow: hidden; overscroll-behavior: contain; }
.gr-boardbox.zoomed .gr-scroll { overflow: auto; }
.gr-board {
    width: calc(100% * var(--gr-zoom)); aspect-ratio: var(--gr-u) / var(--gr-v);
    display: grid; container-type: inline-size;
    color: var(--gr-ink); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.gr-board > * { --c: calc(100cqw / var(--gr-u)); min-width: 0; min-height: 0; }
.gr-corner { position: sticky; top: 0; left: 0; z-index: 3; background: var(--gr-paper); }
.gr-cc { position: sticky; top: 0; z-index: 2; background: var(--gr-paper); display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.gr-rc { position: sticky; left: 0; z-index: 2; background: var(--gr-paper); display: grid; grid-template-rows: repeat(var(--n), minmax(0, 1fr)); }
.gr-cl { display: flex; align-items: center; justify-content: flex-end; font-size: calc(var(--c) * 0.5); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; min-width: 0; min-height: 0; }
.gr-rc .gr-cl { gap: calc(var(--c) * 0.2); padding-right: calc(var(--c) * 0.16); }
.gr-cc .gr-cl { flex-direction: column; gap: calc(var(--c) * 0.1); padding-bottom: calc(var(--c) * 0.14); }
.gr-cl.gr-done { color: var(--gr-cross); }
.gr-cl.hl { background: color-mix(in srgb, var(--gr-amber) 34%, var(--gr-paper)); }
.gr-picking .gr-cl { cursor: pointer; }
.gr-picking .gr-cl:hover { background: color-mix(in srgb, var(--gr-sky) 34%, var(--gr-paper)); }
.gr-cl:focus-visible { outline: 2px solid var(--gr-sky); outline-offset: -2px; }

.gr-gridwrap { position: relative; touch-action: none; border-left: 2px solid var(--gr-rule-5); border-top: 2px solid var(--gr-rule-5); cursor: crosshair; }
.gr-grid { width: 100%; height: 100%; display: grid; grid-template-rows: repeat(var(--n), minmax(0, 1fr)); }
.gr-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); min-height: 0; }
.gr-c { position: relative; min-width: 0; min-height: 0; border-right: 1px solid var(--gr-rule); border-bottom: 1px solid var(--gr-rule); }
.gr-c:nth-child(5n) { border-right: 2px solid var(--gr-rule-5); }
.gr-row:nth-child(5n) > .gr-c { border-bottom: 2px solid var(--gr-rule-5); }
.gr-c.f::after { content: ""; position: absolute; inset: 1px; border-radius: 2px; background: var(--gr-ink); }
.gr-c.x::after, .gr-c.lk:not(.f)::after {
    content: ""; position: absolute; inset: 20%;
    background:
        linear-gradient(45deg, transparent 43%, var(--gr-cross) 43% 57%, transparent 57%),
        linear-gradient(-45deg, transparent 43%, var(--gr-cross) 43% 57%, transparent 57%);
}
/* 힌트로 연 줄 — 하늘색 테두리, 못 바꿈 */
.gr-c.lk { background: color-mix(in srgb, var(--gr-sky) 16%, transparent); }
.gr-c.lkr { box-shadow: inset 0 2px 0 var(--gr-sky), inset 0 -2px 0 var(--gr-sky); }
.gr-c.lkc { box-shadow: inset 2px 0 0 var(--gr-sky), inset -2px 0 0 var(--gr-sky); }
.gr-c.lkr.lkc { box-shadow: inset 0 0 0 2px var(--gr-sky); }
.gr-c:focus { outline: none; }
.gr-c:focus-visible { outline: 2px solid var(--gr-sky); outline-offset: -2px; z-index: 1; }
/* 지금 줄·칸 강조 띠 */
.gr-band { position: absolute; pointer-events: none; background: color-mix(in srgb, var(--gr-amber) 20%, transparent); }
.gr-band-r { left: 0; right: 0; height: calc(100% / var(--n)); top: calc(100% / var(--n) * var(--hr, 0)); }
.gr-band-c { top: 0; bottom: 0; width: calc(100% / var(--n)); left: calc(100% / var(--n) * var(--hc, 0)); }
/* 시작 전 — 흐린 빈 모눈 */
.gr-board.gr-blank { opacity: 0.5; }
.gr-board.gr-blank .gr-gridwrap, .gr-board.gr-over .gr-gridwrap { cursor: default; }

/* 판 위 덮개 — 시작 버튼 · 마감 안내 */
.gr-cover { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; }
.gr-cover .big-btn { font-size: clamp(1rem, 0.9rem + 0.4vw, 1.3rem); padding: 14px 30px; }
.gr-cover p { margin: 0; max-width: 30em; font-size: 0.86rem; line-height: 1.6; color: var(--gr-ink); font-weight: 600; word-break: keep-all; }

/* ── 시그니처: 도안이 그림이 된다 ── */
.gr-pic { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; }
.gr-pic img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; }
.gr-board.gr-bleed .gr-c.f::after { animation: gr-bleed 0.45s ease-out both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes gr-bleed { from { background: var(--gr-ink); } to { background: var(--pc, var(--gr-ink)); } }
.gr-board.gr-shown .gr-pic { opacity: 1; transition: opacity 0.35s ease; }
.gr-board.gr-shown .gr-c { border-color: transparent; transition: border-color 0.35s ease; }
.gr-board.gr-shown .gr-c::after { opacity: 0; transition: opacity 0.35s ease; }
.gr-board.gr-shown .gr-gridwrap { border-color: transparent; transition: border-color 0.35s ease; }
.gr-board.gr-shown .gr-cl { color: var(--gr-cross); }
.gr-name { margin: 2px 0 0; font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.3rem); color: var(--text-sub); text-align: center; }
.gr-name b { font-family: "hb-games-display", var(--font-sans); font-weight: 400; font-size: 1.25em; color: var(--text-main); margin: 0 2px; }
.gr-pickmsg { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 0; font-size: 0.84rem; color: var(--text-main); }

/* ── 옆 칸: 시계 · 도구 · 결과 ── */
.gr-clockrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.gr-clock { display: inline-flex; align-items: center; gap: 6px; font-family: "hb-games-display", var(--font-sans); font-weight: 400; font-size: clamp(1.6rem, 1.3rem + 0.9vw, 2.6rem); color: var(--text-main); line-height: 1; }
.gr-clock .gr-ico { width: 0.8em; height: 0.8em; }
.gr-pen { font-size: 0.84rem; font-weight: 700; color: var(--danger); }
.gr-saved { margin-left: auto; font-size: 0.74rem; color: var(--text-dim); }
.gr-dock { display: flex; flex-direction: column; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; }
.gr-toolrow { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-tool { flex: 1 1 0; }
.gr-root .gr-tool[aria-pressed="true"] { background: var(--gr-ink); border-color: var(--gr-ink); color: #fff; font-weight: 700; }
.gr-root .gr-zoombtn { border-color: var(--gr-sky); }
.gr-acts { display: flex; gap: 8px; }
.gr-acts .mini-btn { flex: 1 1 0; border-color: var(--gr-sky); }
.gr-acts .big-btn { flex: 1.4 1 0; }
.gr-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 0.76rem; line-height: 1.5; color: var(--text-dim); cursor: pointer; word-break: keep-all; }
.gr-opt input { margin: 3px 0 0; accent-color: var(--gr-amber); flex: none; }
.gr-keys { margin: 0; font-size: 0.72rem; line-height: 1.6; color: var(--text-dim); }
.gr-dock.gr-dock-ex :is(.gr-row2, .gr-acts, .gr-opt, .gr-keys) { display: none; }
.gr-dock.gr-dock-ex { order: -1; }   /* 로그인 전 예시 판 — 도구를 옆 칸 맨 위에 */

.gr-intro { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.gr-intro h2, .gr-h { font-size: 0.92rem; color: var(--text-main); margin: 0 0 6px; }
.gr-rule-list { margin: 0; padding-left: 1.3em; font-size: 0.84rem; line-height: 1.75; color: var(--text-sub); word-break: keep-all; }
.gr-rule-list b { color: var(--text-main); }
.gr-ex-msg { margin: 8px 0 0; font-size: 0.84rem; color: var(--text-main); font-weight: 700; }
.gr-today { margin: 0; font-size: 0.8rem; color: var(--text-dim); font-variant-numeric: tabular-nums; line-height: 1.7; }
.gr-today b { color: var(--text-main); }
.gr-today:empty { display: none; }

.login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; }
.login-box h3 { font-family: "hb-games-display", var(--font-sans); font-weight: 400; font-size: 1.25rem; color: var(--text-main); margin: 0 0 8px; }
.login-box p { font-size: 0.82rem; color: var(--text-dim); line-height: 1.75; margin: 0 0 14px; }

.gr-result { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--gr-amber); border-radius: var(--radius-lg); padding: 14px 16px; }
.gr-res-title { font-family: "hb-games-display", var(--font-sans); font-weight: 400; font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.8rem); color: var(--text-main); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.gr-res-list { list-style: none; margin: 0 0 10px; padding: 0; font-size: 0.86rem; line-height: 1.8; font-variant-numeric: tabular-nums; }
.gr-res-list li { display: flex; justify-content: space-between; gap: 12px; }
.gr-res-list b { color: var(--text-main); }
.gr-res-list .sum { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; font-weight: 800; color: var(--text-main); }
.gr-res-note { margin: 0 0 8px; font-size: 0.82rem; line-height: 1.6; color: var(--text-sub); }
.gr-res-note b { color: var(--text-main); }
.gr-share { margin: 0 0 10px; padding: 10px 12px; background: var(--bg-deep); border-radius: var(--radius); font-family: inherit; font-size: 0.84rem; line-height: 1.5; white-space: pre-wrap; color: var(--text-main); font-variant-numeric: tabular-nums; }
.gr-res-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.gr-next { font-size: 0.82rem; color: var(--text-dim); }
.gr-next b { font-family: "hb-games-display", var(--font-sans); font-weight: 400; font-size: 1.2rem; color: var(--text-main); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ── 순위 · 도감 · 내 기록 · 규칙 ── */
.gr-rank td, .gr-rank th { font-size: 0.82rem; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border-dim); }
.gr-rank th { font-size: 0.72rem; color: var(--text-dim); font-weight: 600; white-space: nowrap; border-bottom-color: var(--border); }
.gr-rank .num { text-align: right; white-space: nowrap; }
.gr-rank td:nth-child(2) { color: var(--text-main); word-break: break-all; }
.gr-root .empty-state { padding: 24px 12px; font-size: 0.86rem; line-height: 1.7; }
.gr-note { font-size: 0.76rem; color: var(--text-dim); margin: 6px 0 0; }
.gr-rank-side { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }

.gr-sum { margin: 0 0 10px; font-size: 0.92rem; color: var(--text-sub); }
.gr-sum b { color: var(--text-main); font-variant-numeric: tabular-nums; }
.gr-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 6px 16px; margin: 0 0 14px; }
.gr-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.2em; align-items: center; gap: 2px 8px; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.gr-bar-row span { color: var(--text-sub); }
.gr-bar-row b { color: var(--text-main); text-align: right; }
.gr-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(var(--fg-rgb), 0.08); overflow: hidden; }
.gr-bar i { display: block; height: 100%; background: var(--gr-amber); }
.gr-codex { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 9vw, 190px), 1fr)); gap: 10px; }
.gr-card { display: flex; flex-direction: column; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-width: 0; }
.gr-card-pic { aspect-ratio: 1; background: var(--gr-paper); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gr-card-pic img { width: 86%; height: 86%; object-fit: contain; }
.gr-card b { font-size: 0.84rem; color: var(--text-main); word-break: keep-all; }
.gr-card small { font-size: 0.7rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.gr-card.gr-unknown .gr-card-pic { color: var(--gr-rule-5); font-family: "hb-games-display", var(--font-sans); font-size: 2.4rem; }
.gr-codex-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 12px; text-align: center; font-size: 0.9rem; color: var(--text-sub); }

.me-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.me-cell { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.mc-label { font-size: 0.7rem; color: var(--text-dim); }
.mc-value { font-size: 1.05rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.gr-root .gr-h { margin: 16px 0 6px; }
.gr-recent td, .gr-recent th { font-size: 0.8rem; padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border-dim); white-space: nowrap; }
.gr-recent th { font-size: 0.72rem; color: var(--text-dim); font-weight: 600; }
.gr-titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.gr-title-item { display: flex; flex-direction: column; gap: 3px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-size: 0.8rem; color: var(--text-main); }
.gr-title-item small { color: var(--text-dim); }
.gr-title-item.locked { opacity: 0.55; }
.gr-title-item .mini-btn, .gr-title-item .gr-tag { align-self: flex-start; }
.gr-ach { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.gr-ach li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 0.8rem; color: var(--text-dim); }
.gr-ach li.done { border-style: solid; border-color: var(--gr-amber); color: var(--text-main); }
.gr-ach small { color: var(--text-dim); }
.gr-rules { max-width: 62em; font-size: 0.88rem; line-height: 1.8; color: var(--text-sub); word-break: keep-all; }
.gr-rules ul { margin: 0 0 6px; padding-left: 1.3em; }
.gr-rules b { color: var(--text-main); }
.gr-rules table { border-collapse: collapse; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.gr-rules th, .gr-rules td { font-size: 0.82rem; padding: 5px 12px; border-bottom: 1px solid var(--border-dim); text-align: right; white-space: nowrap; }
.gr-rules th:first-child, .gr-rules td:first-child { text-align: left; }
.gr-rules th { color: var(--text-dim); font-weight: 600; }

/* ── 4K — 큰 화면은 글자도 함께 키움 ── */
@media (min-width: 2400px) {
    .gr-root { font-size: 1.2rem; }
    .gr-root .chip-btn, .gr-root .tab-btn, .gr-root .mini-btn { font-size: 0.98rem; }
    .gr-root .big-btn { font-size: 1.1rem; }
    .gr-rank td, .gr-rank th, .gr-rule-list, .gr-today, .gr-res-list, .gr-rules, .gr-opt, .gr-keys { font-size: 1rem; }
}

/* ── 태블릿·휴대폰 — 시계 위, 도안지, 도구 줄은 판 아래에 붙음 ── */
@media (max-width: 1024px) {
    .gr-root .wrap { max-width: 100%; }
    .gr-stage { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
    .gr-side { display: contents; }
    .gr-clockrow { order: -1; }
    .gr-rank-side { display: none; }
    .gr-boardbox { max-width: 720px; }
    .gr-dock { position: sticky; bottom: 0; z-index: 20; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18); }
    .gr-keys { display: none; }
    /* 로그인 전 예시 판 — 도구는 판 바로 아래 제자리에(붙이지 않음), 규칙·로그인 상자는 그 아래 */
    .gr-dock.gr-dock-ex { position: static; order: 0; border-radius: var(--radius-lg); box-shadow: none; }
    .gr-intro, .login-box { order: 1; }
    /* 채팅 단추(오른쪽 아래 고정)가 도구 줄의 버튼을 가리지 않게 맨 아래 설정 줄 오른쪽을 비워 둔다 */
    .gr-opt { min-height: 46px; align-items: center; padding-right: 116px; }
    .gr-opt input { margin: 0; }
}
@media (max-width: 640px) {
    .gr-root .wrap { padding: 10px 8px 90px; }
    .gr-boardbox { max-width: none; }
    .gr-dock { padding: 8px; gap: 6px; }
    .gr-root .mini-btn, .gr-root .chip-btn { min-height: 38px; }
    .gr-root .mini-btn { padding: 7px 8px; }
    .gr-opt { font-size: 0.72rem; }
    .gr-codex { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
}

/* ── 모션 줄이기 — 번짐 없이 바로 원본 그림 ── */
@media (prefers-reduced-motion: reduce) {
    .gr-board.gr-bleed .gr-c.f::after { animation: none; }
    .gr-board.gr-shown :is(.gr-pic, .gr-c, .gr-c::after, .gr-gridwrap) { transition: none; }
}
body[data-hb-chat] :is(.chat-fab, .chat-panel) { --chat-accent: var(--gr-amber); --chat-accent-ink: var(--gr-amber-ink); } /* 채팅 단추·창 공용 규칙(style.css)에 넘기는 이 게임 색 */
