/* ─────────────────────────────────────────────
 * 단청 무늬 (2026-11-13) — specs/dancheong.md §6 디자인 토큰. 소재: 단청의 바탕칠 뇌록, 오방색 안료, 금박 선, 전각 도리의 나뭇결
 * 뇌록 바탕 #2E5247 · 뇌록 상자 #3A6356 · 장지 글자 #F3EEE2 · 금선 #E0B03A(내 차례·고를 수 있음) · 석간주 #8E3B2A(흘린 물감) · 경고 #E2604A
 * 조각: 청 #2C6FAE · 적 #C2412F · 황 #E3B23C · 백 #F1EBDD · 흑 #26221F (문양으로도 구분 — 연꽃잎·마름모·원·네 잎·가로띠)
 * 서체: 본문 고딕(공용), 점수 숫자만 도현(hb-games-display).
 * 시그니처(하나): 옮기기 때 새 조각이 붓질처럼 번지며 자리 잡고, 다 채운 가로 줄을 따라 금선이 한 번 지나감(.dc-new · .dc-gold).
 * 배치·단추·설정 칸은 공용 public/css/boardgame/room.css — 여기선 토큰과 공방·판만.
 * ───────────────────────────────────────────── */
.dc-root, .chat-fab, .chat-panel {
    --dc-noerok: #2E5247;
    --dc-noerok-2: #3A6356;
    --dc-paper: #F3EEE2;
    --dc-gold: #E0B03A;
    --dc-seokgan: #8E3B2A;
    --dc-wood: #6b4a33;
    --dc-c0: #2C6FAE;
    --dc-c1: #C2412F;
    --dc-c2: #E3B23C;
    --dc-c3: #F1EBDD;
    --dc-c4: #26221F;
    --bg-bg: var(--dc-noerok);
    --bg-panel: var(--dc-noerok-2);
    --bg-line: color-mix(in srgb, var(--dc-gold) 22%, var(--dc-noerok-2));
    --bg-ink: var(--dc-paper);
    --bg-dim: color-mix(in srgb, var(--dc-paper) 64%, var(--dc-noerok));
    --bg-accent: var(--dc-gold);
    --bg-accent-ink: #2B2622;
    --bg-warn: #E2604A;
    --chat-accent: var(--dc-gold);
    --chat-accent-ink: #2B2622;
}
.dc-board {
    width: 100%; color: var(--bg-ink); position: relative;
    --dc-cell: clamp(22px, calc((100vw - 64px) / 12.2), 34px);
    --dc-dt: calc(var(--dc-cell) * 0.86);
    background: var(--dc-noerok); border-radius: 16px; padding: 10px;
}
.dc-layout { display: grid; gap: 10px; grid-template-areas: "opps" "work" "me" "log"; grid-template-columns: minmax(0, 1fr); }
.dc-opps { grid-area: opps; display: flex; gap: 6px; flex-wrap: wrap; }
.dc-work { grid-area: work; display: grid; gap: 8px; align-content: start; }
.dc-me { grid-area: me; display: grid; gap: 8px; align-content: start; justify-items: center; }
.dc-log { grid-area: log; list-style: none; margin: 0; padding: 0; font-size: 0.78rem; color: var(--bg-dim); display: grid; gap: 2px; }
.dc-log li:first-child { color: var(--bg-ink); }
.dc-log b { color: var(--dc-gold); font-weight: 700; }

/* 조각 */
.dc-tile { display: inline-grid; place-items: center; width: var(--dc-dt); height: var(--dc-dt); border-radius: 22%; flex: none; }
.dc-tile img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.4)); }
.dc-tile.c4 img { filter: drop-shadow(0 0 1px rgba(243, 238, 226, 0.35)) drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.4)); } /* 흑 조각이 어두운 칸에 묻히지 않게 */
.dc-tile.sm { width: calc(var(--dc-cell) - 4px); height: calc(var(--dc-cell) - 4px); }
.dc-tile.xs { width: 1em; height: 1em; border-radius: 4px; }
.dc-tile.ghost { opacity: 0.45; }
.dc-tile.hintimg { opacity: 0.22; } /* 고정 판 자리 색 — 문양까지 옅게 */

/* 공방 */
.dc-dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--dc-dt) * 2 + 22px), 1fr)); gap: 8px; }
.dc-dish { position: relative; display: grid; grid-template-columns: repeat(2, var(--dc-dt)); gap: 4px; justify-content: center; align-content: center; padding: 9px 6px 6px; min-height: calc(var(--dc-dt) * 2 + 19px);
    border-radius: 50%; background: url("/img/dancheong/art/dish.png") center / contain no-repeat; border: 2px solid transparent; }
.dc-dish.empty { opacity: 0.45; }
.dc-dish.sel { border-color: var(--dc-gold); }
.dc-dishno { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); font-size: 0.62rem; font-weight: 800; color: #5a4a3a; }
.dc-pick { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 7px; line-height: 0; color: inherit; font: inherit; }
.dc-pick:disabled { cursor: default; }
.dc-pick.on .dc-tile { outline: 2.5px solid var(--dc-gold); outline-offset: 1px; transform: translateY(-2px); }
.dc-pick:focus-visible { outline: 3px solid var(--dc-gold); outline-offset: 2px; }
.dc-center { background: url("/img/dancheong/art/hamji.png") center / 100% 100% no-repeat, color-mix(in srgb, var(--dc-wood) 40%, var(--dc-noerok)); border: 2px solid transparent; border-radius: 14px; padding: 6px 10px; display: flex; gap: 10px; align-items: center; min-height: calc(var(--dc-dt) + 18px); }
.dc-center.sel { border-color: var(--dc-gold); }
.dc-clabel { font-weight: 800; font-size: 0.8rem; color: var(--dc-paper); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); writing-mode: vertical-rl; letter-spacing: 0.1em; }
.dc-cbody { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dc-cgroup { display: inline-flex; align-items: center; gap: 3px; line-height: 1; padding: 2px 4px; }
.dc-cgroup b { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--dc-paper); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); }
.dc-marker { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; font-size: 0.62rem; color: var(--bg-dim); line-height: 1.1; }
.dc-empty { color: var(--bg-dim); font-size: 0.8rem; }
.dc-bag { font-size: 0.78rem; color: var(--bg-dim); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dc-bagc { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }

/* 단청장 판 — 밑그림 줄 | 도리 판 */
.dc-pboard { background: var(--dc-noerok-2); border: 1px solid var(--bg-line); border-radius: 14px; padding: 8px 10px; display: grid; gap: 6px; width: max-content; max-width: 100%; }
.dc-pboard.turn { border-color: var(--dc-gold); box-shadow: 0 0 0 1px var(--dc-gold); }
.dc-phead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dc-pname { font-weight: 800; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 4px; }
.dc-score { font-family: "hb-games-display", var(--font-sans); font-size: 1.5rem; color: var(--dc-gold); font-variant-numeric: tabular-nums; line-height: 1; }
.dc-score small { font-family: var(--font-sans); font-size: 0.7rem; color: var(--bg-dim); margin-left: 2px; }
.dc-pgrid { display: grid; grid-template-columns: auto auto; gap: 8px; }
.dc-lines, .dc-wall { display: grid; gap: 2px; grid-template-rows: repeat(5, var(--dc-cell)); }
.dc-lines { justify-items: end; padding: 3px; border-radius: 8px; background: var(--dc-paper) url("/img/dancheong/art/board-chobon.webp") center / cover; }
.dc-line { display: flex; justify-content: flex-end; gap: 2px; width: max-content; padding: 0; border: 0; background: none; color: inherit; font: inherit; border-radius: 6px; }
button.dc-line.ok { cursor: pointer; background: color-mix(in srgb, var(--dc-gold) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--dc-gold); }
button.dc-line:disabled { cursor: default; }
button.dc-line:focus-visible, .dc-floor:focus-visible, .dc-wcell.pick:focus-visible, .dc-oppbtn:focus-visible { outline: 3px solid var(--dc-gold); outline-offset: 2px; }
.dc-cell, .dc-wcell, .dc-fcell { width: var(--dc-cell); height: var(--dc-cell); border-radius: 6px; display: grid; place-items: center; flex: none; }
.dc-cell { background: color-mix(in srgb, var(--dc-noerok-2) 14%, transparent); box-shadow: inset 0 0 0 1px rgba(70, 50, 30, 0.35); }
.dc-wall { padding: 3px; border-radius: 8px; background: var(--dc-noerok-2) url("/img/dancheong/art/board-dori.webp") center / cover; }
.dc-wrow { display: flex; gap: 2px; position: relative; border-radius: 6px; }
.dc-wcell { background: color-mix(in srgb, color-mix(in srgb, #000 30%, var(--dc-wood)) 30%, transparent); }
.dc-wcell.hint.c0 { background: color-mix(in srgb, var(--dc-c0) 36%, #2a1d14); }
.dc-wcell.hint.c1 { background: color-mix(in srgb, var(--dc-c1) 34%, #2a1d14); }
.dc-wcell.hint.c2 { background: color-mix(in srgb, var(--dc-c2) 32%, #2a1d14); }
.dc-wcell.hint.c3 { background: color-mix(in srgb, var(--dc-c3) 40%, #2a1d14); }
.dc-wcell.hint.c4 { background: color-mix(in srgb, #000 55%, #2a1d14); }
.dc-wcell.pick { border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 2px var(--dc-gold); background: color-mix(in srgb, var(--dc-gold) 20%, var(--dc-wood)); }
.dc-wrow.done { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--dc-gold) 70%, transparent); }
.dc-frow { display: flex; align-items: center; gap: 6px; }
.dc-flabel { font-size: 0.72rem; color: var(--bg-dim); white-space: nowrap; }
.dc-floor { display: flex; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; border-radius: 6px; }
button.dc-floor.ok { cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--dc-gold); }
.dc-fcell { position: relative; background: url("/img/dancheong/art/spill.webp") center / 78% no-repeat, color-mix(in srgb, var(--dc-seokgan) 45%, var(--dc-noerok-2)); }
.dc-fcell small { position: absolute; top: 0; left: 2px; font-size: 0.55rem; color: color-mix(in srgb, var(--dc-paper) 70%, transparent); line-height: 1; }
.dc-fcell .dc-tile { position: relative; z-index: 1; }
.dc-hasmark .dc-tile { width: 1.1em; height: 1.1em; }
.dc-hint { margin: 0; font-size: 0.86rem; text-align: center; }
.dc-hint b { color: var(--dc-gold); }
.dc-guide, .dc-keys { margin: 0; text-align: center; }
.dc-spectate, .dc-wait { text-align: center; }
.dc-wait { padding: 24px 12px; }

/* 다른 단청장 — 휴대폰은 칩, 누르면 판 펼침 */
.dc-opp { flex: 1 1 120px; background: var(--dc-noerok-2); border: 1px solid var(--bg-line); border-radius: 12px; min-width: 0; }
.dc-opp.turn { border-color: var(--dc-gold); }
.dc-oppbtn { width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 6px 10px; display: grid; gap: 1px; cursor: pointer; border-radius: 12px; min-height: 44px; }
.dc-oname { font-weight: 800; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-opp.turn .dc-oname::before { content: "● "; color: var(--dc-gold); }
.dc-ostat { font-size: 0.75rem; color: var(--bg-dim); }
.dc-ostat b { color: var(--dc-gold); }
.dc-oboard { display: none; padding: 0 6px 6px; }
.dc-opp.open { flex-basis: 100%; }
.dc-opp.open .dc-oboard { display: block; }
.dc-oboard .dc-pboard { border: 0; padding: 4px; margin: 0 auto; background: transparent; }
.dc-oboard .dc-phead { display: none; }
.dc-dot { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 3px; border-radius: 999px; background: var(--dc-gold); color: var(--bg-accent-ink); font-weight: 800; font-size: 0.72rem; font-variant-numeric: tabular-nums; }

/* 시그니처 — 붓질로 번지는 새 조각 + 다 채운 줄 금선 */
.dc-new .dc-tile { animation: dc-brush 0.6s cubic-bezier(0.3, 0.6, 0.2, 1) both; animation-delay: var(--dc-d, 0ms); }
@keyframes dc-brush { 0% { clip-path: inset(0 100% 0 0 round 22%); filter: saturate(0.3) brightness(1.4); } 70% { clip-path: inset(0 0 0 0 round 22%); } 100% { clip-path: inset(0 0 0 0 round 22%); filter: none; } }
.dc-gold::after { content: ""; position: absolute; left: 0; top: 50%; height: 3px; width: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, transparent, var(--dc-gold) 20%, #fff3c4 50%, var(--dc-gold) 80%, transparent); border-radius: 2px; animation: dc-goldline 0.6s ease-out 0.45s both; pointer-events: none; }
@keyframes dc-goldline { 0% { transform: scaleX(0); opacity: 1; } 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.dc-flashed { animation: dc-blink 0.6s ease-out 1; }
@keyframes dc-blink { 30% { box-shadow: 0 0 0 2px var(--dc-gold); } }

/* PC — 왼쪽 공방, 가운데 내 판, 오른쪽 다른 단청장 판 */
@media (min-width: 900px) {
    .dc-board { --dc-cell: clamp(26px, calc((var(--bg-board) - 150px) / 8.4), 58px); }
    .dc-layout { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "work me" "opps opps" "log log"; align-items: start; }
    .dc-opps { flex-wrap: wrap; --dc-cell: clamp(15px, calc(var(--bg-board) / 24), 30px); --dc-dt: var(--dc-cell); }
    .dc-opp { flex: 0 1 auto; }
    .dc-oboard { display: block; }
    .dc-oppbtn { cursor: default; pointer-events: none; }
    .dc-dishes { --dc-dt: calc(var(--dc-cell) * 0.82); }
    .dc-keys { display: block; }
}
/* 넓은 화면 — 오른쪽에 다른 단청장 판 세로 줄 */
@media (min-width: 1500px) {
    .dc-layout { grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 0.9fr); grid-template-areas: "work me opps" "log log log"; }
    .dc-opps { flex-direction: column; flex-wrap: nowrap; }
    .dc-opp { flex: none; }
}
@media (max-width: 899px) { .dc-keys { display: none; } }
@media (min-width: 2400px) { .dc-board { font-size: 1.15rem; } }
@media (prefers-reduced-motion: reduce) {
    .dc-new .dc-tile, .dc-gold::after, .dc-flashed { animation: none !important; }
    .dc-pick.on .dc-tile { transform: none; }
}
