/* ════════════════════════════════════════════════════════════════════════════
   UI v4 「잉크 캣 누아르」 (2026-09-29 확정)
   ─ 길티기어(기울어진 판넬·강한 대비·딱 떨어지는 그림자) + 해브 어 나이스 데스(먹선·종이·반점 망점)
   ─ 색은 딱 5개: 먹(ink) · 종이(bone) · 냥 레드(주 행동) · 츄르 골드(보상·별) · 민트(정보)
   ─ 글꼴 3개: Black Han Sans(제목·숫자) · Do Hyeon(버튼·라벨) · Gowun Dodum(긴 글)
   ─ 모든 메뉴 창은 800×400 기준으로 짜고 --z 로 통째로 확대·축소 → 어떤 폰에서도 스크롤 없음
   ════════════════════════════════════════════════════════════════════════════ */
:root {
  --ink: #120e16; --ink2: #1d1723; --ink3: #2b2232; --ink4: #3a2f43;
  --bone: #f3ebdd; --bone2: #d8ccb9; --bone3: #b3a692; --mute: #a596ab;
  --red: #ff3355; --redD: #b3122f; --gold: #ffc53d; --goldD: #b8860b; --mint: #4fe3c1; --mintD: #1d9c80;
  --f-disp: 'Black Han Sans', 'Malgun Gothic', sans-serif;
  --f-ui: 'Do Hyeon', 'Malgun Gothic', sans-serif;
  --f-body: 'Gowun Dodum', 'Malgun Gothic', sans-serif;
  --z: 1;
  /* 망점(반점) 무늬 · 속도선 무늬 — 여러 곳에서 같이 쓴다 */
  --dots: radial-gradient(circle, rgba(243,235,221,.07) 1.2px, transparent 1.6px) 0 0 / 7px 7px;
  --speed: repeating-linear-gradient(-62deg, rgba(243,235,221,.028) 0 2px, transparent 2px 13px);
  /* 예전 이름을 쓰는 곳(대전·댄스 도움말 등)도 새 색을 따라오게 */
  --pink: var(--red); --pinkD: var(--redD); --butter: var(--gold); --butterD: var(--goldD); --sky: var(--mint); --skyD: var(--mintD);
  --cream: var(--ink3); --line: #000; --paper: var(--ink2); --lilac: var(--mute); --shadow: 8px 8px 0 rgba(0,0,0,.55);
}

/* 폰에서 누를 때 뜨는 네모 하이라이트(투명한 부분까지 윤곽이 드러나던 것)·길게 누르기 메뉴·끌기 끄기 */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
button:focus:not(:focus-visible), .mascot:focus { outline: none; }
.mascot { pointer-events: auto; }
/* 한글 줄바꿈: 단어 중간에서 끊지 않고(keep-all), 문단 끝에 한 글자만 남지 않게(pretty), 제목은 줄 길이를 고르게(balance) */
body, .screen.ui, #myRoomUi, #toast, .how-page, .bubble, .d-help, .vs-notice { word-break: keep-all; overflow-wrap: break-word; line-break: strict; }
.screen.ui p, .screen.ui .desc, .screen.ui small, .screen.ui dd, .mr-god p, .how-cats span, .skill-detail .sk-txt, .cat-detail .ms, .cat-detail .skillp { text-wrap: pretty; }
.screen.ui h2, .screen.ui .say, .screen.ui .lead, .res-title, .stage-card .nm, .stage-card .ms, .cat-desc { text-wrap: balance; }
/* ── 메뉴 화면 공통 ─────────────────────────────────────────── */
.screen.ui, .screen.ui * { font-synthesis: none; text-shadow: none; -webkit-font-smoothing: antialiased; }
.screen.ui {
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 10px) calc(env(safe-area-inset-bottom, 0px) + 8px) calc(env(safe-area-inset-left, 0px) + 10px);
  background: radial-gradient(ellipse at 22% 0%, rgba(255,51,85,.16), transparent 55%), var(--speed), rgba(10,7,13,.9);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  font-family: var(--f-body); color: var(--bone);
}
.screen.ui[hidden] { display: none; }
.screen.ui > .sheet, .screen.ui > .hub, .screen.ui > .title-wrap { zoom: var(--z); margin: 0; flex: none; }
.screen.ui b, .screen.ui h2, .screen.ui h3, .screen.ui .say { font-family: var(--f-ui); font-weight: 400; }
.screen.ui h2 { margin: 0; font-family: var(--f-disp); font-size: 24px; color: var(--bone); letter-spacing: .01em; }
.screen.ui img { -webkit-user-drag: none; }
.muted, .screen.ui small { color: var(--mute); }
p.muted { margin: 0; font-size: 14px; }

/* ── 버튼: 기울어진 평행사변형 + 딱 떨어지는 검은 그림자(번짐 없음) ── */
.screen.ui .btn, .snack {
  --bg: var(--bone); --fg: var(--ink); --sk: 11px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: auto; height: auto; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer;
  font: 400 18px/1.1 var(--f-ui); color: var(--fg); padding: 9px 24px 10px; white-space: nowrap; transition: translate .07s;
}
.screen.ui .btn::before, .screen.ui .btn::after, .snack::before, .snack::after {
  content: ''; position: absolute; inset: 0; clip-path: polygon(var(--sk) 0, 100% 0, calc(100% - var(--sk)) 100%, 0 100%);
}
.screen.ui .btn::before, .snack::before { background: var(--bg); z-index: -1; }
.screen.ui .btn::after, .snack::after { background: #000; z-index: -2; translate: 4px 4px; transition: translate .07s; }
.screen.ui .btn:hover::before { filter: brightness(1.08); }
.screen.ui .btn:active, .snack:active { translate: 3px 3px; } .screen.ui .btn:active::after, .snack:active::after { translate: 1px 1px; }
.screen.ui .btn:disabled { opacity: .4; cursor: default; translate: none; }
.screen.ui .btn img { width: 1.35em; height: 1.35em; }
.screen.ui .btn.pink { --bg: var(--red); --fg: #fff; }
.screen.ui .btn.mint, .screen.ui .btn.sky { --bg: var(--mint); --fg: var(--ink); }
.screen.ui .btn.ghost { --bg: var(--ink4); --fg: var(--bone); }
.screen.ui .btn.big { font-size: 24px; padding: 10px 34px 11px; --sk: 14px; font-family: var(--f-disp); }
.screen.ui .btn.big.pink::before { background: linear-gradient(100deg, var(--red) 0 78%, #ff5c77 78% 82%, var(--red) 82%); }
.screen.ui .btn.small { font-size: 15px; padding: 6px 16px 7px; --sk: 8px; }
.screen.ui .btn small { font-size: 12px; color: inherit; opacity: .75; }
.screen.ui .btn:focus-visible, .icon-btn:focus-visible, .stage-card:focus-visible, .dock-btn:focus-visible, .sk-badge:focus-visible, .cat-card:focus-visible, .cat-tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border: 0; cursor: pointer; font: 400 20px var(--f-ui); color: var(--bone); background: var(--ink4);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); display: grid; place-items: center; padding: 0;
}
.icon-btn:hover { background: var(--red); color: #fff; }

/* 칩(보유 별·츄르): 기울어진 먹 판 + 금색 숫자 */
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 14px 2px 8px; font: 400 18px var(--f-disp); color: var(--gold); background: #000;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); border: 0; box-shadow: none; border-radius: 0; }
.chip img.ic { width: 1.35em; height: 1.35em; filter: none; }
.chip.churu { color: #ffb45c; }

/* ── 창(시트): 먹 판 + 굵은 검은 테 + 딱 떨어지는 그림자 + 왼쪽 위 빨간 사선 ── */
.sheet {
  position: relative; display: grid; gap: 10px; text-align: left; width: 740px; max-width: 776px;
  padding: 14px 20px 16px; background: var(--dots), var(--ink2); border: 3px solid #000; border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(243,235,221,.14), var(--shadow);
}
.sheet::before { content: ''; position: absolute; left: -3px; top: -3px; width: 64px; height: 7px; background: var(--red); clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
.sheet::after { content: ''; position: absolute; right: 10px; bottom: 8px; width: 90px; height: 40px; background: radial-gradient(circle, rgba(255,51,85,.35) 1.3px, transparent 1.8px) 0 0 / 6px 6px; pointer-events: none;
  -webkit-mask: linear-gradient(135deg, transparent 30%, #000); mask: linear-gradient(135deg, transparent 30%, #000); }
.sheet-head { display: flex; align-items: center; gap: 12px; min-height: 36px; padding-right: var(--toss-r, 0px); }
.sheet-head h2 { flex: none; margin-left: -20px; padding: 2px 26px 3px 20px; background: var(--red); color: #fff; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.sheet-head small { flex: 1; font-size: 14px; }
.sheet-head .icon-btn, .sheet-head .chip { margin-left: auto; }
.sheet-head .chip + .icon-btn { margin-left: 0; }
.small-sheet { width: 440px; }
.small-sheet.center { justify-items: center; text-align: center; }
.exit-god { width: 72px; height: 72px; }
.intro-foot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: nowrap; }
.small-sheet.center .intro-foot { justify-content: center; }

/* ── 타이틀 ── */
.title-screen { background: radial-gradient(ellipse at 30% 55%, rgba(255,51,85,.28), transparent 55%), var(--speed), var(--dots), rgba(10,7,13,.82); }
.title-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; width: 776px; height: 384px; }
.mascot-box { position: relative; flex: none; width: 310px; height: 310px; display: grid; place-items: center; aspect-ratio: auto; }
.mascot-box::before { content: ''; position: absolute; inset: 8% 4%; border-radius: 0; background: var(--red); clip-path: polygon(14% 4%, 100% 0, 88% 96%, 0 100%); opacity: .9; }
.mascot-box::after { content: ''; position: absolute; inset: 8% 4%; background: radial-gradient(circle, rgba(0,0,0,.35) 1.5px, transparent 2px) 0 0 / 8px 8px; clip-path: polygon(14% 4%, 100% 0, 88% 96%, 0 100%); }
.mascot { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(6px 6px 0 #000); animation: mascotHop 2.4s ease-in-out infinite; transform-origin: 50% 90%; cursor: pointer; }
.mascot-name { position: absolute; z-index: 2; bottom: 4%; left: 8%; font: 400 18px var(--f-disp); color: var(--ink); background: var(--bone); padding: 1px 16px 2px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); border: 0; box-shadow: none; border-radius: 0; }
.title-main { display: grid; gap: 9px; padding-top: 0; justify-items: center; text-align: center; width: 410px; }
.logo { display: grid; justify-items: center; line-height: .92; margin: 0; font-family: var(--f-disp); font-weight: 400; transform: rotate(-4deg) skewX(-8deg); transform-origin: center; max-width: none; }
.logo span { display: block; -webkit-text-stroke: .07em #000; paint-order: stroke fill; }
.logo .l1 { font-size: 40px; color: var(--red); text-shadow: .06em .06em 0 #000 !important; justify-self: start; margin-left: .4em; }
.logo .l2 { font-size: 84px; color: var(--bone); text-shadow: .045em .045em 0 var(--red), .09em .09em 0 #000 !important; letter-spacing: -.01em; }
.tagline { font: 400 15px var(--f-ui); color: var(--ink); background: var(--gold); padding: 3px 18px 4px 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); border: 0; box-shadow: none; border-radius: 0; margin: 4px 0 0; max-width: none; }
.title-menu { display: grid; gap: 8px; justify-items: stretch; margin-top: 4px; width: 300px; }
.title-menu .btn { justify-content: center; }
.title-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.version { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 12px); bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); font: 400 12px var(--f-ui); color: var(--mute); }
@keyframes mascotHop { 0%, 100% { translate: 0 0; rotate: -2deg; } 45% { translate: 0 -8px; rotate: 2deg; } 70% { translate: 0 0; } }

/* ── 게임 소개: 왼쪽 그림 · 오른쪽 글 ── */
.how { width: 700px; }
.how-pages { position: relative; height: 250px; min-height: 0; }
.how-page { display: none; grid-template-columns: 210px 1fr; gap: 20px; align-items: center; height: 100%; animation: pageIn .22s ease-out; }
.how-page.on { display: grid; }
@keyframes pageIn { from { opacity: 0; translate: 18px 0; } to { opacity: 1; translate: 0 0; } }
.how-art { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; height: 100%; background: var(--dots), var(--ink3); clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%); min-height: 0; }
.how-art img { width: 120px; height: 120px; filter: drop-shadow(4px 4px 0 #000); }
.how-art img.small { width: 64px; height: 64px; align-self: flex-end; margin-bottom: 30px; }
.how-art.skills img, .how-art.cats img { width: 84px; height: 84px; }
.how-txt { display: grid; gap: 10px; align-content: center; }
.how-page p { margin: 0; line-height: 1.6; font-size: 15px; color: var(--bone2); }
.how-page .lead { font: 400 21px/1.35 var(--f-ui); color: var(--bone); }
.how-page b { color: var(--gold); font-family: inherit; }
.how-page .how-note { background: #000; padding: 6px 12px; font-size: 14px; border-left: 4px solid var(--red); }
.combo-demo { flex-direction: column; gap: 0; font: 400 16px var(--f-ui); color: var(--gold); }
.combo-demo b { font: italic 400 76px/1 var(--f-disp); color: var(--bone) !important; -webkit-text-stroke: 4px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 var(--red) !important; }
.combo-demo i { display: block; width: 150px; height: 7px; background: var(--red); margin-top: 6px; transform: skewX(-20deg); }
.how-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.how-cats span { background: #000; padding: 5px 9px; font: 400 13px/1.35 var(--f-ui); color: var(--bone2); border-left: 3px solid var(--red); }
.how-cats b { display: block; font: 400 16px var(--f-disp); color: var(--gold); }
.keys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.keys-grid .k { display: flex; align-items: center; gap: 4px; background: #000; padding: 5px 10px; box-shadow: none; border-radius: 0; }
.keys-grid .k span { margin-left: auto; font-family: var(--f-ui); color: var(--bone); }
kbd { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 0; background: var(--bone); border: 0; box-shadow: 2px 2px 0 var(--red); font: 400 14px var(--f-ui); color: var(--ink); }
kbd.wide { min-width: 64px; }
.touch-map { grid-template-columns: 1fr 1fr; gap: 10px; }
.touch-map > div { background: #000; padding: 10px; display: grid; justify-items: center; gap: 6px; font: 400 14px var(--f-ui); text-align: center; color: var(--bone); border-radius: 0; box-shadow: none; }
.tm-stick { width: 54px; height: 54px; border-radius: 50%; border: 3px dashed var(--mint); background: radial-gradient(circle, var(--mint) 0 11px, transparent 12px); }
.tm-btns { display: flex; gap: 6px; } .tm-btns i { font-style: normal; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 12px; }
.how-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dots { display: flex; gap: 6px; } .dots i { width: 12px; height: 8px; background: var(--ink4); transform: skewX(-20deg); transition: all .2s; border-radius: 0; }
.dots i.on { width: 30px; background: var(--red); }

/* ── 만든 사람들: 두 칸 ── */
.credit { width: 720px; }
.credit dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; font-size: 12px; }
.credit dl > div { display: grid; gap: 1px; border-left: 3px solid var(--red); padding-left: 10px; }
.credit dt { font: 400 14px var(--f-ui); color: var(--gold); } .credit dd { margin: 0; color: var(--bone2); line-height: 1.3; }

/* ── 일시정지 ── */
.pause { width: 420px; justify-items: center; text-align: center; }
.pause-head { display: flex; align-items: center; gap: 12px; }
.pause-head img { width: 64px; height: 64px; background: var(--ink3); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); animation: none; }
.pause-head h2 { font-size: 26px; }
.pause-menu { display: grid; gap: 10px; width: 100%; }
.pause-menu .btn { width: 100%; }
.pause-tip { font-size: 12px; }

/* ── 설정: 두 칸 ── */
.setting { width: 740px; }
.set-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-sec { background: var(--ink3); border-radius: 0; padding: 10px 14px; box-shadow: none; display: grid; gap: 8px; align-content: start; border-left: 4px solid var(--red); }
.set-sec h3 { margin: 0; font: 400 18px var(--f-ui); color: var(--gold); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-sec h3 small { font-size: 12px; margin-right: auto; }
.set-row { display: flex; align-items: center; gap: 10px; font: 400 15px var(--f-ui); color: var(--bone); }
.set-row > span { width: 78px; flex: none; }
.set-row em { width: 34px; text-align: right; font-style: normal; color: var(--mute); }
.set-row input[type=range] { flex: 1; accent-color: var(--red); height: 24px; min-width: 0; }
.set-help { color: var(--mute); font-size: 12px; margin-top: -4px; }
.toggle { font: 400 15px var(--f-ui); border: 0; border-radius: 0; padding: 4px 16px 5px; background: var(--mint); color: var(--ink); box-shadow: 3px 3px 0 #000; cursor: pointer; clip-path: none; }
.toggle.off { background: var(--ink4); color: var(--mute); }
.seg { display: flex; background: #000; border-radius: 0; padding: 3px; gap: 2px; flex-wrap: nowrap; }
.seg button { font: 400 14px var(--f-ui); border: 0; background: transparent; color: var(--bone2); padding: 4px 10px; border-radius: 0; cursor: pointer; }
.seg button.on { background: var(--red); color: #fff; box-shadow: none; }
.key-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.key-list button { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 400 14px var(--f-ui); background: #000; color: var(--bone); border: 0; border-radius: 0; padding: 4px 8px; cursor: pointer; box-shadow: none; }
.key-list button.wait { background: var(--red); animation: none; }
.key-list kbd { min-width: 40px; height: 24px; }

/* ── 캣갓의 방: 위 막대 · 왼쪽 분류 · 가운데 스테이지 · 아래 메뉴 ── */
.hub { width: 776px; height: 384px; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: nowrap; padding: 0 var(--toss-r, 0px) 0 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.hub-title { display: flex; align-items: center; gap: 0; }
.hub-title img { width: 50px; height: 50px; margin-right: -12px; position: relative; z-index: 1; filter: drop-shadow(3px 3px 0 #000); animation: none; }
.hub-title h2 { font-size: 26px; background: var(--red); color: #fff; padding: 2px 26px 3px 22px; clip-path: polygon(10px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.chips { display: flex; align-items: center; gap: 6px; }
.acct { display: flex; align-items: center; gap: 5px; background: var(--ink4); border: 0; border-radius: 0; padding: 2px 12px 2px 4px; box-shadow: none; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font: 400 14px var(--f-ui); color: var(--bone); cursor: pointer; max-width: 130px; height: 32px; }
.acct img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--ink3); }
.acct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snack { font-size: 14px; padding: 4px 14px 5px; --bg: var(--gold); --fg: var(--ink); --sk: 7px; }
.snack img.ic { width: 18px; height: 18px; filter: none; } .snack small { opacity: .75; font-size: 11px; color: inherit; }
.snack:disabled { opacity: .45; cursor: default; }
.hub-body { display: grid; grid-template-columns: 158px 1fr; gap: 12px; min-height: 0; }
.cat-tabs { display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 6px; }
.cat-tab { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 0; border-radius: 0; background: var(--ink3); color: var(--bone); cursor: pointer; text-align: left;
  font: inherit; box-shadow: none; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: translate .1s, background .1s; }
.cat-tab img.ic { width: 38px; height: 38px; flex: none; filter: drop-shadow(2px 2px 0 #000); }
.cat-tab span { display: grid; } .cat-tab b { font: 400 17px var(--f-ui); } .cat-tab small { font: 400 13px var(--f-ui); color: var(--mute); display: flex; align-items: center; gap: 2px; }
.cat-tab small img.ic { width: 14px; height: 14px; filter: none; }
.cat-tab:hover { background: var(--ink4); }
.cat-tab.on { background: var(--bone); color: var(--ink); translate: 8px 0; box-shadow: none; transform: none; }
.cat-tab.on small { color: var(--ink4); }
.cat-tab.on::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--red); }
.cat-tab.locked { opacity: .45; filter: none; }
.cat-tab .dot { position: absolute; right: 12px; top: 3px; font: 400 11px var(--f-ui); font-style: normal; background: var(--red); color: #fff; padding: 0 5px; border: 0; border-radius: 0; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.hub-main { display: grid; grid-template-rows: auto 1fr; gap: 6px; min-height: 0; }
.cat-desc { font: 400 15px var(--f-ui); color: var(--bone2); padding-left: 2px; text-shadow: none; }
.cat-desc::before { content: '▶ '; color: var(--red); }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); grid-auto-rows: 1fr; gap: 12px; align-content: start; min-height: 0; max-height: 244px; }
.stage-grid:has(> :nth-child(4)) { grid-template-columns: repeat(5, 1fr); }
.stage-grid:not(:has(> :nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 190px)); }

/* 종이 카드(스테이지·고양이·스킬) — 해브어나이스데스식 종이 + 먹 테두리 + 검은 그림자, 카드마다 살짝 다르게 기울임 */
.stage-card, .cat-card, .sk-badge {
  --c: var(--red); position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; text-align: center; cursor: pointer; font: inherit; color: var(--ink);
  background: radial-gradient(circle, rgba(18,14,22,.07) 1px, transparent 1.4px) 0 0 / 5px 5px, var(--bone); border: 3px solid #000; border-radius: 0; box-shadow: 5px 5px 0 #000;
  transition: translate .1s, box-shadow .1s, rotate .1s;
}
.stage-card { padding: 8px 6px 8px; height: 100%; max-height: 244px; grid-template-rows: auto auto auto auto 1fr; }
.stage-card:nth-child(odd) { rotate: -1.2deg; } .stage-card:nth-child(even) { rotate: .9deg; }
.stage-card:hover, .cat-card:hover, .sk-badge:hover { translate: -2px -2px; box-shadow: 7px 7px 0 #000; }
.stage-card:active { translate: 2px 2px; box-shadow: 2px 2px 0 #000; }
.stage-card .ic-wrap { width: 80px; height: 80px; display: grid; place-items: center; background: var(--c); border: 0; border-radius: 0; box-shadow: none; clip-path: polygon(10% 0, 100% 4%, 90% 100%, 0 94%); }
.stage-card .ic-wrap img { width: 70px; height: 70px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6)); }
.stage-card .num { position: absolute; left: -3px; top: -3px; font: 400 14px var(--f-disp); color: #fff; background: #000; border-radius: 0; padding: 1px 8px 2px; }
.stage-card .nm { font: 400 18px/1.15 var(--f-disp); margin-top: 2px; }
.stage-card .ms { font: 400 13px/1.25 var(--f-ui); color: var(--ink4); }
.stage-card .st { display: flex; } .stage-card .st img.ic { width: 22px; height: 22px; margin: 0 -1px; filter: none; }
.stage-card .bs { font: 400 12px var(--f-ui); color: var(--ink4); align-self: end; }
.stage-card .new { position: absolute; right: -6px; top: -8px; font: 400 12px var(--f-disp); background: var(--red); color: #fff; border-radius: 0; padding: 1px 7px 2px; rotate: 6deg; animation: none; }
.stage-card .lock { font: 400 13px var(--f-ui); color: var(--ink4); display: flex; align-items: center; gap: 2px; }
.stage-card.locked { cursor: default; filter: none; opacity: 1; background: var(--ink3); color: var(--mute); border-color: #000; }
.stage-card.locked .ic-wrap { background: var(--ink4); }
.stage-card.locked .ic-wrap img { filter: brightness(0) opacity(.45); }
.stage-card.locked .lock { color: var(--mute); }
.stage-card.locked:hover { translate: none; box-shadow: 5px 5px 0 #000; }
/* 아래 메뉴(도크) */
.dock { display: flex; gap: 10px; justify-content: center; flex-wrap: nowrap; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; justify-self: stretch; }
.dock-btn { position: relative; isolation: isolate; display: flex; align-items: center; gap: 6px; padding: 3px 16px 3px 6px; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; color: var(--bone); font: inherit; text-align: left; }
.dock-btn::before, .dock-btn::after { content: ''; position: absolute; inset: 0; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.dock-btn::before { background: var(--ink3); z-index: -1; } .dock-btn::after { background: #000; z-index: -2; translate: 4px 4px; }
.dock-btn:hover::before { background: var(--ink4); }
.dock-btn:active { translate: 3px 3px; }
.dock-btn img { width: 40px; height: 40px; border-radius: 0; background: none; filter: drop-shadow(2px 2px 0 #000); }
.dock-btn span { display: grid; } .dock-btn b { font: 400 17px/1.1 var(--f-ui); } .dock-btn small { font: 400 12px var(--f-ui); color: var(--mute); }
.dock-btn.small img { width: 32px; height: 32px; }
.badge { position: absolute; right: -4px; top: -8px; min-width: 22px; height: 22px; background: var(--red); color: #fff; font: 400 14px/22px var(--f-disp); text-align: center; border: 0; border-radius: 0; font-style: normal; padding: 0 5px; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }

/* ── 미션 소개: 왼쪽 미션 · 오른쪽 스킬셋 ── */
.intro { width: 776px; height: 384px; grid-template-rows: 1fr auto; }
.intro-cols { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 0; }
.intro-l { display: grid; gap: 8px; align-content: start; min-height: 0; }
.stage-chip { justify-self: start; margin-left: -20px; font: 400 16px var(--f-ui); color: #fff; background: var(--red); padding: 2px 20px 3px 16px; display: flex; align-items: center; gap: 4px; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.stage-chip img.ic { width: 24px; height: 24px; filter: none; }
.intro .intro-top { display: flex; gap: 8px; align-items: flex-start; }
.intro .god { flex: none; animation: none; filter: none; } .intro .god img { width: 64px; height: 64px; filter: drop-shadow(3px 3px 0 #000); }
.bubble { position: relative; flex: 1; background: var(--bone); color: var(--ink); padding: 8px 12px 10px; border: 3px solid #000; border-radius: 0; box-shadow: 4px 4px 0 #000; display: grid; gap: 3px; }
.bubble::before { content: ''; position: absolute; left: -14px; top: 16px; border: 0; width: 14px; height: 14px; background: #000; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.screen.ui .say { font: 400 21px/1.2 var(--f-disp); color: var(--redD); }
.screen.ui .desc { font-size: 13.5px; line-height: 1.5; color: var(--ink); max-width: none; opacity: 1; }
.screen.ui .targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; color: var(--bone); font: 400 15px var(--f-ui); }
.screen.ui .targets > span { background: #000; padding: 4px 4px 3px; display: grid; justify-items: center; align-content: center; gap: 1px; box-shadow: none; border-radius: 0; line-height: 1.1; }
.screen.ui .targets > span > i { display: flex; font-style: normal; align-items: center; gap: 2px; height: 18px; }
.screen.ui .targets img.ic { width: 17px; height: 17px; margin: 0 -1px; filter: none; }
.screen.ui .hint { color: var(--mint); font: 400 14px var(--f-ui); }
.screen.ui .hint:empty { display: none; }
.intro-r { min-height: 0; }
/* 스킬셋 */
.screen.ui #loadout { display: grid; gap: 6px; overflow: hidden; background: var(--ink3); padding: 10px 12px; color: var(--bone); border-radius: 0; height: 100%; align-content: start; }
.screen.ui .lo-head { font: 400 16px var(--f-ui); display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.screen.ui .lo-head b { color: var(--gold); } .screen.ui .lo-head span { color: var(--mute); font-size: 13px; opacity: 1; }
.screen.ui .lo-head img.ic { filter: none; }
.screen.ui .lo-sug { margin-left: auto; border: 0; border-radius: 0; padding: 3px 12px 4px; font: 400 14px var(--f-ui); background: var(--gold); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 #000; clip-path: none; white-space: nowrap; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.screen.ui .slot { display: grid; justify-items: center; gap: 0; padding: 4px 2px 3px; font: 400 13px/1.15 var(--f-ui); color: var(--ink); background: var(--bone); border: 2px solid #000; border-radius: 0; box-shadow: 3px 3px 0 #000; cursor: pointer; min-width: 0; }
.screen.ui .slot img.ic { width: 30px; height: 30px; filter: none; vertical-align: 0; }
.screen.ui .slot small { display: none; font-size: 10.5px; color: var(--ink4); opacity: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.screen.ui .slot.empty { background: transparent; border: 2px dashed var(--ink4); color: var(--mute); box-shadow: none; display: grid; place-items: center; min-height: 50px; }
.screen.ui .lo-desc { font-size: 12.5px; color: var(--bone2); min-height: 32px; max-height: 34px; overflow: hidden; line-height: 1.4; opacity: 1; }
.screen.ui .lo-desc img.ic { width: 18px; height: 18px; filter: none; }
.abgs { display: grid; grid-template-columns: 1fr; gap: 5px; }
.abg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-items: center; }
.abg > b { grid-column: 1 / -1; line-height: 1; }
.screen.ui .abg b { flex-basis: auto; width: auto; font: 400 13px var(--f-ui); color: var(--mute); }
.screen.ui .ab { display: flex; align-items: center; gap: 2px; padding: 1px 4px 1px 2px; font: 400 12.5px/1.1 var(--f-ui); min-width: 0; white-space: nowrap; overflow: hidden; color: var(--bone); background: #000; border: 2px solid #000; border-radius: 0; box-shadow: none; cursor: pointer; }
.screen.ui .ab img.ic { width: 22px; height: 22px; filter: none; vertical-align: 0; }
.screen.ui .ab.on { background: var(--red); border-color: var(--red); color: #fff; }
.screen.ui .ab.lock { opacity: .35; }
.ab small { display: none; }
.d-help { display: grid; gap: 7px; padding: 12px 14px; background: var(--ink3); border: 0; border-left: 4px solid var(--red); border-radius: 0; text-align: left; font-size: 14px; color: var(--bone2); line-height: 1.5; }
.d-help b { font-family: var(--f-ui); font-weight: 400; color: var(--gold); }

/* ── 결과: 왼쪽 별·점수 · 오른쪽 보상 ── */
.res { width: 700px; text-align: left; justify-items: stretch; }
.res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.res-l { display: grid; gap: 6px; justify-items: center; text-align: center; }
.res-r { display: grid; gap: 8px; align-content: center; }
.res-title { font: 400 30px var(--f-disp); color: var(--bone); -webkit-text-stroke: 0; transform: skewX(-8deg); }
.screen.ui #stars { display: flex; gap: 4px; justify-content: center; letter-spacing: 0; }
.screen.ui #stars img.ic { width: 60px; height: 60px; filter: drop-shadow(3px 3px 0 #000); animation: starPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.screen.ui #stars img.ic:nth-child(2) { animation-delay: .25s; } .screen.ui #stars img.ic:nth-child(3) { animation-delay: .5s; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.score-box { display: grid; justify-items: center; background: #000; padding: 2px 30px 6px; border-radius: 0; box-shadow: none; clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.score-box small { font: 400 13px var(--f-ui); color: var(--red); letter-spacing: .2em; }
.screen.ui #resScore { font: italic 400 48px/1 var(--f-disp); color: var(--gold); }
.screen.ui #resScore { white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-wrap { position: relative; display: grid; justify-items: center; }   /* 점수 칸은 사선으로 잘려 있어 스티커는 바깥 감싸개에 붙인다 */
#resBest { position: absolute; top: -12px; right: -18px; padding: 2px 8px; background: var(--red); color: #fff; font: 400 14px var(--f-disp); transform: rotate(8deg); box-shadow: 2px 2px 0 #000; animation: bestPop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes bestPop { from { transform: rotate(8deg) scale(0); } to { transform: rotate(8deg) scale(1); } }
.screen.ui .res small#resDetail { color: var(--mute); font-size: 12.5px; line-height: 1.4; }
.reward-row { display: flex; }
.screen.ui #reward { font: 400 17px var(--f-ui); color: var(--ink); background: var(--gold); padding: 4px 16px 5px 12px; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.screen.ui #reward:empty { display: none; }
.screen.ui #reward img.ic { width: 22px; height: 22px; filter: none; }
#adDouble { justify-self: start; }
.screen.ui #newFriend { font: 400 16px var(--f-ui); color: var(--mint); }
.screen.ui #newFriend:empty { display: none; }
.god-line { display: flex; align-items: center; gap: 8px; background: var(--bone); color: var(--ink); padding: 8px 12px; border: 3px solid #000; border-radius: 0; box-shadow: 4px 4px 0 #000; }
.god-line img { width: 46px; height: 46px; flex: none; }
.screen.ui #godSay { font: 400 15px/1.4 var(--f-ui); color: var(--ink); }
.screen.ui #godSay img { display: none; }

/* ── 스킬트리: 위 가지 탭 · 왼쪽 배지 · 오른쪽 상세 ── */
.skills { width: 740px; }
.branch-tabs { display: flex; gap: 4px; overflow: visible; padding: 0; }
.branch-tab { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; border: 0; border-radius: 0; background: var(--ink3); padding: 3px 12px 3px 6px; box-shadow: none;
  font: 400 15px var(--f-ui); color: var(--bone2); cursor: pointer; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.branch-tab img { width: 28px; height: 28px; filter: drop-shadow(1px 1px 0 #000); }
.branch-tab.on { background: var(--red); color: #fff; box-shadow: none; }
.branch-tab .cnt { font-size: 12px; opacity: .75; }
.skill-cols { display: grid; grid-template-columns: 1fr 250px; gap: 14px; height: 250px; min-height: 0; }
.skill-l { position: relative; min-height: 0; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, 86px); grid-auto-rows: 112px; gap: 12px 10px; align-content: start; padding: 4px 0 0 2px; }
.sk-badge { padding: 6px 4px 5px; gap: 2px; }
.sk-badge .orb { width: 54px; height: 54px; border-radius: 0; display: grid; place-items: center; background: var(--ink); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.sk-badge .orb img { width: 48px; height: 48px; filter: none; }
.sk-badge .nm { font: 400 13.5px/1.1 var(--f-ui); text-align: center; }
.sk-badge .pips { display: flex; gap: 2px; } .sk-badge .pips i { width: 10px; height: 6px; border-radius: 0; background: var(--bone3); transform: skewX(-20deg); }
.sk-badge .pips i.on { background: var(--red); box-shadow: none; }
.sk-badge.max .orb { background: var(--goldD); } .sk-badge.lock { opacity: .5; } .sk-badge.lock .orb img { filter: grayscale(1) brightness(.7); }
.sk-badge.can::after { content: 'UP'; position: absolute; right: -6px; top: -8px; width: auto; height: auto; border-radius: 0; border: 0; font: 400 11px var(--f-disp); background: var(--red); color: #fff; padding: 0 5px 1px; }
.sk-badge.sel { outline: 3px solid var(--red); outline-offset: 2px; background: #fff; }
.skill-r { display: grid; grid-template-rows: 1fr auto; gap: 8px; min-height: 0; }
.skill-detail { display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; gap: 4px; background: var(--ink3); border-radius: 0; padding: 10px 12px; min-height: 0; text-align: center; border-top: 4px solid var(--red); }
.skill-detail > img.ic { width: 72px; height: 72px; filter: drop-shadow(3px 3px 0 #000); }
.skill-detail .sk-txt { display: grid; gap: 3px; font-size: 13px; color: var(--bone2); line-height: 1.4; }
.skill-detail .sk-txt b { font: 400 20px var(--f-disp); color: var(--bone); }
.skill-detail .sk-txt small { color: var(--mute); font-size: 12px; }
.skill-detail .btn { align-self: end; }
#comboToggle { justify-self: stretch; }
.combo-list { position: absolute; inset: 0; background: var(--ink3); border-radius: 0; padding: 8px 12px; font-size: 12.5px; box-shadow: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; align-content: start; color: var(--bone2); }
.combo-list[hidden] { display: none; }
.combo-list .on { color: var(--bone); } .combo-list .off { color: var(--mute); opacity: .7; }
.combo-list img.ic { width: 18px; height: 18px; filter: none; }

/* ── 고양이 선택: 왼쪽 8칸 · 오른쪽 상세 ── */
.cats { width: 760px; }
.cat-cols { display: grid; grid-template-columns: 1fr 250px; gap: 16px; height: 290px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 12px; }
.cat-card { padding: 6px 4px 4px; gap: 2px; justify-content: center; align-content: center; }
.cat-card:nth-child(4n+1) { rotate: -1deg; } .cat-card:nth-child(4n+3) { rotate: 1deg; }
.cat-card .pf { width: 82px; height: 82px; border-radius: 0; background: var(--ink); display: grid; place-items: center; overflow: hidden; clip-path: polygon(10% 0, 100% 4%, 90% 100%, 0 96%); }
.cat-card .pf img { width: 78px; height: 78px; }
.cat-card .nm { font: 400 16px var(--f-disp); }
.cat-card .bs { font: 400 12px var(--f-ui); color: var(--redD); min-height: 14px; }
.cat-card.sel { outline: 3px solid var(--red); outline-offset: 2px; background: #fff; }
.cat-card.view:not(.sel) { outline: 3px dashed var(--ink4); outline-offset: 2px; }
.cat-card.locked { cursor: pointer; background: var(--ink3); color: var(--mute); }
.cat-card.locked .pf { background: var(--ink4); } .cat-card.locked .pf img { filter: brightness(0) opacity(.5); } .cat-card.locked .nm::after { content: ' ?'; }
.cat-detail { display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: center; gap: 5px; background: var(--ink3); padding: 10px 12px 12px; text-align: center; border-top: 4px solid var(--red); min-height: 0; }
.cat-detail > img { width: 96px; height: 96px; filter: drop-shadow(3px 3px 0 #000); }
.cat-detail > img.locked { filter: brightness(0) opacity(.45); }
.cat-detail b { font: 400 22px var(--f-disp); color: var(--bone); }
.cat-detail .ms { font-size: 13px; color: var(--bone2); line-height: 1.4; }
.cat-detail .skillp { font-size: 12.5px; line-height: 1.35; background: #000; padding: 5px 8px; color: var(--bone2); text-align: left; align-self: start; }
.cat-detail .skillp em { font: 400 14px var(--f-ui); font-style: normal; color: var(--gold); margin-right: 4px; }
.cat-detail .perk { font: 400 12.5px var(--f-ui); color: var(--mint); }

/* ── 순위표: 10위까지 두 줄 ── */
.rank { width: 700px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, 44px); grid-auto-flow: column; gap: 6px 14px; max-height: none; overflow: hidden; }
.rank-list li { display: flex; align-items: center; gap: 8px; background: var(--ink3); padding: 3px 12px 3px 4px; font: 400 16px var(--f-ui); color: var(--bone); border-radius: 0; box-shadow: none; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); min-width: 0; }
.rank-list li:only-child { grid-column: 1 / -1; }
.rank-list li.me { background: var(--red); color: #fff; box-shadow: none; }
.rank-list .no { width: 30px; text-align: center; font: italic 400 20px var(--f-disp); color: var(--mute); }
.rank-list li:nth-child(1) .no { color: var(--gold); } .rank-list li:nth-child(2) .no { color: #c9d1db; } .rank-list li:nth-child(3) .no { color: #e39a5a; }
.rank-list img { width: 34px; height: 34px; border-radius: 0; background: none; }
.rank-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .h { font: 400 18px var(--f-disp); color: var(--gold); }
.rank-foot { text-align: center; color: var(--mute); font-size: 14px; }

/* ── 대전 ── */
.versus { width: 776px; height: 384px; grid-template-rows: auto 1fr; }
.vs-cols { display: grid; grid-template-columns: 250px 1fr; gap: 14px; min-height: 0; }
.vs-notice { background: #000; border: 0; border-left: 4px solid var(--gold); border-radius: 0; padding: 8px 12px; font-size: 12px; line-height: 1.45; color: var(--bone2); align-self: start; }
.vs-notice b { font-family: var(--f-ui); font-weight: 400; color: var(--gold); }
.vs-notice > b { font-size: 15px; }
.vs-notice ul { margin: 4px 0 0; padding-left: 14px; display: grid; gap: 4px; }
.vs-right { display: grid; min-height: 0; align-content: start; }
.vs-right p { margin: 0 0 8px; }
.sheet-body { display: grid; gap: 8px; }
.vs-me { position: absolute; top: 16px; right: calc(64px + var(--toss-r, 0px)); display: flex; align-items: center; gap: 8px; font: 400 14px var(--f-ui); }
.vs-me b { font: 400 18px var(--f-disp); color: var(--gold); }
.vs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.vs-stage { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border: 0; border-radius: 0; background: var(--bone); color: var(--ink); box-shadow: 3px 3px 0 #000; cursor: pointer; text-align: left; font: inherit; min-width: 0; }
.vs-stage img.ic { width: 30px; height: 30px; flex: none; filter: none; }
.vs-stage span { display: grid; min-width: 0; } .vs-stage b { font: 400 13.5px/1.1 var(--f-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .vs-stage small { color: var(--ink4); font-size: 10.5px; white-space: nowrap; }
.vs-stage.lock { opacity: .4; }
.vs-join { display: flex; gap: 8px; align-items: center; font: 400 15px var(--f-ui); }
.vs-join input { width: 6.5em; font: 400 20px var(--f-disp); letter-spacing: .2em; text-transform: uppercase; padding: 2px 8px; border-radius: 0; border: 2px solid #000; text-align: center; color: var(--ink); background: var(--bone); box-shadow: 3px 3px 0 #000; }
.vs-rooms, .room-players, .vs-end-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.vs-rooms { grid-template-columns: 1fr 1fr; grid-auto-rows: 38px; max-height: 81px; overflow: hidden; }
.vs-rooms li.dim, .vs-rooms > li:only-child { grid-column: 1 / -1; }
.vs-rooms li .btn { padding: 4px 10px 5px; font-size: 13px; }
.versus .set-sec { padding: 7px 12px 9px; gap: 6px; }
.vs-rooms li, .room-players li, .vs-end-list li { display: flex; align-items: center; gap: 8px; background: #000; border-radius: 0; padding: 4px 8px; box-shadow: none; min-width: 0; color: var(--bone); }
.vs-rooms li span { flex: 1; display: grid; min-width: 0; } .vs-rooms li small { color: var(--mute); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-rooms img.ic { width: 24px; height: 24px; flex: none; filter: none; }
.vs-rooms .dim, .room-players .dim { color: var(--mute); font-size: 13px; }
.room { width: 700px; }
.room-cols { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: center; }
.room-l { display: grid; justify-items: center; gap: 6px; background: #000; padding: 12px; }
.room-l small { font-size: 12px; }
.room-code { font: italic 400 58px/1 var(--f-disp); letter-spacing: .12em; color: var(--gold); text-align: center; }
.room-players li { height: 48px; }
.room-players img, .vs-end-list img { width: 36px; height: 36px; border-radius: 0; }
.room-players b, .vs-end-list b { font: 400 18px var(--f-ui); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-players small { color: var(--mute); font-size: 12px; } .room-players small.host { background: var(--gold); color: var(--ink); padding: 0 8px; border-radius: 0; }
#roomWait { color: var(--mute); font-size: 14px; flex: 1; text-align: right; }
.vs-end { width: 520px; justify-items: stretch; text-align: center; }
.vs-end-list i { font: italic 400 22px var(--f-disp); width: 1.4em; text-align: center; color: var(--mute); }
.vs-end-list li.me { outline: 3px solid var(--red); } .vs-end-list span { font: 400 20px var(--f-disp); color: var(--gold); }
.vs-end-gain { font: 400 17px var(--f-ui); color: var(--gold); }
.name-input { width: 100%; font: 400 24px var(--f-disp); padding: 8px 14px; border-radius: 0; border: 3px solid #000; color: var(--ink); background: var(--bone); text-align: center; box-shadow: 4px 4px 0 #000; }

/* 나의 집사: 남/여 카드 두 장 + 이름 */
.butler-pick { width: 560px; }
.bp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bp-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 8px 12px; cursor: pointer; font: inherit; color: var(--ink);
  background: radial-gradient(circle, rgba(18,14,22,.07) 1px, transparent 1.4px) 0 0 / 5px 5px, var(--bone); border: 3px solid #000; box-shadow: 5px 5px 0 #000; transition: translate .1s, box-shadow .1s; }
.bp-card:nth-child(1) { rotate: -1.2deg; } .bp-card:nth-child(2) { rotate: 1deg; }
.bp-card img { width: 124px; height: 124px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.35)); }
.bp-card b { font: 400 22px var(--f-disp); }
.bp-card:hover { translate: -2px -2px; box-shadow: 7px 7px 0 #000; }
.bp-card.on { outline: 4px solid var(--red); outline-offset: 3px; background: #fff; }
.bp-card.on::after { content: '선택'; position: absolute; right: -8px; top: -10px; font: 400 14px var(--f-disp); color: #fff; background: var(--red); padding: 1px 9px 2px; rotate: 6deg; }
.bp-name { display: flex; align-items: center; gap: 12px; font: 400 17px var(--f-ui); color: var(--bone); }
.bp-name span { flex: none; }
.bp-name .name-input { font-size: 20px; padding: 5px 12px; }
.butler-pick .intro-foot small { flex: 1; font-size: 12.5px; }

/* 내 고양이 방 */
body.myroom .hud, body.myroom .pad, body.myroom #rank, body.myroom #chainN, body.myroom #bCam, body.myroom #bPause, body.myroom #stickHint, body.myroom #minimap, body.myroom #zoneHint { display: none !important; }
#myRoomUi { position: fixed; inset: 0; z-index: 5; pointer-events: none; font-family: var(--f-ui); color: var(--bone); }
#myRoomUi[hidden] { display: none; }
.mr-top { position: absolute; left: calc(env(safe-area-inset-left, 0px) + 10px); top: calc(env(safe-area-inset-top, 0px) + 10px); display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.mr-top h2 { margin: 0; font: 400 22px var(--f-disp); background: var(--red); color: #fff; padding: 2px 22px 3px 14px; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.mr-shop { position: absolute; right: calc(env(safe-area-inset-right, 0px) + 10px); top: calc(env(safe-area-inset-top, 0px) + 10px); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: 210px;
  display: grid; grid-template-rows: auto 1fr; gap: 6px; padding: 8px; background: var(--dots), rgba(18,14,22,.88); border: 3px solid #000; box-shadow: 6px 6px 0 rgba(0,0,0,.5); pointer-events: auto; }
body.toss .mr-shop { top: calc(var(--toss-top, 0px) + 58px); }
.mr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.mr-shop { grid-template-rows: auto auto auto 1fr; }
.mr-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.mr-mode button { border: 0; background: var(--ink4); color: var(--bone2); font: 400 15px var(--f-disp); padding: 4px 0; cursor: pointer; }
.mr-mode button.on { background: var(--bone); color: var(--ink); }
.mr-empty { color: var(--mute); font-size: 13px; padding: 8px 4px; line-height: 1.5; }
.mr-god { display: flex; align-items: center; gap: 6px; }
.mr-god img { width: 42px; height: 42px; flex: none; filter: drop-shadow(2px 2px 0 #000); }
.mr-god p { margin: 0; flex: 1; background: var(--bone); color: var(--ink); font: 400 12.5px/1.3 var(--f-ui); padding: 4px 7px; position: relative; }
.mr-god p::before { content: ''; position: absolute; left: -7px; top: 10px; width: 7px; height: 10px; background: var(--bone); clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.mr-tabs button { border: 0; background: var(--ink3); color: var(--bone2); font: 400 15px var(--f-ui); padding: 4px 0; cursor: pointer; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.mr-tabs button.on { background: var(--red); color: #fff; }
.mr-item.sel { outline: 2px solid var(--gold); }
.mr-sw { width: 30px; height: 30px; flex: none; border: 2px solid #000; }
.mr-edit { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #000; border-left: 4px solid var(--gold); pointer-events: auto; white-space: nowrap; }
.mr-edit[hidden] { display: none; }
.mr-edit b { font: 400 16px var(--f-disp); color: var(--gold); } .mr-edit small { color: var(--mute); font-size: 12px; }
#myRoomUi .btn { position: relative; isolation: isolate; display: inline-flex; border: 0; background: none; font: 400 14px var(--f-ui); color: var(--ink); padding: 5px 14px 6px; cursor: pointer; --bg: var(--bone); }
#myRoomUi .btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--bg); clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
#myRoomUi .btn.pink { --bg: var(--red); color: #fff; } #myRoomUi .btn.ghost { --bg: var(--ink4); color: var(--bone); }
body.myroom #myRoomUi .mr-edit:not([hidden]) ~ .mr-hint { display: none; }
.mr-list { display: grid; gap: 5px; align-content: start; overflow-y: auto; }
.mr-item { display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border: 0; background: var(--ink3); color: var(--bone); font: 400 14px var(--f-ui); cursor: pointer; text-align: left; }
.mr-item img { width: 30px; height: 30px; flex: none; }
.mr-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-item em { font-style: normal; font: 400 13px var(--f-disp); color: var(--gold); white-space: nowrap; }
.mr-item.own em { color: var(--mint); } .mr-item.off { opacity: .55; }
.mr-item.cant em { color: var(--mute); }
.mr-hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); translate: -50% 0; background: #000; padding: 3px 14px 4px; font-size: 14px; border-left: 4px solid var(--red); white-space: nowrap; }

/* 카메라 버튼 묶음(왼쪽 돌리기·오른쪽 돌리기·위에서 보기): 일시정지 버튼 밑 세로 줄 */
#camBar { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 10px); top: calc(env(safe-area-inset-top, 0px) + 56px); z-index: 3; display: grid; gap: 6px; }
body:not(.playing) #camBar, body.aegyo #camBar, body.m-dance #camBar, body.myroom #camBar { display: none; }
#camBar button, #camBar #bCam { position: static; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 0; font-size: 19px; color: var(--bone); background: rgba(0,0,0,.78); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); cursor: pointer; }
#camBar #bTop.on { background: var(--red); color: #fff; }
body.toss #camBar { top: calc(var(--toss-top, 0px) + 56px); }
/* 미니맵 접기: 왼쪽 위 모서리 버튼 */
#mmWrap { position: relative; width: max-content; pointer-events: none; }
#mmToggle { position: absolute; left: -6px; top: -4px; width: 22px; height: 22px; padding: 0; border: 0; background: var(--red); color: #fff; font: 400 16px/22px var(--f-disp); pointer-events: auto; cursor: pointer; z-index: 2; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
body.mm-off #minimap { display: none; }
body.mm-off #mmWrap { width: 22px; height: 22px; }
body.mm-off #mmToggle { position: static; background: #000; }

/* 계정 */
body:not(.cloud) #titleLogin, body:not(.cloud) #hubAcct, body:not(.cloud) #introRank, body:not(.cloud) #endRank { display: none !important; }
.touch-only-flex { display: none; } body.touch .touch-only-flex { display: flex; }
body.touch .pc-only-block { display: none; }

/* 세로 폰: 이 게임은 가로 전용 → 돌려 달라는 안내 */
.rotate-hint { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-hint { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--speed), var(--ink); color: var(--bone); font: 400 20px var(--f-ui); }
  .rotate-hint b { font: 400 56px var(--f-disp); color: var(--red); animation: rot 1.6s ease-in-out infinite; }
}
@keyframes rot { 0%, 30% { rotate: 0deg; } 60%, 100% { rotate: 90deg; } }

/* ══ 게임 화면 HUD — 같은 화풍(먹 판·기울기·딱 떨어지는 그림자) ══ */
.hud { padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 10px) 0 calc(env(safe-area-inset-left, 0px) + 10px); gap: 8px; font-family: var(--f-ui); }
.hud .txt, .hud.txt, .hud .right.txt { text-shadow: none; }
.hud .meter { padding-left: 50px; width: auto; gap: 3px; }
.hud .meter > .lbl, .hud .meter > .gauge, .hud .meter > #meterSub { width: min(210px, 30vw); }
.hud .meter > .lbl { background: #000; color: var(--bone); border: 0; border-radius: 0; padding: 1px 12px 2px 6px; font: 400 14px var(--f-ui); box-shadow: none; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.hud .meter .face img.ic { width: 24px; height: 24px; filter: none; }
.hud .gauge { height: 10px; margin-top: -3px; border-radius: 0; background: var(--ink3); border: 2px solid #000; box-shadow: 3px 3px 0 rgba(0,0,0,.5); transform: skewX(-18deg); transform-origin: left; }
.gauge i { background: linear-gradient(90deg, var(--gold), var(--red)); }
.gauge.green i { background: var(--mint); } .gauge.pink i { background: linear-gradient(90deg, #ff9ab0, var(--red)); }
.gauge .mark { background: var(--bone); width: 2px; }
.hud #meterSub { font: 400 13px var(--f-ui); color: var(--bone); min-height: 0; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; }
.hud #meterSub:empty { display: none; }
#minimap { width: 104px; height: 104px; margin-top: 2px; border-radius: 0; border: 2px solid #000; outline: 1px solid rgba(243,235,221,.4); background: rgba(18,14,22,.55); opacity: .95; box-shadow: 4px 4px 0 rgba(0,0,0,.45); }
#loHud img.ic { width: 26px; height: 26px; border-radius: 0; background: rgba(18,14,22,.8); border: 1px solid #000; padding: 1px; }
body.touch #loHud { display: none; }
.hud .center { gap: 3px; }
#timer { font: italic 400 clamp(22px, 3.6vw, 30px)/1.05 var(--f-disp); color: var(--bone); background: #000; border: 0; border-radius: 0; padding: 1px 22px 3px; box-shadow: 4px 4px 0 rgba(0,0,0,.4); min-width: 3.6em; text-align: center; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
#timer.low { color: #fff; background: var(--red); animation: pulse .9s ease-in-out infinite; }
#missionTag { font: 400 12px var(--f-ui); background: rgba(0,0,0,.75); color: var(--bone2); border: 0; border-radius: 0; padding: 1px 10px; }
#missionTag img.ic { width: 16px; height: 16px; vertical-align: -3px; filter: none; }
.hud .right { position: relative; background: #000; border: 0; border-radius: 0; padding: 2px 14px 3px 18px; box-shadow: 4px 4px 0 rgba(0,0,0,.4); gap: 0; min-width: 100px; clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%); }
.hud .right::before { content: ''; position: absolute; left: 9px; top: 0; bottom: 0; width: 4px; background: var(--red); transform: skewX(-18deg); }
#score { font: italic 400 clamp(22px, 3.8vw, 32px)/1.05 var(--f-disp); color: var(--gold); }
.hud .right small { color: var(--mute); opacity: 1; font: 400 11px var(--f-ui); }
.hud #combo:empty, .hud #buff:empty { display: none; }
.hud #buff { font: 400 12px var(--f-ui); color: var(--red); }
#chainN, body.touch #chainN { left: auto; transform: none; right: calc(env(safe-area-inset-right, 0px) + 10px); top: calc(env(safe-area-inset-top, 0px) + 70px); text-align: right;
  font: 400 14px var(--f-ui); -webkit-text-stroke: 0; text-shadow: none; background: rgba(0,0,0,.82); border: 0; border-radius: 0; padding: 1px 10px 4px 16px; min-width: 100px; z-index: 2; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); }
#chainN b, body.touch #chainN b { font: italic 400 24px var(--f-disp); color: var(--bone); }
#chainN span { font-size: 11px; color: var(--red); opacity: 1; letter-spacing: .08em; }
#chainN i { height: 3px; margin-top: 2px; border-radius: 0; }
#rank, body.playing:not(.m-style) #rank { top: calc(env(safe-area-inset-top, 0px) + 112px); right: calc(env(safe-area-inset-right, 0px) + 12px); width: 46px; height: 46px; border-radius: 0;
  display: grid; place-items: center; font: italic 400 30px var(--f-disp); -webkit-text-stroke: 0; text-shadow: 2px 2px 0 #000; background: #000; border: 0; opacity: 1; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
body.playing.m-style #rank, body.playing.m-scratch #rank { width: 60px; height: 60px; font-size: 40px; }
body:not(.playing) #rank { display: none; }
#bPause { position: fixed; left: calc(env(safe-area-inset-left, 0px) + 10px); top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 3; width: 40px; height: 40px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 0; background: #000; box-shadow: none; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
#bPause i { width: 5px; height: 15px; background: var(--bone); border-radius: 0; transform: skewX(-12deg); }
body:not(.playing) #bPause, body.aegyo #bPause { display: none; }
#bAegyo { top: auto; right: auto; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); translate: -50% 0; font: 400 19px var(--f-disp); border: 0; border-radius: 0; padding: 7px 26px 9px; color: #fff;
  background: var(--red); box-shadow: 5px 5px 0 #000; clip-path: none; transform: skewX(-10deg); }
#bAegyo img.ic { width: 24px; height: 24px; vertical-align: -5px; filter: none; }
/* 폰 버튼: 먹 동그라미 + 종이 테 + 딱 떨어지는 그림자 */
.pad .btn { border: 3px solid var(--bone); background: rgba(18,14,22,.72); font-family: var(--f-disp); font-weight: 400; color: var(--bone); box-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.pad .btn.on { background: var(--bone); color: var(--ink); }
#bJump { background: rgba(243,235,221,.9); color: var(--ink); font-size: 18px; }
#bPunch { background: rgba(255,51,85,.88); color: #fff; font-size: 17px; }
#bTail { background: rgba(18,14,22,.72); }
.btn span { text-shadow: 1px 1px 0 #000; font-family: var(--f-ui); font-size: 11px; }
#stick { border: 3px solid rgba(243,235,221,.5); background: rgba(18,14,22,.25); }
#stick i { background: rgba(243,235,221,.6); }
#stickHint { font: 400 15px var(--f-ui); color: var(--bone); text-shadow: 1px 1px 0 #000; }
#toast { background: #000; color: var(--bone); font: 400 15px var(--f-ui); border-radius: 0; padding: 6px 18px 7px; border-left: 4px solid var(--red); }
#zoneHint { font: 400 16px var(--f-ui); color: var(--bone); background: #000; border: 0; border-radius: 0; padding: 3px 14px 4px; box-shadow: 3px 3px 0 rgba(0,0,0,.4); }
#zoneHint.locked { color: var(--red); }
#vsBoard div { background: rgba(0,0,0,.78); border-radius: 0; font-family: var(--f-ui); }
#vsBoard div.me { background: var(--red); }
#vsStall { background: #000; border: 0; border-left: 4px solid var(--red); border-radius: 0; font-family: var(--f-ui); }
#vsQuitBtn { border-radius: 0; border: 0; background: #000; font-family: var(--f-ui); }
/* 아양 리듬·댄스 판도 같은 옷 */
#rhythm .veil { background: radial-gradient(ellipse at center, rgba(255,51,85,.1), rgba(10,7,13,.62)); }
#rhythm .title { font: 400 clamp(22px, 5vw, 34px) var(--f-disp); color: var(--bone); text-shadow: 3px 3px 0 var(--red), 5px 5px 0 #000; }
#lane { border-radius: 0; background: rgba(0,0,0,.6); border: 2px solid var(--bone); transform: skewX(-8deg); }
#hitRing { border-color: var(--bone); box-shadow: 0 0 0 3px var(--red); }
.note.tap { background: var(--red); border: 2px solid #000; }
.note.left, .note.right, .note.up { background: var(--bone); color: var(--ink); border: 2px solid #000; }
#judge, .d-judge { font-family: var(--f-disp); font-style: italic; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000; }
#dance { font-family: var(--f-ui); }
.d-panel { background: rgba(10,7,13,.78); border: 3px solid var(--bone); border-radius: 0; box-shadow: 6px 6px 0 rgba(0,0,0,.5); }
.d-panel.freeze { border-color: var(--gold); box-shadow: 6px 6px 0 rgba(0,0,0,.5), 0 0 18px rgba(255,197,61,.6); }
.d-panel.jam { border-color: var(--mint); box-shadow: 6px 6px 0 rgba(0,0,0,.5), 0 0 18px rgba(79,227,193,.6); }
.d-tag { border-radius: 0; background: var(--red); font-family: var(--f-disp); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); padding: 1px 16px; }
.d-panel.freeze .d-tag { background: var(--gold); color: var(--ink); } .d-panel.jam .d-tag { background: var(--mint); color: var(--ink); }
.d-ar { border-radius: 0; background: rgba(243,235,221,.1); border: 2px solid rgba(243,235,221,.4); }
.d-ar.ok { background: var(--gold); color: var(--ink); border-color: #000; }
.d-plus { color: var(--red); }
.d-bt { border-radius: 0; border: 3px solid #000; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.d-bt.nyan, .dbtns .nyan { background: var(--red); } .d-bt.heart, .dbtns .heart { background: #b0487a; } .d-bt.jump, .dbtns .jump { background: var(--mintD); }
.d-beats i { background: rgba(243,235,221,.3); border-radius: 0; transform: skewX(-15deg); }
.d-beats i.on { background: var(--bone); box-shadow: none; }
.d-beats i.d-t { border-color: var(--gold); } .d-beats i.d-t.on { background: var(--gold); box-shadow: none; }
.d-sweep { background: var(--red); box-shadow: none; }
.d-lv { font-family: var(--f-disp); text-shadow: 2px 2px 0 #000; } .d-lv small { color: var(--bone2); font-family: var(--f-ui); }
.d-freeze, .d-count { font-family: var(--f-disp); color: var(--bone); -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 5px 5px 0 var(--red); }
.dpad .dp { border-radius: 0; border: 3px solid var(--bone); background: rgba(18,14,22,.72); box-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.dbtns .db { border: 3px solid var(--bone); font-family: var(--f-ui); box-shadow: 3px 3px 0 rgba(0,0,0,.6); }

/* 낮은 가로 화면(폰): HUD 더 작게 */
@media (max-height: 460px) {
  .hud .meter > .lbl, .hud .meter > .gauge, .hud .meter > #meterSub { width: min(160px, 26vw); }
  .hud .meter > .lbl { font-size: 13px; } .hud .meter .face img.ic { width: 20px; height: 20px; }
  #minimap { width: 74px; height: 74px; }
  #timer { font-size: 21px; padding: 1px 16px 2px; } #missionTag { display: none; }
  #score { font-size: 22px; } .hud .right { padding: 1px 12px 2px 16px; min-width: 84px; }
  #chainN, body.touch #chainN { top: calc(env(safe-area-inset-top, 0px) + 56px); min-width: 84px; } #chainN b, body.touch #chainN b { font-size: 19px; }
  #rank, body.playing:not(.m-style) #rank { top: calc(env(safe-area-inset-top, 0px) + 94px); width: 38px; height: 38px; font-size: 25px; }
  body.playing.m-style #rank, body.playing.m-scratch #rank { width: 48px; height: 48px; font-size: 32px; }
  #vsBoard { top: calc(env(safe-area-inset-top, 0px) + 44px); }
}
@media (max-width: 520px) {
  .hud { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px; padding-left: 8px; padding-right: 8px; }
  .meter { width: auto; min-width: 0; } .hud .meter { padding-left: 46px; }
  .hud .meter > .lbl, .hud .meter > .gauge, .hud .meter > #meterSub { width: auto; } #minimap { width: 72px; height: 72px; }
  #missionTag { display: none; } #timer { font-size: 22px; } #score { font-size: 22px; } .hud .right small { font-size: 10px; }
  .meter .lbl span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) { .meter #meterName { display: none; } }

/* ── 앱인토스판: 오른쪽 위 토스 버튼(더보기·닫기) 자리 비우기 ── */
body.toss .hud .right { margin-right: 92px; margin-top: calc(var(--toss-top, 0px)); }
body.toss #chainN, body.toss #rank { margin-top: calc(var(--toss-top, 0px) + 6px); }
body.toss .screen.ui { padding-top: calc(var(--toss-top, 0px) + 8px); }
body.toss { --toss-r: calc(96px / var(--z)); }
body.toss #vsQuitBtn { display: none !important; }
.vs-soon { display: none; } body.toss .vs-soon { display: block; background: var(--mintD) !important; }
body.toss #toVersus { opacity: .6; } body.toss #toVersus .vs-sub { visibility: hidden; }
.d-lv { z-index: 1; }

/* 2026-09-30 폰에서 스타일 등급·콤보·카메라 버튼이 겹치던 것:
   카메라 버튼은 왼쪽 일시정지 버튼 밑으로 옮기고, 등급 상자는 글자(SSS)만큼 넓어지게, 콤보는 한 줄 고정 */
#rank, body.playing:not(.m-style) #rank, body.playing.m-style #rank, body.playing.m-scratch #rank { width: auto; min-width: 46px; padding: 0 10px; white-space: nowrap; }
#chainN, body.touch #chainN { white-space: nowrap; }
.hud .meter { min-height: 96px; }
@media (max-height: 460px) {
  #rank, body.playing:not(.m-style) #rank, body.playing.m-style #rank, body.playing.m-scratch #rank { top: calc(env(safe-area-inset-top, 0px) + 96px); min-width: 38px; }
}

/* 게임 소개: 그림 칸이 글 칸을 밀어내지 않게(그림 4장은 2×2) */
.how-page { grid-template-columns: 210px minmax(0, 1fr); }
.how-art { min-width: 0; overflow: hidden; }
.how-art.skills, .how-art.quad { display: grid; grid-template-columns: repeat(2, 78px); justify-content: center; align-content: center; gap: 6px 10px; }
.how-art.skills img, .how-art.quad img { width: 78px; height: 78px; }

/* 결과 상세: 목표 줄바꿈 살리기 · 캣갓의 방 아래 메뉴 5개가 빽빽하지 않게 */
.screen.ui .res small#resDetail { white-space: pre-line; }
.dock { gap: 8px; }
.dock-btn { padding: 3px 12px 3px 5px; }
.dock-btn img { width: 36px; height: 36px; }
.dock-btn b { font-size: 16px; } .dock-btn small { font-size: 11px; }

/* 미션 소개 스킬셋: 공격 스킬 둘째 줄이 칸 밑으로 잘리던 것 — 위쪽 슬롯·설명을 납작하게 해서 목록 자리 확보 */
.screen.ui #loadout { gap: 5px; padding: 8px 10px; }
.screen.ui .slot { display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px 2px; min-height: 0; font-size: 12px; }
.screen.ui .slot img.ic { width: 22px; height: 22px; flex: none; }
.screen.ui .slot.empty { min-height: 30px; }
.screen.ui .lo-desc { min-height: 0; max-height: none; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abgs { gap: 3px; }
.abg { gap: 3px; }
.screen.ui .ab { padding: 1px 4px 1px 2px; font-size: 12px; min-height: 24px; }
.screen.ui .ab img.ic { width: 20px; height: 20px; }
.screen.ui .abg b { font-size: 12px; }

/* 결과 화면: 이번·최고 스타일 등급 + 올 S/SS 현황 */
#resStyle { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: center; font: 400 13px var(--f-ui); color: var(--bone); }
#resStyle b { font: italic 400 24px/1 var(--f-disp); -webkit-text-stroke: 1px #000; }
#resStyle i { font-style: normal; opacity: .7; margin-left: 6px; }
#resStyle em { font: 400 12px var(--f-disp); background: var(--red); color: #fff; padding: 1px 6px; transform: rotate(-6deg); font-style: normal; }
#resStyle small { flex-basis: 100%; text-align: center; font-size: 11px; opacity: .75; }
.stage-card .bs .rk { font: italic 400 13px var(--f-disp); margin-left: 4px; }
