/* 코인체스 — 밝은 테마 (리넨 탁자 + 돌빛 판)
   판이 주인공. 글자 화면은 여백·정렬·얇은 구분선으로 구조를 만든다.
   글자 크기: 본문 14~15px, 가장 작은 글씨도 12px 이상. 글자 대비는 배경 대비 4.5:1 이상.
   황동(--brass)은 '지금 고른 것'과 중요한 강조에만. */
:root {
  --bg: #e9e3d7;
  --panel: #fbf9f4;
  --panel2: #f3efe6;
  --hover: #efe9dd;
  --line: #e2dacb;
  --line2: #cbc1ae;
  --text: #25211c;
  --body: #3b352d;
  --muted: #5f584c;
  --dim: #7d7568;
  --brass: #9b722d;
  --brass-bg: rgb(155 114 45 / 10%);
  --attack: #b8432c;
  --blue: #3d6c99;
  --red: #b0472f;
  --blue-text: #2f5a82;
  --red-text: #9d3d27;
  --face0: #f5f0e6;
  --ink0: #1d2933;
  --face1: #2b2724;
  --ink1: #f0e9db;
  --shadow: 0 10px 30px rgb(60 48 30 / 14%), 0 1px 3px rgb(60 48 30 / 10%);
  --shadow-lg: 0 24px 60px rgb(50 40 25 / 22%), 0 2px 6px rgb(50 40 25 / 10%);
  --sans: "Pretendard", "Pretendard Variable", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", "AppleMyungjo", Georgia, serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5; word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
#gameCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }
b { font-weight: 700; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- 공통 ---------- */
.ico { width: 1.2em; height: 1.2em; flex: none; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 18px; border-radius: 6px; border: 1px solid var(--line2); background: #fff;
  color: var(--text); font-weight: 700; font-size: 14.5px; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--panel2); border-color: #b4a993; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.primary { background: var(--text); border-color: var(--text); color: #fbf8f1; }
.btn.primary:hover { background: #3a342c; }
.text-btn { border: 0; background: none; color: var(--muted); padding: 8px 10px; font-size: 14px; }
.text-btn:hover { color: var(--text); }
kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; background: #fff;
  font: 700 12.5px var(--sans); color: var(--muted);
}
.keys { display: inline-flex; gap: 4px; }
.dim { color: var(--dim); }
.pn.s0 { color: var(--blue-text); }
.pn.s1 { color: var(--red-text); }
.dots::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes fadeIn { from { opacity: 0; } }

/* 진영 표시 점: 파랑 = 밝은 면, 빨강 = 어두운 면 (색 없이도 명도로 구별) */
.mark { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.mark.s0 { background: var(--face0); box-shadow: inset 0 0 0 2.5px var(--blue); }
.mark.s1 { background: var(--face1); box-shadow: inset 0 0 0 2.5px var(--red); }
.mark.none { box-shadow: inset 0 0 0 1.5px var(--line2); }

/* 작은 코인: 판 위 코인과 같은 생김새 */
.coin {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
}
.coin .ico { width: 58%; height: 58%; position: relative; z-index: 1; }
.coin.s0 { background: var(--face0); color: var(--ink0); box-shadow: inset 0 0 0 2px var(--blue), 0 1px 2px rgb(0 0 0 / 15%); }
.coin.s1 { background: var(--face1); color: var(--ink1); box-shadow: inset 0 0 0 2px var(--red), 0 1px 2px rgb(0 0 0 / 15%); }
.coin.royal.s0, .coin.royal.s1 { box-shadow: inset 0 0 0 2px var(--brass), 0 1px 2px rgb(0 0 0 / 15%); }
.coin.royal.s0 { color: #8a6526; }
.coin.royal.s1 { color: #d2ad6c; }
.coin.neutral { background: #b2a995; color: #fbf8f1; box-shadow: inset 0 0 0 1.5px #8b826f; }
.coin.md, .coin.lg { box-shadow: inset 0 0 0 3px var(--blue), 0 1px 3px rgb(0 0 0 / 18%); }
.coin.s1.md, .coin.s1.lg { box-shadow: inset 0 0 0 3px var(--red), 0 1px 3px rgb(0 0 0 / 18%); }
.coin.royal.md, .coin.royal.lg { box-shadow: inset 0 0 0 3px var(--brass), 0 1px 3px rgb(0 0 0 / 18%); }
.coin.neutral.md, .coin.neutral.lg { box-shadow: inset 0 0 0 1.5px #8b826f; }
.coin.md::after, .coin.lg::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; }
.coin.s0.md::after, .coin.s0.lg::after { border: 1px solid rgb(29 41 51 / 28%); }
.coin.s1.md::after, .coin.s1.lg::after { border: 1.5px dotted rgb(240 233 219 / 45%); }
.coin.sm { width: 22px; height: 22px; }
.coin.md { width: 36px; height: 36px; }
.coin.lg { width: 52px; height: 52px; }
.coin.lg::after { inset: 7px; }

/* ---------- 위쪽 현황 ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 6;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch;
  padding: 0 16px; background: rgb(251 249 244 / 94%); border-bottom: 1px solid var(--line2);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--text); }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark i { width: 16px; height: 16px; border-radius: 50%; }
.brand-mark i:first-child { background: var(--face0); box-shadow: inset 0 0 0 2.5px var(--blue); }
.brand-mark i:last-child { margin-left: -5px; background: var(--face1); box-shadow: inset 0 0 0 2.5px var(--red), 0 0 0 2px var(--panel); }
.brand-mark.big i { width: 40px; height: 40px; }
.brand-mark.big i:first-child { box-shadow: inset 0 0 0 4px var(--blue), 0 2px 6px rgb(0 0 0 / 15%); }
.brand-mark.big i:last-child { margin-left: -13px; box-shadow: inset 0 0 0 4px var(--red), 0 0 0 3px var(--panel); }

#scoreBar { display: flex; align-items: stretch; }
.side { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 22px; min-width: 290px; }
.side.s1 { align-items: flex-end; }
.side-top, .side-bot { display: flex; align-items: center; gap: 8px; }
.side.s1 .side-top, .side.s1 .side-bot { flex-direction: row-reverse; }
.side-top b { font-size: 16px; color: var(--muted); }
.side.turn .side-top b { color: var(--text); }
.side-top small { font-size: 13px; color: var(--dim); }
.turn-chip { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: var(--text); color: #fbf8f1; }
.side.turn::after { content: ''; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 3px; background: var(--pc); }
.crown { color: var(--brass); display: flex; }
.crown .ico { width: 17px; height: 17px; }
.pips { display: flex; gap: 6px; }
.pips i { width: 10px; height: 10px; transform: rotate(45deg); box-shadow: inset 0 0 0 1.5px var(--line2); background: #fff; }
.pips i.on { background: var(--pc); box-shadow: none; }
.pts { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pts small { color: var(--dim); font-weight: 500; font-size: 13px; }
.stock { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin: 0 6px; }
.mid { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 22px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 1.15; }
.mid small { font-size: 12px; color: var(--dim); }
.mid b { font-size: 24px; font-variant-numeric: tabular-nums; }

#corner { justify-self: end; display: flex; align-items: center; gap: 2px; }
.nav-sep { width: 1px; height: 22px; background: var(--line2); margin: 0 6px; }
.icon-btn {
  position: relative; min-width: 40px; height: 40px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: color .12s, background .12s;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn.on { color: var(--text); background: var(--brass-bg); }
.icon-btn.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: var(--brass); }
.icon-btn .ico { width: 20px; height: 20px; }

#status {
  position: fixed; top: 80px; right: 16px; z-index: 5; max-width: 340px;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: rgb(251 249 244 / 88%); box-shadow: 0 1px 3px rgb(60 48 30 / 12%);
  font-size: 14.5px; color: var(--muted); pointer-events: none;
}
#status:empty { display: none; }
#status b { color: var(--text); }

/* ---------- 라운드 알림: 판을 가로지르는 띠 ---------- */
#banner {
  position: fixed; left: 0; right: 0; top: 44%; z-index: 7; transform: translateY(-50%); pointer-events: none;
  padding: 16px 0 14px; text-align: center; background: rgb(251 249 244 / 94%);
  border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); box-shadow: var(--shadow);
  font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--text);
  opacity: 0; transition: opacity .18s;
}
#banner.show { opacity: 1; }
#banner small { display: block; margin-top: 2px; font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--muted); }

/* ---------- 오른쪽 아래 행동 패널 ---------- */
#dock {
  position: fixed; right: 16px; bottom: 16px; z-index: 5; width: 360px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 160px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadow);
  animation: rise .14s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.dock-prompt { display: flex; align-items: center; gap: 8px; padding: 13px 96px 13px 16px; font-size: 15.5px; flex-wrap: wrap; }
.dock-prompt.soft { color: var(--muted); padding: 14px 16px; }
.dock-prompt > .ico { width: 18px; height: 18px; color: var(--muted); }
.dock-prompt .arrow { display: flex; color: var(--dim); }
.dock-prompt .arrow .ico { width: 13px; height: 13px; }
.dock-prompt .ask { color: var(--muted); }
.turn-tag { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 8px; border-radius: 5px; background: var(--text); color: #fbf8f1; font-weight: 700; font-size: 14px; }
.turn-tag .mark.s1 { box-shadow: inset 0 0 0 2.5px var(--red), 0 0 0 1px rgb(255 255 255 / 35%); }
.dock-row { display: flex; flex-direction: column; border-top: 1px solid var(--line); background: #fff; }
.act {
  display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 16px; border: 0; background: transparent;
  color: var(--text); text-align: left; transition: background .12s;
}
.act + .act { box-shadow: inset 0 1px 0 var(--line); }
.act:hover { background: var(--hover); }
.act .ico { width: 24px; height: 24px; color: var(--text); flex: none; }
.act .al { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.act .al b { font-size: 15px; }
.act .al small { font-size: 13px; color: var(--muted); }
.act.is-attack .ico, .act.is-attack .al b { color: var(--attack); }
.dock-row.spend { flex-direction: row; align-items: center; background: var(--panel2); padding: 0 6px 0 16px; }
.spend-label { flex: none; font-size: 12.5px; font-weight: 600; color: var(--dim); margin-right: 4px; }
.act.minor { flex: 1; flex-direction: column; gap: 3px; width: auto; padding: 9px 6px; text-align: center; color: var(--muted); }
.act.minor + .act.minor { box-shadow: inset 1px 0 0 var(--line); }
.act.minor .ico { width: 19px; height: 19px; color: var(--muted); }
.act.minor .al b { font-size: 13.5px; font-weight: 600; }
.act.minor:hover, .act.minor:hover .ico { color: var(--text); }
.act.pick { gap: 12px; }
.act.pick span { display: flex; flex-direction: column; line-height: 1.3; font-weight: 700; }
.act.pick small { color: var(--dim); font-weight: 500; font-size: 12.5px; }
.dock-back {
  position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 5px;
  border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 4px 6px 4px 8px;
}
.dock-back:hover { color: var(--text); background: var(--hover); }
.dock-back .ico { width: 14px; height: 14px; }
.dock-back kbd { min-width: 0; height: 20px; font-size: 11.5px; }
.dock-preview {
  border-top: 1px solid var(--line); padding: 11px 16px; min-height: 46px;
  font-size: 14px; line-height: 1.55; color: var(--body); background: var(--panel2);
}
.dock-preview b { color: var(--text); }
.dock-preview:empty::before { content: '칸이나 버튼에 마우스를 올리면 결과를 미리 보여 줘요'; color: var(--dim); }
.warn-t { font-style: normal; color: var(--red-text); font-weight: 600; }
.win-t { font-style: normal; color: var(--brass); font-weight: 700; }
.dock-hint { border-top: 1px solid #ecd9b8; padding: 9px 16px; font-size: 14px; color: #7a5413; background: #fbf1df; }
.guide { box-shadow: inset 0 0 0 2px var(--brass) !important; animation: guide 1.6s ease-in-out infinite; }
@keyframes guide { 50% { background: var(--brass-bg); } }
.focus { outline: 2px solid var(--brass); outline-offset: -2px; animation: focusPulse 1.6s ease-in-out infinite; }
@keyframes focusPulse { 50% { outline-color: rgb(155 114 45 / 25%); } }

/* ---------- 왼쪽 아래 설명 ---------- */
#infoCard {
  position: fixed; left: 16px; bottom: 16px; z-index: 5; width: 320px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadow);
  line-height: 1.6; animation: fadeIn .12s;
}
.ic-head { display: flex; gap: 12px; align-items: center; }
.ic-head b { font-size: 17px; }
.ic-head small { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 13px; }
.ic-tag { display: inline-block; margin-top: 12px; padding: 1px 8px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
#infoCard p { margin: 6px 0 0; font-size: 14.5px; color: var(--body); }
.ic-note { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 13.5px; color: var(--blue-text); }
.ic-note .ico { width: 16px; height: 16px; }

/* ---------- 서랍 ---------- */
#drawer {
  position: fixed; top: 64px; right: 0; bottom: 0; z-index: 8; width: 390px; max-width: 92vw; overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line2); box-shadow: -16px 0 40px rgb(50 40 25 / 12%);
  padding: 0 22px 22px; animation: slide .16s ease-out;
}
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }
#drawer > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; padding: 14px 0 12px; background: var(--panel); border-bottom: 1px solid var(--line2); }
#drawer h3 { flex: 1; margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.army { padding: 16px 0 4px; }
.army + .army { border-top: 1px solid var(--line2); margin-top: 8px; }
.army h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.army h4 small { color: var(--dim); font-weight: 500; font-size: 13px; }
.army .grow { flex: 1; }
.army .pts { color: var(--muted); font-weight: 600; font-size: 14px; }
.army-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.army-stats span { display: flex; align-items: center; gap: 4px; }
.army-stats .ico { width: 15px; height: 15px; }
.arow { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.arow-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.arow-head b { font-size: 15px; }
.arow p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--body); }
.arow em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.st { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.st.on { color: var(--text); background: #fff; border-color: var(--pc); }
.log { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; line-height: 1.6; }
.log li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; color: var(--body); }
.log li .mark { transform: translateY(1px); }
.log li.round { align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.log li.round::before, .log li.round::after { content: ''; flex: 1; height: 1px; background: var(--line2); }

/* ---------- 튜토리얼 안내 ---------- */
#tutor {
  position: fixed; left: 16px; top: 80px; z-index: 6; width: 350px; padding: 16px 20px 10px;
  background: var(--panel); border: 1px solid var(--line2); border-top: 3px solid var(--brass); border-radius: 8px;
  box-shadow: var(--shadow); line-height: 1.7; animation: fadeIn .15s;
}
.tut-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.tut-badge { color: var(--brass); font-weight: 700; }
#tutor h3 { margin: 4px 0 10px; font-family: var(--serif); font-size: 21px; font-weight: 700; }
.tut-dots { display: flex; gap: 4px; margin-bottom: 12px; }
.tut-dots span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.tut-dots span.done { background: var(--brass); }
.tut-dots span.now { background: rgb(155 114 45 / 40%); }
.tut-text { font-size: 15px; color: var(--body); }
.tut-text b { color: var(--text); }
.tut-text small { color: var(--dim); font-size: 13px; }
.tut-task { margin-top: 12px; padding: 9px 12px; border-left: 3px solid var(--brass); border-radius: 0 6px 6px 0; background: var(--brass-bg); font-size: 14.5px; font-weight: 600; }
.tut-ok { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 9px 12px; border-left: 3px solid #5f8a4a; border-radius: 0 6px 6px 0; background: rgb(95 138 74 / 12%); color: #3f6a2c; font-weight: 700; }
.tut-ok .ico { width: 17px; height: 17px; }
.tut-main { margin-top: 14px; display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tut-main small { font-weight: 500; opacity: .65; font-size: 12.5px; }
.tut-nav { display: flex; gap: 2px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.tut-nav button { border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 13.5px; padding: 5px 8px; }
.tut-nav button:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.tut-nav .grow { flex: 1; }

/* ---------- 덮는 창 ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgb(60 50 35 / 30%); }
.overlay.solid { background: var(--bg); }
.panel {
  max-width: 620px; max-height: 88vh; overflow-y: auto; padding: 30px 34px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: var(--shadow-lg); line-height: 1.7; animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.panel h1, .panel h2 { font-family: var(--serif); font-weight: 700; margin: 4px 0; }
.panel h1 { font-size: 40px; }
.panel h2 { font-size: 26px; }
.panel.center { text-align: center; }
.sub { color: var(--muted); margin: 6px 0; font-size: 15px; }
.row { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.panel.rules { width: min(660px, 94vw); }
.panel.rules ol { margin: 16px 0 0; padding-left: 26px; font-size: 15px; color: var(--body); }
.panel.rules li { margin: 8px 0; padding-left: 4px; }
.panel.rules li::marker { color: var(--dim); font-weight: 600; font-variant-numeric: tabular-nums; }

.panel.start { width: min(600px, 94vw); padding: 40px 40px 22px; }
.title-block { text-align: center; margin-bottom: 26px; }
.title-block h1 { margin-top: 14px; }
.menu-list { border-top: 1px solid var(--line2); }
.menu-row {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 14px 10px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left;
  transition: background .12s;
}
button.menu-row:hover, .menu-row.static:hover { background: var(--panel2); }
.mi { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
.mi .ico { width: 21px; height: 21px; }
.mt { flex: 1; display: flex; flex-direction: column; line-height: 1.45; }
.mt b { font-size: 17px; }
.mt small { color: var(--muted); font-size: 14px; }
.tag { flex: none; padding: 2px 10px; border-radius: 4px; background: var(--brass-bg); font-size: 13px; font-weight: 700; color: var(--brass); }
.go { color: var(--dim); }
.go .ico { width: 18px; height: 18px; }
.levels { display: flex; gap: 6px; }
.check { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--muted); font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--text); margin: 0; width: 16px; height: 16px; }

.big-mark { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; }
.big-mark.s0 { background: var(--face0); box-shadow: inset 0 0 0 5px var(--blue), 0 2px 6px rgb(0 0 0 / 15%); }
.big-mark.s1 { background: var(--face1); box-shadow: inset 0 0 0 5px var(--red), 0 2px 6px rgb(0 0 0 / 15%); }
#overStats { margin: 20px auto 0; border-collapse: collapse; font-size: 15px; }
#overStats th, #overStats td { padding: 9px 18px; border-top: 1px solid var(--line); text-align: left; font-weight: 500; }
#overStats tr:last-child td { border-bottom: 1px solid var(--line); }
#overStats th { color: var(--dim); font-size: 13px; border-top: 0; }
#overStats td.num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
#overStats td b { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- 온라인 대기실 ---------- */
.panel.lobby { width: min(560px, 94vw); }
.invite { display: flex; gap: 6px; margin: 16px 0 4px; }
.invite input {
  flex: 1; min-width: 0; font: 13.5px ui-monospace, Consolas, monospace; padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--line2); background: #fff; color: var(--body);
}
.seats { margin: 18px 0 8px; border-top: 1px solid var(--line2); }
.seat { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.seat .sname { width: 60px; font-weight: 700; }
.seat .sstate { font-size: 14px; color: var(--muted); }
.seat.filled .sstate, .seat.me .sstate { color: var(--text); font-weight: 600; }
.warn { margin-top: 12px; padding: 10px 14px; border-left: 3px solid #c08a3e; border-radius: 0 6px 6px 0; background: #fbf1df; color: #7a5413; font-size: 14px; }
.err { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--attack); border-radius: 0 6px 6px 0; background: #f9e6e1; color: #7f2f1f; font: 13px ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.lobby select { font: inherit; padding: 6px 10px; border-radius: 6px; background: #fff; color: var(--text); border: 1px solid var(--line2); }
.hostrow { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; color: var(--muted); }

/* 좁은 화면: 덜 중요한 것부터 접는다 */
@media (max-width: 1280px) {
  .stock { display: none; }
  .side { min-width: 0; }
  .icon-btn > span { display: none; }
}
@media (max-width: 1050px) {
  .brand > span:last-child { display: none; }
  #infoCard { width: 270px; }
}

.mid b.word { font-family: var(--serif); font-size: 18px; }

/* ---------- 설정 마법사: 모드 → 구성 → 부대 편성 ---------- */
.panel.setup { width: min(720px, 94vw); padding: 0; display: flex; flex-direction: column; max-height: 90vh; }
.wiz-head { padding: 24px 32px 14px; border-bottom: 1px solid var(--line); }
.wiz-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 13.5px; color: var(--dim); }
.wiz-steps li { display: flex; align-items: center; gap: 7px; }
.wiz-steps li + li::before { content: ''; width: 22px; height: 1px; background: var(--line2); margin-right: 2px; }
.wiz-steps i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); font-style: normal; font-size: 12px; font-weight: 700; background: #fff; }
.wiz-steps li.now { color: var(--text); font-weight: 700; }
.wiz-steps li.now i { background: var(--text); border-color: var(--text); color: #fbf8f1; }
.wiz-steps li.done i { background: var(--brass-bg); border-color: var(--brass); color: var(--brass); }
.wiz-head h2 { margin: 0; }
.wiz-body { padding: 16px 32px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.wiz-foot { display: flex; align-items: center; gap: 12px; padding: 14px 32px; border-top: 1px solid var(--line); background: var(--panel2); border-radius: 0 0 10px 10px; }
.wiz-foot .ico { width: 15px; height: 15px; }
.wiz-sum { flex: 1; text-align: center; font-size: 13.5px; color: var(--muted); }
.choice {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 16px 18px; text-align: left;
  border: 1px solid var(--line2); border-radius: 8px; background: #fff; color: var(--text); transition: border-color .12s, background .12s;
}
.choice:hover { border-color: #b4a993; background: var(--panel); }
.choice.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.radio { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line2); background: #fff; }
.choice.on .radio { border-color: var(--text); box-shadow: inset 0 0 0 4px #fff; background: var(--text); }
.ct { display: flex; flex-direction: column; gap: 2px; line-height: 1.5; }
.ct b { font-size: 17px; }
.ct small { font-size: 14px; color: var(--muted); }
.unit-strip { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.us { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--body); }
.exp { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 0 5px; border-radius: 3px; background: var(--brass-bg); color: var(--brass); }

.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lineup { border: 1px solid var(--line2); border-radius: 8px; padding: 12px 14px 14px; background: #fff; }
.lineup h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.lineup h4 small { font-size: 13px; color: var(--dim); font-weight: 500; }
.lineup .grow { flex: 1; }
.cnt { font-size: 13.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.cnt.ok { color: #3f6a2c; }
.presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.presets .btn.sm { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.presets .text-btn.sm { padding: 3px 6px; font-size: 13px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chip {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 5px 9px; text-align: left;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 14px; font-weight: 600; color: var(--body);
}
.chip:hover:not(:disabled) { border-color: #b4a993; }
.chip.on { border-color: var(--text); background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.chip .exp { margin-left: auto; }
.unit-desc { margin: 4px 0 0; min-height: 44px; font-size: 14px; color: var(--body); }

/* ---------- 드래프트 ---------- */
.overlay.draft-ov { background: rgb(233 227 215 / 72%); z-index: 15; }
.panel.draft { width: min(1180px, 97vw); max-width: none; padding: 0; display: flex; flex-direction: column; max-height: 92vh; }
.draft-head { padding: 16px 28px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.draft-head h2 { margin: 0; }
.draft-order { display: flex; align-items: center; justify-content: center; list-style: none; margin: 14px 0 0; padding: 0; }
.draft-order li { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; }
.draft-order li .mark { width: 12px; height: 12px; }
.draft-order li.now { border: 2px solid var(--brass); box-shadow: 0 0 0 3px var(--brass-bg); }
.draft-order li.done { border-color: transparent; background: transparent; }
.draft-order .dash { width: 14px; height: 1px; background: var(--line2); }
.draft-prompt { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; font-size: 15.5px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.draft-body { display: grid; grid-template-columns: 196px 1fr 196px; gap: 0; overflow-y: auto; }
.draft-side { padding: 16px 18px; }
.draft-side:first-child { border-right: 1px solid var(--line); }
.draft-side:last-child { border-left: 1px solid var(--line); }
.draft-side.now { background: var(--brass-bg); }
.draft-side h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.draft-side h4 small { font-size: 13px; font-weight: 500; color: var(--dim); }
.draft-side ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.draft-side li { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.draft-side li span { display: flex; flex-direction: column; line-height: 1.3; }
.draft-side li b { font-size: 15px; }
.draft-side li small { font-size: 12.5px; color: var(--muted); }
.draft-side li.empty { color: var(--dim); font-size: 13.5px; }
.draft-side li.empty i { width: 36px; height: 36px; border-radius: 50%; border: 1.5px dashed var(--line2); }
.draft-side li.filled { animation: pop .2s ease-out; }
.draft-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; padding: 14px; align-content: start; }
.dcard {
  display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; text-align: left;
  border: 1px solid var(--line2); border-radius: 8px; background: #fff; color: var(--text);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.dcard:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--text); box-shadow: var(--shadow); }
.dcard:disabled { opacity: 1; cursor: default; }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-head b { font-size: 16px; }
.dc-head .exp { margin-left: auto; }
.dc-tag { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.dc-desc { font-size: 13.5px; line-height: 1.55; color: var(--body); }
.draft-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--line); font-size: 13.5px; }
@media (max-width: 900px) {
  .draft-body { grid-template-columns: 1fr; }
  .lineups { grid-template-columns: 1fr; }
}
.net-warn { color: #7a5413; font-weight: 600; }
