/* PLAYORA 도시 만들기 */
:root {
  --ink: #26303b; --ink-2: #4c5764; --ink-3: #7a8490;
  --paper: #fbf8f1; --paper-2: #f2ede2; --paper-3: #e7e0d1; --line: #ddd5c4;
  --acc: #e07a2e; --acc-2: #c4651f; --acc-ink: #fffaf3;
  --sel: #2f4566; --sel-ink: #f6f2e8;
  --zr: #58a65c; --zc: #4f86c6; --zi: #d9a23a;
  --good: #4fae6d; --bad: #e0533d; --gold: #f2c14e;
  --page: #f4f0e7; --page-ink: #232b33; --page-2: #5d6773; --page-line: #ddd5c6;
  --f-body: "IBM Plex Sans KR", "Pretendard", system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --f-disp: "Do Hyeon", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 6px; --r2: 10px; --r3: 14px;
  --sh: 0 1px 0 rgba(38, 48, 59, 0.08), 0 6px 18px -8px rgba(38, 48, 59, 0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@supports (color: oklch(0 0 0)) {
  :root {
    --ink: oklch(0.29 0.022 250); --ink-2: oklch(0.44 0.02 250); --ink-3: oklch(0.6 0.016 250);
    --paper: oklch(0.982 0.008 88); --paper-2: oklch(0.948 0.014 86); --paper-3: oklch(0.91 0.02 86); --line: oklch(0.87 0.022 86);
    --acc: oklch(0.68 0.16 52); --acc-2: oklch(0.6 0.15 50);
    --sel: oklch(0.36 0.055 255);
    --page: oklch(0.958 0.012 85); --page-line: oklch(0.88 0.02 85);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--page); color: var(--page-ink); font: 400 16px/1.7 var(--f-body); word-break: keep-all; overflow-wrap: anywhere; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 페이지 */
.mast { display: flex; align-items: baseline; gap: var(--s4); padding: var(--s3) clamp(var(--s4), 3vw, var(--s6)); border-bottom: 1px solid var(--page-line); }
.mast-brand { text-decoration: none; font-size: 14px; color: var(--page-2); white-space: nowrap; }
.mast-brand b { font-weight: 700; letter-spacing: 0.1em; color: var(--page-ink); margin-right: 6px; }
.mast-more { margin-left: auto; font-size: 14px; color: var(--page-2); white-space: nowrap; }
.head { max-width: 1240px; margin: 0 auto; padding: var(--s4) clamp(var(--s3), 3vw, var(--s6)) var(--s3); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.head h1 { margin: 0; font: 400 clamp(32px, 4.2vw, 46px)/1.1 var(--f-disp); color: var(--sel); letter-spacing: 0.01em; }
.head p { margin: 0; color: var(--page-2); font-size: 15px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(0px, 2vw, var(--s5)); }
.nojs { padding: var(--s6); text-align: center; }

/* ---------------------------------------------------------------- 게임 틀 */
.cb { position: relative; width: 100%; height: clamp(560px, calc(100svh - 132px), 860px); background: #dae4df; color: var(--ink); overflow: hidden; border-radius: var(--r2);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; font: 400 14px/1.45 var(--f-body); isolation: isolate; }
@media (max-width: 640px) { .cb { border-radius: 0; height: calc(100svh - 96px); min-height: 560px; } .head { padding-top: var(--s3); } .head p { display: none; } }
html.embed, html.embed body { height: 100%; overflow: hidden; background: #dae4df; }
html.embed .mast, html.embed .head, html.embed .about, html.embed .foot { display: none !important; }
html.embed .wrap { padding: 0; max-width: none; }
html.embed .cb { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; border-radius: 0; }
.cb:fullscreen { border-radius: 0; }
.cb canvas#cv { position: absolute; inset: 0; display: block; touch-action: none; cursor: grab; }
.cb.building canvas#cv { cursor: crosshair; }
.cb button:focus-visible, .cb input:focus-visible, .cb select:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.cb svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 위 막대 */
.hud { position: absolute; top: var(--s2); left: var(--s2); right: var(--s2); z-index: 5; display: flex; align-items: center; gap: var(--s2); pointer-events: none; }
.hud > * { pointer-events: auto; }
.cb.at-start .hud, .cb.at-start .side, .cb.at-start .dock, .cb.at-start .tipbar, .cb.at-start .undo, .cb.at-start .tray { display: none !important; }
.h-city, .h-stats, .h-speed { display: flex; align-items: center; height: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh); }
.h-city { padding: 0 var(--s3); gap: var(--s2); min-width: 0; }
.h-city b { font: 400 19px/1 var(--f-disp); color: var(--sel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.stage { font-size: 12px; font-weight: 700; color: var(--sel-ink); background: var(--sel); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.h-stats { padding: 0 var(--s1); min-width: 0; }
.hs { display: inline-flex; align-items: center; gap: 5px; padding: 0 var(--s2); height: 100%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hs + .hs { border-left: 1px solid var(--line); }
.hs b { font-weight: 600; font-size: 14px; }
.hs svg { width: 17px; height: 17px; color: var(--ink-3); }
.h-money.neg b { color: var(--bad); }
.h-date b { font-weight: 500; color: var(--ink-2); }
.sun { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px rgba(242, 193, 78, 0.3); }
.sun.moon { background: #c9d2e6; box-shadow: inset -3px -1px 0 #8392b3; }
.h-speed { padding: 3px; gap: 2px; }
.sp { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.sp svg { width: 16px; height: 16px; }
.sp:hover { background: var(--paper-2); }
.sp.on { background: var(--sel); color: var(--sel-ink); }
.sp1 { display: none; }
.h-btns { margin-left: auto; display: flex; gap: 6px; }
.hb { height: 40px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: var(--paper); box-shadow: var(--sh); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.hb.icon { width: 40px; padding: 0; justify-content: center; }
.hb:hover { background: var(--paper-2); }
.hb.on { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.hb.narrow { display: none; }
.cb.narrow .hb.wide { display: none; }
.cb.narrow .hb.narrow { display: inline-flex; }
.cb.mid .h-city, .cb.mid #bAch, .cb.mid #bHelp { display: none; }
.cb.mid .hb.narrow { display: inline-flex; }
/* 1100px보다 좁은 가로 화면: 업적·설정·도움말은 메뉴로 (후반에 자금·인구 숫자가 커도 위 막대에 들어가게) */
.cb.land:not(.wide) #bAch, .cb.land:not(.wide) #bSet, .cb.land:not(.wide) #bHelp { display: none; }
.cb.land:not(.wide) .hb.narrow { display: inline-flex; }
.cb.narrow .h-speed .sp[data-sp] { display: none; }
.cb.narrow .h-speed .sp1 { display: inline-flex; width: 40px; }
.cb.narrow .sp1 b { font-size: 14px; }
.cb.narrow .h-city b { max-width: 6em; font-size: 17px; }
.cb.narrow .hud { gap: 6px; }
.cb.tiny .h-city { display: none; }
.cb.tiny .h-date { display: none; }
.cb.tiny .hs { padding: 0 5px; gap: 4px; }
.cb.tiny .hb.icon { width: 36px; }
.cb.tiny .h-btns { gap: 4px; }
.cb.tiny #bSound { display: none; }
.cb.tiny .hs svg { width: 15px; height: 15px; }
.cb.tiny .hs b { font-size: 13px; }
@media (max-width: 1000px) { .cb:not(.wide) .hb.wide:not(.icon) span { display: none; } .cb:not(.wide) .hb.wide:not(.icon) { width: 40px; padding: 0; justify-content: center; } }

/* 왼쪽: 수요 막대, 목표, 소식 */
.side { position: absolute; top: 58px; left: var(--s2); z-index: 4; width: 196px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.dem { pointer-events: auto; display: flex; gap: 6px; padding: var(--s2) var(--s2) 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh); width: max-content; }
.db { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.db i { position: relative; display: block; width: 14px; height: 46px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.db i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(38, 48, 59, 0.25); }
.db em { position: absolute; left: 0; right: 0; bottom: 50%; height: 0; border-radius: 2px; transition: height 0.4s var(--ease), bottom 0.4s var(--ease); }
.db.r em { background: var(--zr); } .db.c em { background: var(--zc); } .db.i em { background: var(--zi); }
.db.neg em { opacity: 0.55; }
.db span { font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1; }
.goal { pointer-events: auto; padding: 6px var(--s2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--sh); font-size: 12px; color: var(--ink-2); }
.goal span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.goal i { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.goal em { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 3px; transition: width 0.5s var(--ease); }
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.news li { font-size: 12px; line-height: 1.35; padding: 5px var(--s2); border-radius: var(--r1); background: rgba(38, 48, 59, 0.78); color: #f4f1ea; max-width: 196px; animation: newsIn 0.4s var(--ease); }
.news li.v::before { content: "시민 "; color: var(--gold); font-weight: 700; }
.news li:nth-child(n+3) { opacity: 0.7; }
@keyframes newsIn { from { opacity: 0; transform: translateY(-4px); } }
.cb.port .side { width: auto; top: 56px; flex-direction: row; align-items: flex-start; }
.cb.port .goal { width: 150px; }
.cb.port .news { display: none; }
.cb.port .dem { padding: 6px; }
.cb.port .db i { height: 34px; width: 12px; }
.cb.short .news { display: none; }

/* 아래 도구 줄 */
.dock { position: absolute; left: 50%; bottom: var(--s2); transform: translateX(-50%); z-index: 6; display: flex; gap: 2px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh); }
.dk { width: 62px; height: 52px; border: 0; border-radius: var(--r2); background: transparent; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); }
.dk svg { width: 22px; height: 22px; }
.dk span { font-size: 12px; font-weight: 600; line-height: 1; }
.dk:hover { background: var(--paper-2); color: var(--ink); }
.dk.on { background: var(--sel); color: var(--sel-ink); }
.dk[data-cat="dozer"].on { background: var(--bad); }
.cb.narrow .dock { left: 0; right: 0; bottom: 0; transform: none; border-radius: var(--r3) var(--r3) 0 0; border-width: 1px 0 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-between; }
.cb.narrow .dk { flex: 1 1 0; width: auto; min-width: 0; height: 50px; }
.cb.tiny .dk span { font-size: 12px; }
.cb.tiny .dk svg { width: 20px; height: 20px; }

/* 고르기 칸 (도구 안의 건물) */
.tray { position: absolute; bottom: 78px; z-index: 6; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; max-width: min(560px, calc(100% - 16px)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh); animation: trayIn 0.22s var(--ease); }
@keyframes trayIn { from { opacity: 0; transform: translateY(6px); } }
.ti { width: 104px; padding: 4px 4px 6px; border: 1px solid transparent; border-radius: var(--r2); background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: normal; text-align: center; color: var(--ink); }
.ti img { width: 52px; height: 52px; }
.ti b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.ti small { font-size: 12px; color: var(--ink-3); line-height: 1.2; display: inline-flex; align-items: center; gap: 2px; }
.ti small svg { width: 12px; height: 12px; }
.ti:hover { background: var(--paper-2); }
.ti.on { border-color: var(--sel); background: #e9eef5; }
.ti.lock { opacity: 0.55; }
.ti.lock img { filter: grayscale(1); }
.cb.narrow .tray { left: 4px !important; right: 4px; max-width: none; bottom: calc(62px + env(safe-area-inset-bottom)); justify-content: flex-start; }
.cb.narrow .ti { width: calc(25% - 3px); }
.cb.narrow .ti img { width: 42px; height: 42px; }
.cb.short .ti img { width: 36px; height: 36px; }
.cb.short .tray { bottom: 70px; }

/* 도구 설명 줄 */
.tipbar { position: absolute; left: var(--s2); bottom: 78px; z-index: 5; max-width: min(460px, calc(100% - 140px)); padding: 6px var(--s3); background: rgba(38, 48, 59, 0.86); color: #f4f1ea; border-radius: var(--r2); font-size: 13px; line-height: 1.4; }
.tipbar b { font-weight: 700; margin-right: 4px; }
.tipbar em { font-style: normal; color: var(--gold); font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cb:has(.tray:not([hidden])) .tipbar { display: none; }
.cb.narrow .tipbar { bottom: calc(66px + env(safe-area-inset-bottom)); left: var(--s2); right: 64px; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb.narrow .tipbar span { display: none; }

/* 되돌리기 */
.undo { position: absolute; right: var(--s2); bottom: 78px; z-index: 6; height: 40px; padding: 0 var(--s3); display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--paper); box-shadow: var(--sh); font-size: 14px; font-weight: 600; }
.undo:hover { background: var(--paper-2); }
.cb.narrow .undo { bottom: calc(66px + env(safe-area-inset-bottom)); width: 44px; padding: 0; justify-content: center; }
.cb.narrow .undo span { display: none; }
.cb.narrow:has(.tray:not([hidden])) .undo { display: none; }

/* 살펴보기 카드 */
.card { position: absolute; right: var(--s2); top: 58px; z-index: 5; width: 260px; max-height: calc(100% - 150px); overflow: auto; padding: var(--s3) var(--s4) var(--s4); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh); animation: trayIn 0.2s var(--ease); }
.card h3 { margin: 0 28px 2px 0; font: 400 22px/1.2 var(--f-disp); color: var(--sel); }
.card .sub { margin: 0 0 var(--s2); font-size: 13px; color: var(--ink-2); }
.card .big { margin: 0 0 var(--s2); font-size: 14px; } .card .big b { font-size: 17px; font-variant-numeric: tabular-nums; }
.card .flags { display: flex; gap: 6px; margin: 0 0 var(--s2); }
.card .flags span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.flags .ok { background: #e3f2e6; color: #2f7a46; } .flags .no { background: #fbe3df; color: #b23a2a; }
.cb-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: var(--s2); font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.cb-row i { display: block; height: 6px; border-radius: 3px; background: var(--paper-3); overflow: hidden; }
.cb-row em { display: block; height: 100%; border-radius: 3px; }
.cb-row i.good em { background: var(--good); } .cb-row i.bad em { background: var(--bad); }
.card .iss { margin: var(--s2) 0 0; padding: 0; list-style: none; }
.card .iss li { font-size: 13px; padding: 4px 0 4px 14px; position: relative; color: #9a3324; }
.card .iss li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.x:hover { background: var(--paper-2); }
.cb.port .card { left: var(--s2); right: var(--s2); width: auto; top: auto; bottom: calc(66px + env(safe-area-inset-bottom)); max-height: 46%; }

/* 겹쳐 보기 범례 */
.legend { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px var(--s3); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--sh); font-size: 13px; white-space: nowrap; }
.legend b { font-weight: 700; color: var(--sel); }
.legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; }
.cb.port .legend { top: auto; bottom: calc(66px + env(safe-area-inset-bottom)); max-width: calc(100% - 16px); overflow: hidden; }
.cb.tiny .legend span:nth-of-type(3) { display: none; }

/* 알림, 말풍선 */
.toast { position: absolute; left: 50%; top: 58px; z-index: 9; transform: translate(-50%, -8px); max-width: min(480px, calc(100% - 24px)); padding: var(--s2) var(--s4); background: var(--ink); color: #f6f2e8; border-radius: var(--r2); font-size: 14px; line-height: 1.45; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.3s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.cb.port .toast { top: 104px; }
.bubbles { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.bub { position: absolute; left: 0; top: 0; max-width: 200px; padding: 6px 10px; background: #fffdf8; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; line-height: 1.35; box-shadow: var(--sh); white-space: normal; }
.bub::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: #fffdf8; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }

/* 처음 안내 */
.tut { position: absolute; left: var(--s2); bottom: 130px; z-index: 6; width: 280px; padding: var(--s3) var(--s4); background: var(--sel); color: var(--sel-ink); border-radius: var(--r3); box-shadow: var(--sh); animation: trayIn 0.3s var(--ease); }
.tut .step { margin: 0; font-size: 12px; opacity: 0.75; }
.tut b { display: block; font: 400 20px/1.25 var(--f-disp); margin: 2px 0 4px; }
.tut p { margin: 0; font-size: 13px; line-height: 1.5; }
.tb2 { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s2); }
.lnk { border: 0; background: transparent; padding: 4px 0; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.lnk.dim { opacity: 0.7; font-weight: 500; }
.cb.port .tut { top: 102px; bottom: auto; left: var(--s2); right: var(--s2); width: auto; padding: var(--s2) var(--s3); }
.cb.port .tut b { font-size: 17px; }
.cb.short .tut { bottom: auto; top: 58px; left: auto; right: var(--s2); width: 250px; }

/* 단추 */
.btn1, .btn2, .btn3 { min-height: 44px; padding: 0 var(--s4); border-radius: var(--r2); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); transition: transform 0.12s var(--ease); }
.btn1 { border: 0; background: var(--acc); color: var(--acc-ink); box-shadow: 0 3px 0 var(--acc-2); }
.btn1:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--acc-2); }
.btn1.sm { min-height: 34px; font-size: 13px; padding: 0 var(--s3); }
.btn2 { border: 1px solid var(--sel); background: #eef2f8; color: var(--sel); }
.btn2:hover { background: #e2e9f3; }
.btn3 { border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
.btn3:hover { background: var(--paper-2); }
.row2 { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }

/* 창 */
.modal { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: var(--s3); background: rgba(24, 30, 38, 0.45); animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } }
.mbox { position: relative; width: min(440px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; padding: var(--s5) var(--s5) var(--s5); background: var(--paper); border-radius: var(--r3); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5); animation: popIn 0.28s var(--ease); scrollbar-width: thin; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.mbox.small { width: min(420px, 100%); }
.mbox.mid { width: min(560px, 100%); }
.mbox.wide { width: min(860px, 100%); }
.mbox h2 { margin: 0 40px var(--s3) 0; font: 400 28px/1.15 var(--f-disp); color: var(--sel); }
.mbox h2 small { font: 600 14px/1 var(--f-body); color: var(--ink-3); margin-left: 6px; }
.mbox h3 { margin: var(--s4) 0 var(--s2); font-size: 14px; font-weight: 700; color: var(--ink); }
.mbox p { margin: 0 0 var(--s2); color: var(--ink-2); font-size: 14px; }
.mbox .note { font-size: 13px; color: var(--ink-3); }
.cb.short .mbox { padding: var(--s4); }
.cb.short .mbox h2 { font-size: 24px; margin-bottom: var(--s2); }
/* 예산 */
.bud-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.bud-top div { padding: var(--s2) var(--s3); background: var(--paper-2); border-radius: var(--r2); min-width: 0; }
.bud-top span { display: block; font-size: 12px; color: var(--ink-3); }
.bud-top b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: #2f7a46; } .neg { color: #b23a2a; }
.mbox .pop-line { margin: var(--s3) 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.pop-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bud-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s5); }
.bud-l canvas { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r2); }
.leg { display: flex; gap: var(--s3); align-items: center; font-size: 12px; margin-top: 6px !important; }
.leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: -6px; }
.leg .li { background: #4fae6d; } .leg .le { background: #e0533d; } .leg .lm { background: #2f4f86; height: 3px; }
.tax { display: grid; grid-template-columns: 34px 32px minmax(0, 1fr) 32px 40px; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.tax b { text-align: right; font-variant-numeric: tabular-nums; }
.tb { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.tax input { width: 100%; accent-color: var(--sel); }
.bt { width: 100%; border-collapse: collapse; font-size: 13px; }
.bt th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 3px 0; }
.bt td { text-align: right; font-variant-numeric: tabular-nums; padding: 3px 0; }
.bt tr + tr { border-top: 1px solid var(--line); }
.bud-r .btn2 { margin-top: var(--s3); width: 100%; }
.cb.port .bud-grid, .cb.narrow .bud-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.cb.narrow .bud-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 겹쳐 보기 고르기 */
.lgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lg { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r2); background: #fff; font-weight: 600; font-size: 14px; }
.lg.on { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.lg.off { color: var(--ink-3); }
/* 저장 칸 */
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: #fff; }
.sl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-t b { font-size: 14px; }
.sl-t span { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-t span.empty { color: var(--ink-3); }
.sl-t small { font-size: 12px; color: var(--ink-3); }
.sl-b { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sl-b .btn2, .sl-b .btn3 { min-height: 36px; font-size: 13px; padding: 0 var(--s3); }
.cb.tiny .slot { flex-direction: column; align-items: stretch; }
.cb.tiny .sl-b { justify-content: flex-start; }
/* 설정 */
.tg { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tg span { display: flex; flex-direction: column; }
.tg b { font-size: 15px; font-weight: 600; } .tg small { font-size: 12px; color: var(--ink-3); }
.tg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg i { position: relative; flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--paper-3); transition: background 0.2s; }
.tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease); }
.tg input:checked + i { background: var(--sel); }
.tg input:checked + i::after { transform: translateX(20px); }
.tg input:focus-visible + i { outline: 3px solid var(--acc); outline-offset: 2px; }
.rowv { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rowv span { flex: none; width: 68px; font-weight: 600; }
.rowv input[type=range] { flex: 1; accent-color: var(--sel); }
.rowv select { flex: 1; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 var(--s2); }
/* 업적 */
.achs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.achs li { padding: var(--s2) var(--s3); border-radius: var(--r2); background: var(--paper-2); color: var(--ink-3); display: flex; flex-direction: column; }
.achs li b { font-size: 14px; } .achs li span { font-size: 12px; line-height: 1.4; } .achs li small { font-size: 12px; margin-top: 2px; }
.achs li.on { background: #fdf1d8; color: var(--ink); box-shadow: inset 3px 0 0 var(--gold); }
.cb.tiny .achs { grid-template-columns: minmax(0, 1fr); }
/* 도움말·메뉴 */
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys th { text-align: left; vertical-align: top; font-weight: 600; padding: 5px var(--s3) 5px 0; white-space: nowrap; }
.keys td { padding: 5px 0; color: var(--ink-2); }
.keys tr + tr { border-top: 1px solid var(--line); }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mgrid button { min-height: 52px; border: 1px solid var(--line); border-radius: var(--r2); background: #fff; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3); font-weight: 600; font-size: 15px; }
.mgrid svg { color: var(--ink-3); width: 20px; height: 20px; }
/* 단계 오름 */
.stg .kick { margin: 0; font-size: 13px; font-weight: 700; color: var(--acc-2); letter-spacing: 0.04em; }
.stg h2 { font-size: 34px; margin-top: 2px; }
.unl { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.unl li { display: flex; flex-direction: column; align-items: center; width: 92px; font-size: 13px; text-align: center; }
.unl img { width: 56px; height: 56px; }
.stg .btn1 { width: 100%; margin-top: var(--s2); }
.tips { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 처음 화면 */
.start { position: absolute; top: 0; left: 0; bottom: 0; z-index: 8; width: min(400px, 100%); display: flex; padding: var(--s3); pointer-events: none; }
.st-panel { pointer-events: auto; width: 100%; overflow: auto; overscroll-behavior: contain; padding: var(--s5); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh); scrollbar-width: thin; }
.st-t { margin: 0 0 var(--s2); font: 400 40px/1 var(--f-disp); color: var(--sel); }
html:not(.embed) .st-t { display: none; }
.st-d { margin: 0 0 var(--s3); font-size: 14px; color: var(--ink-2); }
.st-panel h3 { margin: var(--s4) 0 var(--s2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.st-cont { width: 100%; justify-content: flex-start; padding: var(--s2) var(--s4); min-height: 56px; text-align: left; }
.st-cont span { display: flex; flex-direction: column; line-height: 1.25; }
.st-cont small { font-weight: 500; font-size: 12px; opacity: 0.9; }
.maps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mp { padding: 4px 4px 6px; border: 2px solid var(--line); border-radius: var(--r2); background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; white-space: normal; }
.mp img { width: 100%; aspect-ratio: 1; border-radius: 6px; image-rendering: pixelated; }
.mp b { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; }
.mp.on { border-color: var(--sel); background: #e9eef5; }
.seed { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s2); font-size: 13px; color: var(--ink-2); }
.seed b { font-variant-numeric: tabular-nums; color: var(--ink); }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.md { padding: var(--s2) var(--s3); border: 2px solid var(--line); border-radius: var(--r2); background: #fff; display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; }
.md b { font-size: 15px; } .md small { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.md.on { border-color: var(--sel); background: #e9eef5; }
.nm { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s4); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.nm input { min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: #fff; font-size: 16px; font-weight: 500; color: var(--ink); -webkit-user-select: text; user-select: text; }
.st-panel .row2 .btn1 { flex: 1; }
.st-panel .row2 { position: sticky; bottom: calc(-1 * var(--s5)); margin-bottom: calc(-1 * var(--s5)); padding: var(--s3) 0 var(--s5); background: var(--paper); z-index: 1; }
.cb.port .st-panel .row2, .cb.short .st-panel .row2 { bottom: calc(-1 * var(--s4)); margin-bottom: calc(-1 * var(--s4)); padding-bottom: var(--s4); }
.cb.port .st-d { display: none; }
.cb.port .st-panel h3 { margin-top: var(--s3); }
.cb.port .nm { margin-top: var(--s3); }
.cb.port .start { top: auto; width: 100%; height: 66%; padding: var(--s2); }
.cb.port .st-panel { padding: var(--s4); }
.cb.port .st-t { font-size: 32px; }
.cb.short .start { width: min(380px, 60%); }
.cb.short .st-panel { padding: var(--s4); }

/* ---------------------------------------------------------------- 소개 글 */
.about { max-width: 1240px; margin: 0 auto; padding: var(--s7) clamp(var(--s4), 3vw, var(--s6)); display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s7); }
.about h2 { margin: var(--s6) 0 var(--s3); font: 400 30px/1.25 var(--f-disp); color: var(--sel); }
.about h2:first-child { margin-top: 0; }
.about h3 { margin: var(--s5) 0 var(--s2); font-size: 18px; font-weight: 700; }
.about p, .about li { color: #39424d; }
.about ol, .about ul { padding-left: 1.3em; }
.about li { margin-bottom: 6px; }
.about dl { margin: 0; }
.about dt { font-weight: 700; margin-top: var(--s4); }
.about dd { margin: 4px 0 0; color: #39424d; }
.about .more { margin-top: var(--s6); font-size: 14px; line-height: 2; color: var(--page-2); }
.about-side h3:first-child { margin-top: 0; }
.keytab { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: var(--s4); }
.keytab th { text-align: left; font-weight: 600; padding: 6px var(--s3) 6px 0; vertical-align: top; white-space: nowrap; }
.keytab td { padding: 6px 0; color: #4b5560; }
.keytab tr + tr { border-top: 1px solid var(--page-line); }
@media (max-width: 900px) { .about { grid-template-columns: minmax(0, 1fr); gap: var(--s5); } }
.foot { border-top: 1px solid var(--page-line); padding: var(--s5) clamp(var(--s4), 3vw, var(--s6)) var(--s6); max-width: 1240px; margin: 0 auto; font-size: 14px; color: var(--page-2); }
.foot a { margin-right: var(--s4); white-space: nowrap; display: inline-block; }
.foot p { font-size: 13px; margin: var(--s3) 0 0; }

@media (prefers-reduced-motion: reduce) { .cb *, .cb *::before, .cb *::after { animation: none !important; transition: none !important; } }
