/* 로비(js/lobby.js) · 타이틀 인트로(js/title-intro.js). 그림은 assets/hud/(나인패치 판·아이콘·도트 배경·단상)
   원칙(11/2 점검): ① 클래스는 lb- 앞붙이 + 나인패치 상자는 배경·둥근 모서리·overflow를 직접 지운다(게임의 .pill 같은 규칙이 묻지 않게)
   ② 위치는 흐름(위 HUD → 무대 → 시작 → 독)으로, 무대만 남는 높이를 차지한다. 로비 높이는 화면에서 로비 위쪽(언어 띠·상단바)을 뺀 만큼(--lb-h)
   ③ 글자 칸은 늘어날 자리를 둔다(기금은 줄여 쓰고, 독 이름은 두 줄까지). 검사: tools/qa/lobby-layout.js */
.lobby { position: relative; min-height: max(var(--lb-h, 100dvh), 560px); overflow: hidden; background: #2A1A14; color: #2A211E; font-family: 'Paperlogy', var(--head); }
.lb-bg, .lb-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-bg img { object-fit: cover; object-position: center 38%; image-rendering: pixelated; filter: saturate(.72) brightness(.8) contrast(.96); }   /* 11/2 의견 '배경이 너무 쨍하다': 채도·밝기를 낮춘다 */
.lb-bg::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(26,16,12,.42), rgba(26,16,12,.06) 28%, rgba(26,16,12,.08) 58%, rgba(26,16,12,.6) 100%); }   /* 위(기금 줄)·아래(업데이트 줄·시작 버튼) 그늘 */
.lb-hud { position: relative; z-index: 1; box-sizing: border-box; min-height: inherit; max-width: 560px; margin: 0 auto; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
:where(.lobby) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }   /* :where로 우선순위 0: 아래 버튼 규칙을 덮지 않게 */
/* 나인패치 상자 공통: 남의 규칙을 지운다 */
.lb-fund, .lb-att, .lb-gear, .lb-tag, .lb-start, .lb-new, .lb-dock, .lb-mrow { box-sizing: border-box; background: none; border-radius: 0; overflow: visible; margin: 0; box-shadow: none; text-shadow: none; }
.lb-ico { display: block; flex: none; object-fit: contain; pointer-events: none; }

/* 위 HUD */
.lb-top { display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; gap: 6px; align-items: center; }
.lb-fund, .lb-att { height: 46px; border: solid transparent; border-width: 11px 22px; border-image: url(../assets/hud/pill-dark.webp) 22 48 fill / 11px 22px; display: flex; align-items: center; gap: 6px; padding: 0; min-width: 0; white-space: nowrap; }
.lb-fund { color: #FFE58A; font-weight: 800; font-size: 15px; }
.lb-fund b { margin-left: auto; color: #FFF6DE; font-size: 17px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.lb-fund-k { flex: none; }
.lb-att { border-image-source: url(../assets/hud/chip-cream.webp); font-weight: 800; font-size: 16px; }
.lb-att.full { color: #B3122A; }
.lb-fund .lb-ico, .lb-att .lb-ico { width: 26px; height: 26px; }
.lb-gear { width: 48px; height: 48px; border: 0; padding: 0; background: url(../assets/hud/square.webp) center / contain no-repeat; display: grid; place-items: center; }
.lb-gear .lb-ico { width: 26px; height: 26px; }

/* 무대: 남는 높이를 다 쓰고, 그 높이에 맞춰 단상·캐릭터·이벤트 버튼 크기를 정한다 */
.lb-stage { position: relative; flex: 1 1 auto; min-height: 250px; --sh: 400px; --sw: 360px; --s: min(62px, calc(var(--sh) * .19)); }   /* --sh·--sw: 무대 높이·폭(js/lobby.js lbFit이 잰다. cqh는 플렉스 안에서 0이 되는 브라우저가 있어 쓰지 않는다) */
.lb-side { position: absolute; left: 0; top: 4px; display: grid; gap: min(12px, calc(var(--sh) * .024)); z-index: 2; }
.lb-ev { position: relative; width: calc(var(--s) + 8px); display: grid; justify-items: center; padding: 0; border: 0; background: none; }
.lb-ring { width: var(--s); height: var(--s); background: url(../assets/hud/round.webp) center / contain no-repeat; display: grid; place-items: center; }
.lb-ring .lb-ico { width: 50%; height: 50%; }
.lb-ring .lb-stall { width: 64%; height: 64%; }
.lb-ring .lb-cal { transform: translateY(-7%); }   /* 달력은 아래가 무거워 가운데보다 조금 위로(11/2 의견) */
.lb-ev-k { overflow-wrap: normal; word-break: keep-all; margin-top: -5px; font-weight: 800; font-size: 12.5px; line-height: 1.1; color: #FFF6DE; white-space: nowrap; text-shadow: 1.5px 0 0 #2A211E, -1.5px 0 0 #2A211E, 0 1.5px 0 #2A211E, 0 -1.5px 0 #2A211E, 0 2px 3px rgba(0,0,0,.45); }
.lb-hero { --w: min(240px, calc(var(--sh) * .62), calc(var(--sw) * .64), calc(var(--sw) - 2 * var(--s) - 28px));   /* 왼쪽 이벤트 버튼과 안 겹치게 */ position: absolute; left: 50%; bottom: 0; width: var(--w); transform: translateX(-50%); }
.lb-me { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; }
.lb-pod { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.lb-char { position: absolute; left: 50%; bottom: 48%; width: 66.7%; height: auto; aspect-ratio: 1; transform: translateX(-50%); image-rendering: pixelated; }
.lb-tag { position: absolute; left: 66%; bottom: calc(var(--w) * .62); max-width: calc(var(--sw) / 2 - var(--w) * .16); height: 38px; border: solid transparent; border-width: 9px 10px 9px 20px; border-image: url(../assets/hud/tag.webp) 18 20 18 44 fill / 9px 10px 9px 20px; display: flex; align-items: center; gap: 4px; padding: 0; font-weight: 800; font-size: 12.5px; white-space: nowrap; z-index: 2; }
.lb-tag span { overflow: hidden; text-overflow: ellipsis; }
.lb-tag .lb-ico { width: 20px; height: 20px; }

/* 한 줄 소식 */
.lb-news { align-self: center; max-width: 100%; box-sizing: border-box; margin: 0; min-height: 1.4em; padding: 3px 9px 2px; border-radius: 12px; background: rgba(26,18,14,.74); box-shadow: inset 0 0 0 1px rgba(217,166,46,.55); text-align: center; font-size: 12px; letter-spacing: -.01em; line-height: 1.4; color: #FFF6DE; text-shadow: none; }   /* 밝은 바닥 위에서도 읽히게 어두운 알약(11/2 의견) */
.lb-news:empty { background: none; box-shadow: none; }
@media (max-width: 380px) { .lb-news { padding: 3px 7px 2px; font-size: 11.5px; letter-spacing: -.02em; } }   /* 작은 폰: 알약 여백만큼 줄이 넘쳐 일본어가 쪼개졌다 */
.lb-news .ts-sep { display: none; }
.lb-news a { color: inherit; }

/* 시작 버튼 */
.lb-start { height: 74px; width: 100%; border: 17px solid transparent; border-image: url(../assets/hud/btn-primary.webp) 34 fill / 17px; display: flex; justify-content: center; align-items: center; gap: 10px; padding: 0 0 2px; color: #fff; font-weight: 900; font-size: 26px; line-height: 1; text-shadow: 0 2px 0 #8E2416, 1.5px 0 0 #8E2416, -1.5px 0 0 #8E2416; }
.lb-start span { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.lb-start small { font-size: 12.5px; font-weight: 700; color: #FFE9DC; text-shadow: 0 1px 0 #8E2416; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lb-start .lb-ico { width: 20px; height: 20px; }
.lb-new { height: 52px; width: 100%; border: 14px solid transparent; border-image: url(../assets/hud/btn-secondary.webp) 34 fill / 14px; padding: 0 0 2px; font-weight: 800; font-size: 17px; line-height: 1; }
@media (hover: hover) { .lb-start:hover, .lb-new:hover { filter: brightness(1.06); } }
.lb-start:active, .lb-new:active, .lb-dk:active, .lb-ev:active, .lb-gear:active { transform: translateY(2px); }

/* 아래 독 */
.lb-dock { height: 92px; border: 20px solid transparent; border-image: url(../assets/hud/dock.webp) 40 fill / 20px; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); align-items: center; padding: 0; }
.lb-dk { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; height: 100%; padding: 0 2px; border: 0; background: none; font-weight: 800; font-size: 12px; line-height: 1.1; text-align: center; word-break: keep-all; }
.lb-dk + .lb-dk::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; background: #E8D7B0; }
.lb-dk .lb-ico { width: 32px; height: 28px; }
:lang(ja) .lb-dk span, :lang(zh) .lb-dk span { white-space: nowrap; }   /* 일본어·중국어는 keep-all로도 가나·한자 사이에서 끊긴다: 한 줄로 두고 글자를 줄인다 */
.lb-dk span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; overflow-wrap: normal; word-break: keep-all; }   /* 단어 가운데서 끊지 않는다(게임 전체 규칙은 끊는다). 넘치면 js/lobby.js lbFitText가 글자를 줄인다 */
.lb-dot { position: absolute; top: 0; right: 18%; width: 10px; height: 10px; border-radius: 50%; background: #E2452B; box-shadow: 0 0 0 2px #FFF6DE; }

/* 더보기 창 */
.lb-more { display: grid; gap: 8px; margin: 6px 0 10px; }
.lb-mrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 15px; text-align: left; }
.lb-mrow .lb-ico { width: 28px; height: 28px; }

/* 좁은 화면: 기금은 동전과 숫자만(글자 이름은 화면 읽기용으로 남는다) */
@media (max-width: 380px) { .lb-fund-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .lb-fund, .lb-att { border-width: 11px 18px; } .lb-tag { font-size: 11.5px; } }
/* 짧은 화면: 독과 버튼을 조금 낮춘다 */
@media (max-height: 700px) { .lb-start { height: 64px; font-size: 22px; } .lb-new { height: 46px; } .lb-dock { height: 84px; } .lb-hud { gap: 6px; } }
/* 넓은 화면(상단바가 보인다): 설정은 상단바에 있다 */
@media (min-width: 821px) { .lb-top { grid-template-columns: minmax(0, 1fr) auto; } .lb-gear { display: none; } }

/* 타이틀 인트로: 메뉴 창 자리에 '눌러서 시작' */
.title-intro { cursor: pointer; }
.ti-tap { grid-area: menu; align-self: end; justify-self: center; display: grid; justify-items: center; gap: 4px; margin-bottom: 26px; }
.ti-tap b { font: 700 clamp(20px, 2vw, 30px) 'Paperlogy', var(--head); color: #FFF6DE; text-shadow: 3px 3px 0 #2A211E, -2px -2px 0 #2A211E, 2px -2px 0 #2A211E, -2px 2px 0 #2A211E; animation: tiBlink 1.4s steps(2, end) infinite; }
.ti-tap small { font: 400 13px 'Paperlogy', var(--head); color: rgba(255,246,222,.9); text-shadow: 1px 1px 0 #000; }
@keyframes tiBlink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ti-tap b { animation: none; } }
@media (min-width: 821px) { .lb-gear { display: none; } }   /* 넓은 화면은 상단바에 설정이 있다 */
