/* 나전칠기 밤 (2026-11-01): 흑칠 판 + 자개빛 장식선 + 백자빛 안내 판. 이전 톤(옻칠 나무·청동·양피지)은 삼국지풍이라 바꿨다 */
:root {
  /* 나전칠기 밤 (2026-11-01): 흑칠 바탕 + 주칠 포인트 + 자개 무지갯빛. 삼국지풍 나무·청동·금을 걷어냈다 */
  --bg: #121014;
  --wood-0: #0f0d11;
  --wood-1: #1b171d;
  --wood-2: #241f27;
  --wood-3: #2e2832;
  --bronze: #5e5468;          /* 테두리: 옅은 자개빛 회보라 */
  --bronze-hi: #cfe9ef;       /* 강조 테두리: 자개 청록 */
  --bronze-lo: #3a3340;
  --parch: #ddd5d0;           /* 밝은 판: 빛바랜 한지 (2026-11-01: 흰빛이 너무 쨍해 톤을 낮춤) */
  --parch-2: #cbc1bd;
  --ink: #2b2030;
  --ink-dim: #6e6278;
  --text: #efe9f2;
  --dim: #a59cb0;
  --gold: #ecdcb4;            /* 수치·제목: 자개 속 미색 */
  --red: #e0604e;
  --green: #8fd0a0;
  --cyan: #9fe3ef;
  --line: #3a3340;
  --panel: #1b171d;
  --lacquer: #7d1d1d;         /* 주칠 */
  --pearl: linear-gradient(115deg, #f6d6e6, #cfe9ef 30%, #e6dcf8 55%, #f4eed2 75%, #cfe9ef);
  --grain: radial-gradient(ellipse at 20% 0%, rgba(207, 233, 239, .05), transparent 60%);
  --wood: var(--grain), linear-gradient(180deg, #1f1a22, #141116);
  --card: linear-gradient(180deg, #1d191f, #151216);
  --parchment: radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .14), transparent 55%), radial-gradient(ellipse at 90% 95%, rgba(110, 90, 120, .16), transparent 60%), linear-gradient(180deg, #ddd5d0, #cbc2be);
  --f-body: "Gowun Dodum", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --f-head: "Gowun Batang", var(--f-head);
}
* { box-sizing: border-box; }
/* 화면 배율 (2026-10-30: 15인치 1920×1080 노트북에서 글자가 작다). 캔버스 지도 클릭은 표준 CSS zoom 에서 그대로 맞는다.
   배율 100% 1920 폭 → 1.25 (레이아웃 1536×864), Windows 125% 1536 폭 → 1.1 */
:root { --ui-zoom: 1; }
@media (min-width: 1500px) and (min-height: 820px) { :root { --ui-zoom: 1.1; } }
@media (min-width: 1800px) and (min-height: 1000px) { :root { --ui-zoom: 1.25; } }
@media (min-width: 2400px) and (min-height: 1300px) { :root { --ui-zoom: 1.5; } }
html { zoom: var(--ui-zoom); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--f-body); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #8a6430, #5e4220); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }

button { font: inherit; color: #f4eef8; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); background: linear-gradient(180deg, #2c2532, #19151c); border: 1px solid #6a5f72; border-radius: 5px; padding: 4px 12px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(207, 233, 239, .14), 0 1px 2px rgba(0, 0, 0, .45); }
button:hover:not(:disabled) { background: linear-gradient(180deg, #3a3141, #221d27); border-color: var(--bronze-hi); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.4); }
button.alt { background: linear-gradient(180deg, #9a2a26, #6a1616); border-color: #d8817a; } /* 주요 행동: 주칠 */
button.alt:hover:not(:disabled) { background: linear-gradient(180deg, #b0332d, #7d1d1d); }
button.danger { background: linear-gradient(180deg, #4a1c22, #2a0f13); border-color: #c0605a; color: #ffd9d2; }
button.rush { background: linear-gradient(180deg, #d9a521, #8a6210); border-color: #ffd970; color: #1c1206; font-weight: 700; }
button.rush:hover:not(:disabled) { background: linear-gradient(180deg, #ecb92e, #9c7014); }
.topbar .gold-cur b { color: #ffd34d; }
.gold-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe68a, #c48d12); color: #5a3a00; font-size: 11px; font-weight: 800; align-self: center; }
button.danger:hover:not(:disabled) { background: linear-gradient(180deg, #5e2229, #351217); }
button.link { background: none; border: none; box-shadow: none; text-shadow: none; color: var(--dim); padding: 0; text-decoration: underline; }
input, select { font: inherit; color: var(--text); background: #0e0c10; border: 1px solid var(--bronze-lo); border-radius: 4px; padding: 4px 6px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
input:focus, select:focus { outline: none; border-color: var(--bronze-hi); }
/* 키보드 포커스와 기본 입력 컨트롤 (2026-10-30) */
button:focus-visible, input:focus-visible, select:focus-visible, [role=button]:focus-visible { outline: 2px solid var(--bronze-hi); outline-offset: 2px; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--bronze); }
select option { color: var(--text); background: #0e0c10; }
.next { margin: 6px 0; padding: 6px 8px; border-left: 3px solid var(--bronze); background: rgba(90, 64, 104, .12); color: var(--ink); font-size: 13px; }
input[type=number] { width: 80px; }
h2 { margin: 0 0 10px; font-family: var(--f-head); font-weight: 800; font-size: 19px; color: var(--gold); text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
h3 { margin: 14px 0 8px; font-family: var(--f-head); font-weight: 800; font-size: 15px; color: var(--gold); }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid rgba(160, 150, 180, .22); padding: 5px 6px; text-align: left; }
th { color: var(--dim); font-weight: normal; }
.dim { color: var(--dim); }
.red { color: var(--red); }
.green { color: var(--green); }
.gold { color: var(--gold); }
.cyan { color: var(--cyan); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg { min-height: 1.4em; color: #a8321f; }
[hidden] { display: none !important; }

/* 로그인 */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: auto; background: #0c0a0e; }
/* 병풍: UR 원화 다섯 폭을 어둡게 깔고 천천히 숨쉬듯 확대 (2026-11-01) */
.title-screen { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; overflow: hidden; background: linear-gradient(90deg, #2b2530, #6a5f72, #2b2530); }
.title-screen > div { background: var(--art) center 18% / cover; filter: saturate(.85) brightness(.55); animation: folding 24s ease-in-out infinite alternate; }
.title-screen > div:nth-child(2n) { animation-delay: -12s; }
.title-screen::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 50% 50%, rgba(12, 10, 14, .25), rgba(12, 10, 14, .88) 75%), linear-gradient(180deg, rgba(12, 10, 14, .6), transparent 30%, transparent 65%, rgba(12, 10, 14, .9)); }
@keyframes folding { to { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .title-screen > div { animation: none; } }
@media (max-width: 720px) { .title-screen { grid-template-columns: repeat(3, 1fr); } .title-screen > div:nth-child(n+4) { display: none; } }

.login-wrap { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; width: min(400px, calc(100% - 32px)); padding: 24px 0; }
.title-mark { display: flex; align-items: center; gap: 10px; }
.title-mark h1 { margin: 0; font: 400 clamp(64px, 14vw, 96px)/1 "Nanum Brush Script", "Nanum Myeongjo", serif; letter-spacing: 2px; color: #f4eef8;
  background: linear-gradient(115deg, #f6d6e6 10%, #cfe9ef 35%, #e6dcf8 60%, #f4eed2 85%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #1b1020) drop-shadow(0 6px 18px rgba(0, 0, 0, .8)); }
.title-mark .seal { display: grid; place-items: center; width: 44px; height: 44px; margin-top: 18px; transform: rotate(-6deg); color: #fbe9d0; font: 800 15px/1.05 var(--f-head); writing-mode: vertical-rl; letter-spacing: 1px;
  background: #b0291c; border-radius: 6px; box-shadow: inset 0 0 0 2px #fbe9d0, inset 0 0 0 4px #b0291c, 0 3px 8px rgba(0, 0, 0, .6); }
.title-sub { margin: -4px 0 8px; color: #e2d6ea; font: 700 15px var(--f-head); letter-spacing: 1px; text-align: center; text-shadow: 0 1px 6px #000; }
.title-foot { margin: 6px 0 0; color: rgba(226, 214, 234, .55); font-size: 11px; letter-spacing: .5px; text-align: center; }
.title-foot a { color: inherit; }
/* Google 계정 로그인 (2026-11-16) */
.google-box { margin-bottom: 14px; }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.google-name { margin-top: 12px; }
.google-hello { margin: 0 0 10px; color: #f4eef8; font-size: 14px; }
.google-or { margin: 12px 0 0; color: #b9b0c4; font-size: 12px; text-align: center; }
.google-age { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #d4cddc; font-size: 13px; }
.login-box .google-age input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; box-shadow: none; } /* .login-box input 의 width:100% 가 체크박스에 걸려 글자가 오른쪽으로 밀렸다 (2026-11-16) */
.google-cancel { display: block; margin: 10px auto 0; }
/* Google 로 처음 가입하는 동안은 가입 칸만 (2026-11-16 유저: 기존 군주 입성 칸이 아래에 보여 헷갈림) */
.login.google-signup .google-btn, .login.google-signup .google-or, .login.google-signup .login-tabs, .login.google-signup #login-form { display: none; }
.google-age a { color: #cfe9ef; }
.delete-account p { margin: 0 0 10px; }
.settings { display: grid; gap: 10px; }
.settings p { margin: 0; }
.settings a { color: #cfe9ef; }
.delete-account input { width: 100%; box-sizing: border-box; margin: 4px 0 12px; }
.login.google-only .login-tabs { display: none; }

/* 칠기 판: 검붉은 옻칠 + 금테 */
.login-box { width: 100%; box-sizing: border-box; padding: 18px 22px 16px; color: var(--text); text-align: left;
  background: radial-gradient(ellipse at 30% 0%, rgba(207, 233, 239, .08), transparent 60%), linear-gradient(180deg, #1f1a22, #121014);
  border: 1px solid #cfe9ef; border-radius: 12px; box-shadow: inset 0 0 0 3px #121014, inset 0 0 0 4px rgba(230, 220, 248, .4), 0 18px 50px rgba(0, 0, 0, .75); }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 14px; border-bottom: 1px solid rgba(207, 233, 239, .3); }
.login-tabs button { padding: 8px 0 9px; color: #b8a47e; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; font: 700 15px var(--f-head); cursor: pointer; }
.login-tabs button.on { color: #f4eef8; border-bottom-color: #cfe9ef; }
.login-tabs button:focus-visible, .login-go:focus-visible { outline: 2px solid #cfe9ef; outline-offset: 2px; }
.login-box .field { display: grid; gap: 4px; margin-bottom: 10px; }
.login-box .field span { color: #b9b0c4; font-size: 12px; letter-spacing: .5px; }
.login-box input { width: 100%; box-sizing: border-box; margin: 0; padding: 11px 12px; font-size: 15px; color: #f4eef8; background: rgba(0, 0, 0, .35); border: 1px solid #4a4252; border-radius: 7px; box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6); }
.login-box input:focus { outline: none; border-color: #cfe9ef; box-shadow: 0 0 0 3px rgba(207, 233, 239, .18), inset 0 1px 4px rgba(0, 0, 0, .6); }
.login-box input::placeholder { color: #6e6278; }
.login-go { width: 100%; margin-top: 4px; padding: 12px 0; font: 800 18px var(--f-head); letter-spacing: 6px; color: #fbe9e6; cursor: pointer;
  background: linear-gradient(180deg, #a3302b, #7d1d1d 55%, #5a1212); border: 1px solid #e6a7a0; border-radius: 8px; box-shadow: 0 0 0 1px #2b1418, 0 4px 14px rgba(125, 29, 29, .4); text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.login-go:hover { filter: brightness(1.08); }
.login-go:active { transform: translateY(1px); }
.login-box .msg { min-height: 1.2em; margin: 10px 0 0; text-align: center; color: #ff9a7a; font-size: 13px; }

/* 레이아웃 */
.app { display: grid; height: calc(100vh / var(--ui-zoom, 1)); grid-template-columns: 136px 1fr 340px; grid-template-rows: 54px 3fr 2fr; /* 2026-10-30: 채팅을 오른쪽 아래로 옮겨 지도·성 화면을 아래까지. 안내 6 : 채팅 4 */ background: var(--wood-0); }
.app[hidden] { display: none; }
.topbar { grid-column: 1 / -1; z-index: 3; display: flex; gap: 8px; align-items: center; padding: 0 12px; overflow-x: auto; white-space: nowrap; background: var(--wood); box-shadow: inset 0 -1px 0 var(--bronze), 0 2px 0 #08070a, 0 4px 10px rgba(0, 0, 0, .55); }
.topbar .res { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 11px; color: var(--dim); font-size: 13px; background: linear-gradient(180deg, #0e0c10, #1b171d); border: 1px solid var(--bronze-lo); border-radius: 7px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 220, 150, .08); }
.topbar .res b { color: var(--gold); font-size: 15px; font-weight: 700; }
.topbar .res small { color: #9fcf72; font-size: 11px; }
.topbar .res small.neg { color: #ff8a7a; } /* 줄어드는 자원 (식량: 생산보다 병사 유지비가 많다) */
.topbar .res.full b { color: var(--red); }
.topbar .spacer { flex: 1; }
.menu { grid-row: 2 / 4; z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--wood); box-shadow: inset -1px 0 0 var(--bronze), 2px 0 0 #08070a, 4px 0 10px rgba(0, 0, 0, .45); }
.menu button { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 8px; text-align: left; font-size: 14px; color: var(--text); background: transparent; border: 1px solid transparent; box-shadow: none; }
.menu button::before { content: attr(data-icon); flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font: 700 17px/1 var(--f-head); color: var(--bronze-hi); background: radial-gradient(circle at 35% 30%, #2e2832, #121014); border: 2px solid var(--bronze-lo); box-shadow: inset 0 0 0 1px rgba(207, 233, 239, .25), 0 1px 3px rgba(0, 0, 0, .6); }
.menu button:hover:not(:disabled) { background: rgba(207, 233, 239, .08); border-color: rgba(160, 150, 180, .4); }
.menu button.on { background: linear-gradient(90deg, rgba(214, 200, 238, .28), rgba(214, 200, 238, .06)); border-color: var(--bronze); }
.menu button.on::before { color: #2b2030; background: radial-gradient(circle at 35% 30%, #f4eef8, #b9a9cf); border-color: var(--bronze-hi); box-shadow: 0 0 10px rgba(214, 200, 238, .55); }
.menu-foot button { display: inline; padding: 0; font-size: 12px; border: none; background: none; }
.menu-foot button::before { content: none; }
.menu-foot { margin-top: auto; padding: 6px 4px; font-size: 12px; color: var(--dim); border-top: 1px solid rgba(160, 150, 180, .3); }
.badge { position: absolute; left: 30px; top: 2px; background: linear-gradient(180deg, #a3302b, #6a1616); color: #fff; border: 1px solid var(--bronze-hi); border-radius: 9px; padding: 0 5px; font-size: 10px; line-height: 15px; }
.view { grid-column: 2; grid-row: 2 / 4; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #221c26, #121014 70%); }
.pane { position: absolute; inset: 0; overflow: auto; padding: 14px 16px; }
.pane[hidden] { display: none; }
/* 과업 · 조언자 (design/tutorial.md): 왼쪽 아래 초상 + 말풍선, 화면 아래 대화창, 과업 목록 창 */
/* 아래 칩 줄 #dock: 과업 초상 · 레이드(휴대폰) · SR 경매를 화면 맨 아래 한 줄에 두고, 화면 칸은 그 높이(--dock-h, main.js syncDock)만큼 줄인다.
   2026-11-10 유저 요청: 과업 초상이 없을 때 레이드·경매 칩이 내용 위에 떠서 치료 버튼 등을 가렸다. 칩이 많으면 줄을 넘겨 쌓는다 */
.view .pane { bottom: var(--dock-h, 0px); }
/* 2026-11-11 유저 요청: 칩이 넷(과업 · 구미호 · 강철이 · 경매)이면 두 줄로 쌓여 화면을 먹었다 → 늘 한 줄. 칩이 좁아지며 글자는 … 으로 줄이고, 그래도 넘치면 옆으로 민다 */
.dock { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.dock::-webkit-scrollbar { display: none; }
.dock.on { padding: 6px 12px; background: linear-gradient(180deg, #151216, #0f0d11); border-top: 1px solid rgba(160, 150, 180, .35); }
.dock > *, .dock .raid-chip, .dock .ac-bubble { flex: 0 1 auto; min-width: 0; }
.dock .raid-chip > *, .dock .auction-chip > *, .dock .ac-bubble, .dock .ac-bubble small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advisor-chip { position: relative; z-index: 5; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ac-face { flex: none; width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; background: #2e2832 center 12% / cover no-repeat; border: 2px solid var(--gold); font: 700 22px/1 var(--f-head); color: #fff6dc; box-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.advisor-chip:hover .ac-face { box-shadow: 0 0 0 3px rgba(207, 233, 239, .35), 0 2px 6px rgba(0, 0, 0, .7); }
.ac-badge { position: absolute; left: 62px; top: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 13px !important; display: grid; place-items: center; background: linear-gradient(180deg, #b8321f, #7a1d12); color: #fff; font-size: 11px; font-weight: 700; border: 1px solid #f6f1f8; animation: info-pulse 1.6s ease-in-out infinite; }
.ac-bubble { position: relative; max-width: 380px; padding: 10px 16px; background: var(--parch); color: var(--ink); border-radius: 12px; font-size: 19px; font-weight: 700; line-height: 1.25; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.ac-bubble::before { content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left: 0; border-right-color: var(--parch); }
.ac-bubble small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-dim); }
.dlg { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(980px, calc(100% - 24px)); z-index: 900; animation: dlg-in .25s ease-out; }
.dlg[hidden] { display: none; }
.dlg-box { position: relative; display: flex; gap: 22px; padding: 20px 22px 16px; min-height: 230px; background: linear-gradient(180deg, #1f1a22, #121014); border: 2px solid var(--bronze); border-radius: 10px; box-shadow: 0 0 0 1px #000, 0 14px 36px rgba(0, 0, 0, .75); cursor: pointer; }
.dlg-box::after { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(207, 233, 239, .35); border-radius: 7px; pointer-events: none; }
.dlg-face { flex: none; width: 150px; height: 196px; border-radius: 6px; border: 2px solid var(--gold); display: grid; place-items: center; background: #2e2832 center / cover no-repeat; font: 700 44px/1 var(--f-head); color: #fff6dc; box-shadow: 0 4px 10px rgba(0, 0, 0, .7); }
.dlg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dlg-name { align-self: flex-start; margin: -32px 0 10px -6px; padding: 4px 16px; background: var(--gold); color: #2b2030; font-weight: 700; font-size: 17px; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.dlg-name small { font-weight: 400; color: #5e5468; }
.dlg-text { margin: 0; flex: 1; min-height: 3.3em; color: #f4eef8; font: 20px/1.7 var(--f-head); white-space: pre-wrap; word-break: keep-all; }
.dlg-cursor { align-self: flex-end; color: var(--gold); font-size: 12px; line-height: 1; animation: dlg-blink 1s steps(2) infinite; }
.dlg-cursor[hidden] { display: none; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 10px; cursor: default; }
.dlg-actions button { font-size: 16px; padding: 8px 18px; }
.dlg-x { position: absolute; top: 6px; right: 8px; padding: 2px 6px; background: none; border: 0; color: var(--dim); font-size: 14px; }
.dlg-x:hover { color: #f6f1f8; }
.dlg-scene { font-size: 12px; letter-spacing: .08em; color: var(--gold); margin-bottom: 6px; } /* 시즌 이야기 장면 제목 (첫 줄에만) */
.dlg-skip { position: absolute; top: 6px; right: 40px; padding: 3px 10px; font-size: 12px; border-radius: 12px; } /* 이미 본 시즌 이야기 건너뛰기 */
@keyframes dlg-in { from { transform: translate(-50%, 24px); opacity: 0; } }
@keyframes dlg-blink { to { opacity: 0; } }
.quest-pop { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.quest-pop[hidden] { display: none; }
/* 창(모달) 양식은 하나: 어두운 옻칠 판 + 청동 테두리 + 오른쪽 위 기본 버튼 '닫기' + Esc·바깥 클릭 (2026-10-30) */
.quest-panel, .info-box { max-height: calc(80vh / var(--ui-zoom, 1)); overflow: auto; padding: 14px 16px 16px; color: #ece6f0; background: linear-gradient(180deg, #1d191f, #141116); border: 1px solid var(--bronze); border-radius: 10px; box-shadow: 0 0 0 2px var(--wood-0), 0 12px 36px rgba(0, 0, 0, .65); }
.quest-panel { width: min(560px, 100%); }
.qp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; color: #f6f1f8; font-size: 16px; }
.qp-stage { margin: 10px 0 2px; color: var(--gold); font-size: 13px; font-weight: 700; }
.qp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 0; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .05); }
.qp-row.cur { color: #f6f1f8; } .qp-row.done { color: var(--dim); } .qp-row.later { color: #8a8296; }
.qp-mark { width: 16px; text-align: center; }
.qp-title { flex: 1 1 8em; min-width: 8em; } /* 보상이 길어도 과업 이름이 한 글자씩 세로로 찌그러지지 않게 (2026-11-01, 폰) */
.qp-reward { flex: 0 1 auto; min-width: 10em; max-width: 58%; margin-left: auto; color: #b9b0c4; font-size: 12px; text-align: right; word-break: keep-all; }
.qp-row button { flex: none; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.qp-foot { margin-top: 8px; text-align: right; }
.quest-target { outline: 3px solid #ff3b2f !important; outline-offset: 3px; border-radius: 6px; animation: quest-step 1s ease-in-out infinite; position: relative; z-index: 3; }
@keyframes quest-step { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 47, .75); } 50% { box-shadow: 0 0 0 8px rgba(255, 59, 47, 0); } }
@media (max-width: 640px) { .dlg { bottom: 8px; } .dlg-box { gap: 10px; padding: 16px 10px 10px; min-height: 170px; } .dlg-face { width: 84px; height: 112px; } .dlg-name { margin-top: -26px; font-size: 15px; } .dlg-text { font-size: 16px; } .dlg-actions button { font-size: 14px; padding: 6px 12px; } .ac-face { width: 52px; height: 52px; } .ac-badge { left: 38px; } .ac-bubble { max-width: 190px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .ac-badge, .quest-target, .dlg, .dlg-cursor { animation: none; } }
.chat { grid-column: 3; grid-row: 3; min-height: 0; z-index: 2; display: flex; flex-direction: column; background: var(--wood); border-left: 6px solid var(--wood-1); box-shadow: inset 0 1px 0 var(--bronze), 0 -2px 0 #08070a, 0 -4px 10px rgba(0, 0, 0, .45); }
.chat-tabs { display: flex; gap: 4px; padding: 6px 10px 0; }
.chat-tabs button { padding: 2px 14px; border-radius: 6px 6px 0 0; color: var(--dim); background: rgba(0, 0, 0, .25); border-color: var(--bronze-lo); border-bottom: none; box-shadow: none; }
.chat-tabs button.on { color: #2b2030; text-shadow: none; background: linear-gradient(180deg, #f4eef8, #b9a9cf); border-color: var(--bronze-hi); }
.chat-log { flex: 1; overflow-y: auto; margin: 0 10px; padding: 4px 10px; font-size: 13px; background: rgba(10, 6, 3, .55); border: 1px solid var(--bronze-lo); box-shadow: inset 0 1px 4px rgba(0, 0, 0, .7); }
.chat-log .who { color: var(--gold); margin-right: 6px; font-weight: 600; }
.chat-log .ally .who { color: var(--green); }
.chat-form { padding: 6px 10px 8px; }
.chat-form input { width: 100%; padding: 6px 10px; }

/* 사이드 패널: 양피지 */
.side { grid-column: 3; grid-row: 2; min-height: 0; z-index: 1; overflow: auto; padding: 16px 16px 14px; color: var(--ink); background: var(--parchment); border-left: 6px solid var(--wood-1); box-shadow: inset 0 0 0 1px var(--bronze), inset 0 0 30px rgba(90, 64, 104, .35); }
.side h2 { font-size: 17px; color: #7d1d1d; text-shadow: none; padding-bottom: 6px; border-bottom: 1px solid rgba(90, 64, 104, .4); }
.side h3 { color: #7d1d1d; }
.side .dim, .side th { color: var(--ink-dim); }
.side .gold { color: #9a620a; }
.side .red, .side .why, .side .cost .short { color: #b0321f; }
.side .green { color: #3f7f2a; }
.side .cyan { color: #1d7c98; }
.side td, .side th { border-bottom-color: rgba(90, 64, 104, .28); }
.side input, .side select { color: var(--ink); background: #ebe5e1; border-color: #a99cbc; box-shadow: inset 0 1px 3px rgba(90, 64, 104, .25); }
.side button.link { color: #7d1d1d; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 4px 8px; margin-bottom: 12px; }
.kv span:nth-child(odd) { color: var(--ink-dim); }
.mform td { padding: 3px 4px; }
.mform input[type=number] { width: 70px; }
.mform .mstep td, .mform div.mstep { padding: 8px 4px 2px; border-bottom: 1px solid var(--bronze); }
.mform tr.locked { opacity: .4; }
.eta { margin: 8px 0; padding: 7px 9px; border-radius: 6px; background: rgba(90, 64, 104, .12); border: 1px solid rgba(90, 64, 104, .35); }
.tribute .row { margin-top: 4px; gap: 4px; flex-wrap: wrap; }
.tribute .row button { padding: 2px 9px; font-size: 12px; }
.gains { margin-top: 6px; padding: 6px 8px; border-radius: 6px; font-size: 12px; background: rgba(200, 160, 60, .1); border: 1px solid rgba(200, 160, 60, .4); }
.gains ul { margin: 4px 0 0; padding-left: 18px; }
.gains li { margin: 2px 0; }
.preview { margin-top: 6px; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.preview.win { background: rgba(80, 140, 40, .15); border: 1px solid rgba(80, 140, 40, .45); color: #2e5a10; }
.preview.stale { background: rgba(120, 120, 120, .12); border: 1px solid rgba(120, 120, 120, .45); color: #555; }
.preview.lose { background: rgba(176, 50, 31, .12); border: 1px solid rgba(176, 50, 31, .45); color: #8a2414; }
.rep-side { padding: 8px; margin: 6px 0; border-radius: 6px; background: rgba(90, 64, 104, .1); border: 1px solid rgba(90, 64, 104, .3); }
.side .bar { background: rgba(60, 44, 70, .25); }

/* 성 화면 */
.city-head { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.queues { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.queue, .march, .cand { background: var(--card); border: 1px solid var(--bronze-lo); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(207, 233, 239, .07), 0 2px 6px rgba(0, 0, 0, .4); }
.queue { padding: 8px 12px; min-height: 60px; }
.qitem { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; margin: 4px 0; }
.qitem > .bar { grid-column: 1 / -1; }
.qitem > .timer { min-width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; } /* 줄마다 칸이 같은 자리에 (남은 시간 길이가 달라도) */
.qitem > .rush { min-width: 8.5em; }
.bar { grid-column: 1 / -1; height: 6px; background: #0d0804; border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7); }
.bar > i { display: block; height: 100%; width: 0; background: var(--pearl); }
.cost { font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cost .short { color: var(--red); }
.why { font-size: 12px; color: var(--red); min-height: 1.3em; }
.units { background: var(--card); border: 1px solid var(--bronze-lo); border-radius: 8px; overflow: hidden; }
.units th { background: rgba(0, 0, 0, .25); }
.units td input { width: 70px; }
/* 징병 수량: −10 −5 [수량] +5 +10 붙은 한 덩어리 + 징병, 아래 줄에 최대·초기화·안내 */
.train-ctl { display: flex; flex-direction: column; gap: 3px; }
.train-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid #6a5f72; border-radius: 5px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.stepper button.step { border: 0; border-radius: 0; box-shadow: none; padding: 3px 7px; min-width: 34px; font-size: 13px; background: linear-gradient(180deg, #2c2532, #19151c); }
.stepper button.step + button.step, .stepper input + button.step { border-left: 1px solid rgba(160, 150, 180, .45); }
.stepper button.step:hover:not(:disabled) { background: linear-gradient(180deg, #3a3141, #221d27); }
.stepper input { width: 56px; border: 0; border-left: 1px solid rgba(160, 150, 180, .45); border-radius: 0; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.train-sub { display: flex; align-items: center; gap: 10px; font-size: 12px; min-height: 1.3em; }
.train-sub button.link { background: none; border: 0; box-shadow: none; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 2px; font-size: 12px; text-shadow: none; }
.train-sub button.link:hover:not(:disabled) { background: none; color: #f6f1f8; }
.train-sub button.link:disabled { color: inherit; text-decoration: none; }
.train-sub .why { min-height: 0; }
/* 징병 줄: 수량 조절과 [징병]을 한 줄에 (2026-11-16 유저). 버튼 글자도 줄바꿈하지 않는다 */
.train-main { flex-wrap: nowrap; }
.stepper button.step, .train-main > button { white-space: nowrap; }
@media (max-width: 640px), (max-height: 560px) { /* 휴대폰 (세로 · 가로): 능력 칸을 빼고 수량 조절에 자리를 준다 */
  .units th:nth-child(3), .units td:nth-child(3) { display: none; }
  .stepper button.step { min-width: 30px; padding: 3px 5px; }
  .stepper input { width: 46px; }
}
@media (max-width: 640px) { /* 세로 휴대폰: 표 한 줄에 다 넣으면 좁아서, 징병 칸을 병종 줄 아래 한 줄 전체로 내린다 */
  .units tr:first-child { display: none; }
  .units tr { display: grid; grid-template-columns: 48px 40px 1fr; align-items: center; border-bottom: 1px solid rgba(160, 150, 180, .22); }
  .units td { border-bottom: 0; }
  .units td:last-child { grid-column: 1 / -1; padding-top: 0; }
  .units td:nth-child(4) .cost { display: flex; flex-wrap: wrap; gap: 2px 8px; }
  .stepper input { flex: 1 1 40px; min-width: 40px; }
  .units .train-main .stepper { flex: 1 1 auto; }
}
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cand { padding: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 12px; text-align: center; margin: 6px 0; }
.stats b { display: block; font-size: 15px; color: var(--gold); }

.ai-tag { display: inline-block; margin-left: 5px; padding: 0 5px; font-size: 10px; line-height: 15px; border-radius: 4px; color: #e2dbe8; background: #1b171d; border: 1px solid var(--bronze-lo); vertical-align: 1px; }

/* 아이콘 */
.ico { display: inline-block; object-fit: contain; vertical-align: -4px; margin-right: 3px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.topbar .res .ico { align-self: center; margin-right: 1px; }
.cost span { display: inline-flex; align-items: center; gap: 2px; }
.cost .ico { vertical-align: middle; margin: 0; }
h3 .ico { vertical-align: -5px; margin-right: 5px; }

/* 성 장면: 남은 세로 공간에 맞춰 축소 (스크롤 없이 장면 + 큐가 한 화면) */
.scene-wrap { height: calc(100% - 152px); min-height: 220px; margin: 2px 0 10px; container-type: size; display: flex; justify-content: center; align-items: flex-start; } /* stretch 면 창이 좁을 때 높이가 칸에 늘어나 비율이 깨진다 (2026-11-02) */
.scene-wrap .city-scene { width: min(100cqw, 100cqh * var(--scene-ar, 1.7778)); margin: 0; }
@media (max-width: 640px) { .scene-wrap { height: auto; container-type: inline-size; } .scene-wrap .city-scene { width: 100%; } }
.city-head { margin-bottom: 4px; }
.city-head h2 { margin: 0; }
.queue { min-height: 0; }
.city-scene { isolation: isolate; position: relative; width: 100%; aspect-ratio: var(--scene-ar, 1.7778); margin: 4px 0 14px; overflow: hidden; border: 3px solid var(--wood-1); border-radius: 10px; box-shadow: 0 0 0 1px var(--bronze), 0 6px 18px rgba(0, 0, 0, .55); background: #3d6b2a; user-select: none; }
.city-world { position: absolute; background: url(/assets/city/bg.webp) 0 0 / 100% 100% no-repeat; } /* 배경 전체. 잘라 보기 범위만 .city-scene 에 보인다 (main.js sceneCrop) */
.bslot { position: absolute; cursor: pointer; } /* 위치·크기는 main.js placeSlot (그림 바닥을 터에 맞춘다) */
.bslot img { display: block; width: 100%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); transition: filter .15s, transform .15s; }
.bslot:hover img { filter: brightness(1.12) drop-shadow(0 0 6px #e6dcf8); transform: translateY(-2px); }
.bslot.sel img { filter: brightness(1.08) drop-shadow(0 0 3px #f4eef8) drop-shadow(0 0 10px #9fd6e2); }
.bslot.empty img { opacity: .9; }
.bslot.void-plot img { opacity: .45; filter: grayscale(.6); }
.bslot.void-plot .blabel { display: none; }
.bslot.gate { pointer-events: none; z-index: 1; } /* 성벽: 화면 전체를 덮는 상자지만 SVG 성벽 면만 눌린다 */
.bslot.gate svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bslot.gate svg > * { pointer-events: visiblePainted; fill: transparent; stroke: none; cursor: pointer; transition: fill .15s; }
.bslot.gate:hover svg > *, .bslot.gate.sel svg > * { fill: rgba(230, 220, 248, .2); stroke: #e6dcf8; stroke-width: 3; vector-effect: non-scaling-stroke; }
.blabel { position: absolute; left: 50%; top: 6%; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none; background: linear-gradient(180deg, rgba(34, 28, 38, .95), rgba(18, 15, 20, .95)); border: 1px solid #a99cbc; border-radius: 10px; padding: 0 9px; font-size: clamp(10px, .85vw, 13px); line-height: 1.65; color: #f4eef8; box-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.bslot.top-plot .blabel { top: 38%; }
.bslot.gate svg > .quest-target { fill: rgba(255, 59, 47, .18); stroke: #ff3b2f; stroke-width: 3; vector-effect: non-scaling-stroke; outline: none; } /* 튜토리얼 성벽 과업: 빨간 테두리를 성벽 면에 (SVG 에는 outline 이 그려지지 않는다) */
.bslot.gate .blabel { transform: translate(-50%, -50%); } /* 위치는 main.js (plots.json wallRing.label) */
.bslot.empty .blabel { color: #e4d8bc; border-color: #8a7a5c; background: rgba(20, 16, 22, .72); }
.bslot.sel .blabel { border-color: #fff2b0; color: #fff; }
.bprog { position: absolute; left: 18%; right: 18%; bottom: 10%; height: 6px; background: rgba(0, 0, 0, .6); border-radius: 3px; }
.bprog > i { background: linear-gradient(180deg, #b6f08a, #5fb83a); }
.bpanel-img { display: block; width: 72%; margin: 0 auto 8px; filter: drop-shadow(0 4px 5px rgba(80, 50, 20, .45)); }

/* 맵 */
.map-pane { padding: 0; overflow: hidden; }
.map-toolbar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; align-items: center; padding: 5px 10px; background: var(--wood); border: 1px solid var(--bronze); border-radius: 8px; box-shadow: 0 0 0 2px var(--wood-0), 0 4px 10px rgba(0, 0, 0, .5); }
.map-toolbar input { width: 56px; }
.map-toolbar > span:first-child { color: var(--gold); }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#map-canvas.drag { cursor: grabbing; }
.minimap { position: absolute; right: 12px; bottom: 12px; cursor: pointer; image-rendering: pixelated; background: #000; border: 3px solid var(--wood-1); border-radius: 6px; box-shadow: 0 0 0 1px var(--bronze-hi), 0 0 0 4px var(--wood-0), 0 6px 14px rgba(0, 0, 0, .6); }

/* 목록 */
.list { background: var(--card); border: 1px solid var(--bronze-lo); border-radius: 8px; overflow: hidden; }
.list .item { padding: 8px 12px; border-bottom: 1px solid rgba(160, 150, 180, .18); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.list .item:last-child { border-bottom: none; }
.list .item:hover { background: rgba(207, 233, 239, .07); }
.list .item.on { background: linear-gradient(90deg, rgba(214, 200, 238, .22), transparent); }
.march { padding: 9px 12px; margin-bottom: 8px; }
.march.enemy { border-color: var(--red); box-shadow: inset 0 0 0 1px rgba(224, 96, 78, .25), 0 0 10px rgba(224, 96, 78, .2); }
#v-generals table, #v-alliance table, #v-rank table { background: var(--card); border: 1px solid var(--bronze-lo); border-radius: 8px; overflow: hidden; }
#v-generals th, #v-alliance th, #v-rank th { background: rgba(0, 0, 0, .25); }

.toasts { position: fixed; top: 62px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 1200; pointer-events: none; }
.toast { max-width: 330px; padding: 8px 13px; color: var(--ink); background: var(--parchment); border: 1px solid var(--bronze); border-radius: 7px; box-shadow: 0 0 0 2px var(--wood-1), 0 6px 16px rgba(0, 0, 0, .55); animation: tin .2s ease-out; }
.toast.err { border-color: #b0321f; }
.toast.warn { color: #fbe9e6; background: linear-gradient(180deg, #8e2424, #5a1212); border-color: #d8817a; }
@keyframes tin { from { transform: translateY(-6px); opacity: 0; } }
.conn { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); background: linear-gradient(180deg, #a23e2c, #6a2218); border: 1px solid #e08a6a; color: #fff; padding: 6px 14px; border-radius: 6px; z-index: 60; }

@media (max-width: 900px), (max-height: 560px) { /* 가로로 든 휴대폰(높이 412 등)도 한 줄 배치 (2026-10-30) */
  .app { grid-template-columns: 1fr; grid-template-rows: 50px auto 1fr auto 150px; }
  .menu { grid-row: 2; flex-direction: row; overflow-x: auto; padding: 4px 6px; box-shadow: inset 0 -1px 0 var(--bronze); }
  .menu button { flex: none; padding: 4px 8px 4px 4px; }
  .menu button::before { width: 26px; height: 26px; font-size: 14px; }
  .menu-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px 8px; max-width: 48%; margin: 0 0 0 auto; padding: 0 6px; border-top: none; border-left: 1px solid rgba(160, 150, 180, .3); position: sticky; right: 0; background: var(--wood); } /* 휴대폰에서도 공지사항·로그아웃 (2026-11-02). 메뉴가 옆으로 스크롤돼도 맨 오른쪽에 고정해 로그아웃이 화면 밖으로 밀리지 않게 (2026-11-16) */
  .menu .menu-foot button { padding: 4px 2px; }
  .menu-foot #me-name { display: none; }
  .menu .menu-foot #notice-btn { display: inline; margin: 0; }
  .view { grid-column: 1; grid-row: 3; min-height: 50vh; }
  .side { grid-column: 1; grid-row: 4; max-height: 40vh; border-left: none; border-top: 6px solid var(--wood-1); }
  .chat { grid-column: 1; grid-row: 5; border-left: none; }
  /* 모바일 (2026-10-30): 자원 바는 두 줄로 접고, 지도 툴바는 한 줄로 줄이고, 채팅은 낮게 */
  .app { grid-template-rows: auto auto 1fr auto 120px; height: auto; min-height: calc(100vh / var(--ui-zoom, 1)); } /* 내용이 길면 페이지가 스크롤된다 */
  .view { min-height: max(50vh, 300px); }
  .ac-face { width: 52px; height: 52px; } .ac-badge { left: 38px; } .ac-bubble { max-width: 220px; font-size: 14px; padding: 6px 10px; }
  .topbar { flex-wrap: wrap; white-space: normal; overflow-x: visible; gap: 4px; padding: 4px 8px; }
  .topbar .res { padding: 2px 7px; font-size: 11px; }
  .topbar .res b { font-size: 13px; }
  .topbar .res small { display: none; }
  .topbar .res small.keep { display: inline; } /* 인구 상한은 휴대폰에서도 (시간당 생산만 숨긴다) */
  body.show-rates .topbar .res small { display: inline; } /* 자원을 누르면 시간당 생산도 (main.js setShowRates) */
  .topbar .res { cursor: pointer; }
  .map-toolbar { gap: 4px; padding: 4px 6px; flex-wrap: nowrap; white-space: nowrap; }
  .map-toolbar > span:first-child, #hover-info { display: none; }
  .map-toolbar input { width: 40px; }
  .map-toolbar button { padding: 3px 7px; font-size: 12px; }
  .queues { grid-template-columns: 1fr; }
}

/* 장수 카드 */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, 172px); gap: 14px; }
.gcard { --rc: #8a7a5c; --rc2: #4a3f30; width: 172px; perspective: 900px; }
/* 등급 = 테두리 재질: N 무쇠, R 청동, SR 은, SSR 금, UR 자개 (design/art-style.md) */
.gcard.r-UR { --rc: #ffd0ec; --rc2: #7a5fd0; }
.gcard.r-SSR { --rc: #ffd76a; --rc2: #b8862a; }
.gcard.r-SR { --rc: #e8edf3; --rc2: #7d8794; }
.gcard.r-R { --rc: #d99a5e; --rc2: #6b4020; }
.gcard.r-N { --rc: #8d949c; --rc2: #3a3f46; }
.ginner { position: relative; height: 268px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.gcard.back .ginner { transform: rotateY(180deg); }
.gface, .gback { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; }
.gface { display: flex; flex-direction: column; padding: 8px 10px 10px; color: var(--text); background: linear-gradient(180deg, #221d25, #141116); border: 2px solid var(--rc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 18px color-mix(in srgb, var(--rc2) 45%, transparent), 0 4px 12px rgba(0, 0, 0, .5); overflow: hidden; }
.gcard.r-SSR .gface::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255, 240, 180, .35) 50%, transparent 60%); animation: shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes shine { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.gback { transform: rotateY(180deg); display: grid; place-items: center; background: repeating-linear-gradient(45deg, #221c26 0 8px, #1a161d 8px 16px); border: 2px solid var(--bronze); box-shadow: inset 0 0 0 4px var(--wood-1), inset 0 0 0 5px var(--bronze-lo), 0 4px 12px rgba(0, 0, 0, .5); }
.gback span { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; font: 700 40px/1 var(--f-head); color: #2b2030; background: radial-gradient(circle at 35% 30%, #f4eef8, #b9a9cf); box-shadow: 0 0 18px rgba(214, 200, 238, .5); }
.gtop { display: flex; align-items: center; gap: 5px; height: 20px; }
.grar { font: 400 21px/1 "Nanum Brush Script", "Malgun Gothic", cursive; letter-spacing: 1px; color: var(--rc); text-shadow: 0 0 6px var(--rc2), 0 1px 0 #000; }
.gportrait { position: relative; height: 118px; margin: 4px 0 2px; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--fc) 18%, #e9d3a0), color-mix(in srgb, var(--fc) 22%, #3a2614) 78%); border: 1px solid rgba(0, 0, 0, .5); box-shadow: inset 0 0 14px rgba(0, 0, 0, .5); }
.gportrait.art { height: 118px; background-size: cover; background-repeat: no-repeat; border-color: color-mix(in srgb, var(--rc) 60%, #000); }
.gcard:has(.gportrait.art) .ginner { height: 300px; }
.gportrait span { font: 700 46px/1 var(--f-head); color: #fff6dc; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.gname { text-align: center; font-weight: 700; font-size: 16px; color: #f6f1f8; margin-bottom: 4px; }
.gstats { display: grid; gap: 3px; font-size: 11px; }
.gstat { display: grid; grid-template-columns: 26px 1fr 22px; align-items: center; gap: 4px; color: var(--dim); }
.gstat i { height: 6px; background: rgba(0, 0, 0, .5); border-radius: 3px; overflow: hidden; }
.gstat i b { display: block; height: 100%; background: linear-gradient(90deg, var(--rc2), var(--rc)); }
.gstat em { font-style: normal; text-align: right; color: var(--text); font-weight: 600; }
.gfoot { display: grid; gap: 5px; margin-top: 7px; font-size: 12px; text-align: center; }
.gcard.picked .gface { box-shadow: 0 0 0 3px #fff2b0, 0 0 24px var(--rc); }

/* 첫 카드 뽑기 (장수 칸) */
.starter-panel { margin-bottom: 22px; padding: 16px 16px 20px; text-align: center; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, rgba(214, 200, 238, .16), rgba(0, 0, 0, .25)); border: 1px solid var(--bronze); box-shadow: inset 0 0 30px rgba(214, 200, 238, .12); }
.starter-panel h2 { font: 700 26px/1.2 var(--f-head); letter-spacing: 6px; }
.starter-cards { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.starter-cards .gcard { margin: 8px 6px; cursor: pointer; transition: transform .2s; }
.starter-cards .gcard:not(.back):hover { transform: translateY(-4px); }
button.big { padding: 9px 22px; font-size: 16px; }

/* 보고서 */
.reschips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.reschip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 16px; background: rgba(90, 64, 104, .14); border: 1px solid rgba(90, 64, 104, .35); }
.reschip b { font-size: 15px; }
.reschip small { color: var(--ink-dim); font-size: 11px; }
.reschips.gain .reschip b { color: #2f7a1f; }
.reschips.loss .reschip b { color: #b0321f; }
.reschip .ico { margin: 0; }
.rep-banner { display: flex; flex-direction: column; align-items: center; margin: 4px 0 10px; padding: 8px; border-radius: 8px; font: 700 20px/1.2 var(--f-head); letter-spacing: 4px; }
.rep-banner small { font: 12px/1.4 var(--f-body); letter-spacing: 0; margin-top: 3px; }
.rep-banner.win { color: #3a2448; background: linear-gradient(115deg, #f6e2ec, #dff0f3 40%, #ece4fa 70%, #f6f0dc); border: 1px solid #a99cbc; }
.rep-banner.lose { color: #fbe9e6; background: linear-gradient(180deg, #8e2424, #5a1212); border: 1px solid #d8817a; }
.rep-side-h { display: flex; align-items: center; gap: 6px; }
.me-tag { font-size: 11px; padding: 0 6px; border-radius: 8px; background: var(--gold); color: #2b2030; font-weight: 700; }
.rep-units { margin-top: 4px; }
.rep-units td .ico { width: 16px; height: 16px; }

.tavern-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); } /* 장수 화면 맨 위 (2026-11-08) */
.tavern-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
/* 뽑기 인물의 등급별 카드 수 */
.gstock { display: grid; gap: 4px; }
.gstock-row { display: flex; justify-content: center; gap: 3px; }
.gst { font-size: 10px; padding: 0 3px; border-radius: 6px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(160, 150, 180, .35); }
.gst b { font: 400 14px/1 "Nanum Brush Script", cursive; }
.gst.zero { opacity: .45; }
.gst.r-N b { color: #8d949c; } .gst.r-R b { color: #d99a5e; } .gst.r-SR b { color: #e8edf3; } .gst.r-SSR b { color: #ffd76a; }

/* 배치 창 */
.pcols { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.pcol { padding: 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--bronze-lo); cursor: pointer; }
.pcol.on { border-color: var(--bronze-hi); box-shadow: 0 0 0 1px var(--bronze-hi), 0 0 14px rgba(214, 200, 238, .25); }
.phead { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.phead b { color: var(--gold); }
.peff { margin: 4px 0 2px; color: #9fcf72; font-weight: 600; }
.pslot { margin-top: 7px; min-height: 40px; padding: 6px 8px; border-radius: 7px; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pslot.filled { background: rgba(214, 200, 238, .1); border: 1px solid var(--bronze); }
.pslot.filled em { margin-left: auto; font-style: normal; color: #9fcf72; font-weight: 700; }
.pslot.filled:hover { border-color: var(--red); }
.pslot.empty { border: 1px dashed var(--bronze); color: var(--dim); justify-content: center; }
.pslot.empty.on, .pslot.empty:hover { color: var(--gold); border-color: var(--bronze-hi); }
.pslot.locked { border: 1px dashed rgba(160, 150, 180, .25); color: rgba(184, 164, 126, .6); font-size: 11px; justify-content: center; text-align: center; }
.prar { font-size: 10px; font-weight: 800; padding: 0 4px; border-radius: 4px; color: #1b1410; background: #b8a888; }
.prar.r-SSR { background: #ffd76a; } .prar.r-SR { background: #e8edf3; } .prar.r-R { background: #d99a5e; } .prar.r-N { background: #8d949c; } .prar.r-UR { background: linear-gradient(90deg, #ff9a9a, #ffe28a, #9affc2, #9ad6ff, #e39aff); }
.dept-sum { display: inline-flex; gap: 10px; color: #9fcf72; font-size: 13px; }
.dept-sum span { display: inline-flex; align-items: center; gap: 2px; }
/* 출진 장수 편성 */
.mgens { display: grid; gap: 4px; max-height: 210px; overflow-y: auto; margin: 6px 0; }
.mgen { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(90, 64, 104, .3); cursor: pointer; font-size: 13px; }
.mgen.on { background: rgba(214, 200, 238, .25); border-color: #b8862a; }
.mgen-role { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #8a4a00; }
@media (max-width: 900px) { .pcols { grid-template-columns: repeat(2, 1fr); } }

/* UR: 무지갯빛 테두리 + 반짝임 */
/* 재질: 테두리를 금속 그라데이션으로 */
.gcard.r-N .gface { border-color: transparent; background: linear-gradient(180deg, #2b2a28, #191816) padding-box, linear-gradient(135deg, #5b6068, #a9b0b8, #4a4f56, #8d949c) border-box; }
.gcard.r-R .gface { border-color: transparent; background: linear-gradient(180deg, #33231a, #1d140c) padding-box, linear-gradient(135deg, #7a4a22, #e8b07a, #8a5428, #d99a5e) border-box; }
.gcard.r-SR .gface { border-color: transparent; background: linear-gradient(180deg, #262a30, #15181c) padding-box, linear-gradient(135deg, #8d97a3, #ffffff, #9aa4b0, #e8edf3) border-box; }
.gcard.r-SSR .gface { border-color: transparent; background: linear-gradient(180deg, #33231a, #1d140c) padding-box, linear-gradient(135deg, #b8862a, #fff1b0, #c8962e, #ffd76a) border-box; }
.gcard.r-UR .gface { border: 2px solid transparent; background: linear-gradient(180deg, #2a2030, #16101c) padding-box, conic-gradient(from 45deg, #f6e6ff, #bfe3ff, #c8fbe8, #fff1c2, #ffd0e6, #f6e6ff) border-box; }
.gcard.r-UR .grar { background: linear-gradient(90deg, #ffd0e6, #fff1c2, #c8fbe8, #bfe3ff, #f6e6ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.gcard.r-UR .gface::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .45) 50%, transparent 62%); animation: shine 2.4s ease-in-out infinite; pointer-events: none; }
.gtitle { text-align: center; font-size: 11px; color: var(--rc); margin: -3px 0 4px; min-height: 14px; }
.info-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 0; border: 0; background: transparent; vertical-align: middle; cursor: pointer; font: inherit; }
.info-i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #2b2030; font: italic 700 15px/1 Georgia, serif; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .5); }
.info-btn:hover .info-i, .info-btn:focus-visible .info-i { background: #f4eef8; }
.info-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 14px; }
.info-btn.unread { padding: 2px 10px 2px 2px; border-radius: 16px; background: var(--gold); color: #2b2030; animation: info-pulse 1.6s ease-in-out infinite; }
.info-btn.unread .info-i { background: #2b2030; color: var(--gold); box-shadow: none; }
.info-label { font-size: 13px; font-weight: 700; font-style: normal; text-shadow: none; }
@keyframes info-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 200, 238, .7); } 50% { box-shadow: 0 0 0 7px rgba(214, 200, 238, 0); } }
@media (prefers-reduced-motion: reduce) { .info-btn.unread { animation: none; } }
.info-pop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.info-box { width: min(460px, 100%); }
.info-box.wide { width: min(960px, 100%); } /* 정찰한 성 구경 (2026-11-02) */
/* 「이야기 보기」 시즌 소설 (2026-11-10) */
.info-box:has(.novel) { width: min(640px, 100%); }
.novel { font-size: 15px; line-height: 1.85; color: #ece6f0; }
.novel p { margin: 0 0 12px; word-break: keep-all; white-space: pre-line; }
.novel-title { margin: 4px 0 16px; font-size: 18px; color: var(--gold); }
.novel-sep { text-align: center; color: #8d8094; letter-spacing: .3em; }
.novel-nav { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.novel-nav select { flex: 1; min-width: 0; }
.novel-img { display: block; width: 100%; margin: 6px 0 16px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .12); }
.novel-cine { margin: 0 0 14px; }
.novel-tabs { gap: 6px; margin: 0 0 12px; } /* 연출로 보기 | 원작 소설 (2026-11-12) */
.novel-tabs button { flex: 1; }
.novel-tabs + .novel-nav { margin: 0 0 14px; padding: 0 0 12px; border-top: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); } /* 장 고르기를 맨 위로 (2026-11-12) */
.novel-book p { text-indent: 0; }
/* 시즌 이야기 연출 (2026-11-10, 프린세스 메이커 프롤로그식): 장면 그림 + 내레이션 창 */
.cine { position: fixed; inset: 0; z-index: 1200; overflow: hidden; background: #000; cursor: pointer; animation: cine-in .6s ease; outline: none; }
.cine.out { opacity: 0; transition: opacity .4s; }
@keyframes cine-in { from { opacity: 0; } }
.cine-pic { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.cine-bg { position: absolute; inset: 0; background: center / cover no-repeat; }
.cine-fit { display: none; }
.cine-pic.on { opacity: 1; animation: cine-kb 16s ease-out forwards; }
@keyframes cine-kb { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.cine-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .78) 100%); pointer-events: none; }
.cine-title { position: absolute; left: 0; right: 0; top: 34%; text-align: center; color: #f3e6c4; font-size: clamp(26px, 4vw, 52px); letter-spacing: .12em; text-shadow: 0 2px 18px #000, 0 0 2px #000; transition: opacity 1.4s; pointer-events: none; }
.cine-title.gone { opacity: 0; }
.cine-box { position: absolute; left: 50%; bottom: 4.5vh; width: min(1100px, calc(100% - 32px)); transform: translateX(-50%); min-height: 132px; padding: 22px 30px 26px; color: #f4eef6; background: linear-gradient(180deg, rgba(24, 19, 26, .88), rgba(12, 10, 14, .92)); border: 2px solid var(--bronze); border-radius: 10px; box-shadow: 0 0 0 1px #000, 0 12px 40px rgba(0, 0, 0, .7); }
.cine-text { margin: 0; font-size: clamp(16px, 1.6vw, 21px); line-height: 1.75; word-break: keep-all; white-space: pre-line; }
.cine-cursor { position: absolute; right: 18px; bottom: 10px; color: var(--gold); animation: cine-blink 1s steps(2) infinite; }
@keyframes cine-blink { 50% { opacity: 0; } }
.cine-skip { position: absolute; top: 16px; right: 16px; padding: 6px 14px; color: #e8dfe9; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; font-size: 13px; }
@media (max-width: 640px) { .cine-box { padding: 16px 16px 22px; min-height: 120px; } }
/* 세로 화면 (2026-11-12): 2:1 그림을 꽉 채우면 가운데 1/4 만 보여 잘렸다 → 그림을 위쪽에 크게 놓고 좌우로 천천히 훑는다, 나머지는 같은 그림을 흐리게 */
@media (orientation: portrait) {
  .cine-pic.on { animation: none; }
  .cine-bg { inset: -24px; filter: blur(14px) brightness(.45); }
  .cine-fit { display: block; position: absolute; left: 0; right: 0; top: 9vh; height: min(36vh, 70vw); background: 0% center / auto 100% no-repeat; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
  .cine-pic.on .cine-fit { animation: cine-pan 14s ease-in-out infinite alternate; }
  .cine-title { top: calc(9vh + min(36vh, 70vw) + 24px); }
}
.cine-rotate { display: none; }
@media (orientation: portrait) {
  .cine-rotate { display: block; position: absolute; left: 50%; top: calc(9vh + min(36vh, 70vw) + 74px); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; color: #f3e6c4; background: rgba(0, 0, 0, .6); border: 1px solid rgba(243, 230, 196, .35); border-radius: 18px; font-size: 13px; text-align: center; pointer-events: none; transition: opacity .8s; animation: cine-in .6s ease; }
  .cine-rotate.gone { opacity: 0; }
}
@keyframes cine-pan { from { background-position: 0% center; } to { background-position: 100% center; } }
@media (prefers-reduced-motion: reduce) { .cine-pic.on, .cine-pic.on .cine-fit { animation: none; } .cine-fit { background-position: center; } }
.spy-scene .bslot { cursor: default; pointer-events: none; }
.info-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 16px; }
.info-box h4 { margin: 12px 0 4px; font-size: 13px; color: #ecdcb4; }
.info-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-tbl th { text-align: left; white-space: nowrap; padding: 4px 12px 4px 0; color: #b9b0c4; font-weight: 600; vertical-align: top; }
.info-tbl td { padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.info-tbl tr:first-child td { border-top: 0; }
.tavern-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tavern-head h2 { margin-bottom: 4px; }
.ginner.zoomable { cursor: zoom-in; }
.ginner.zoomable:hover .gface { filter: brightness(1.08); }

/* 카드 크게 보기 */
.czoom { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; align-content: center; gap: 14px; padding: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(30, 24, 34, .72), rgba(0, 0, 0, .9)); backdrop-filter: blur(6px); animation: zfade .2s ease-out; touch-action: none; }
.czoom.out { animation: zfade .18s ease-in reverse forwards; }
.zstage { perspective: 1200px; }
.zcard { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --hp: 50%; --rc: #8a7a5c; --rc2: #4a3f30;
  position: relative; width: min(calc(52vh / var(--ui-zoom, 1)), 427px, calc(100vw / var(--ui-zoom, 1) - 32px)); aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.2, .9, .3, 1.2); transform-style: preserve-3d;
  border: 6px solid transparent; background: linear-gradient(#120e14, #120e14) padding-box, linear-gradient(135deg, var(--rc2), var(--rc), var(--rc2), var(--rc)) border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 40px color-mix(in srgb, var(--rc) 35%, transparent); animation: zin .45s cubic-bezier(.2, .9, .3, 1.15); }
.zcard.live { transition: transform .08s linear; }
.zcard.r-N { --rc: #8d949c; --rc2: #3a3f46; }
.zcard.r-R { --rc: #d99a5e; --rc2: #6b4020; }
.zcard.r-SR { --rc: #e8edf3; --rc2: #7d8794; }
.zcard.r-SSR { --rc: #ffd76a; --rc2: #b8862a; }
.zcard.r-UR { background: linear-gradient(#1a1220, #1a1220) padding-box, conic-gradient(from 45deg, #f6e6ff, #bfe3ff, #c8fbe8, #fff1c2, #ffd0e6, #f6e6ff) border-box; --rc: #ffd0ec; }
.zart { position: absolute; inset: 0; background-size: cover; background-position: 50% 0; }
.zglyph { display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--fc) 60%, #f5e2b0), color-mix(in srgb, var(--fc) 70%, #120b06) 70%); }
.zglyph span { margin-top: -30%; font: 700 min(22vh, 180px)/1 var(--f-head); color: #fff6dc; text-shadow: 0 6px 18px rgba(0, 0, 0, .6); }
.zrar { position: absolute; top: 10px; left: 16px; font: 400 min(7vh, 56px)/1 "Nanum Brush Script", cursive; color: var(--rc); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.zcard.r-UR .zrar { background: linear-gradient(90deg, #ffd0e6, #fff1c2, #c8fbe8, #bfe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.zinfo { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 8px; padding: 70px 22px 18px;
  background: linear-gradient(180deg, transparent, rgba(14, 11, 16, .82) 32%, rgba(10, 8, 12, .95)); color: #f1ecf4; }
.zname { font: 700 min(4.2vh, 32px)/1.1 var(--f-head); color: #f6f1f8; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.zname small { display: block; margin-top: 4px; font: 500 14px/1.2 inherit; color: var(--rc); }
.zskill { display: grid; gap: 2px; font-size: min(2vh, 15px); }
.zskill b { color: var(--rc); }
.zskill span { color: #e2d6ea; }
.zstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: min(1.9vh, 14px); }
.zstats div { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 6px; }
.zstats span { color: #b9b0c4; }
.zstats i { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.zstats i b { display: block; height: 100%; background: linear-gradient(90deg, var(--rc2), var(--rc)); }
.zstats em { font-style: normal; font-weight: 700; text-align: right; }
.zdesc { font-size: min(1.8vh, 13px); line-height: 1.45; color: #a99fb5; }
/* 빛 반사: 포인터 위치에 하얀 원 */
.zglare { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .75), rgba(255, 255, 255, .15) 30%, transparent 60%); opacity: .55; }
.zcard.live .zglare { opacity: .9; }
/* 홀로: SR 이상, 등급이 높을수록 진하게 */
.zholo { position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge; background-size: 300% 300%; background-position: var(--hp) var(--hp);
  background-image: linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .5) 32%, rgba(255, 230, 120, .5) 42%, rgba(120, 255, 200, .5) 52%, rgba(120, 180, 255, .5) 62%, transparent 75%); }
.zcard.r-SR .zholo { opacity: .1; }
.zcard.r-SSR .zholo { opacity: .16; }
.zcard.r-UR .zholo { opacity: .24; }
.zcard.live.r-SR .zholo { opacity: .3; }
.zcard.live.r-SSR .zholo { opacity: .5; }
.zcard.live.r-UR .zholo { opacity: .7; }
/* 카드 뒷면 */
.zcard.has-back { cursor: pointer; }
.zcard > * { transition: transform .17s ease-in; }
.zcard.turning > * { transform: scaleX(0); }
.zback { position: absolute; inset: 0; display: none; z-index: 1; }
.zcard.flipped .zback { display: block; }
.zcard.flipped > .zart, .zcard.flipped > .zrar, .zcard.flipped > .zinfo, .zcard.flipped > .zturn { display: none; }
.zlore { gap: 6px; padding-top: 90px; }
.zlore-title { font: 700 min(3.4vh, 26px)/1.2 var(--f-head); color: var(--rc); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.zlore p { margin: 0; font-size: min(2vh, 15px); line-height: 1.6; color: #f1ecf4; }
.zlore-who { font-size: 12px; color: #a99fb5; }
/* 얼굴이 그림 아래에 있는 카드(cardart info:'top'): 글자 패널을 위로, 등급 글자·뒤집기 표시는 아래로. 뒷면 이야기는 그대로 아래 */
.zcard.info-top > .zinfo { top: 0; bottom: auto; padding: 18px 22px 70px; background: linear-gradient(0deg, transparent, rgba(14, 11, 16, .82) 32%, rgba(10, 8, 12, .95)); }
.zcard.info-top > .zrar { top: auto; bottom: 10px; }
.zcard.info-top > .zturn { top: auto; bottom: 14px; }
.zturn { position: absolute; top: 14px; right: 14px; padding: 3px 10px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #fff1b0; font-size: 12px; pointer-events: none; }
.zhint { font-size: 13px; color: rgba(255, 240, 210, .6); }
@keyframes zin { from { transform: translateY(40px) scale(.6) rotateY(-25deg); opacity: 0; } }
@keyframes zfade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .zcard, .czoom { animation: none; } .zcard { transition: none; } }
.store-rar { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; color: var(--dim); }
.gcount { margin-left: auto; padding: 0 7px; border-radius: 9px; background: rgba(0, 0, 0, .55); color: #fff1b0; font-size: 13px; font-weight: 700; }
.glv { margin-left: 4px; padding: 0 6px; border-radius: 9px; background: rgba(0, 0, 0, .55); color: #bfe6ff; font-size: 12px; font-weight: 700; }
.glevel .row { gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.glevel .row button { padding: 2px 6px; font-size: 12px; }
.tag-line { font-size: 12px; text-align: center; }
.gskill { text-align: center; font-size: 10px; color: #e2d6ea; margin: -4px 0 4px; white-space: nowrap; }
.gdesc { font-size: 11px; line-height: 1.35; color: var(--dim); }
.side .gdesc { color: var(--ink-dim); }

/* 거점 */
.city-select { font-weight: 700; color: var(--gold); max-width: 230px; }
.city-kind { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; line-height: 16px; border-radius: 8px; vertical-align: 2px; color: #2b2030; background: linear-gradient(180deg, #f4eef8, #b9a9cf); font-weight: 700; }
/* 방출 · 승급 합성 */
/* 출진 군량 */
.msupply { margin: 8px 0; padding: 6px 8px; border: 1px solid rgba(90, 64, 104, .4); border-radius: 6px; font-size: 13px; }
.msupply .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msupply input { width: 90px; }
.msupply button.link.on { color: var(--gold); font-weight: 700; text-decoration: none; }
/* 거점 빈 터: 새 건물 목록 */
.newb { display: grid; gap: 8px; margin-top: 8px; }
.newb-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; padding: 6px; border: 1px solid rgba(90, 64, 104, .4); border-radius: 7px; }
.newb-row img { width: 56px; height: 42px; object-fit: contain; }

/* 움직임 줄이기: 반짝임·뒤집기·알림까지 모두 (2026-10-30) */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* 등급별 카드 프레임 (design/art-style.md, 2026-10-30): N 무쇠 · R 청동 · SR 은 · SSR 금박 · UR 자개 */
.gcard.r-N .gface { border-color: #5d636a; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 4px #2b2f34, inset 0 0 0 5px #6b7178, 0 4px 12px rgba(0, 0, 0, .5); }
.gcard.r-R .gface { border-color: #b8783e; box-shadow: inset 0 0 0 1px #2a170a, inset 0 0 0 4px #5a3519, inset 0 0 0 5px #e0a466, inset 0 0 18px rgba(120, 70, 30, .35), 0 4px 12px rgba(0, 0, 0, .5); }
.gcard.r-SR .gface { border-color: #d9e0e8; box-shadow: inset 0 0 0 1px #20252b, inset 0 0 0 4px #4a525c, inset 0 0 0 5px #f2f6fa, inset 0 0 22px rgba(200, 215, 230, .25), 0 4px 14px rgba(0, 0, 0, .5), 0 0 10px rgba(220, 230, 240, .18); }
.gcard.r-SSR .gface { border: 2px solid #f3c64e; box-shadow: inset 0 0 0 1px #3a2606, inset 0 0 0 4px #7a5414, inset 0 0 0 5px #ffe28a, inset 0 0 0 7px #3a2606, inset 0 0 26px rgba(255, 200, 80, .28), 0 4px 16px rgba(0, 0, 0, .55), 0 0 16px rgba(255, 210, 100, .25); }
.gcard.r-SSR .gface::before { content: ''; position: absolute; inset: 3px; pointer-events: none; z-index: 2; border-radius: 8px;
  background: radial-gradient(circle at 0 0, #ffe28a 0 5px, transparent 6px), radial-gradient(circle at 100% 0, #ffe28a 0 5px, transparent 6px), radial-gradient(circle at 0 100%, #ffe28a 0 5px, transparent 6px), radial-gradient(circle at 100% 100%, #ffe28a 0 5px, transparent 6px); }
.gcard.r-UR .gface { border: 2px solid transparent; background: linear-gradient(180deg, #2a1d2e, #160f18) padding-box, conic-gradient(from var(--ur-a, 0deg), #f6e6ff, #bfe3ff, #c8fbe8, #fff1c2, #ffd0e6, #f6e6ff) border-box; box-shadow: inset 0 0 0 4px rgba(20, 12, 24, .9), inset 0 0 0 5px rgba(255, 230, 250, .7), inset 0 0 30px rgba(220, 190, 255, .25), 0 4px 18px rgba(0, 0, 0, .55), 0 0 18px rgba(230, 200, 255, .3); animation: ur-spin 6s linear infinite; }
@property --ur-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes ur-spin { to { --ur-a: 360deg; } }
.zcard.r-SSR::before { content: ''; position: absolute; inset: 6px; z-index: 3; pointer-events: none; border-radius: 12px; border: 1px solid rgba(255, 226, 138, .8);
  box-shadow: inset 0 0 0 3px rgba(58, 38, 6, .6); background: radial-gradient(circle at 0 0, #ffe28a 0 7px, transparent 8px), radial-gradient(circle at 100% 0, #ffe28a 0 7px, transparent 8px), radial-gradient(circle at 0 100%, #ffe28a 0 7px, transparent 8px), radial-gradient(circle at 100% 100%, #ffe28a 0 7px, transparent 8px); }
.zcard.r-UR { background: linear-gradient(#1a1220, #1a1220) padding-box, conic-gradient(from var(--ur-a, 45deg), #f6e6ff, #bfe3ff, #c8fbe8, #fff1c2, #ffd0e6, #f6e6ff) border-box; animation: zin .45s cubic-bezier(.2, .9, .3, 1.15), ur-spin 6s linear infinite; }

/* 과업 칩: 한동안 진행이 없으면 붉게 굵게 깜박인다 (2026-10-30 유저 의견: 왼쪽 아래 과업이 잘 안 보인다) */
.advisor-chip.idle .ac-bubble { background: #b8321f; color: #fff; font-weight: 800; animation: quest-idle 1.1s ease-in-out infinite; }
.advisor-chip.idle .ac-bubble::before { border-right-color: #b8321f; }
.advisor-chip.idle .ac-bubble small { color: #ffe1d6; }
.advisor-chip.idle .ac-face { border-color: #ff5a3c; animation: quest-idle-face 1.1s ease-in-out infinite; }
@keyframes quest-idle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.04); } }
@keyframes quest-idle-face { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, .8), 0 2px 6px rgba(0, 0, 0, .7); } 50% { box-shadow: 0 0 0 10px rgba(255, 90, 60, 0), 0 2px 6px rgba(0, 0, 0, .7); } }
@media (prefers-reduced-motion: reduce) { .advisor-chip.idle .ac-bubble, .advisor-chip.idle .ac-face { animation: none; } }

.army-goal { margin: 4px 0 8px; padding: 8px 12px; border-left: 3px solid var(--bronze-hi); background: rgba(207, 233, 239, .07); color: #efe9f2; font-size: 15px; }

/* 장수 상태 배지 (피로·출진·배치) — 2026-10-30 */
.gbadge { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); z-index: 4; white-space: nowrap; padding: 3px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .7); pointer-events: auto; }
.gbadge.rest { background: rgba(70, 40, 110, .92); border: 1px solid #c9a6ff; }
.gbadge.march { background: rgba(150, 90, 20, .92); border: 1px solid #ffd27a; }
.gbadge.post { background: rgba(30, 80, 60, .9); border: 1px solid #8fd6b0; }
.gbadge-stack { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.gbadge-stack .gbadge { position: static; transform: none; text-align: center; }
button.gbadge.restbtn { background: rgba(120, 80, 10, .94); border: 1px solid #ffd27a; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
button.gbadge.restbtn:hover { background: rgba(160, 110, 20, .96); }
.gbadge.restbtn.done { background: rgba(60, 60, 60, .9); border: 1px solid #999; font-weight: 600; }
.gcard.resting .gportrait { filter: grayscale(.6) brightness(.7); }
.mgen.rest { opacity: .7; cursor: not-allowed; padding: 4px 6px; }
.mgen.rest .timer { color: #c9a6ff; font-weight: 700; }

/* 중요 보고서 (장수를 빼앗김 등) — 2026-10-30 */
.list .item.important { color: #ff8a7a; font-weight: 800; border-left: 4px solid #d8432f; background: rgba(216, 67, 47, .12); }
/* 강제 안내 (2026-10-31): 눌러야 할 곳만 밝게 뚫고 나머지는 어둡게. 클릭 차단은 main.js guideBlocks 가 한다 */
.guide { position: absolute; left: 0; top: 0; z-index: 800; pointer-events: none; } /* 문서 좌표 — main.js pinBox 가 화면 (0,0) 에 맞춘다 (fixed 는 휴대폰에서 대상과 어긋났다, 2026-11-11) */
.guide-dim { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; fill: rgba(8, 5, 2, .62); }
.guide-probe { position: fixed; left: 1000px; top: 0; width: 0; height: 0; visibility: hidden; } /* CSS zoom 배율 재기 (main.js guideScale) */
.guide-hole { position: absolute; border-radius: 10px; outline: 3px solid #ffd76a; outline-offset: 0; animation: guide-pulse 1.1s ease-in-out infinite; } /* 위치는 매 프레임 맞추므로 전환 효과를 두지 않는다 (어둡게 덮는 판과 어긋나 보였다) */
.guide.region .guide-hole, .guide.region .guide-dim { display: none; }
@keyframes guide-pulse { 0%, 100% { outline-color: #ffd76a; } 50% { outline-color: #ff6a3d; } }
.guide-tip { position: absolute; width: 140px; padding: 6px 10px; text-align: center; font-size: 14px; font-weight: 700; color: #3b2408; background: linear-gradient(180deg, #ffe9a8, #e5b54d); border: 1px solid #8a5a17; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); animation: guide-bob 1s ease-in-out infinite; }
@keyframes guide-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#guide-skip { position: fixed; top: 8px; right: 12px; pointer-events: auto; padding: 4px 10px; font-size: 13px; color: #f4e4bf; background: rgba(0, 0, 0, .55); border-radius: 6px; }
/* 화면 단위 안내: 메뉴·위쪽 막대·채팅만 어둡게 */
body.guiding:has(.guide.region:not([hidden])) #menu, body.guiding:has(.guide.region:not([hidden])) #topbar, body.guiding:has(.guide.region:not([hidden])) .chat { filter: brightness(.38); }
body.guiding .advisor-chip { z-index: 850; }
@media (prefers-reduced-motion: reduce) { .guide-hole, .guide-tip { animation: none; transition: none; } }
@media (max-width: 640px) { #guide-skip { top: auto; bottom: 8px; right: 8px; font-size: 12px; } }

/* 가로로 든 휴대폰 (2026-10-31): 한 줄로 쌓으면 성 화면 칸이 높이 230px 남짓이라 너무 작았다.
   왼쪽 아이콘 메뉴 · 가운데 화면 · 오른쪽 안내+채팅으로 펼치고, 위쪽 자원 막대는 한 줄로 */
@media (max-height: 560px) and (min-width: 641px) and (orientation: landscape) {
  .app { grid-template-columns: 54px 1fr 250px; grid-template-rows: auto 1fr 96px; height: 100dvh; min-height: 0; }
  .topbar { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding: 2px 8px; }
  .menu { grid-column: 1; grid-row: 2 / 4; flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 4px; box-shadow: inset -1px 0 0 var(--bronze); }
  .menu button { justify-content: center; padding: 3px; font-size: 0; }
  .menu button .badge { font-size: 10px; left: auto; right: 0; top: 0; }
  /* 위 font-size: 0 이 아래쪽 공지사항·계정 삭제·로그아웃 글자까지 0 으로 만들었다 → 세로로 쌓고 글씨 복구 (2026-11-16) */
  .menu-foot { position: static; flex-direction: column; align-items: stretch; flex-wrap: nowrap; max-width: none; gap: 4px; margin: auto 0 0; padding: 6px 0 0; border-left: none; border-top: 1px solid rgba(160, 150, 180, .3); background: none; text-align: center; }
  .menu .menu-foot button { font-size: 10px; line-height: 1.2; padding: 3px 0; }
  .view { grid-column: 2; grid-row: 2 / 4; min-height: 0; }
  .side { grid-column: 3; grid-row: 2; max-height: none; padding: 10px; border-top: none; border-left: 6px solid var(--wood-1); }
  .chat { grid-column: 3; grid-row: 3; border-left: 6px solid var(--wood-1); }
  .ac-face { width: 42px; height: 42px; } .ac-badge { left: 30px; } .ac-bubble { font-size: 13px; padding: 4px 9px; }
  .city-head { margin-bottom: 2px; font-size: 11px; gap: 10px; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; } .city-head h2 { font-size: 16px; }
  .scene-wrap { height: calc(100dvh - 128px); min-height: 200px; }
  .bpanel-img { width: 42%; margin-bottom: 4px; } /* 좁은 오른쪽 패널: 건물 그림을 줄여 업그레이드 버튼이 스크롤 없이 보이게 */
}
.chat-toggle { display: none; }
/* 세로 한 줄 배치 (휴대폰·접힌 폴드 등, 2026-11-01): 아래 안내 패널을 접었다 펼 수 있게. 접으면 첫 줄(제목)만 보인다 */
.side-toggle { display: none; }
@media (max-width: 900px), (max-height: 560px) {
  .side-toggle { display: block; grid-column: 1; grid-row: 4; justify-self: end; align-self: start; z-index: 2; margin: 12px 10px 0 0; padding: 3px 10px; font-size: 12px; }
  /* 접으면 안내 패널과 채팅을 모두 숨기고 「안내 펼치기」만 맨 아래에 (2026-11-11 유저 요청, 그전에는 안내 첫 줄만 남기고 채팅은 그대로) */
  body.side-min .side, body.side-min .chat { display: none; }
  body.side-min .app { grid-template-rows: auto auto 1fr auto auto; }
  body.side-min .side-toggle { grid-row: 5; align-self: center; margin: 6px 10px; }
}
@media (max-height: 560px) and (min-width: 641px) and (orientation: landscape) {
  /* 가로 배치도 오른쪽 안내 · 채팅 칸을 접는다 (2026-11-16 유저: 성 화면 · 징병 목록을 크게). 접으면 가운데 화면이 오른쪽 끝까지. 건물을 누르면 다시 펼친다 (openSideOnSelect) */
  .side-toggle { display: block; position: fixed; z-index: 30; top: 38px; right: 258px; grid-row: auto; margin: 0; padding: 2px 9px; font-size: 11px; opacity: .92; }
  body.side-min .side-toggle { right: 8px; margin: 0; }
  body.side-min .app { grid-template-columns: 54px 1fr 0; grid-template-rows: auto 1fr 40px; }
  body.side-min .side, body.side-min .chat { display: none; }
}
@media (max-height: 560px) and (min-width: 641px) and (orientation: landscape) {
  .city-head { flex-wrap: wrap; row-gap: 0; line-height: 1.35; } /* 성 정보가 잘리지 않게 두 줄까지 (2026-10-31) */
  .scene-wrap { height: calc(100dvh - 146px); }
  .app { grid-template-rows: auto 1fr 40px; }
  .chat-toggle { display: inline-block; margin-left: auto; padding: 2px 10px; font-size: 12px; }
  body:not(.chat-big) .chat .chat-log, body:not(.chat-big) .chat .chat-form, body:not(.chat-big) .chat-tabs button[data-ch] { display: none; }
  body.chat-big .chat { grid-row: 2 / 4; z-index: 4; } /* 펼치면 오른쪽 칸 전체 (안내 패널 위) */
  body.chat-big .chat-log { min-height: 0; }
}
/* 휴대폰 (2026-10-31): 테스트용 배속 표시는 자원 막대를 넘치게 해서 숨기고, 안내 패널의 건물 그림을 줄여 업그레이드 버튼이 바로 보이게 */
@media (max-width: 640px), (max-height: 560px) { .topbar .speed { display: none; } }
@media (max-width: 640px) { .bpanel-img { width: 30%; float: left; margin: 0 10px 4px 0; } } /* 그림은 왼쪽에 작게, 이름·설명이 옆으로 흐른다 */
/* 공지사항 (js/notices.js) */
.notices { max-width: 560px; }
.notice h3 { margin: 4px 0 8px; font-size: 17px; }
.notice h3 .dim { font-size: 13px; font-weight: 400; }
.notice h4 { margin: 12px 0 4px; color: var(--gold, #e8c36a); font-size: 15px; }
.notice ul { margin: 0; padding-left: 18px; line-height: 1.6; }
.menu-foot #notice-btn { display: block; margin-bottom: 4px; }
.demolish { margin-top: 16px; padding-top: 8px; border-top: 1px dashed var(--bronze); }

/* 시장 (2026-11-01) */
.market-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.market-table th, .market-table td { padding: 4px 6px; border-bottom: 1px solid var(--bronze-lo); text-align: left; white-space: nowrap; }
.market-table tr.on td { background: rgba(160, 150, 180, .22); font-weight: 600; }
.market #market-n { width: 90px; }
.market-box { width: min(520px, 100%); }
.market-log tr.mine td { color: #ffd76a; font-weight: 600; }
.market-box .market-table th, .market-box .market-table td { border-bottom-color: rgba(160, 150, 180, .25); }

/* 귀갑문 (2026-11-01): 나전함의 거북등 육각 무늬를 흑칠 바탕에 옅은 자개선으로, 판 네 모서리에 자개 꺾쇠, 메뉴 아이콘은 육각 */
:root {
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='48' viewBox='0 0 42 48'%3E%3Cpath d='M21 2 L39 12 L39 36 L21 46 L3 36 L3 12 Z' fill='none' stroke='%23cfe9ef' stroke-opacity='.10' stroke-width='1.2'/%3E%3Cpath d='M21 9 L33 16 L33 32 L21 39 L9 32 L9 16 Z' fill='none' stroke='%23f6d6e6' stroke-opacity='.06' stroke-width='1'/%3E%3C/svg%3E");
  --wood: var(--hex) 0 0 / 42px 48px, linear-gradient(180deg, #1f1a22, #141116);
}
.view { background: var(--hex) 0 0 / 42px 48px, radial-gradient(ellipse at 50% 0%, #221c26, #121014 70%); }
.topbar { box-shadow: inset 0 -1px 0 #cfe9ef, 0 2px 0 #08070a, 0 4px 10px rgba(0, 0, 0, .55); }
/* 꺾쇠: 판 네 모서리에 자개 ㄱ자 장식 */
.queue, .march, .cand, .units, .list, .pcol {
  background:
    linear-gradient(#cfe9ef, #cfe9ef) 4px 4px / 14px 1.5px no-repeat, linear-gradient(#cfe9ef, #cfe9ef) 4px 4px / 1.5px 14px no-repeat,
    linear-gradient(#f6d6e6, #f6d6e6) right 4px top 4px / 14px 1.5px no-repeat, linear-gradient(#f6d6e6, #f6d6e6) right 4px top 4px / 1.5px 14px no-repeat,
    linear-gradient(#e6dcf8, #e6dcf8) left 4px bottom 4px / 14px 1.5px no-repeat, linear-gradient(#e6dcf8, #e6dcf8) left 4px bottom 4px / 1.5px 14px no-repeat,
    linear-gradient(#f4eed2, #f4eed2) right 4px bottom 4px / 14px 1.5px no-repeat, linear-gradient(#f4eed2, #f4eed2) right 4px bottom 4px / 1.5px 14px no-repeat,
    var(--card); }
.menu button::before { border-radius: 8px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
h2 { color: #f4eef8; }
.side h2 { color: #7d1d1d; }

/* 장수 개편 (2026-11-01): 참모 지정 단추, 수비 총대장 칸, 보고서의 장수 효과 */
.mgen { flex-wrap: wrap; }
.mgen b, .mgen .prar, .mgen-role { white-space: nowrap; }
.mgen > .dim { flex: 1 1 8em; min-width: 0; }
.mgen-sage { margin-left: auto; padding: 0 8px; font-size: 11px; line-height: 20px; white-space: nowrap; }
.mgen.sage { border-color: #9fe3ef; background: rgba(159, 227, 239, .12); }
.mgen.sage .mgen-role { color: #1d6f80; }
.pslot-role { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pslot.cmd { border-color: #cfe9ef; box-shadow: 0 0 0 1px rgba(207, 233, 239, .4); }
.rep-gen { margin: 4px 0 10px; padding: 7px 10px; border-left: 3px solid #cfe9ef; background: rgba(90, 64, 104, .1); font-size: 13px; display: grid; gap: 2px; }

/* 승급 연출 (2026-11-01 2차): 어둡게 → 뒤에서 빛줄기가 돌고 별이 반짝이며 빛 입자가 카드로 모임 → 은은한 빛 → 위 등급 카드가 나타나며 입자가 터짐 */
.promo { position: fixed; inset: 0; z-index: 1150; display: grid; place-items: center; align-content: center; gap: 18px; padding: 16px; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(30, 24, 34, .85), rgba(0, 0, 0, .95)); animation: zfade .3s ease-out; }
.promo.done { cursor: pointer; }
.promo-stage { position: relative; perspective: 1200px; }
.promo-stage .zcard { position: relative; z-index: 2; animation: none; }
.promo-stage.charging .zcard { animation: promo-glow .6s ease-in-out infinite alternate; }
@keyframes promo-glow { from { box-shadow: 0 0 24px rgba(207, 233, 239, .35); } to { box-shadow: 0 0 60px rgba(246, 214, 230, .75), 0 0 120px rgba(207, 233, 239, .35); } }
.promo-rays { position: absolute; left: 50%; top: 50%; width: 1100px; height: 1100px; margin: -550px; z-index: 0; border-radius: 50%; opacity: 0; transition: opacity .8s;
  background: repeating-conic-gradient(from 0deg, rgba(246, 214, 230, .16) 0 6deg, transparent 6deg 18deg, rgba(207, 233, 239, .14) 18deg 24deg, transparent 24deg 36deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 62%); mask: radial-gradient(circle, #000 15%, transparent 62%); animation: promo-spin 14s linear infinite; }
.promo-stage.charging .promo-rays { opacity: .8; }
.promo-stage.revealed .promo-rays { opacity: 1; }
@keyframes promo-spin { to { transform: rotate(360deg); } }
.promo-stars { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.promo-stars i { position: absolute; width: 22px; height: 22px; margin: -11px; opacity: 0; animation: promo-twinkle 1.4s ease-in-out infinite; animation-delay: var(--d);
  background: radial-gradient(circle, #fff 0 2px, transparent 3px), linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, .9) 50%, transparent 55%), linear-gradient(0deg, transparent 45%, rgba(255, 255, 255, .9) 50%, transparent 55%); }
@keyframes promo-twinkle { 0%, 100% { opacity: 0; transform: scale(calc(var(--s) * .3)) rotate(0deg); } 50% { opacity: 1; transform: scale(var(--s)) rotate(45deg); } }
.promo-shine { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 18px; overflow: hidden; opacity: 0; }
.promo-shine::before { content: ''; position: absolute; inset: -20% -60%; background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%); transform: translateX(-60%); }
.promo-stage.charging .promo-shine { opacity: 1; }
.promo-stage.charging .promo-shine::before { animation: promo-sweep 1.1s ease-in-out infinite; }
@keyframes promo-sweep { to { transform: translateX(60%); } }
.promo-sparks { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; }
.promo-stage.charging .promo-sparks { opacity: 1; }
.promo-sparks i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: radial-gradient(circle, #fff, #f6d6e6 45%, transparent 70%);
  box-shadow: 0 0 8px #cfe9ef; animation: promo-spark 1.2s ease-in infinite; animation-delay: var(--d); }
@keyframes promo-spark { from { transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(1.2); opacity: 0; } 25% { opacity: 1; } to { transform: rotate(var(--a)) translateY(-30px) scale(.3); opacity: 0; } }
.promo-burst { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.promo-burst i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff, #f4eed2 40%, #cfe9ef 60%, transparent 72%); }
.promo-stage.revealed .promo-burst i { animation: promo-burst 1.2s cubic-bezier(.15, .7, .3, 1) forwards; animation-delay: var(--d); }
@keyframes promo-burst { from { transform: rotate(var(--a)) translateY(0) scale(1.4); opacity: 1; } to { transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(.2); opacity: 0; } }
.promo-stage::after { content: ''; position: absolute; inset: 10%; z-index: 5; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 65%); opacity: 0; }
.promo-stage.flash::after { animation: promo-flash .45s ease-out forwards; }
@keyframes promo-flash { 0% { opacity: 0; } 40% { opacity: .6; } 100% { opacity: 0; } }
.zcard.promo-new { animation: promo-new .9s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes promo-new { from { transform: scale(.7) rotateY(-90deg); filter: brightness(1.5); } 60% { transform: scale(1.05) rotateY(0); } to { transform: none; filter: none; } }
.promo-stage.revealed .zcard { box-shadow: 0 0 50px rgba(246, 214, 230, .55), 0 0 110px rgba(207, 233, 239, .3); }
.promo-cap { position: relative; z-index: 6; display: grid; justify-items: center; gap: 2px; text-align: center; color: #f4eef8; text-shadow: 0 2px 8px #000; }
.promo-cap b { font: 700 26px var(--f-head); }
.promo-cap small { color: #cfc6d8; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .promo-stage .zcard, .promo-sparks i, .promo-stars i, .promo-burst i, .promo-rays, .promo-shine::before, .promo-stage::after, .zcard.promo-new { animation: none !important; } }
/* SSR 고르기 */
.ssr-pick { position: fixed; inset: 0; z-index: 1090; /* 카드 크게 보기(.czoom 1100)가 위에 뜨게 */ display: grid; place-items: center; padding: 16px; overflow: auto; background: rgba(0, 0, 0, .82); }
.ssr-pick-box { max-width: 1040px; padding: 18px 20px 20px; text-align: center; background: linear-gradient(180deg, #1d191f, #141116); border: 1px solid #cfe9ef; border-radius: 12px; }
.ssr-pick-box h2 { margin: 0 0 4px; }
.ssr-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 12px; }
.ssr-choice { display: grid; grid-template-rows: 1fr auto; gap: 8px; justify-items: center; align-items: start; }
.rep-capture { margin: 4px 0 10px; padding: 7px 10px; border-left: 3px solid #f4eed2; background: rgba(90, 64, 104, .1); font-size: 13px; }

/* 요괴왕 레이드 상단 칩 (2026-11-04) */
.topbar .raid-chip { background: #3a1c40; border: 1px solid #c77dff; color: #f3dcff; border-radius: 14px; padding: 3px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.topbar .raid-chip.fight { background: #5a1a6a; animation: raid-pulse 1.6s ease-in-out infinite; }
@keyframes raid-pulse { 50% { box-shadow: 0 0 10px #c77dff; } }

/* 요괴왕 전투 화면 (2026-11-04, js/raidview.js) */
.raid-pane { display: flex; flex-direction: column; height: 100%; }
.raid-pane[hidden] { display: none; }
.raid-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 6px; }
.raid-hp { position: relative; flex: 1 1 220px; max-width: 420px; height: 18px; background: #2a1830; border: 1px solid #c77dff; border-radius: 9px; overflow: hidden; }
.raid-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7b2fbf, #c77dff); transition: width .8s; }
.raid-hp span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 18px; color: #fff; text-shadow: 0 1px 2px #000; }
.raid-wrap { flex: 1 1 auto; min-height: 220px; container-type: size; display: flex; justify-content: center; align-items: flex-start; }
.raid-scene { position: relative; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; border: 3px solid var(--wood-1); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--bronze), 0 6px 18px rgba(0, 0, 0, .55); background: #2b3320; }
.raid-canvas { display: block; width: 100%; height: 100%; }
.raid-foot { margin: 0 0 6px; font-size: 13px; }
@media (max-width: 640px) { .raid-wrap { flex: none; container-type: inline-size; min-height: 0; } .raid-scene { width: 100%; } }

/* 숫자가 바뀌어도 칸 너비가 그대로 (2026-11-04): 글자 폭이 달라지면 줄바꿈이 바뀌어 화면이 위아래로 흔들렸다 */
body { font-variant-numeric: tabular-nums; }
.topbar .res b { display: inline-block; min-width: 7ch; text-align: right; }
@media (min-width: 641px) { .topbar .res small { display: inline-block; min-width: 6.5ch; } }
.timer { display: inline-block; min-width: 4.6ch; text-align: right; }
.raid-chip-pct, .raid-left-txt { display: inline-block; min-width: 4ch; text-align: right; }
.kv .raid-left-txt { text-align: left; } /* 옆 패널 값 칸은 다른 줄처럼 왼쪽 정렬 */
/* 옆 패널 설명 줄 (ⓘ 규칙 보기 + 한 줄 설명): 알약 높이만큼 줄을 잡아 아래 표와 겹치지 않게 */
.side > div:has(> .info-btn) { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 28px; margin: 6px 0 10px; }
.side > div:has(> .info-btn) > .info-btn { margin-left: 0; }
.raid-status { display: inline-block; min-width: 24ch; }
@media (max-width: 640px) { .topbar .res b { min-width: 6ch; } }

/* 열전 (2026-11-04) */
.yeol { margin-bottom: 18px; }
.yeol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.yeol-book { border: 1px solid var(--bronze-lo); border-radius: 10px; padding: 10px; background: rgba(0, 0, 0, .25); }
.yeol-book.open { border-color: #ffd65a; }
.yeol-book.ready { border-color: #ff9f43; box-shadow: 0 0 0 1px #ff9f43 inset; }
.yeol-book.complete { border-color: #c0392b; }
.yeol-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.yeol-face { width: 56px; height: 56px; border-radius: 8px; background-size: 260%; background-color: #2a2018; border: 1px solid var(--bronze); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.yeol-eps { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.yeol-ep { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #2a2420; color: var(--dim); }
.yeol-ep.s-done { background: #2f4a24; color: #cfe8b0; }
.yeol-ep.s-ready { background: #6a4410; color: #ffe2a0; }
.yeol-ep.s-open { background: #5a4a10; color: #ffe8a0; }
.yeol-ep.s-can { background: #34302a; color: #f0e2c0; }
.yeol-steps { margin: 8px 0 0 18px; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.yeol-steps li.done { color: var(--dim); }
.yeol-steps li.cur { color: #ffe8a0; }
.yeol-opts { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.yeol-opts button { text-align: left; }
.yeol-go { margin-left: 6px; padding: 1px 8px; font-size: 12px; }
.yeol-tales { margin-top: 6px; font-size: 12px; color: var(--dim); }
.yeol-note { margin: 4px 0 8px; padding: 6px 8px; border-radius: 6px; background: rgba(255, 214, 90, .12); border: 1px solid #ffd65a; font-size: 13px; }

.dlg-face.narr { filter: sepia(.35) brightness(.9); } /* 열전 서술 줄: 그 편 카드 그림을 옅게 */

/* 집결 출진 (금싸라기 땅, 2026-11-05) */
.rally-form { display: grid; gap: 8px; margin-top: 8px; }
.rally-city { padding: 6px 8px; border: 1px solid rgba(90, 64, 104, .35); border-radius: 6px; display: grid; gap: 4px; }
.rally-city.off { opacity: .55; }
.rally-u { font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.rally-un { display: inline-block; width: 3.4em; text-align: right; } /* 병종 이름 폭을 맞춰 입력칸이 한 줄로 서게 */
.rally-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, max-content)); gap: 4px 14px; }
.rally-gens { display: flex; flex-wrap: wrap; gap: 4px; }
.rally-gen { font-size: 12px; padding: 2px 6px; border: 1px solid rgba(90, 64, 104, .35); border-radius: 12px; cursor: pointer; white-space: nowrap; }
.rally-gen.on { background: rgba(217, 165, 33, .25); border-color: #b8860b; }
.rally-gen input { margin: 0 2px 0 0; vertical-align: middle; }
.rally-role { font-size: 11px; color: var(--ink-dim); }
.rally-role.lead { color: #9a620a; font-weight: 700; }
.rally-role.sage { color: #1d7c98; font-weight: 700; }
.rally-roles { font-size: 12px; display: grid; gap: 2px; padding: 6px 8px; border-left: 3px solid #b8860b; background: rgba(217, 165, 33, .08); }
/* 레이드 표시 · 휴대폰: 아래 칩 줄(#dock)에 크게 (2026-11-06, 2026-11-10 줄로). 넓은 화면은 상단에 */
.raid-float { display: none; }
@media (max-width: 900px) {
  .topbar .raid-chip { display: none; }
  .raid-float { display: contents; } /* 레이드·스토리 칩이 #dock 의 칸으로 바로 들어간다 */
  .raid-float .raid-chip { background: #3a1c40; border: 2px solid #c77dff; color: #f3dcff; border-radius: 12px; padding: 4px 10px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
  .raid-float .raid-chip b { font-size: 15px; }
  .raid-float .raid-chip small { font-size: 13px; opacity: .9; }
  .raid-float .raid-chip.fight { background: #5a1a6a; animation: raid-pulse 1.6s ease-in-out infinite; }
  .raid-float .story-chip { background: #4a1414; border-color: #ff6b6b; color: #ffe2e2; }
}
/* 휴대폰 아래 칩 줄 (2026-11-11): 과업 · 스토리 · 레이드 · 경매 넷이 390px 한 줄에 들어가게 칩을 줄이고, 레이드 칩이 있으면 과업은 초상(+ 못 받은 보상 수)만. 안내 중에는 말풍선을 그대로 */
@media (max-width: 640px) {
  .dock { gap: 6px; } .dock.on { padding: 6px 8px; }
  body:not(.guiding) .dock:has(.raid-chip) .ac-bubble { display: none; }
  .dock .raid-float .raid-chip, .dock .auction-chip { padding: 3px 7px; }
  .dock .raid-float .raid-chip b, .dock .auction-chip b { font-size: 13px; }
  .dock .raid-float .raid-chip small, .dock .auction-chip small { font-size: 11px; }
}

.store-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.store-sort { font-size: 13px; padding: 3px 6px; margin-left: auto; }
.yeol-camps { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-top: 8px; }
/* 주점 뽑기 족자 (2026-11-08) */
/* 전체화면 족자 창 (카드 크게 보기 .czoom 아래, 1100 > 1080) */
.tavern-pop { position: fixed; inset: 0; z-index: 1080; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(40, 28, 20, .78), rgba(0, 0, 0, .92)); backdrop-filter: blur(6px); animation: zfade .2s ease-out;
  touch-action: pan-x pan-y; overscroll-behavior: contain; } /* 손가락 확대 막기 (main.js pinchBlocked) */
.tp-head { display: flex; gap: 18px; align-items: baseline; color: #f0e2c0; }
.tp-head b { font: 400 30px/1 "Nanum Brush Script", "Malgun Gothic", serif; letter-spacing: 1px; color: #ffd98a; text-shadow: 0 2px 6px #000; }
.tp-head span { font-size: 13px; color: #cdbb95; }
.tp-fit { position: relative; }
.tp-fit .tavern-scrolls { position: absolute; left: 0; top: 0; transform-origin: 0 0; grid-template-columns: repeat(5, 300px); width: max-content; margin: 0; }
/* 버튼 (2026-11-11): 두 줄 버튼을 같은 높이로. 획득은 위 한 줄 전체, 새로고침 골드 · 동전 나란히, 건너뛰기 · 닫기는 아래 */
.tp-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(460px, 100%); }
.tp-bar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 50px; padding: 6px 10px; line-height: 1.2; }
.tp-bar button b { font-size: 15px; }
.tp-bar button small { font-size: 12px; font-weight: 600; opacity: .85; }
.tp-bar .tp-take { grid-column: 1 / -1; min-height: 54px; }
.tp-bar .tp-take b { font-size: 17px; }
.tp-bar .tp-close { grid-column: 1 / -1; min-height: 40px; }
.tp-bar .tp-skip { grid-column: 1; min-height: 40px; }
.tp-bar .tp-skip + .tp-close { grid-column: 2; }
.tp-bar button.rush.silver { background: linear-gradient(180deg, #eef2f6, #9aa4ae); border-color: #f7fafc; color: #1b1f24; }
.tp-bar button.rush.silver:hover:not(:disabled) { background: linear-gradient(180deg, #ffffff, #aab4be); }
/* 카드 크게 보기를 뽑기 창 위에 띄울 때: 흐림을 두 겹 쌓지 않고 뒤 창은 숨긴다 (아이폰 메모리) */
body:has(.czoom) .tavern-pop { visibility: hidden; }
.tavern-pop ~ .czoom { backdrop-filter: none; background: rgba(0, 0, 0, .92); }
/* 휴대폰 뽑기 창 · 카드 크게 보기 (2026-11-11 아이폰 사파리에서 손가락으로 크게 확대하면 페이지가 죽어 로그인 화면으로 갔다):
   확대하면 사파리가 화면 전체를 배율만큼 다시 그린다 → 창 뒤 게임 화면(장수 카드 그림 수백 장)은 숨기고, 흐림 대신 단색 배경 */
@media (hover: none) and (pointer: coarse) {
  .tavern-pop, .czoom { backdrop-filter: none; -webkit-backdrop-filter: none; background: radial-gradient(circle at 50% 45%, #2a1e16, #0b0807 75%); }
  body:has(.tavern-pop) #app, body:has(.czoom) #app { visibility: hidden; }
}
/* 휴대폰 뽑기 창 (2026-11-11): 카드를 폭에 맞춰 크게(세로 2열 · 가로 5열, main.js fitTavernPop) → 카드 칸(.tp-scroll)만 위아래로 스크롤, 버튼 줄은 그 밖 아래.
   버튼 줄을 스크롤 창 안에 sticky 로 붙였더니 아이폰 사파리에서 눌리지 않았다 (보이는 자리와 누르는 자리가 어긋나는 WebKit 버그) */
@media (max-width: 640px), (max-height: 560px) {
  .tavern-pop { overflow: hidden; justify-content: flex-start; gap: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .tavern-pop > * { flex: none; }
  .tavern-pop > .tp-scroll { flex: 1 1 auto; min-height: 0; width: 100%; overflow-y: auto; overscroll-behavior: contain; display: flex; justify-content: center; align-items: flex-start; }
}
/* 가로로 든 휴대폰: 높이가 낮아 버튼을 한 줄로 */
@media (max-height: 560px) {
  .tp-bar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: min(780px, 100%); }
  .tavern-pop { padding-top: 8px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); } /* 아이폰 가로: 바닥 끝은 사파리 도구막대·홈 바 자리라 조금 띄운다 */
  .tp-head b { font-size: 24px; }
  .tp-bar .tp-take, .tp-bar .tp-close, .tp-bar .tp-skip, .tp-bar .tp-skip + .tp-close { grid-column: auto; min-height: 44px; }
  .tp-bar .tp-take b { font-size: 15px; }
}
.tp-hint { font-size: 12px; color: #b9a98a; text-align: center; }
.tavern-scrolls { display: grid; grid-template-columns: repeat(auto-fill, 300px); gap: 18px 10px; margin-top: 8px; }
/* 두루마리 그림 (2026-11-08 2판, ComfyUI FLUX schnell + 성주전쟁 화풍 LoRA, assets/tavern/scroll-<등급>.webp 600×900 = 화면 2배).
   다섯 장 모두 같은 설계도: 위 축(0~43) / 표구와 종이(43~403) / 아래 축과 술(403~450) 세 조각으로 써서, 아래가 내려오며 펼쳐진다.
   종이는 미색 한지, 등급은 표구 비단과 축으로: N 먹색 삼베 · R 주홍 비단 · SR 은청 비단 · SSR 금 비단 · UR 흑칠 자개. 동전이 모자란 칸은 N */
.scroll { --img: url(/assets/tavern/scroll-N.webp); position: relative; width: 300px; height: 450px; }
.scroll.r-R { --img: url(/assets/tavern/scroll-R.webp); }
.scroll.r-SR { --img: url(/assets/tavern/scroll-SR.webp); }
.scroll.r-SSR { --img: url(/assets/tavern/scroll-SSR.webp); }
.scroll.r-UR { --img: url(/assets/tavern/scroll-UR.webp); }
.scroll .s-top, .scroll .s-paper, .scroll .s-bot { position: absolute; left: 0; width: 100%; background: var(--img) no-repeat; background-size: 300px 450px; }
.scroll .s-top { top: 0; height: 43px; background-position: 0 0; z-index: 2; }
.scroll .s-paper { top: 43px; height: 360px; background-position: 0 -43px; }
.scroll .s-bot { top: 403px; height: 47px; background-position: 0 -403px; z-index: 2; }
.scroll .s-slot { position: absolute; left: 64px; top: 30px; width: 172px; height: 300px; display: flex; align-items: center; justify-content: center; }
.scroll .s-note { position: absolute; right: 50px; top: 8px; z-index: 1; max-width: 120px; padding: 1px 8px; border-radius: 9px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(10, 8, 12, .82); color: #cfc6d8; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.scroll .s-note.gold { color: var(--gold); }
.scroll-lack { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #3a3f46; text-align: center; font-family: 'Nanum Brush Script', 'Malgun Gothic', serif; }
.scroll-lack b { font-size: 24px; letter-spacing: 1px; } .scroll-lack small { color: #50565e; font-family: 'Malgun Gothic', sans-serif; }
/* 촤르륵 (2026-11-08 유저 요청: 너무 후다닥): 말린 족자가 줄지어 있다가 0.45초 간격으로 한 장씩. 잠깐 걸렸다가 아래로 쏟아지듯 펼쳐지고 축이 살짝 튕기며 멈춘다 */
.scroll.unroll .s-paper { animation: scroll-open 1s linear both; animation-delay: calc(var(--i) * .45s - var(--el, 0s)); }
.scroll.unroll .s-bot { animation: scroll-drop 1s linear both; animation-delay: calc(var(--i) * .45s - var(--el, 0s)); }
@keyframes scroll-open {
  0% { clip-path: inset(0 0 100% 0); }
  14% { clip-path: inset(0 0 95% 0); animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
  76% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}
@keyframes scroll-drop { /* 아래 말린 부분: 위 말린 부분 바로 밑(종이 높이만큼 위)에서 내려와 살짝 튕기며 멈춘다 */
  0% { transform: translateY(-360px); }
  14% { transform: translateY(-345px); animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
  76% { transform: translateY(7px); animation-timing-function: ease-out; }
  88% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
.tavern-scrolls.done .scroll .s-paper, .tavern-scrolls.done .scroll .s-bot { animation: none; }
.tavern-draw { font-size: 16px; padding: 8px 22px; }
@media (prefers-reduced-motion: reduce) { .scroll.unroll .s-paper, .scroll.unroll .s-bot { animation: none; } }
.gift-cards { justify-content: center; margin: 10px 0; } /* 운영자 선물 대화창의 카드 (2026-11-08) */
/* SR 경매 · 병영 의무실 (2026-11-09) */
.auction-lots { display: flex; flex-wrap: wrap; gap: 12px; }
.auction-lot { min-width: 0; }
.auction-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 13px; }
.auction-bid { display: flex; gap: 6px; }
.auction-amt { width: 7em; }
.infirmary { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.infirmary h3 { margin-top: 0; }
.infirmary table { margin: 6px 0; }
/* SR 경매 버튼: 아래 칩 줄(#dock) 「오늘의 과업」 오른쪽 (2026-11-09 유저 요청) */
.auction-float { position: relative; z-index: 6; }
.auction-chip { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; white-space: nowrap; padding: 6px 12px; border-radius: 12px; cursor: pointer; background: #3b2a12; border: 2px solid var(--gold); color: #ffe9b8; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.auction-chip b { font-size: 16px; }
.auction-chip small { font-size: 13px; opacity: .9; }
.auction-chip.mine { border-color: #7fd18b; }
.auction-body .auction-lots { justify-content: center; }
.auction-rules { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: var(--ink-dim, #a99); line-height: 1.5; }
.auction-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.auction-row .ar-face { flex: none; width: 64px; height: 84px; border-radius: 6px; border: 2px solid #b9c3cc; background: #2e2832 center 15% / cover no-repeat; }
.auction-row .ar-main { min-width: 0; flex: 1; }
.auction-row .auction-foot { margin-top: 2px; }
.auction-body .auction-lots:has(.auction-row) { display: block; }
