/* ============================================================
   임기 30일 — 게임 화면 레이어
   도트 무대, HUD, 창(window) 패널, 대사창, 연출.
   style.css 위에 덮어쓴다. 폰트: NeoDunggeunmo (16px 배수에서 선명)
   ============================================================ */
:root {
  --px: 'NeoDunggeunmo', 'Galmuri11', 'Malgun Gothic', monospace;
  --edge: #070b20;
  --gold: #e8b83c;
  --night: #0c1230;
  --night2: #151d46;
  --hard: 4px 4px 0 var(--edge);
  --k-line: #2a3470; --k-t1: #c8cdf6; --k-t2: #aab6e0; --k-t3: #8f9ad0; --k-bg1: #1b2a66; --k-bg2: #1a2250; --k-bg3: #2b3a86; --k-deep: #0a0f26;
}
html[data-theme='dark'] { --edge: #000; }

body {
  background-color: var(--night);
  background-image: radial-gradient(#ffffff0c 1px, transparent 1.4px);
  background-size: 12px 12px;
}
.px, .win-h, .btn, .loc b, .ttl-item b, .hud-day b, .sp-d, .dlg-name b, .modal::before, .fx-banner b, .grade b, .gold span, .gold-n { font-family: var(--px); font-weight: 400; letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---------- 상단 바 ---------- */
.topbar { height: 40px; background: var(--edge); border-bottom: 3px solid var(--k-line); }
.brand b { font-family: var(--px); font-weight: 400; font-size: 16px; letter-spacing: 0; }
.brand span { font-size: 12px; }
.icon-btn { height: 40px; font-family: var(--px); font-weight: 400; font-size: 16px; padding: 0 12px; }
.icon-btn.off { color: var(--k-t3); }

/* ---------- 버튼 ---------- */
.btn { font-family: var(--px); font-weight: 400; font-size: 16px; border: 3px solid var(--edge); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--edge); padding: 8px 16px 7px; position: relative; top: 0; transition: none; }
.btn:hover:not(:disabled) { background: var(--hi); color: #111; }
.btn:active:not(:disabled) { top: 3px; box-shadow: 0 1px 0 var(--edge); }
.btn.primary { background: var(--blue); border-color: var(--edge); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #5560d4; border-color: var(--edge); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-width: 2px; border-style: dashed; color: var(--ink2); margin-top: 8px; }
.btn.xl { padding: 12px 26px 11px; font-size: 16px; }
.btn.big { padding: 10px 24px 9px; }
.btn.pulse { box-shadow: 0 4px 0 var(--edge), 0 0 0 3px var(--gold); animation: blinkb .9s steps(2) infinite; }
@keyframes blinkb { 50% { box-shadow: 0 4px 0 var(--edge), 0 0 0 3px transparent; } }
.btn.wide { margin-top: 14px; }
.pxi { display: inline-block; vertical-align: -2px; image-rendering: pixelated; }

/* ---------- 창(window) ---------- */
.win { background: var(--paper); border: 3px solid var(--edge); box-shadow: inset 0 0 0 2px var(--paper2), var(--hard); border-radius: 0; color: var(--ink); }
.win-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 12px 4px; font-size: 16px; color: #fff; background: var(--blue); border-bottom: 3px solid var(--edge); }
.win-h small { color: var(--k-t1); font-family: var(--sans); font-size: 12px; font-weight: 600; }
.win-b { padding: 12px; }
.sub-h { font-family: var(--px); font-weight: 400; font-size: 16px; margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--line2); }

/* ============================================================
   게임 화면 구조
   ============================================================ */
.gm { max-width: 1320px; margin: 0 auto; padding: 14px 14px 100px; }
.gm-top { display: flex; justify-content: center; background: var(--edge); border: 3px solid var(--k-line); padding: 8px; box-shadow: var(--hard); }
.stage-frame { position: relative; container-type: inline-size; width: 100%; max-width: 100%; background: #000; line-height: 0; user-select: none; overflow: hidden; }
.stage-slot { width: 100%; display: flex; justify-content: center; line-height: 0; background: var(--k-deep); min-height: 128px; }
.stage-cv { display: block; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; max-width: 100%; }
.stage-fallback { width: 100%; height: 300px; display: grid; place-items: center; background: linear-gradient(var(--k-bg1), #0c1230); color: #fff; font-family: var(--px); font-size: 32px; }
.stage-frame.wipe::after { content: ''; position: absolute; inset: 0; z-index: 8; background: #000; animation: wipe .42s steps(8) both; pointer-events: none; }
@keyframes wipe { 0% { clip-path: inset(0 100% 0 0); } 45% { clip-path: inset(0 0 0 0); } 55% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }

/* HUD (무대 위 겹침) */
.hud { position: absolute; z-index: 5; line-height: 1.3; color: #fff; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-l { left: 8px; top: 8px; display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px 6px 6px; background: color-mix(in srgb, var(--edge) 86%, transparent); border: 2px solid var(--k-line); }
.hud-bust { width: 56px; height: 56px; flex: none; border: 2px solid var(--k-line); background: var(--k-bg1); overflow: hidden; }
.hud-bust canvas, .hud-bust .bust { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.bust-svg svg { width: 100%; height: 100%; display: block; }
.hud-id { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.hud-id > b { font-family: var(--px); font-weight: 400; font-size: 16px; }
.hud-id > span { font-size: 12px; color: var(--k-t2); display: flex; align-items: center; gap: 5px; }
.hud-id > span i { width: 8px; height: 8px; display: inline-block; }
.hud-bar { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.hud-bar .bar { flex: 1; height: 9px; border: 2px solid #000; background: var(--k-bg2); position: relative; }
.hud-bar .bar i { display: block; height: 100%; transition: width .7s steps(10); }
.hud-bar.hb-hp .bar i { background: #43c17a; } .hud-bar.hb-hp .pxi { color: #43c17a; }
.hud-bar.hb-risk .bar i { background: #e5484d; } .hud-bar.hb-risk .pxi { color: #e5484d; }
.hud-bar b { width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.hud-r { right: 8px; top: 8px; display: flex; gap: 10px; align-items: stretch; padding: 6px 10px; background: color-mix(in srgb, var(--edge) 86%, transparent); border: 2px solid var(--k-line); }
.hud-day { display: flex; flex-direction: column; justify-content: center; line-height: 1; }
.hud-day small { font-size: 11px; color: var(--k-t2); margin-bottom: 3px; }
.hud-day b { font-size: 32px; color: var(--gold); text-shadow: 2px 2px 0 #000; } .hud-day b span { font-size: 16px; color: var(--k-t2); text-shadow: none; }
.hud-info { display: flex; flex-direction: column; justify-content: center; gap: 3px; font-size: 12px; }
.hud-info > b { font-size: 13px; }
.sess-b { color: var(--k-t3); font-weight: 700; } .sess-b.open { color: #7be0a4; }
.key-b { color: var(--gold); font-weight: 800; }
.hud-res { display: flex; flex-direction: column; justify-content: center; gap: 5px; border-left: 2px solid var(--k-line); padding-left: 10px; }
.hud-ap { display: flex; align-items: center; gap: 8px; } .hud-ap small { font-size: 11px; color: var(--k-t2); }
.pips { display: flex; gap: 4px; } .pips i { width: 14px; height: 14px; border: 2px solid var(--gold); background: none; transform: rotate(45deg) scale(.85); } .pips i.on { background: var(--gold); }
.hud-fund { display: flex; align-items: center; gap: 6px; color: var(--gold); } .hud-fund b { font-size: 14px; font-variant-numeric: tabular-nums; }

/* 장소 바 */
.loc-bar { position: relative; z-index: 5; display: flex; justify-content: center; gap: 6px; line-height: 1.2; padding: 6px; background: var(--edge); border-top: 3px solid var(--k-line); }
.loc { display: flex; align-items: center; gap: 6px; padding: 5px 12px 4px; background: #11193f; border: 2px solid var(--k-line); white-space: nowrap; color: var(--k-t1); font-size: 16px; }
.loc b { font-size: 16px; }
.loc:hover { background: var(--k-bg1); color: #fff; }
.loc.on { background: var(--gold); border-color: #fff; color: #1a1300; }
.loc.lock { opacity: .55; }
.loc .pxi { vertical-align: -3px; }
@container (max-width: 760px) {
  .hud-id > span, .hud-info > b, .hud-day small, .hud-ap small { display: none; }
  .hud-id { min-width: 110px; } .hud-id > b { font-size: 14px; }
  .hud-bust { width: 40px; height: 40px; }
  .hud-day b { font-size: 24px; }
  .loc b { display: none; } .loc { padding: 5px 8px; }
}
@container (max-width: 520px) {
  .hud-bar.hb-risk, .hud-info, .hud-bar b { display: none; }
  .hud-id { min-width: 70px; }
  .hud-res { border: 0; padding: 0; }
}

/* 속보 띠 */
.ticker { display: flex; align-items: stretch; background: var(--edge); border: 3px solid var(--k-line); border-top: 0; font-size: 13px; color: var(--k-t1); overflow: hidden; }
.ticker b { background: var(--red); color: #fff; padding: 3px 12px; font-family: var(--px); font-weight: 400; font-size: 16px; flex: none; }
.ticker .marquee { overflow: hidden; flex: 1; }
.ticker .marquee-in { display: inline-flex; gap: 60px; white-space: nowrap; padding: 5px 0 5px 20px; animation: tick 60s linear infinite; }

/* 달력 */
.gm-cal { margin: 12px 0; }
.cal { margin: 0; border: 3px solid var(--edge); background: var(--paper); box-shadow: var(--hard); gap: 0; }
.cd { height: 34px; border-right: 2px solid var(--line); font-family: var(--px); font-size: 14px; }
.cd.sess { border-bottom: 4px solid var(--green); }
.cd.past { background: var(--paper2); } .cd.past span { opacity: .55; }
.cd.today { background: var(--gold); color: #1a1300; outline: 3px solid var(--edge); outline-offset: -3px; z-index: 1; } .cd.today span { color: #1a1300; font-weight: 400; }
.cd.key span { color: var(--red); font-weight: 400; }
.cd i { top: 2px; right: 2px; width: 5px; height: 5px; }

/* 3열 */
.cols { grid-template-columns: 272px minmax(0, 1fr) 320px; gap: 14px; }
.col-l, .col-r { position: static; max-height: none; overflow: visible; }
.stats { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px 12px; }
.stat { display: grid; grid-template-columns: 76px 1fr 28px; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.stat .sl { white-space: nowrap; color: var(--ink2); }
.stat .sv { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.bar { height: 12px; border: 2px solid var(--edge); background: var(--paper2); position: relative; }
.bar i { display: block; height: 100%; background: var(--c, var(--blue)); transition: width .7s steps(12); }
.stat .bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 5px, #00000040 5px 6px); pointer-events: none; }
.stat.hit-up .sv { animation: hitup .5s steps(5); } .stat.hit-dn .sv { animation: hitdn .5s steps(5); }
@keyframes hitup { 0%, 100% { color: inherit; } 30%, 70% { color: #2f9e5b; transform: translateY(-2px); } }
@keyframes hitdn { 0%, 100% { color: inherit; } 30%, 70% { color: #e5484d; transform: translateX(2px); } }
.polls .win-b, .house .win-b { padding: 10px 12px 12px; }
.suprow { border: 3px solid var(--edge); height: 24px; }
.seg { font-family: var(--px); font-size: 14px; }
.legend { font-size: 12px; }
.hemi circle { transition: fill .16s; }

/* 가운데: 현안 · 명령창 */
.issues .win-h, .actions .win-h { background: var(--navy); }
.issue-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.issue { border: 3px solid var(--edge); background: var(--paper2); border-radius: 0; box-shadow: 0 3px 0 var(--edge); padding: 8px 10px; gap: 5px; position: relative; top: 0; }
.issue:hover { background: var(--hi); color: #111; } .issue:active { top: 3px; box-shadow: 0 0 0 var(--edge); }
.issue.mine { border-left: 8px solid var(--blue); }
.issue b { font-size: 14px; line-height: 1.3; }
.is-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--ink2); font-weight: 700; }
.is-heat { display: inline-flex; gap: 2px; } .is-heat i { width: 7px; height: 7px; border: 2px solid var(--red); background: none; box-sizing: border-box; } .is-heat i.on { background: var(--red); }
.cmd-h span { display: inline-flex; align-items: center; gap: 6px; }
.act-grid { margin: 0; display: grid; grid-template-columns: 1fr; padding: 8px; gap: 6px; }
.act { border: 3px solid var(--edge); background: var(--paper); border-bottom-width: 5px; border-radius: 0; padding: 9px 12px 8px 40px; position: relative; align-items: flex-start; transition: none; }
.act:hover:not(.off) { background: var(--hi); color: #111; transform: translateX(3px); }
.act:hover:not(.off) .act-body p { color: #333; }
.act:active:not(.off) { transform: translate(3px, 2px); border-bottom-width: 3px; }
.act.off { background: var(--paper2); opacity: .75; border-style: dashed; border-bottom-width: 3px; }
.act-n { position: absolute; left: 8px; top: 9px; width: 22px; height: 22px; display: grid; place-items: center; font-family: var(--px); font-size: 14px; background: var(--edge); color: #fff; }
.act-name { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.act-name .ap { display: inline-flex; gap: 2px; margin-left: auto; } .act-name .ap i { width: 9px; height: 9px; background: var(--gold); border: 2px solid var(--edge); transform: rotate(45deg) scale(.8); }
.lockmsg { padding: 20px 14px; color: var(--ink2); }
.tagc { border-radius: 0; border: 2px solid var(--line2); }
.why { font-size: 12px; color: var(--red); font-weight: 700; }

/* 오른쪽 */
.rp { overflow: hidden; }
.rp .tabs { margin: 0; padding: 0 4px; background: var(--navy); border-bottom: 3px solid var(--edge); }
.rp .tab { font-family: var(--px); font-weight: 400; font-size: 16px; color: var(--k-t2); border-bottom: 0; padding: 7px 12px 5px; margin: 0; }
.rp .tab:hover { color: #fff; background: #ffffff18; } .rp .tab.on { background: var(--paper); color: var(--ink); }
.rp .tab .dot { background: var(--red); color: #fff; font-family: var(--sans); font-size: 11px; padding: 0 5px; margin-left: 4px; }
.rp-b { padding: 8px 12px 12px; max-height: 560px; overflow: auto; scrollbar-width: thin; }
.nw { padding: 8px 2px; } .nw p { font-size: 13px; }
.lbx { padding: 6px 8px; display: flex; flex-direction: column; font-size: 11.5px; color: var(--ink2); border-right: 2px solid var(--line); } .lbx:last-child { border-right: 0; } .lbx b { font-size: 16px; font-family: var(--px); font-weight: 400; color: var(--ink); } .lbx b.bad { color: var(--red); } .lbx.full { grid-column: 1/-1; border-top: 2px solid var(--line); border-right: 0; }
.legal-box { border: 3px solid var(--edge); }
.scc, .bl { border-radius: 0; }

/* 하단 독 */
.dock { background: var(--edge); border-top: 3px solid var(--k-line); color: var(--k-t1); }
.dock-in { max-width: 1320px; }
.dock-hint { color: var(--k-t2); font-size: 14px; } .dock-hint b { color: var(--gold); font-family: var(--px); font-weight: 400; font-size: 16px; }
.dock .btn { border-color: #000; }

/* ============================================================
   모달 · 대사창
   ============================================================ */
.modal-wrap { background: rgba(5, 8, 26, .74); }
.modal { border: 3px solid var(--edge); border-radius: 0; box-shadow: inset 0 0 0 2px var(--paper2), 8px 8px 0 rgba(0, 0, 0, .5); }
.modal::before { font-size: 16px; background: var(--blue); border-bottom: 3px solid var(--edge); padding: 6px 18px 5px; letter-spacing: 0; }
.ev-head h3, .res-title, .vote h3, .wiz h3, .gq h3 { font-family: var(--px); font-weight: 400; font-size: 16px; letter-spacing: 0; }
.ev-head h3 { font-size: 16px; }
.ev-k { font-size: 12px; font-family: var(--sans); }
.ev-choices { border: 3px solid var(--edge); background: var(--paper); box-shadow: 0 3px 0 var(--edge); border-radius: 0; }
.choice { padding: 10px 14px 10px 46px; border-bottom: 2px solid var(--line2); }
.choice::before { left: 12px; top: 10px; width: 22px; height: 22px; border: 2px solid var(--edge); background: var(--paper2); font-family: var(--px); font-size: 14px; font-weight: 400; }
.choice:hover:not(.disabled), .choice:focus-visible { background: var(--hi); color: #111; outline: 0; }
.choice:hover:not(.disabled) small, .choice:focus-visible small { color: #444; }
.choice:hover:not(.disabled)::before, .choice:focus-visible::before { background: var(--edge); color: var(--gold); }
.choice:hover:not(.disabled)::after, .choice:focus-visible::after { content: ''; position: absolute; right: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: var(--edge); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.res-ic, .ev-ic { display: none; }
.quote { font-family: var(--sans); border-left: 6px solid var(--edge); border-radius: 0; font-size: 15px; background: var(--paper2); }
.clip { border: 3px solid #2d2a20; border-radius: 0; background: #efe6cf; }
.clip-h { font-family: var(--sans); font-weight: 800; font-size: 15px; }
.dchip { opacity: 0; animation: chipin .3s steps(3) forwards; animation-delay: var(--i, 0s); }
@keyframes chipin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chips { border-top: 3px solid var(--edge); }
.bdg { border-radius: 0; border-width: 2px; }

/* 대사창: 화면 아래에 붙는다 */
.modal-wrap.dlg { align-items: flex-end; padding: 0 12px 12px; background: rgba(5, 8, 26, .38); }
.modal-wrap.dlg .modal { width: min(980px, 100%); max-height: 78vh; margin: 0 auto; padding: 0; background: var(--paper); transform: translateY(24px); transition: transform .18s steps(4); }
.modal-wrap.dlg.in .modal { transform: none; }
.modal-wrap.dlg .modal::before { display: none; }
.modal-wrap.dlg .modal > div { padding: 0; }
.dlg-box { display: flex; gap: 0; align-items: stretch; }
.dlg-who { flex: none; width: 168px; background: var(--k-bg1); border-right: 3px solid var(--edge); display: flex; align-items: flex-end; justify-content: center; padding: 10px; position: relative; overflow: hidden; }
.dlg-who::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #ffffff10 0 4px, transparent 4px 8px); }
.dlg-who .bust { width: 144px; height: 144px; image-rendering: pixelated; position: relative; background: var(--k-bg3); border: 3px solid var(--edge); }
.dlg-who .bust-svg { background: #dde2ee; } .dlg-who .bust-svg span { display: grid; place-items: center; height: 100%; font-family: var(--px); font-size: 48px; color: var(--k-bg1); }
.dlg-main { flex: 1; min-width: 0; padding: 12px 18px 16px; overflow: auto; max-height: 78vh; scrollbar-width: thin; }
.dlg-name { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.dlg-name b { font-size: 16px; background: var(--edge); color: var(--gold); padding: 2px 10px 1px; }
.dlg-name span { font-size: 12px; font-weight: 800; color: var(--blue); letter-spacing: .02em; }
.dlg-title { font-family: var(--px); font-weight: 400; font-size: 16px; margin: 6px 0 6px; padding-bottom: 5px; border-bottom: 2px solid var(--line2); }
.dlg-text { font-size: 15px; line-height: 1.75; min-height: 3.5em; white-space: pre-line; margin: 6px 0 12px; color: var(--ink); }
.dlg-text.typing::after { content: ''; display: inline-block; width: 9px; height: 15px; margin-left: 3px; background: var(--ink); vertical-align: -2px; animation: blinkb2 .5s steps(2) infinite; }
@keyframes blinkb2 { 50% { opacity: 0; } }
.dlg-after.wait { visibility: hidden; pointer-events: none; }
.dlg-after.show { animation: afterin .22s steps(4); }
@keyframes afterin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dlg-after .btn.wide { margin-top: 12px; }
.dlg .res-text, .dlg .quote { margin-top: 0; }
.dlg .cmts { margin-top: 4px; }
.dlg .fl-st { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 700; } .dlg .fl-st .bar { flex: 1; } .dlg .fl-st .bar i { background: #43c17a; }
.dlg.result.bad .dlg-who { background: #5a1a22; } .dlg.result.good .dlg-who { background: #1b4a35; }

/* 구설수: 골든타임 */
.modal-wrap.scandal-m { background: rgba(40, 6, 12, .78); }
.scandal-m .modal { border-color: #000; box-shadow: inset 0 0 0 2px #7a1d24, 8px 8px 0 rgba(0, 0, 0, .55); }
.scandal-m .modal::before { background: var(--red); }
.cr-h { font-family: var(--px); font-weight: 400; font-size: 32px; line-height: 1.25; letter-spacing: 0; border-bottom: 4px double var(--edge); }
.cr-lede { font-size: 15px; }
.cr-bar .live { color: var(--red); animation: blinkb2 .8s steps(2) infinite; }
.gold { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; padding: 4px 10px; background: var(--edge); color: #fff; }
.gold span { font-size: 16px; color: var(--gold); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gold-bar { flex: 1; height: 12px; border: 2px solid #000; background: var(--k-bg2); } .gold-bar i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width .25s linear; }
.gold-n { font-size: 16px; width: 26px; text-align: right; }
.gold.hot .gold-bar i { background: var(--red); } .gold.hot .gold-n { color: #ff7b80; animation: blinkb2 .5s steps(2) infinite; }
.resp-grid { border: 3px solid var(--edge); border-radius: 0; }
.resp { border-color: var(--line2); }
.resp::before { border: 2px solid var(--edge); font-family: var(--px); font-weight: 400; background: var(--paper2); }
.resp:hover:not(.disabled) { background: var(--hi); color: #111; }
.resp:hover:not(.disabled) small { color: #444; }

/* 발언 마법사 · 표결 · 기타 창 */
.w-steps i { height: 8px; border: 2px solid var(--edge); background: var(--paper2); } .w-steps i.cur { background: var(--gold); } .w-steps i.done { background: var(--blue); }
.wcard, .scard, .tgt { border: 3px solid var(--edge); border-radius: 0; box-shadow: 0 3px 0 var(--edge); }
.wcard:hover:not(.off), .scard:hover, .tgt:hover { background: var(--hi); color: #111; }
.wcard.on, .scard.on { border: 3px solid var(--edge); background: var(--gold); color: #1a1300; padding: 12px; box-shadow: 0 3px 0 var(--edge), inset 0 0 0 2px #fff6; }
.scard.on { padding: 11px 14px; }
.wcard.on small, .wcard.on p, .scard.on small { color: #3a2f08; }
.wcard b, .scard b { font-family: var(--sans); }
.scard q { font-family: var(--sans); font-weight: 700; }
.vb { border: 3px solid var(--edge); border-radius: 0; font-family: var(--px); font-weight: 400; box-shadow: 0 4px 0 var(--edge); }
.verdict { font-family: var(--px); font-weight: 400; }
.tally .tl { border: 3px solid var(--edge); border-radius: 0; }
.tally .tl b { font-family: var(--px); font-weight: 400; }
.lbar { border: 2px solid var(--edge); }
.sym-grid .sy, .en-card, .ending .grade { border-radius: 0; }
.x { font-family: var(--px); }

/* 토스트 · 팝업 · 배너 */
.toast { border: 3px solid var(--edge); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: var(--hard); font-size: 14px; }
.toast.warn { background: var(--hi); color: #3a2f08; } .toast.bad { background: #f3d4d6; color: #5a1018; } .toast.good { background: #d3efe0; color: #0e3a24; }
.toast.ach { display: flex; align-items: center; gap: 12px; background: var(--edge); color: #fff; border-color: var(--gold); padding: 10px 16px; min-width: 260px; }
.toast.ach small { display: block; color: var(--gold); font-family: var(--px); font-size: 16px; } .toast.ach b { display: block; font-family: var(--px); font-weight: 400; font-size: 16px; } .toast.ach span { font-size: 12px; color: var(--k-t2); font-weight: 500; }
.fx-pop { position: fixed; z-index: 1300; pointer-events: none; font-family: var(--px); font-size: 16px; color: #fff; text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000; animation: popup 1.2s steps(12) forwards; transform: translate(-50%, -50%); white-space: nowrap; }
.fx-pop.up { color: #7be0a4; } .fx-pop.dn { color: #ff7b80; }
@keyframes popup { 0% { opacity: 0; margin-top: 8px; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -36px; } }
#fx-canvas { position: fixed; inset: 0; z-index: 1200; pointer-events: none; image-rendering: pixelated; }
.fx-banner { position: fixed; left: 0; right: 0; top: 38%; z-index: 1250; transform: translateX(-100%); transition: transform .24s steps(6); pointer-events: auto; }
.fx-banner.in { transform: none; } .fx-banner.out { transform: translateX(100%); }
.fx-banner .fb-in { background: var(--edge); border-block: 4px solid var(--gold); padding: 14px 20px; text-align: center; color: #fff; box-shadow: 0 8px 0 #0008; }
.fx-banner b { display: block; font-size: 32px; color: var(--gold); text-shadow: 3px 3px 0 #000; }
.fx-banner span { color: var(--k-t1); font-size: 14px; }
.fx-banner.win .fb-in { border-color: #7be0a4; } .fx-banner.lose .fb-in { border-color: var(--red); }

/* 날짜 스플래시 */
.splash { background: var(--edge); background-image: repeating-linear-gradient(0deg, #ffffff08 0 2px, transparent 2px 4px); }
.sp-d { font-size: 96px; color: var(--gold); text-shadow: 6px 6px 0 #000; letter-spacing: 0; }
.sp-d small { font-size: 32px; color: var(--k-t2); text-shadow: none; }
.sp-dots { display: flex; justify-content: center; gap: 4px; margin: 12px auto 0; } .sp-dots i { width: 10px; height: 10px; background: var(--k-line); } .sp-dots i.p { background: #6c8fe8; } .sp-dots i.c { background: var(--gold); outline: 3px solid #fff; outline-offset: 0; transform: scale(1.3); }
.sp-t { font-family: var(--px); font-weight: 400; font-size: 16px; margin-top: 18px; }
.sp-s { font-family: var(--px); color: var(--gold); font-size: 16px; }
.splash.key .sp-d { color: #ff7b80; }
.sp-flag .flag { image-rendering: pixelated; border: 3px solid #000; }

/* ============================================================
   타이틀
   ============================================================ */
.ttl { position: relative; min-height: calc(100vh - 40px); overflow: hidden; background: var(--k-deep); display: flex; flex-direction: column; }
.ttl-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; line-height: 0; }
.ttl-bg .ttl-cv { flex: none; max-width: none; image-rendering: pixelated; }
.ttl-in { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 36px 16px 90px; text-align: center; }
.ttl-flag .flag { width: 72px; height: auto; border: 3px solid #000; box-shadow: 4px 4px 0 #000; image-rendering: pixelated; }
.ttl-sub { font-family: var(--px); font-size: 16px; color: var(--k-t1); margin: 14px 0 6px; text-shadow: 2px 2px 0 #000; }
.ttl .logo { font-family: var(--px); font-weight: 400; font-size: clamp(64px, 14vw, 160px); line-height: 1.05; letter-spacing: 0; color: #fff; display: flex; align-items: baseline; justify-content: center; gap: .08em; text-shadow: 0 .05em 0 #000, .05em .05em 0 #000, -.04em .05em 0 #000, 0 -.04em 0 #000, .05em 0 0 #000, -.05em 0 0 #000; }
.ttl .logo .l2 { color: var(--gold); font-size: 1.3em; }
.ttl .logo .l1, .ttl .logo .l3 { font-size: .8em; }
.ttl-menu { display: flex; flex-direction: column; gap: 4px; min-width: min(360px, 90vw); background: #070b20e0; border: 3px solid var(--k-line); padding: 12px 14px; box-shadow: 6px 6px 0 #000; }
.ttl-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px 6px; color: var(--k-t1); text-align: left; }
.ttl-item b { font-size: 16px; } .ttl-item small { margin-left: auto; color: var(--k-t3); font-size: 12px; }
.ttl-item .cur { width: 16px; opacity: 0; color: var(--gold); }
.ttl-item.sel { background: var(--k-bg1); color: #fff; } .ttl-item.sel .cur { opacity: 1; animation: nudge .5s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }
.ttl-rec { font-family: var(--px); font-size: 16px; color: var(--k-t2); text-shadow: 2px 2px 0 #000; }
.ttl-tick { position: absolute; left: 0; right: 0; bottom: 26px; z-index: 2; }
.ttl-foot { position: absolute; left: 0; right: 0; bottom: 4px; z-index: 2; text-align: center; font-size: 11.5px; color: var(--k-t3); padding: 0 10px; }

/* ============================================================
   생성 화면 · 엔딩 · 업적
   ============================================================ */
.create .card, .create .card.sel { border: 3px solid var(--edge); border-radius: 0; box-shadow: 0 4px 0 var(--edge); }
.create .card.sel.on { background: var(--gold); color: #1a1300; border-color: var(--edge); padding: 16px; }
.create .card.sel.on p, .create .card.sel.on small, .create .card.sel.on li { color: #3a2f08; }
.create .card.sel.on::after { background: var(--edge); color: var(--gold); font-family: var(--px); font-size: 14px; border-radius: 0; }
.create-head { border-bottom: 3px solid var(--edge); color: #fff; } .create-head .link, .create-head .sum { color: var(--k-t1); }
.step { font-family: var(--px); color: var(--k-t3); font-size: 16px; } .step.cur { color: #fff; } .step.done { color: var(--gold); }
.step i { border-radius: 0; border: 2px solid var(--k-line); font-family: var(--px); }
.step.cur i { background: var(--gold); border-color: var(--edge); color: #1a1300; } .step.done i { background: none; border-color: var(--gold); color: var(--gold); }
.step-h { font-family: var(--px); font-weight: 400; font-size: 32px; color: #fff; text-shadow: 3px 3px 0 #000; letter-spacing: 0; } .step-p { color: var(--k-t2); }
.create-sprite { width: 160px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto; }
.portrait-card { background: var(--k-bg1); border: 3px solid var(--edge); padding: 16px 10px 10px; text-align: center; box-shadow: var(--hard); }
.portrait-card .pname { font-family: var(--px); font-size: 16px; color: #fff; margin-top: 8px; }
.chip-sel { border: 3px solid var(--edge); border-radius: 0; font-weight: 700; }
.chip-sel.on { background: var(--gold); color: #1a1300; }
.input { border: 3px solid var(--edge); border-radius: 0; font-family: var(--px); font-size: 16px; }
.ending .grade b { font-family: var(--px); font-weight: 400; }
.ach-win .ach-g { font-family: var(--px); font-size: 16px; margin: 12px 0 6px; border-bottom: 2px solid var(--line2); padding-bottom: 3px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.ach-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 3px solid var(--edge); background: var(--paper2); opacity: .7; } .ach-card.on { opacity: 1; background: var(--paper); border-color: var(--gold); }
.ach-card b { display: block; font-size: 14px; } .ach-card small { display: block; font-size: 12px; line-height: 1.4; }
.ach-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; background: var(--edge); }

@media (max-width: 1180px) {
  .cols { grid-template-columns: 250px minmax(0, 1fr); }
  .col-r { grid-column: 1 / -1; }
  .rp-b { max-height: 360px; }
}
@media (max-width: 860px) {
  .gm { padding: 8px 8px 100px; }
  .cols { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: 1fr; }
  .dlg-box { flex-direction: column; }
  .dlg-who { width: 100%; height: 96px; padding: 6px; border-right: 0; border-bottom: 3px solid var(--edge); }
  .dlg-who .bust { width: 80px; height: 80px; }
  .modal-wrap.dlg { padding: 0 6px 6px; }
  .cd { height: 28px; font-size: 11px; }
  .cr-h { font-size: 24px; }
  .sp-d { font-size: 64px; }
  .ttl .logo { font-size: clamp(56px, 22vw, 120px); }
}
@media (prefers-reduced-motion: reduce) {
  .ttl-item.sel .cur, .btn.pulse, .cr-bar .live { animation-duration: 1.6s; }
}

/* 생성 화면 하단 */
.create-foot { background: var(--edge); border-top: 3px solid var(--k-line); color: #fff; }
.create-foot .btn { border-color: #000; }
.create-body { color: #fff; }
.create-body .card { color: var(--ink); }
.create .lab { color: var(--k-t1); font-family: var(--px); font-weight: 400; font-size: 16px; }

/* 표결 버튼 */
.vbtns { border: 0; gap: 8px; }
.vb { border: 3px solid var(--edge); border-bottom-width: 6px; font-family: var(--px); font-weight: 400; font-size: 16px; padding: 12px 6px 10px; color: #fff; text-shadow: 2px 2px 0 #0006; }
.vb:last-child { border-right: 3px solid var(--edge); }
.vb.for { background: var(--v-for); } .vb.against { background: var(--v-against); } .vb.abstain { background: #6a7284; } .vb.absent { background: #2e3440; }
.vb.for:hover { background: var(--v-for); } .vb.against:hover { background: var(--v-against); } .vb.abstain:hover { background: #6a7284; } .vb.absent:hover { background: #2e3440; }
.vb:hover { filter: brightness(1.2); color: #fff; }
.vb:active { transform: translateY(3px); border-bottom-width: 3px; }
.vb small { font-family: var(--sans); color: #ffffffcc; text-shadow: none; }
.verdict { border-radius: 0; border-width: 6px; border-style: solid; font-size: 32px; background: var(--paper); transform: rotate(-6deg); box-shadow: 6px 6px 0 var(--edge); }
.stats-sep { height: 3px; background: var(--line2); margin: 3px 0; }

/* 초상 크기는 도트 모듈이 인라인으로 40px 을 박아 두므로 덮어쓴다 */
.dlg-who .bust { width: 144px !important; height: 144px !important; }
.hud-bust .bust { width: 100% !important; height: 100% !important; }
.dlg.result .dlg-after.show, .dlg.result .dlg-after.wait { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: 'clip cmts' 'badges cmts' 'chips cmts' 'btn btn'; column-gap: 18px; align-items: start; }
.dlg.result .dlg-after .clip { grid-area: clip; margin: 0 0 8px; }
.dlg.result .dlg-after .badges { grid-area: badges; margin: 0 0 8px; }
.dlg.result .dlg-after .chips { grid-area: chips; margin: 0; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dlg.result .dlg-after .cmts { grid-area: cmts; margin: 0; }
.dlg.result .dlg-after .cmts h5 { border-top: 0; padding-top: 0; }
.dlg.result .dlg-after .btn { grid-area: btn; margin-top: 10px; }
.dlg.result .dlg-after:not(:has(.clip)) .chips { grid-area: clip / clip / chips / clip; }
.dlg-text { min-height: 2.4em; }
.modal-wrap.dlg .modal { max-height: 66vh; }
.dlg-main { max-height: 66vh; }
@media (max-width: 860px) {
  .dlg.result .dlg-after.show, .dlg.result .dlg-after.wait { display: block; }
  .dlg-who .bust { width: 80px !important; height: 80px !important; }
}

/* ============================================================
   엔딩
   ============================================================ */
.ending { max-width: 1040px; padding: 18px 16px 90px; }
.en-stage { width: min(960px, 100%); margin: 0 auto 14px; background: #000; border: 3px solid var(--k-line); box-shadow: var(--hard); line-height: 0; display: flex; justify-content: center; }
.en-hero { background: var(--edge); color: #fff; border: 3px solid var(--k-line); border-top: 3px solid var(--k-line); box-shadow: var(--hard); text-align: center; padding: 18px 20px 20px; }
.en-hero h2 { font-family: var(--px); font-weight: 400; letter-spacing: 0; font-size: clamp(48px, 9vw, 96px); line-height: 1.1; text-shadow: 5px 5px 0 #000; }
.ending.win .en-hero h2 { color: var(--gold); } .ending.lose .en-hero h2 { color: #ff6b72; }
.en-hero p { color: var(--k-t2); font-size: 15px; }
.en-grid { gap: 14px; margin-top: 14px; }
.en-card, .grade, .en-title { border: 3px solid var(--edge); border-radius: 0; box-shadow: inset 0 0 0 2px var(--paper2), var(--hard); }
.en-card h5 { font-family: var(--px); font-weight: 400; font-size: 16px; color: #fff; background: var(--blue); border-bottom: 3px solid var(--edge); padding: 5px 14px 4px; margin: -14px -14px 10px; }
.grade b { font-family: var(--px); font-weight: 400; font-size: 128px; text-shadow: 5px 5px 0 var(--edge); }
.grade.g-S b { color: var(--gold); } .grade.g-A b { color: var(--green); } .grade.g-B b { color: var(--blue); } .grade.g-F b, .grade.g-D b { color: var(--red); }
.grade small { font-family: var(--px); font-size: 16px; }
.en-title b { font-family: var(--px); font-weight: 400; font-size: 32px; letter-spacing: 0; }
.en-btns .btn { margin-top: 4px; }
.en-btns .link { color: var(--k-t1); }
.ending, .ending.win, .ending.lose { background: transparent !important; box-shadow: none; border: 0; }
.en-stage { width: min(966px, 100%); }
.chip-sel { background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--edge); }
.chip-sel small { color: var(--ink2); }
.chip-sel:hover { background: var(--hi); color: #111; }
.chip-sel.on small { color: #3a2f08; }
.create .final-right .lab { margin-top: 16px; }
.icon-btn { white-space: nowrap; }
@media (max-width: 560px) {
  .icon-btn { font-family: var(--sans); font-size: 12px; font-weight: 700; padding: 0 7px; }
  .brand b { font-size: 14px; }
}
