:root {
  --bg: #050c0d; --bg2: #0b1719; --panel: #0f2023; --panel2: #16303a; --line: #234652;
  --text: #e6f4f1; --muted: #86a8a4; --accent: #2ee6a6; --alert: #ff4b5c; --warn: #ffb02e; --danger: #ff4b5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at 50% -20%, #12363a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font-family: 'Noto Sans KR', system-ui, sans-serif; min-height: 100vh;
}
h1, h2, h3 { font-family: 'Do Hyeon', 'Noto Sans KR', sans-serif; font-weight: 400; margin: 0; }
h2 { font-size: 26px; margin-bottom: 10px; }
h3 { font-size: 19px; margin-bottom: 6px; }
small { font-size: 0.7em; color: var(--muted); font-family: 'Noto Sans KR', sans-serif; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.center { text-align: center; }

button {
  font: inherit; font-weight: 700; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 14px; cursor: pointer; transition: transform .08s, background .15s; touch-action: manipulation;
}
button:active:not(:disabled) { transform: scale(0.96); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button small { display: block; font-size: 12px; color: inherit; opacity: .75; font-weight: 400; }
button.primary { background: linear-gradient(180deg, #4cf5bb, #14b47f); color: #022014; border-color: #8ff7d2; }
button.danger { background: #3a1018; border-color: #6e1c2a; color: #ffb3b3; }
button.ghost { background: transparent; }
button.ghost.off { opacity: 0.4; text-decoration: line-through; }
button.sm { padding: 4px 9px; font-size: 13px; border-radius: 9px; }
button.big { padding: 14px 20px; font-size: 19px; width: 100%; }
select, input { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

header {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; flex-wrap: wrap;
  background: rgba(5, 12, 13, 0.8); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px);
}
header h1 { font-size: 26px; white-space: nowrap; }
.spacer { flex: 1; }
.net { font-size: 13px; color: var(--muted); white-space: nowrap; }
.speed { font-size: 14px; color: var(--muted); }
.host-badge { background: var(--warn); color: #2a1600; padding: 2px 7px; border-radius: 8px; font-weight: 900; font-size: 12px; }

.overlay { position: fixed; inset: 0; background: rgba(2, 6, 7, 0.8); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.overlay-box { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; text-align: center; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.qr svg { width: 100%; max-width: 320px; background: #fff; border-radius: 12px; }
.small-qr { text-align: center; }
.small-qr svg { max-width: 200px; }
.join-url { word-break: break-all; font-size: 14px; color: var(--accent); margin: 8px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #123a3a; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; z-index: 80; font-weight: 700; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .25s; }
.toast.err { background: #4a1220; border-color: #8a2436; }
@keyframes pop { from { transform: translate(-50%, 20px); opacity: 0; } }
body.shake main { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ---------- 룰렛 ---------- */
.wheel-wrap { position: relative; width: min(340px, 80vw); margin: 0 auto; }
.wheel { width: 100%; display: block; }
.pointer { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 30px; color: var(--accent); z-index: 1; text-shadow: 0 2px 6px #000; }
.roulette-result { font-family: 'Do Hyeon'; font-size: 26px; color: var(--accent); margin: 10px 0 0; }

/* ---------- 첫 화면 ---------- */
.landing main { max-width: 640px; margin: 0 auto; padding: 32px 16px; text-align: center; }
.landing h1 { font-size: clamp(40px, 11vw, 60px); margin-bottom: 8px; color: var(--accent); text-shadow: 0 0 24px rgba(46,230,166,.35); }
.hero { position: relative; height: 110px; }
.virus { position: absolute; top: 10px; font-size: 64px; filter: drop-shadow(0 0 16px rgba(46,230,166,.45)); animation: float 3s ease-in-out infinite; }
.virus.v1 { left: calc(50% - 110px); font-size: 44px; animation-delay: -1s; }
.virus.v2 { left: calc(50% - 34px); font-size: 72px; top: 0; }
.virus.v3 { left: calc(50% + 60px); font-size: 40px; animation-delay: -2s; filter: hue-rotate(140deg) drop-shadow(0 0 16px rgba(255,75,92,.5)); }
@keyframes float { 50% { transform: translateY(-10px) rotate(12deg); } }
.big-link { display: block; padding: 16px; margin: 10px 0; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 900; font-size: 19px; }
.big-link small { display: block; font-weight: 400; font-size: 13px; margin-top: 4px; color: inherit; opacity: .8; }
.big-link.host { background: linear-gradient(180deg, #4cf5bb, #14b47f); color: #022014; }
.big-link.host2 { border-color: var(--accent); }
.pick { margin-top: 22px; font-size: 22px; }
.note { color: var(--muted); font-size: 14px; }
.rules { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-top: 14px; }
.rules summary { cursor: pointer; font-weight: 900; }
.rules li { margin: 6px 0; font-size: 14px; }

/* ---------- 대기실 ---------- */
.lobby { display: grid; grid-template-columns: minmax(260px, 380px) minmax(300px, 560px); gap: 24px; justify-content: center; padding: 24px 16px; }
.join-box, .members, .card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.join-box { text-align: center; }
.mlist { list-style: none; padding: 0; margin: 0 0 10px; }
.mlist li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--bg2); margin-bottom: 6px; }
.mlist .seat { width: 26px; height: 26px; border-radius: 50%; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; flex: none; }
.mlist .mname { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist .online { font-size: 12px; color: var(--danger); }
.mlist .online.on { color: var(--accent); }
.mlist li.me { outline: 2px solid var(--accent); }
.npc-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 12px 0; font-weight: 700; }
@media (max-width: 720px) { .lobby { grid-template-columns: 1fr; } }

/* ---------- 방장: 게임판 ---------- */
.host .table { display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 300px); gap: 18px; padding: 16px; min-height: calc(100vh - 60px); }
.host .board { display: flex; flex-direction: column; gap: 14px; }
.turn-banner { text-align: center; font-family: 'Do Hyeon'; font-size: clamp(26px, 3vw, 40px); }
.turn-banner b { font-weight: 400; color: var(--accent); }
.last { text-align: center; color: var(--warn); font-weight: 700; min-height: 1.4em; }
.host .last { font-size: clamp(16px, 1.6vw, 22px); }
.board-area { display: flex; align-items: center; justify-content: center; background: rgba(15,32,35,.6); border: 1px dashed var(--line); border-radius: 20px; min-height: 320px; }
.placeholder { text-align: center; font-size: 72px; }
.placeholder p { font-size: 20px; margin: 8px 0 0; font-family: 'Do Hyeon'; }
.host .side { display: flex; flex-direction: column; gap: 12px; }
.players { display: flex; flex-direction: column; gap: 10px; }
.pl { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; transition: box-shadow .2s, border-color .2s; }
.pl.turn { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(46,230,166,.3), 0 0 24px rgba(46,230,166,.18); }
.pl-name { font-weight: 900; }
.off { font-size: 12px; color: var(--danger); font-weight: 700; }
.log-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.log { margin: 0; padding-left: 20px; font-size: 14px; max-height: 260px; overflow: auto; }
.log li { margin: 3px 0; }
.over h2 { margin-bottom: 16px; }
@media (max-width: 860px) { .host .table { grid-template-columns: 1fr; } }

/* ---------- 휴대폰 ---------- */
.player main { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.player header h1 { font-size: 22px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.join input { width: 100%; margin-bottom: 10px; font-size: 18px; }
.host-note { color: var(--warn); font-size: 14px; }
.p-banner { text-align: center; font-family: 'Do Hyeon'; font-size: 26px; padding: 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.p-banner.mine { background: linear-gradient(180deg, #14b47f, #0b6e52); border-color: var(--accent); animation: pulse 1.4s infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 24px rgba(46,230,166,.45); } }
.last.small { font-size: 14px; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
.actions button { flex: 1; padding: 12px; }
.dbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.dbox summary { cursor: pointer; font-weight: 900; }
.dbox .qr { text-align: center; margin: 10px 0; }

/* ---------- 게임판 (세계 지도) ---------- */
.board-svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.board-svg .grid { stroke: rgba(120, 200, 190, .08); stroke-width: .6; fill: none; }
.board-svg .land { stroke: #3c7f78; stroke-width: .6; stroke-linejoin: round; }
.board-svg .leaders path { stroke: rgba(230, 244, 241, .45); stroke-width: .7; stroke-dasharray: 1.5 1.2; fill: none; }
.board-svg .true-pos { fill: rgba(230, 244, 241, .6); }
.board-svg .city .halo { opacity: .28; }
.board-svg .labels text { font-family: 'Noto Sans KR', sans-serif; font-weight: 700; font-size: 7.6px; fill: #e6f4f1;
  paint-order: stroke; stroke: #061316; stroke-width: 2.4px; stroke-linejoin: round; }
.board-area.has-map { border-style: solid; padding: 8px; align-items: stretch; }
.board-area.has-map .board-svg { margin: auto 0; }

/* 지도 미리보기 페이지 */
.design main { max-width: 1400px; margin: 0 auto; padding: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 12px 0; font-weight: 700; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid #fff; }
.city-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.city-table section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.city-table ol { margin: 0; padding-left: 22px; font-size: 14px; columns: 2; }
.board-svg .links path { stroke: rgba(150, 240, 200, .5); stroke-width: 1.3; stroke-linecap: round; fill: none;
  filter: drop-shadow(0 0 1.5px rgba(46, 230, 166, .55)); }
.board-svg .links path.pacific { stroke-dasharray: 4 2.5; }
.board-svg .labels text.edge-tag { font-size: 6.2px; fill: #9ff0cf; font-weight: 700; }

/* ---------- 카드 ---------- */
.cr-card { width: var(--card-w, 160px); height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.design h2 { margin: 26px 0 12px; }
.card-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; --card-w: 170px; margin-bottom: 14px; }
.card-note { max-width: 120px; }
.dz-row { display: flex; flex-wrap: wrap; gap: 24px; }
.dz-row figure { margin: 0; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.dz-row figcaption { margin-top: 6px; }
@media (max-width: 520px) { .card-grid { --card-w: calc(50% - 7px); } }
.pawn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.pawn-row figure { margin: 0; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 96px; font-weight: 700; font-size: 14px; }
.cr-pawn { display: block; margin: 0 auto 4px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.cr-portrait { display: block; margin: 0 auto 2px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.12), transparent 70%); }

/* =========================================================
   게임 화면
   ========================================================= */
/* 게임판 위 상태 표시 */
.board-svg .city { cursor: pointer; }
.board-svg .station { fill: rgba(255,255,255,.1); stroke: #fff; stroke-width: 1.4; }
.board-svg .station-roof { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.board-svg .pick-ring { fill: rgba(46,230,166,.18); stroke: #2ee6a6; stroke-width: 1.6; stroke-dasharray: 3 2; animation: spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.board-svg .sel-ring { fill: none; stroke: #fff; stroke-width: 2; }
.board-svg .danger-ring { fill: none; stroke: #ff4b5c; stroke-width: 1.6; animation: dangerPulse 1.1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.board-svg .cube text { font: 900 7px 'Noto Sans KR', sans-serif; fill: #fff; }
.board-svg .cube.danger rect { animation: cubeBlink 1s infinite alternate; }
.board-svg .pawn.cur path { filter: drop-shadow(0 0 6px #fff); }
.board-svg .flash { fill: none; stroke: var(--c); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; animation: flashOut 1.4s ease-out forwards; }
.board-svg .flash.big { stroke-width: 3.5; animation-duration: 1.8s; }
.board-svg .spread { stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; fill: none; stroke-dasharray: 140; stroke-dashoffset: 140; animation: spreadLine 1.2s ease-out forwards; filter: drop-shadow(0 0 3px var(--c)); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dangerPulse { from { opacity: .35; transform: scale(.9); } to { opacity: 1; transform: scale(1.15); } }
@keyframes cubeBlink { to { fill: #8a1a26; } }
@keyframes flashOut { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(3.4); } }
@keyframes spreadLine { 60% { stroke-dashoffset: 0; opacity: 1; } to { stroke-dashoffset: 0; opacity: 0; } }

/* 상태 줄 */
.status { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; justify-content: center; background: rgba(15,32,35,.75); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; }
.st-block { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.st-lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.track { display: flex; gap: 3px; }
.track i { font-style: normal; width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.track i.past { opacity: .45; }
.track.rate i.on { background: #2ee6a6; color: #022014; border-color: #8ff7d2; box-shadow: 0 0 10px rgba(46,230,166,.6); }
.track.out i.hot { border-color: #6e1c2a; }
.track.out i.on { background: var(--alert); color: #fff; border-color: #ffb3bb; box-shadow: 0 0 10px rgba(255,75,92,.7); }
.cures { display: flex; gap: 8px; }
.cure { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; opacity: .8; }
.cure b { font-weight: 900; }
.cure.done { opacity: 1; border-color: #8ff7d2; background: #0f3b2c; }
.cure.erad { border-color: #ffd23a; background: #3a3208; }
.decks { flex-direction: row; gap: 10px; }
.deck { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.deck b { font-family: 'Do Hyeon'; font-weight: 400; font-size: 22px; color: var(--text); line-height: 1.1; }
.deck small { font-size: 11px; }
.status.small { gap: 6px 10px; padding: 8px; }
.status.small .st-block:nth-child(3) .st-lbl, .status.small .decks small { display: none; }
.status.small .deck { flex-direction: row; gap: 5px; padding: 3px 8px; }
.status.small .cure { padding: 1px 6px 1px 2px; }
.status.small .track i { width: 19px; height: 19px; font-size: 11px; border-radius: 5px; }
.status.small .st-lbl small { display: none; }
.status.small .deck b { font-size: 17px; }

/* 카드 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 5px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--bg2); border: 1.5px solid var(--c, var(--line)); color: var(--text); }
.chip .cr-dz { flex: none; }
.chip.event { border-color: #f3d98b; background: #241a4a; color: #f3d98b; }
.chip.epi { border-color: #c6f23a; color: #c6f23a; }
.chip.inf { background: #0b1719; }
.chip.mini { font-size: 11.5px; padding: 2px 7px 2px 3px; }
.chip.on { background: #0f3b2c; box-shadow: 0 0 0 2px #2ee6a6; }
.card-view { max-width: 340px; }
.card-view .cr-card { --card-w: min(280px, 80vw); margin: 0 auto 12px; }

/* 참가자 목록 */
.plist { display: flex; flex-direction: column; gap: 8px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--r); border-radius: 14px; padding: 8px 10px; }
.pcard.cur { box-shadow: 0 0 0 2px var(--r), 0 0 18px color-mix(in srgb, var(--r) 40%, transparent); }
.pcard.me { background: #12292d; }
.pc-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.pc-head .cr-portrait { border-radius: 50%; background: color-mix(in srgb, var(--r) 35%, #0b1719); flex: none; }
.pc-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pc-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-role { font-size: 12px; color: var(--r); font-weight: 900; }
.pc-city { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pc-hand { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.pc-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }
.stored { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #f3d98b; }

/* 기록 */
.log li.lg-outbreak, .log li.lg-lose { color: #ff8f9a; font-weight: 700; }
.log li.lg-epidemic { color: #c6f23a; font-weight: 700; }
.log li.lg-cure, .log li.lg-eradicate, .log li.lg-win { color: #8ff7d2; font-weight: 700; }
.log li.lg-turn { color: var(--warn); margin-top: 6px; }
.log li.lg-infect, .log li.lg-blocked { color: var(--muted); }

/* 큰 알림 */
.big-banner { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 70; pointer-events: none; animation: bannerIn .35s ease-out; }
.big-banner > div { background: rgba(5,12,13,.92); border: 3px solid #2ee6a6; border-radius: 22px; padding: 22px 34px; text-align: center; max-width: calc(100% - 32px); box-shadow: 0 0 60px rgba(46,230,166,.45); }
.big-banner h2 { font-size: clamp(38px, 8vw, 72px); margin: 0; color: #2ee6a6; }
.big-banner p { margin: 6px 0 0; font-weight: 700; }
.big-banner.epi > div { border-color: #c6f23a; background: repeating-linear-gradient(45deg, rgba(21,26,8,.95) 0 18px, rgba(40,50,10,.95) 18px 36px); box-shadow: 0 0 80px rgba(198,242,58,.5); }
.big-banner.epi h2 { color: #c6f23a; }
.big-banner.out { animation: bannerOut .4s forwards; }
@keyframes bannerIn { from { opacity: 0; transform: scale(.8); } }
@keyframes bannerOut { to { opacity: 0; transform: scale(1.1); } }

/* 결과 */
.result { text-align: center; }
.result h2 { font-size: 40px; margin-bottom: 6px; }
.result.win h2 { color: #2ee6a6; }
.result.lose h2 { color: #ff8f9a; }
.cures.big { justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.cures.big .cure { padding: 4px 12px 4px 4px; font-size: 14px; }
.final-pos { list-style: none; padding: 0; margin: 8px 0 14px; font-size: 14px; }

/* 대기실: 난이도 */
.diff-box { margin: 12px 0; }
.diff-list { display: flex; flex-direction: column; gap: 6px; }
.diff { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--bg2); border: 1.5px solid var(--line); font-weight: 400; }
.diff b { font-size: 16px; }
.diff span { font-size: 12.5px; color: var(--muted); }
.diff.on { border-color: #2ee6a6; background: #0f3b2c; }
.diff.on span { color: var(--text); }
.level-help { font-size: 13px; margin: 4px 0 8px; }
.level-help summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.level-help ul { padding-left: 18px; margin: 6px 0; }
.level-help li { margin: 4px 0; }

/* ---------- 방장 화면 ---------- */
.host-game { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.hg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; justify-content: space-between; }
.hg-top .turn-banner { font-size: clamp(22px, 2.4vw, 34px); text-align: left; }
.hg-main { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 360px); gap: 14px; align-items: start; }
.hg-board { display: flex; flex-direction: column; gap: 8px; }
.board-frame { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #061316; }
.wait-line { min-height: 1.5em; font-weight: 700; color: var(--warn); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draw-line { min-height: 1.5em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.hg-side { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 150px); overflow: auto; }
.side-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.side-box .log { max-height: 240px; }
.wait-roulette { margin: 40px auto; max-width: 420px; }
.city-info { text-align: left; }
@media (max-width: 900px) { .hg-main { grid-template-columns: 1fr; } .hg-side { max-height: none; } }

/* ---------- 휴대폰 게임 화면 ---------- */
.p-game { display: flex; flex-direction: column; gap: 10px; }
.player main { padding-left: 10px; padding-right: 10px; }
.p-top { position: sticky; top: 50px; z-index: 15; }
.p-top .p-banner { font-size: 20px; padding: 7px; }
.map-wrap { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #061316; max-height: 62vh; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.map-inner { width: 100%; }
.map-inner .board-svg { border-radius: 0; }
.zoom-btns { position: sticky; left: calc(100% - 44px); bottom: 6px; display: inline-flex; flex-direction: column; gap: 4px; margin: -110px 0 6px; float: right; z-index: 2; }
.zoom-btns button { background: rgba(5,12,13,.85); width: 36px; height: 32px; padding: 0; font-size: 18px; }
.prompt { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); }
.prompt.ask { border-color: #2ee6a6; background: #0f2f27; box-shadow: 0 0 18px rgba(46,230,166,.2); }
.prompt.wait { color: var(--muted); font-size: 14px; }
.prompt p { margin: 0 0 8px; }
.prompt .chip { vertical-align: middle; }
.fc-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 5px; }
.fc-list li { display: flex; align-items: center; gap: 6px; background: var(--bg2); border-radius: 10px; padding: 5px 8px; }
.fc-list .sp { flex: 1; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.panel h3 { margin: 0; }
.panel .grp { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.panel .cancel { align-self: flex-start; }
.actions.col { flex-direction: column; }
.actions.col button { text-align: left; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.act-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; font-size: 14px; border-radius: 14px; background: var(--panel2); }
.act-btn .ic { font-size: 24px; line-height: 1.1; }
.act-btn small { font-size: 10.5px; font-weight: 400; color: var(--muted); text-align: center; }
.act-btn.off { opacity: .45; }
.act-btn.end { background: #2a1d0b; border-color: #6b4a1a; }
.city-panel .cb { display: inline-flex; align-items: center; gap: 2px; margin-right: 10px; font-weight: 700; }
.city-panel p { margin: 0; }
.tip { margin: 0; }
.my-hand h3 { margin: 10px 0 6px; }
.my-role { display: flex; gap: 10px; align-items: flex-start; }
.role-btn { padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--r) 40%, #0b1719); border: 2px solid var(--r); flex: none; }
.role-btn .cr-portrait { display: block; }
.my-role b { color: var(--r); font-size: 17px; }
.role-text { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hand-list { display: flex; flex-wrap: wrap; gap: 6px; }
.hand-card { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border-radius: 999px; padding-right: 4px; }
.hand-card .sm { padding: 3px 8px; }
.pawn-pick .chip { border-color: var(--c); }
@media (max-width: 380px) { .act-grid { grid-template-columns: repeat(2, 1fr); } }
