/* 달 없는 밤 — UI 스타일 (한지·먹·낙관·초롱빛) */
:root {
  --night: #0b0d1a; --night2: #141834; --ink: #1d1a1f; --ink2: #51474a; --ink3: #8a7d74;
  --paper: #f3e9d2; --paper2: #e6d6b6; --crimson: #c2263a; --crimson2: #93182a;
  --lantern: #ffb469; --gold: #ffd66b; --ghost: #dff3ff; --danger: #ff5a6a;
  --serif-ko: 'Gowun Batang', 'Nanum Myeongjo', 'AppleMyungjo', 'Noto Serif KR', 'Noto Serif CJK KR', 'Source Han Serif K', 'Batang', '바탕', 'Apple SD Gothic Neo', serif;
  --serif: var(--serif-ko);
  --brush: 'Nanum Brush Script', 'East Sea Dokdo', var(--serif);
  --logo-brush: 'Nanum Brush Script', 'East Sea Dokdo', var(--serif-ko); /* the logo stays Korean in every language */
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --hanji: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .22 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
           url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .16' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .99 0 0 0 0 .97 0 0 0 0 .9 0 0 0 -1.5 .62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); overflow: hidden; overscroll-behavior: none; }
/* phones: the visible height with the browser's bars where they are now (dvh), never under them (docs/NOTES-MOBILE.md) */
@supports (height: 100dvh) { html, body { height: 100dvh; } }
body { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-family: var(--serif); color: var(--paper);
  word-break: keep-all; overflow-wrap: break-word; line-height: 1.5; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#ui [hidden] { display: none !important; }
#ui input { user-select: text; -webkit-user-select: text; }
:where(#ui) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#ui svg { display: block; }
#ui svg.chibi { overflow: visible; }
/* 첫 로딩 화면(.boot)은 index.html 인라인 스타일에 있다 */
#ui-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
#ui[data-screen=title] #ui-bg, #ui[data-screen=connecting] #ui-bg, #ui[data-screen=lobby] #ui-bg { display: block; }
#ui[data-screen=lobby] #ui-bg { filter: brightness(.62) saturate(.9); }

.screen { position: absolute; inset: 0; display: none; pointer-events: auto; }
.screen.on { display: flex; }
.scr-game.on { pointer-events: none; }

/* ── 공통: 종이, 버튼, 낙관 ───────────────────────── */
.paper { color: var(--ink); background-color: var(--paper); background-image: var(--hanji), radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(120,85,40,.22));
  border-radius: 5px; box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.35) inset, 0 0 0 1px rgba(90,60,30,.18) inset; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; border-radius: 6px; padding: .8em 1.4em; font-weight: 700;
  font-size: 17px; letter-spacing: .02em; min-height: 48px; transition: transform .15s, box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .42; cursor: default; filter: saturate(.4); }
.btn-primary { color: #fff6e6; background: linear-gradient(180deg, #d23447, var(--crimson) 45%, var(--crimson2)); text-shadow: 0 1px 0 rgba(0,0,0,.3);
  box-shadow: 0 0 0 1px rgba(255,214,107,.25) inset, 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 30px rgba(194,38,58,.35), 0 0 40px rgba(255,140,80,.12); }
.btn-primary:not(:disabled):hover { box-shadow: 0 0 0 1px rgba(255,214,107,.5) inset, 0 1px 0 rgba(255,255,255,.3) inset, 0 12px 36px rgba(194,38,58,.5), 0 0 60px rgba(255,160,90,.25); transform: translateY(-1px); }
.btn-ghost { color: var(--paper); background: rgba(11,13,26,.45); box-shadow: 0 0 0 1px rgba(243,233,210,.32) inset; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:not(:disabled):hover { background: rgba(255,180,105,.12); box-shadow: 0 0 0 1px rgba(255,180,105,.7) inset, 0 0 24px rgba(255,180,105,.18); }
.btn-ink { color: var(--paper); background: var(--ink); box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 6px 16px rgba(0,0,0,.25); }
.btn-ink:not(:disabled):hover { background: #2c262c; }
.btn-line { color: var(--ink); background: transparent; box-shadow: 0 0 0 1.5px rgba(29,26,31,.55) inset; }
.btn-line:not(:disabled):hover { background: rgba(29,26,31,.06); }
.btn-sm { font-size: 15px; min-height: 40px; padding: .5em 1em; }
.btn-text { background: none; border: 0; color: rgba(243,233,210,.75); font-size: 15px; padding: .6em .8em; display: inline-flex; gap: .4em; align-items: center; border-radius: 6px; min-height: 44px; }
.btn-text svg { width: 18px; height: 18px; }
.btn-text:hover { color: var(--lantern); }
.seal { display: inline-grid; place-items: center; color: #fff1ea; background: var(--crimson); border-radius: 7px; font-family: var(--serif); font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255,240,230,.0), inset 0 0 0 2.5px rgba(255,236,226,.85), inset 0 0 12px rgba(80,0,10,.45); line-height: 1; transform: rotate(-7deg);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 60%, rgba(0,0,0,.82) 61%, #000 75%); }
kbd { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .35em; border-radius: 4px; font: 700 .78em/1 ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--paper); background: rgba(243,233,210,.12); box-shadow: 0 0 0 1px rgba(243,233,210,.35) inset, 0 2px 0 rgba(0,0,0,.4); vertical-align: middle; }
.paper kbd { color: var(--ink); background: rgba(29,26,31,.06); box-shadow: 0 0 0 1px rgba(29,26,31,.35) inset, 0 2px 0 rgba(29,26,31,.15); }
.only-touch { display: none !important; }
.is-touch .only-touch { display: revert !important; }
.is-touch .only-desk { display: none !important; }

/* ── 타이틀: the home screen (docs/NOTES-UI.md "Home screen") ─────────────────
   A top bar (her profile chip → the character sheet · 친구 · 게임 방법 · 설정 · 🌐), the logo, her character large on a lantern-lit
   spot (+ 꾸미기), the ways in at the bottom (방 만들기 big · 빠른 매칭 · 코드로 참가 opening the code row). Invites are cards at the
   top (.inv-stack, under the bar); they never change a button. Desktop and landscape: logo + ways left, her character right. */
.scr-title { flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.home { position: relative; flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; }
.home-top { position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + var(--sat)) calc(16px + var(--sar)) 0 calc(16px + var(--sal)); animation: fade .8s both; }
.home-icons { display: flex; align-items: center; gap: 4px; flex: none; flex-wrap: nowrap; }
.home-icons .btn-text { min-height: 40px; padding: .4em .7em; font-size: 14.5px; white-space: nowrap; }
.home-icons .btn-text[hidden] { display: none; }
/* her profile chip: face + name (tap → the character sheet) */
.profile-chip { flex: 0 1 auto; min-width: 0; max-width: 260px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 4px; border: 0; border-radius: 999px;
  font: inherit; color: var(--paper); background: rgba(11,13,26,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.3) inset; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; }
.profile-chip:hover, .profile-chip:focus-visible { box-shadow: 0 0 0 1px rgba(255,180,105,.75) inset, 0 0 20px rgba(255,180,105,.18); }
.profile-chip:active { transform: scale(.98); }
.prof-face { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 62%, rgba(255,180,105,.5), rgba(255,180,105,.08) 72%); box-shadow: 0 0 0 1px rgba(255,214,160,.28) inset; }
.prof-face .chibi-head { width: 36px; height: 33px; margin-top: 4px; }
.prof-txt { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.prof-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; letter-spacing: .02em; }
/* the middle: logo · her character · the ways in */
.home-body { flex: 1 0 auto; display: grid; align-content: center; justify-content: center; column-gap: 64px;
  grid-template-columns: minmax(0, 520px) minmax(0, 420px); grid-template-areas: "brand stage" "ways stage";
  padding: 12px calc(40px + var(--sar)) 12px calc(40px + var(--sal)); }
.home-brand { grid-area: brand; align-self: end; min-width: 0; animation: rise 1.2s cubic-bezier(.2,.7,.2,1) both; }
.kicker { margin: 0 0 4px; font-size: 14px; letter-spacing: .28em; color: rgba(255,214,160,.72); }
.logo { position: relative; margin: 0; display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 400; }
.logo-txt { white-space: nowrap; font-family: var(--logo-brush); font-size: clamp(76px, 10.5vw, 136px); line-height: 1.05; color: #fbf3e2; letter-spacing: .01em;
  text-shadow: 0 0 18px rgba(255,180,105,.35), 0 0 60px rgba(255,140,80,.18), 0 4px 0 rgba(0,0,0,.35); }
.no-logo .logo-txt { font-family: var(--serif-ko); font-weight: 800; letter-spacing: .06em; font-size: clamp(56px, 8vw, 104px); }
.logo .seal { width: 54px; height: 54px; font-size: 20px; margin-top: 14px; writing-mode: vertical-rl; letter-spacing: -1px; animation: stampIn .5s .9s cubic-bezier(.3,1.6,.5,1) both; }
.tagline { margin: 6px 0 0; font-size: 18px; color: rgba(243,233,210,.86); line-height: 1.7; text-shadow: 0 2px 10px #000; }
/* her character on a lantern-lit spot: the whole spot is a button (→ the sheet); 꾸미기 under it says so */
.home-stage { grid-area: stage; align-self: center; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise 1.2s .3s cubic-bezier(.2,.7,.2,1) both; }
.stage { position: relative; display: block; width: 100%; height: clamp(240px, calc(100vh - 270px), 400px); border: 0; padding: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@supports (height: 100dvh) { .stage { height: clamp(240px, calc(100dvh - 270px - var(--inv-h, 0px)), 400px); } }
.stage-glow { position: absolute; inset: 4% 6% 0; border-radius: 50%; pointer-events: none; transition: opacity .3s;
  background: radial-gradient(closest-side, rgba(255,180,105,.26), rgba(255,160,90,.08) 62%, rgba(255,160,90,0)); }
.stage::after { content: ''; position: absolute; left: 50%; bottom: 3%; width: 46%; height: 8%; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0)); }
.stage-fig { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; }
.stage-fig .chibi { flex: none; height: 100%; width: auto; max-width: 100%; overflow: visible; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.stage-fig.pop .chibi { animation: pop .35s cubic-bezier(.3,1.7,.5,1); }
.stage:hover .stage-glow, .stage:focus-visible .stage-glow { opacity: 1.0; background: radial-gradient(closest-side, rgba(255,180,105,.36), rgba(255,160,90,.12) 62%, rgba(255,160,90,0)); }
.stage:focus-visible { outline: none; }
.btn-custom { min-height: 40px; padding: .4em 1.1em; font-size: 14.5px; border-radius: 999px; }
.btn-custom svg { width: 16px; height: 16px; }
/* the ways in: 방 만들기 (big) · 빠른 매칭 · 코드로 참가 (a quieter line; opens the code row under it) */
.home-ways { grid-area: ways; align-self: start; display: flex; flex-direction: column; gap: 10px; width: min(380px, 100%); margin-top: 26px; animation: rise 1.2s .15s cubic-bezier(.2,.7,.2,1) both; }
.home-ways .btn { width: 100%; }
.btn-hero { font-size: 19px; min-height: 58px; }
.way-code-box { display: flex; flex-direction: column; gap: 8px; }
.way-code { align-self: center; gap: 8px; font-size: 15px; color: rgba(243,233,210,.8); }
.way-code > span { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(243,233,210,.35); }
.way-code-arrow { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.way-code[aria-expanded=true] .way-code-arrow { transform: translateY(2px) rotate(-135deg); }
.code-row { display: none; gap: 8px; }
.code-row.on { display: flex; animation: rise .35s both; }
.code-input { flex: 1; min-width: 0; height: 52px; border-radius: 6px; border: 0; padding: 0 14px; font: 700 26px/1 ui-monospace, Menlo, monospace; text-align: center; letter-spacing: .5em; text-indent: .5em;
  text-transform: uppercase; color: var(--ink); background: var(--paper); box-shadow: 0 0 0 2px rgba(255,180,105,.0) inset; outline: none; }
.code-input:focus { box-shadow: 0 0 0 2px var(--lantern) inset, 0 0 24px rgba(255,180,105,.3); }
.code-input::placeholder { color: rgba(29,26,31,.28); letter-spacing: .5em; }
.code-row .btn { width: auto; flex: none; }
/* the foot: the headphones line and the legal link (pass.js puts it here) */
.home-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 16px; min-height: 36px;
  padding: 0 calc(16px + var(--sar)) calc(4px + var(--sab)) calc(16px + var(--sal)); }
.title-foot { margin: 0; font-size: 12.5px; color: rgba(243,233,210,.42); letter-spacing: .08em; }
.game-ver { margin: 0; font-size: 11px; color: rgba(243,233,210,.5); font-variant-numeric: tabular-nums; white-space: nowrap; } /* (the build this page is: js/version.js) */
.modal .game-ver { margin-top: 10px; color: var(--ink2); text-align: center; user-select: text; -webkit-user-select: text; }
/* the gate's invite note (gate.js; the title's own invites are .inv-card below) */
.invite { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; background: rgba(255,180,105,.1); box-shadow: 0 0 0 1px rgba(255,180,105,.35) inset; }
.invite .seal { width: 44px; height: 44px; font-size: 13px; flex: none; letter-spacing: .04em; }
.invite p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--paper); }
.invite b { color: var(--gold); letter-spacing: .12em; }

/* ── invite cards: one look for every invite (a room link, a tapped notification, a friend's invite: ui.js inviteCard) ──
   On the title they sit in the page under the top bar (and push the rest down); elsewhere they float at the top, over dialogs. */
.inv-stack { position: absolute; z-index: 45; top: calc(12px + var(--sat)); left: 50%; transform: translateX(-50%); width: min(480px, calc(100% - 28px - var(--sal) - var(--sar)));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.inv-stack:empty { display: none; }
.home > .inv-stack { position: relative; z-index: 5; top: auto; left: auto; transform: none; margin: 10px auto 0; width: min(520px, calc(100% - 32px - var(--sal) - var(--sar))); }
.inv-card { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; border-radius: 8px; color: var(--ink);
  box-shadow: 0 0 0 1px rgba(194,38,58,.22) inset, 0 12px 34px rgba(0,0,0,.5); animation: toastIn .35s cubic-bezier(.3,1.4,.5,1) both; }
.inv-seal { flex: none; width: 40px; height: 40px; font-size: 13px; letter-spacing: .04em; }
.inv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.inv-txt p { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 700; }
.inv-txt b { color: var(--crimson); letter-spacing: .12em; font-family: ui-monospace, Menlo, monospace; }
.inv-txt small { font-size: 12px; color: var(--ink2); line-height: 1.35; }
.inv-join { flex: none; min-width: 0; white-space: nowrap; min-height: 40px; padding: .4em 1em; font-size: 15px; }
.inv-x { flex: none; width: 36px; height: 36px; margin-left: -4px; border: 0; padding: 0; background: none; color: var(--ink2); display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.inv-x svg { width: 18px; height: 18px; }
.inv-x:hover { background: rgba(29,26,31,.07); color: var(--crimson); }
.is-touch .inv-x { width: 44px; height: 44px; margin: -4px 0 -4px -8px; }
#ui.gate-up .inv-stack { visibility: hidden; }

/* ── the wardrobe (a dialog: her character, 꾸미기) ── */
.maker-modal { width: min(500px, 100%); }
.maker { position: relative; }
.maker-opts > .opt:first-child { margin-top: 14px; }
.maker-top { display: flex; gap: 14px; align-items: center; }
.preview { position: relative; width: 150px; height: 170px; flex: none; display: grid; place-items: center;
  background: radial-gradient(closest-side, rgba(255,180,105,.32), rgba(255,180,105,0) 75%), radial-gradient(70% 22% at 46% 92%, rgba(60,40,20,.22), transparent); border-radius: 50%; }
.preview .chibi { width: 150px; height: 166px; overflow: visible; }
.chibi .ch-body { animation: bob 2.6s ease-in-out infinite; transform-box: view-box; transform-origin: 56px 130px; }
.chibi .ch-lantern { animation: sway 2.6s ease-in-out infinite; transform-box: view-box; transform-origin: 82px 101px; }
.chibi .ch-eyes { animation: blink 4.5s infinite; transform-box: view-box; transform-origin: 56px 58px; }
.preview.pop .chibi { animation: pop .35s cubic-bezier(.3,1.7,.5,1); }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink2); letter-spacing: .1em; }
.name-input { width: 100%; height: 46px; border: 0; border-bottom: 2px solid rgba(29,26,31,.7); background: transparent; font: 700 22px/1 var(--serif); color: var(--ink); padding: 4px 2px; outline: none; border-radius: 0; }
.name-input:focus { border-color: var(--crimson); }
.name-input::placeholder { color: rgba(29,26,31,.3); font-weight: 400; }
.dice { align-self: flex-start; margin-top: 8px; background: none; border: 0; color: var(--ink2); font-size: 14px; padding: 6px 0; display: inline-flex; gap: 6px; align-items: center; }
.dice:hover { color: var(--crimson); }
.body-seg { flex-wrap: nowrap; } /* girl / boy */
.maker-top .opt-body { margin-top: 0; }
.body-seg .chip { height: 32px; font-size: 14px; }
.opt { margin-top: 12px; }
.opt > span { display: block; font-size: 13px; color: var(--ink2); letter-spacing: .1em; margin-bottom: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 6px; font-size: 15px; font-weight: 700; color: var(--ink2); background: rgba(29,26,31,.06); box-shadow: 0 0 0 1px rgba(29,26,31,.18) inset; transition: .15s; }
.chip:hover { background: rgba(29,26,31,.1); }
.chip[aria-pressed=true] { color: #fff6e6; background: var(--ink); box-shadow: none; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset, 0 2px 4px rgba(0,0,0,.2); position: relative; transition: transform .15s; }
.sw:hover { transform: scale(1.08); }
.sw[aria-pressed=true]::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--crimson); }

/* ── the profile (a dialog: the profile chip): who she is + her record on this device ── */
.prof-modal { width: min(540px, 100%); }
.prof-who { display: flex; gap: 14px; align-items: center; }
.prof-fig-btn { flex: none; width: 104px; height: 118px; border: 0; padding: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(closest-side, rgba(255,180,105,.32), rgba(255,180,105,0) 75%), radial-gradient(70% 22% at 46% 92%, rgba(60,40,20,.22), transparent); }
.prof-fig-btn:hover, .prof-fig-btn:focus-visible { outline: none; background: radial-gradient(closest-side, rgba(255,180,105,.48), rgba(255,180,105,0) 78%), radial-gradient(70% 22% at 46% 92%, rgba(60,40,20,.22), transparent); }
.prof-fig, .prof-fig .chibi { display: block; width: 104px; height: 116px; overflow: visible; }
.prof-custom { align-self: flex-start; margin-top: 10px; gap: 7px; min-height: 36px; padding: .3em 1em; font-size: 14px; border-radius: 999px; }
.prof-custom svg { width: 15px; height: 15px; }
.pr-rec { margin-top: 14px; }
.pr-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pr-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 8px; background: rgba(29,26,31,.06); box-shadow: 0 0 0 1px rgba(29,26,31,.12) inset; text-align: center; min-width: 0; }
.pr-tile b { font-size: 22px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-tile b small { font-size: 13px; font-weight: 400; color: var(--ink3); }
.pr-tile > span { font-size: 12.5px; color: var(--ink2); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pr-nights { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pr-night { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px 5px; border-radius: 6px; background: rgba(29,26,31,.04); }
.pr-night .pr-n { font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.pr-night .stars { display: inline-flex; gap: 1px; align-items: center; }
.pr-night .stars svg { width: 14px; height: 14px; }
.pr-night.won { background: rgba(255,180,105,.16); }
.pr-night.won .pr-n { color: var(--ink); font-weight: 700; }
.pr-none { opacity: .5; }
.pr-night.soon { opacity: .45; }
.pr-note { margin: 8px 0 0; font-size: 12px; color: var(--ink3); text-align: center; }

/* ── 연결 중 ─────────────────────────────────────── */
.scr-connecting { align-items: center; justify-content: center; flex-direction: column; gap: 22px; text-align: center; padding: 24px; }
.conn-lantern { width: 64px; height: 64px; color: var(--lantern); filter: drop-shadow(0 0 18px rgba(255,180,105,.8)); animation: sway 2.4s ease-in-out infinite, breathe 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.conn-text { font-size: 20px; margin: 0; text-shadow: 0 2px 12px #000; }
.conn-sub { font-size: 14px; margin: -12px 0 0; color: rgba(243,233,210,.6); }
.dots::after { content: '…'; display: inline-block; width: 1em; text-align: left; animation: dots 1.4s steps(4) infinite; overflow: hidden; vertical-align: bottom; }

/* ── 로비 ───────────────────────────────────────── */
.scr-lobby { flex-direction: column; overflow-y: auto; padding: calc(16px + var(--sat)) calc(32px + var(--sar)) calc(18px + var(--sab)) calc(32px + var(--sal)); }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.night-label { font-size: 15px; letter-spacing: .25em; color: var(--gold); display: flex; align-items: center; gap: 10px; }
.night-label::before, .night-label::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,214,107,.6)); }
.night-label::after { transform: scaleX(-1); }
.lobby-main { flex: 1; display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; width: min(1140px, 100%); margin: 0 auto; padding: 14px 0; }
.code-card { padding: 22px 22px 18px; text-align: center; position: relative; }
.code-card > p { margin: 0; font-size: 13px; letter-spacing: .25em; color: var(--ink2); }
.room-code { display: flex; justify-content: center; gap: 8px; margin: 10px 0 14px; }
.room-code span { width: 50px; height: 62px; display: grid; place-items: center; font: 800 38px/1 var(--serif); color: var(--ink); border-bottom: 3px solid var(--crimson);
  background: rgba(29,26,31,.04); border-radius: 4px 4px 0 0; }
.code-card .btn { width: 100%; margin-top: 8px; }
.code-card .hint { margin: 12px 0 0; font-size: 13px; color: var(--ink2); letter-spacing: 0; line-height: 1.55; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.seat { position: relative; aspect-ratio: 3 / 4.1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 10px 8px 14px; min-width: 0;
  background: radial-gradient(80% 55% at 60% 55%, rgba(255,170,90,.2), transparent 70%), linear-gradient(180deg, rgba(20,24,52,.75), rgba(8,9,20,.85));
  box-shadow: 0 0 0 1px rgba(255,214,107,.22) inset, 0 16px 40px rgba(0,0,0,.45); animation: rise .5s both; }
.seat.me { box-shadow: 0 0 0 1.5px rgba(255,180,105,.7) inset, 0 0 30px rgba(255,160,90,.15), 0 16px 40px rgba(0,0,0,.45); }
.seat .chibi { width: 86%; height: auto; flex: 1; min-height: 0; max-height: 210px; }
.seat-name { margin-top: 6px; font-size: 17px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--paper); }
.seat-sub { font-size: 12.5px; color: rgba(243,233,210,.55); min-height: 1.4em; }
.seat .crown { position: absolute; top: 10px; left: 10px; width: 30px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.seat .ready-seal { position: absolute; top: 10px; right: 10px; width: 46px; height: 46px; font-size: 15px; opacity: 0; transform: rotate(-12deg) scale(2.2); transition: none; }
.seat.ready .ready-seal { opacity: 1; transform: rotate(-12deg) scale(1); animation: stampIn .38s cubic-bezier(.3,1.6,.5,1) both; }
.seat.off { filter: grayscale(.8) brightness(.6); }
.seat.empty { justify-content: center; gap: 10px; background: transparent; box-shadow: none; border: 1.5px dashed rgba(243,233,210,.22); color: rgba(243,233,210,.5); font-size: 14px; text-align: center; cursor: pointer; transition: .2s; }
.seat.empty:hover { border-color: rgba(255,180,105,.6); color: var(--lantern); background: rgba(255,180,105,.05); }
.seat.empty .ghost-lantern { width: 38px; height: 38px; opacity: .45; }
.lobby-bottom { flex: none; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; width: min(1140px, 100%); margin: 0 auto; }
.howto-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.howto-mini .goal { grid-column: 1 / -1; margin: 0; font-size: 15px; color: rgba(243,233,210,.9); }
.howto-mini .goal b { color: var(--gold); font-weight: 700; }
.howto-mini .goal small { display: block; font-size: 13px; color: rgba(243,233,210,.55); margin-top: 2px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: rgba(11,13,26,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.1) inset; }
.tip i { flex: none; width: 30px; height: 30px; color: var(--lantern); display: grid; place-items: center; }
.tip i svg { width: 26px; height: 26px; }
.tip b { display: block; font-size: 14.5px; color: var(--paper); }
.tip span { display: block; font-size: 12.5px; color: rgba(243,233,210,.65); line-height: 1.5; }
.lobby-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 280px; }
.lobby-actions .btn { width: 100%; }
.lobby-status { text-align: center; font-size: 13px; color: rgba(243,233,210,.6); min-height: 1.5em; margin: 0; }
/* 난이도 (순한맛/보통맛/매운맛): host picks, everyone sees it */
.diff { display: flex; flex-direction: column; gap: 3px; }
.diff-seg { display: flex; border-radius: 8px; overflow: hidden; background: rgba(11,13,26,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.22) inset; }
.diff-seg button { flex: 1; min-width: 0; border: 0; background: none; height: 36px; padding: 0 2px; font-size: 14px; font-weight: 700; color: rgba(243,233,210,.55); white-space: nowrap; pointer-events: auto; }
.diff-seg button + button { box-shadow: -1px 0 0 rgba(243,233,210,.16); }
.diff-seg button[aria-pressed=true] { color: var(--paper); background: linear-gradient(180deg, rgba(255,180,105,.2), rgba(255,180,105,.06)); box-shadow: inset 0 -2px 0 var(--lantern); }
.diff-seg button[data-d=mild][aria-pressed=true] { background: linear-gradient(180deg, rgba(255,226,170,.2), rgba(255,226,170,.05)); box-shadow: inset 0 -2px 0 #f3d9a0; }
.diff-seg button[data-d=spicy][aria-pressed=true] { background: linear-gradient(180deg, rgba(194,38,58,.34), rgba(194,38,58,.1)); box-shadow: inset 0 -2px 0 var(--crimson); }
.diff-seg button:disabled { cursor: default; opacity: .5; }
.diff-seg button[aria-pressed=true]:disabled { opacity: 1; }
.diff-note { margin: 0; text-align: center; font-size: 12px; color: rgba(243,233,210,.55); }
.diff-chip { display: inline-block; margin-left: .6em; padding: .1em .6em; border-radius: 99px; font-size: .92em; letter-spacing: .04em; font-weight: 700; vertical-align: .05em;
  color: #fbf3e2; background: rgba(255,180,105,.28); box-shadow: 0 0 0 1px rgba(255,180,105,.55) inset; }
.diff-chip.d-mild { background: rgba(243,217,160,.24); box-shadow: 0 0 0 1px rgba(243,217,160,.6) inset; }
.diff-chip.d-spicy { background: rgba(194,38,58,.55); box-shadow: 0 0 0 1px rgba(255,120,130,.6) inset; }
.res-kicker .diff-chip { letter-spacing: .06em; font-size: 12px; color: var(--ink); background: rgba(255,180,105,.32); box-shadow: 0 0 0 1px rgba(168,116,42,.45) inset; }
.res-kicker .diff-chip.d-mild { background: rgba(214,190,130,.3); }
.res-kicker .diff-chip.d-spicy { color: #fff1ea; background: var(--crimson); box-shadow: none; }
.intro-diff { margin: 6px 0 0; font-size: 15px; } .intro-diff .diff-chip { margin: 0; }
.btn-ready[aria-pressed=true] { background: rgba(255,214,107,.15); box-shadow: 0 0 0 1.5px var(--gold) inset; color: var(--gold); }

/* ── 모달 ───────────────────────────────────────── */
.modals { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); pointer-events: auto;
  background: rgba(3,4,10,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s both; }
.modal { position: relative; width: min(480px, 100%); max-height: 100%; overflow-y: auto; padding: 26px 28px 22px; animation: unroll .35s cubic-bezier(.2,.8,.3,1) both; }
.modal.wide { width: min(720px, 100%); }
.modal h3 { margin: 0 0 14px; font-size: 22px; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.modal h3 .seal { width: 30px; height: 30px; font-size: 12px; }
.modal .x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink2); display: grid; place-items: center; border-radius: 50%; }
.modal .x svg { width: 22px; height: 22px; }
.modal .x:hover { background: rgba(29,26,31,.07); color: var(--crimson); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.set-row { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(29,26,31,.08); }
.set-row > span:first-child { font-size: 15px; font-weight: 700; }
.set-row output { font-size: 13px; color: var(--ink2); text-align: right; font-variant-numeric: tabular-nums; }
.set-row.seg-row { grid-template-columns: 92px 1fr; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--crimson) var(--p, 50%), rgba(29,26,31,.18) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 2px var(--crimson), 0 2px 6px rgba(0,0,0,.3); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(29,26,31,.18); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--crimson); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--crimson); background: var(--paper); }
.seg { display: flex; border-radius: 6px; box-shadow: 0 0 0 1px rgba(29,26,31,.3) inset; overflow: hidden; }
.seg button { flex: 1; border: 0; background: none; height: 38px; font-size: 14px; color: var(--ink2); padding: 0 4px; }
.seg button + button { box-shadow: -1px 0 0 rgba(29,26,31,.2); }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); font-weight: 700; }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; font-size: 14.5px; line-height: 1.65; }
.howto h4 { margin: 0 0 4px; font-size: 15px; color: var(--crimson); letter-spacing: .08em; }
.howto p { margin: 0; color: var(--ink2); }
.howto ul { margin: 0; padding: 0; list-style: none; color: var(--ink2); }
.howto li { display: flex; gap: 8px; align-items: baseline; padding: 1.5px 0; }
.howto li kbd { flex: none; }
.howto .full { grid-column: 1 / -1; }
.pause-list { display: flex; flex-direction: column; gap: 10px; }
.pause-list .btn { width: 100%; }
.pause-note { margin: 12px 0 0; font-size: 13px; color: var(--ink2); text-align: center; }
.err-text { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.6; }
/* 의견 보내기 · the rating prompt (js/ui/feedback.js) */
.fb-lead { font-size: 15px; color: var(--ink2); margin-bottom: 12px; }
.fb-kinds { margin-bottom: 10px; }
.fb-text { display: block; width: 100%; box-sizing: border-box; min-height: 120px; resize: vertical; padding: 10px 12px; border: 0; border-radius: 6px; font: inherit; font-size: 16px; line-height: 1.5;
  color: var(--ink); background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(29,26,31,.3) inset; }
.fb-text:focus { outline: none; box-shadow: 0 0 0 2px var(--crimson) inset; }
.fb-foot { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; min-height: 20px; }
.fb-count { margin-left: auto; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.fb-err { margin: 0; font-size: 13.5px; color: var(--crimson); font-weight: 700; }
.fb-err[hidden] { display: none; }
.fb-ask-modal .fb-later { display: flex; margin: 8px auto 0; color: var(--ink2); }
.fb-ask-modal .fb-later:hover { color: var(--crimson); }
.fb-row .btn { justify-self: start; }

/* ── 토스트 (메뉴 화면) ───────────────────────────── */
.toasts { position: absolute; left: 50%; bottom: calc(26px + var(--sab)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; font-size: 15px; color: var(--ink); background: var(--paper); box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: toastIn .3s cubic-bezier(.3,1.4,.5,1) both; white-space: nowrap; }
.toast.err { background: var(--crimson); color: #fff3ee; }
.toast.out { animation: fadeOut .35s both; }

/* ── 결과 ───────────────────────────────────────── */
.scr-result { align-items: center; justify-content: center; padding: calc(14px + var(--sat)) calc(16px + var(--sar)) calc(14px + var(--sab)) calc(16px + var(--sal));
  background: radial-gradient(80% 80% at 50% 40%, rgba(11,13,26,.55), rgba(3,4,10,.92)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .6s both; }
.res-card { position: relative; width: min(980px, 100%); max-height: 100%; overflow-y: auto; display: grid; grid-template-columns: 340px 1fr; gap: 0; padding: 0; animation: unroll .6s .1s cubic-bezier(.2,.8,.3,1) both; }
.res-left { padding: 26px 24px 22px; border-right: 1px solid rgba(120,85,40,.22); display: flex; flex-direction: column; gap: 14px; position: relative; }
.res-right { padding: 24px 26px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.res-kicker { margin: 0; font-size: 13px; letter-spacing: .25em; color: var(--ink2); }
.res-head { padding-right: 84px; margin: -4px 0 0; font-family: var(--brush); font-weight: 400; font-size: 64px; line-height: 1; color: var(--ink); }
.no-brush .res-head { font-family: var(--serif); font-weight: 800; font-size: 44px; }
.res-card.lose .res-head { color: var(--crimson2); }
.res-meta { display: flex; gap: 16px; font-size: 14px; color: var(--ink2); flex-wrap: wrap; }
.res-meta b { display: block; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank { position: absolute; top: 20px; right: 20px; width: 92px; height: 92px; font-size: 52px; flex-direction: column; opacity: 0; }
.rank small { display: block; font-size: 11px; letter-spacing: .1em; margin-top: 2px; font-weight: 700; }
.rank.slam { animation: slam .55s cubic-bezier(.5,0,.6,1.6) forwards; }
.rank-word { font-size: 14px; color: var(--crimson); font-weight: 700; margin-top: -6px; }
.ghost-card { display: flex; gap: 12px; padding: 14px; border-radius: 6px; background: linear-gradient(160deg, #141834, #0b0d1a); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(223,243,255,.15), 0 8px 20px rgba(0,0,0,.25); animation: rise .5s 1.1s both; }
.ghost-card + .ghost-card { animation-delay: 1.3s; }
.ghost-card .gsvg { width: 54px; flex: none; color: var(--ghost); filter: drop-shadow(0 0 10px rgba(223,243,255,.4)); }
.ghost-card small { font-size: 12px; color: rgba(223,243,255,.6); letter-spacing: .12em; }
.ghost-card h4 { margin: 0; font-size: 19px; color: var(--ghost); }
.ghost-card p { margin: 3px 0 0; font-size: 13px; line-height: 1.55; color: rgba(243,233,210,.8); }
.ghost-card .counter { margin-top: 6px; font-size: 13px; color: var(--gold); }
.prows { display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 6px; background: rgba(29,26,31,.045); box-shadow: inset 0 0 0 1px rgba(29,26,31,.08); animation: rise .45s both; }
.prow.me { background: rgba(255,180,105,.14); }
.prow .chibi-head { width: 52px; height: 47px; }
.prow-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prow-name { font-size: 17px; font-weight: 700; }
.ptitle { font-size: 12.5px; font-weight: 700; color: #fff4ea; background: var(--crimson); padding: 2px 9px 2px 8px; border-radius: 3px; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%); padding-right: 14px; }
.pstate { font-size: 12.5px; color: var(--ink3); }
.pstate.ok { color: #2f6b3e; font-weight: 700; }
.pstats { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.pstats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.res-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; align-items: center; position: sticky; bottom: -22px; padding-top: 14px; z-index: 2; margin-bottom: -22px; padding-bottom: 22px;
  background: linear-gradient(rgba(233,218,188,0), rgba(233,218,188,.96) 16px); }
.res-actions .btn { flex: 1; }
.res-wait { flex: 1; text-align: center; font-size: 14px; color: var(--ink2); margin: 0; padding: 12px; }
/* 오늘 밤의 명장면 */
.hl { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px dashed rgba(120,85,40,.3); }
.hl .res-kicker { color: var(--crimson); }
.hl-row { display: flex; align-items: center; gap: 10px; animation: hlIn .6s cubic-bezier(.2,.9,.3,1.2) both; }
.hl-face { flex: none; width: 40px; height: 36px; }
.hl-face .chibi-head { width: 40px; height: 36px; }
.hl-row p { margin: 0; font-size: 17px; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.res-actions .btn-line { background: var(--paper); }
.hl-row p b { color: var(--crimson); background: linear-gradient(transparent 62%, rgba(194,38,58,.16) 62%); padding: 0 1px; }
.hl-row.me p { font-weight: 700; }
.btn-share { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 4px; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--crimson); }
.btn-share svg { width: 19px; height: 19px; }
.btn-share:hover { color: var(--crimson2); text-decoration: underline; text-underline-offset: 4px; }
.share-modal { width: min(400px, 100%); }
.share-frame { position: relative; margin: 0 auto; width: min(100%, calc((100dvh - 250px) * 9 / 16), 300px); aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #0b0d1a; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.share-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--paper); font-size: 14px; text-align: center; padding: 16px; }
.share-wait .conn-lantern { width: 44px; height: 44px; }
.share-img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s; -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; pointer-events: auto; }
.share-frame.ready .share-img { opacity: 1; }
.share-note { margin: 10px 0 0; font-size: 13px; color: var(--ink2); text-align: center; }

/* ── 게임 HUD ───────────────────────────────────── */
.hud { position: absolute; inset: 0; pointer-events: none; font-size: 15px; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.6); }
.hud-tl { position: absolute; top: calc(16px + var(--sat)); left: calc(18px + var(--sal)); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tal { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; background: linear-gradient(90deg, rgba(8,9,20,.7), rgba(8,9,20,.25)); }
.tal-ic { width: 20px; height: 33px; filter: drop-shadow(0 0 6px rgba(255,214,107,.45)); transition: transform .2s; }
.tal-n { font: 700 24px/1 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; min-width: 1ch; display: inline-block; }
.tal-d { font-size: 16px; color: rgba(243,233,210,.6); }
.tal-l { font-size: 12.5px; color: rgba(243,233,210,.6); margin-left: 4px; letter-spacing: .06em; }
/* tonight's find (2026-11-27): its icon sits in the talisman's box; +n = finds in my hands, not counted yet (a night whose find is brought somewhere) */
.tal-ic svg { width: 100%; height: 100%; display: block; }
.tal-c { margin-left: 2px; padding: 2px 7px; border-radius: 999px; font: 700 13px/1 var(--serif); color: #1a1408; background: var(--gold); box-shadow: 0 0 10px rgba(255,214,107,.5); }
.tal-c[hidden] { display: none; }
.tal.tick .tal-n { animation: tick .6s cubic-bezier(.3,1.8,.5,1); }
.tal.tick .tal-ic { animation: talFly .6s cubic-bezier(.3,1.6,.5,1); }
.tal.tick { animation: talGlow .9s ease-out; }
.tal.done .tal-n, .tal.done .tal-d { color: var(--gold); }
.tal.done { box-shadow: 0 0 0 1px rgba(255,214,107,.5) inset, 0 0 22px rgba(255,214,107,.25); }
/* 부활 가능 횟수 — 부적 카운터와 다르게: 작고, 혼불 빛(청백), 각진 쪽지 */
.rvl { display: flex; align-items: center; gap: 6px; margin-top: -4px; padding: 3px 10px 3px 7px; border-radius: 6px; font-size: 12.5px; color: var(--ghost);
  background: rgba(8,9,20,.62); box-shadow: 0 0 0 1px rgba(223,243,255,.28) inset; }
.rvl[hidden] { display: none; }
.rvl-ic { width: 15px; height: 15px; color: var(--ghost); filter: drop-shadow(0 0 5px rgba(223,243,255,.6)); }
.rvl-ic svg { width: 100%; height: 100%; display: block; }
.rvl-l { color: rgba(223,243,255,.78); letter-spacing: .02em; }
.rvl-n { font: 700 15px/1 var(--serif); color: #fff; font-variant-numeric: tabular-nums; }
.rvl.none { color: #ffd2d7; background: rgba(60,6,14,.66); box-shadow: 0 0 0 1px rgba(255,90,106,.6) inset; }
.rvl.none .rvl-ic { color: rgba(223,243,255,.35); filter: grayscale(1); }
.rvl.none .rvl-l { color: #ffd2d7; font-weight: 700; }
.rvl.used { animation: rvlUsed 1.4s cubic-bezier(.3,1.4,.5,1); transform-origin: left center; }
.rvl.used .rvl-ic { animation: rvlFly 1.1s ease-out; }
.feed { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; max-width: min(360px, 40vw); }
.feed-item { font-size: 14px; padding: 4px 12px 4px 10px; border-left: 2px solid var(--lantern); background: linear-gradient(90deg, rgba(8,9,20,.65), rgba(8,9,20,0)); animation: feedIn .35s cubic-bezier(.2,.9,.3,1.2) both; }
.feed-item.bad { border-color: var(--danger); color: #ffd8dc; }
.feed-item.good { border-color: #9fe0a8; }
.feed-item.gold { border-color: var(--gold); color: #fff0c2; }
.feed-item.out { animation: fadeOut .5s both; }
.hud-tr { position: absolute; top: calc(14px + var(--sat)); right: calc(16px + var(--sar)); display: flex; gap: 10px; align-items: flex-start; }
.mates { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mate { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 12px; border-radius: 999px; background: linear-gradient(270deg, rgba(8,9,20,.72), rgba(8,9,20,.25)); font-size: 14px; transition: opacity .3s; }
.mate .chibi-head { width: 30px; height: 27px; border-radius: 50%; background: rgba(255,180,105,.18); }
.mate-st { font-size: 12px; color: rgba(243,233,210,.6); }
.mate[data-s=hidden] .mate-st { color: #a9c7ff; }
.mate[data-s=downed] { background: linear-gradient(270deg, rgba(120,10,25,.75), rgba(120,10,25,.2)); animation: pulseBad 1.2s infinite; }
.mate[data-s=downed] .mate-st { color: #ffd2d7; font-weight: 700; }
.mate[data-s=downed] .chibi-head { filter: grayscale(1) brightness(.7); }
.mate[data-s=escaped] { opacity: .75; }
.mate[data-s=escaped] .mate-st { color: #9fe0a8; }
.mate.off { opacity: .4; }
.icon-btn { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(8,9,20,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.2) inset; color: var(--paper); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { box-shadow: 0 0 0 1px var(--lantern) inset; color: var(--lantern); }
.hud-bc { position: absolute; left: 50%; bottom: calc(22px + var(--sab)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 420px; max-width: 60vw; }
.prompt { display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 8px; border-radius: 999px; background: rgba(8,9,20,.7); box-shadow: 0 0 0 1px rgba(255,214,107,.35) inset, 0 0 26px rgba(255,180,105,.15); font-size: 16px; font-weight: 700; animation: popIn .25s cubic-bezier(.3,1.6,.5,1) both; white-space: nowrap; }
.prompt[hidden] { display: none; }
.prompt.locked kbd { font-size: 13px; background: rgba(194,38,58,.25); color: #ffd8dc; box-shadow: 0 0 0 1px rgba(255,120,130,.55) inset; }
.prompt.locked span:last-child { font-weight: 400; font-size: 14.5px; }
.prompt-key { position: relative; width: 38px; height: 38px; display: grid; place-items: center; }
.prompt-key kbd { font-size: 15px; width: 30px; height: 30px; background: rgba(255,214,107,.16); color: var(--gold); box-shadow: 0 0 0 1px rgba(255,214,107,.6) inset; }
.prompt-key .ring { position: absolute; inset: 0; width: 38px; height: 38px; transform: rotate(-90deg); }
.prompt-key .ring circle { fill: none; stroke-width: 3; }
.prompt-key .ring .bg { stroke: rgba(255,214,107,.18); }
.prompt-key .ring .fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 107; stroke-dashoffset: 107; }
.prompt-key svg.tic { width: 22px; height: 22px; color: var(--gold); }
.prompt small { font-weight: 400; font-size: 13px; color: rgba(243,233,210,.6); }
.stam { width: 160px; height: 5px; border-radius: 3px; background: rgba(8,9,20,.7); box-shadow: 0 0 0 1px rgba(243,233,210,.15); overflow: hidden; transition: opacity .4s; }
.stam i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, #ffcf8a, var(--lantern)); border-radius: 3px; }
.stam.low i { background: var(--danger); }
.stam.hide { opacity: 0; }
.breath { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 18px 12px; border-radius: 12px; background: rgba(8,9,20,.72); box-shadow: 0 0 0 1px rgba(169,199,255,.3) inset; }
.breath[hidden] { display: none; }
.breath-t { font-size: 14px; color: #cfe0ff; display: flex; gap: 8px; align-items: center; }
.breath-bar { width: 200px; height: 6px; border-radius: 3px; background: rgba(169,199,255,.15); overflow: hidden; }
.breath-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8fb4ff, #dff3ff); transform-origin: left; }
.breath.urgent { box-shadow: 0 0 0 1.5px var(--danger) inset, 0 0 30px rgba(255,90,106,.35); animation: pulseBad .8s infinite; }
.breath.urgent .breath-t { color: #ffd2d7; font-weight: 700; }
.breath.holding .breath-t { color: #fff; }
.hud-bl { position: absolute; left: calc(18px + var(--sal)); bottom: calc(18px + var(--sab)); display: flex; gap: 8px; }
.slot { position: relative; width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; background: rgba(8,9,20,.62); box-shadow: 0 0 0 1px rgba(243,233,210,.16) inset; color: rgba(243,233,210,.85); }
.slot svg { width: 26px; height: 26px; }
.slot kbd { position: absolute; left: -5px; top: -6px; font-size: 11px; min-width: 20px; height: 20px; background: rgba(8,9,20,.9); }
.slot .cnt { position: absolute; right: 5px; bottom: 2px; font-size: 13px; font-weight: 700; }
.slot.on { color: var(--lantern); box-shadow: 0 0 0 1px rgba(255,180,105,.55) inset, 0 0 18px rgba(255,180,105,.2); }
.slot.off { color: rgba(243,233,210,.35); }
.slot.empty { opacity: .45; }
.slot.full { color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.5) inset, 0 0 16px rgba(255,255,255,.15); }
.slot .cd { position: absolute; inset: 0; border-radius: 10px; background: conic-gradient(rgba(243,233,210,.2) calc(var(--cd, 0) * 360deg), transparent 0); }
.slot-l { position: absolute; bottom: -19px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: rgba(243,233,210,.55); white-space: nowrap; }
.hud-br { position: absolute; right: calc(18px + var(--sar)); bottom: calc(18px + var(--sab)); display: flex; gap: 6px; }
.emo { pointer-events: auto; height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 999px; background: rgba(8,9,20,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.15) inset; font-size: 13px; display: flex; align-items: center; gap: 6px; color: rgba(243,233,210,.85); }
.emo kbd { font-size: 10px; min-width: 18px; height: 18px; }
.emo:hover { box-shadow: 0 0 0 1px var(--lantern) inset; }
.anchors { position: absolute; inset: 0; overflow: hidden; }
.anc { position: absolute; left: 0; top: 0; will-change: transform; }
.tag { transform: translate(-50%, -100%); font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(8,9,20,.5); white-space: nowrap; color: var(--paper); }
.tag[data-s=downed] { color: #ffd2d7; background: rgba(120,10,25,.6); }
.tag[data-s=hidden] { opacity: .6; }
.pin { transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; color: var(--gold); animation: pinIn .4s cubic-bezier(.3,1.7,.5,1) both; }
.pin svg { width: 26px; height: 26px; filter: drop-shadow(0 0 8px rgba(255,214,107,.8)); }
.pin span { font-size: 12px; font-weight: 700; white-space: nowrap; }
.pin.shout { color: #ffc6a0; }
.pin::after { content: ''; position: absolute; bottom: -6px; width: 34px; height: 12px; border-radius: 50%; border: 2px solid currentColor; opacity: .7; animation: ripple 1.2s infinite; }
.bubble { transform: translate(-50%, -100%); padding: 4px 12px; border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 700; text-shadow: none; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.4); animation: popIn .3s cubic-bezier(.3,1.7,.5,1) both; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--paper); }
.edge { transform: translate(-50%, -50%); width: 46px; height: 46px; display: grid; place-items: center; }
.edge .arw { position: absolute; inset: 0; display: grid; place-items: center; }
.edge .arw svg { width: 22px; height: 22px; transform: translateY(-17px); }
.edge .eic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,9,20,.75); font-size: 11px; font-weight: 700; }
.edge.down { color: var(--danger); animation: pulseBad 1s infinite; }
.edge.down .eic { box-shadow: 0 0 0 1.5px var(--danger) inset; }
/* a ping off the screen: an arrow on the edge, whose it is and how far (2026-11-27; the gate has no arrow any more — the map shows it) */
.edge.ping { color: var(--gold); animation: pinIn .4s cubic-bezier(.3,1.7,.5,1) both; }
.edge.ping .eic { box-shadow: 0 0 0 1.5px var(--gold) inset, 0 0 14px rgba(255,214,107,.45); }
.edge.ping .eic svg { width: 18px; height: 18px; }
.edge.ping .ename, .edge.ping .edist { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.edge.ping .ename { top: 100%; margin-top: -3px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.edge.ping .edist { top: 100%; margin-top: 10px; color: var(--paper); font-weight: 600; }
/* 지도 (§4): nothing stays on screen — once the team has the map, a map button under the top-right buttons (desktop: its M key under it);
   M / the button opens the hand-inked plan FULL SCREEN over the game, which goes on (she can't move while it is open: §4 "Reading the
   map"); the edge reddens as a ghost comes near (--dz: 0 … 1); M, Esc, the button or a tap anywhere closes it (ui/minimap.js) */
.mm-ico { position: absolute; top: calc(66px + var(--sat)); right: calc(16px + var(--sar)); z-index: 5; overflow: visible; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mm-ico[hidden] { display: none; }
.mm-ico.in { animation: popIn .35s cubic-bezier(.3,1.6,.5,1) both; }
.mm-ico.on { box-shadow: 0 0 0 1.5px var(--lantern) inset; color: var(--lantern); }
.mm-ico-l { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 1; color: rgba(243,233,210,.8); text-shadow: 0 1px 2px #000; white-space: nowrap; pointer-events: none; }
.mm-ico-l kbd, .mm-key kbd { display: inline-block; min-width: 15px; padding: 1px 3px; margin-right: 3px; border: 1px solid rgba(243,233,210,.5); border-radius: 3px; font: 600 10px/1.2 var(--sans, sans-serif); text-align: center; }
.mm-full { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  background: rgba(6,5,4,.86); pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; --dz: 0; }
.mm-full.on { display: flex; animation: mmFade .22s ease-out both; }
.mm-full::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: var(--dz); transition: opacity .4s;
  box-shadow: inset 0 0 60px 18px rgba(150,14,20,.9), inset 0 0 160px 40px rgba(120,10,16,.55); }
.mm-full.near::after { animation: mmBeat 1.1s ease-in-out infinite; }
@keyframes mmFade { from { opacity: 0; } }
@keyframes mmBeat { 0%, 100% { opacity: var(--dz); } 18% { opacity: calc(var(--dz) * .55); } 32% { opacity: var(--dz); } 46% { opacity: calc(var(--dz) * .7); } }
.mm-card { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; max-height: 100%; }
.mm-sheet { position: relative; height: min(calc(100vh - 150px), calc((100vw - 40px) / var(--ar, 1))); aspect-ratio: var(--ar, 1); border-radius: 2px 3px 2px 4px; overflow: hidden;
  transform: rotate(-.4deg); box-shadow: inset 0 0 0 1px rgba(70,46,22,.4), 0 10px 40px rgba(0,0,0,.7); animation: mmUnroll .5s cubic-bezier(.2,.8,.3,1) both; }
.mm-sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@keyframes mmUnroll { from { clip-path: inset(0 0 0 100%); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.mm-title { order: -1; font-family: var(--brush, serif); font-weight: 400; font-size: 24px; line-height: 1; color: var(--paper); letter-spacing: .1em; }
.mm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: 13px; color: rgba(243,233,210,.86); }
.mm-still { font-size: 12.5px; color: rgba(255,190,170,.82); }
.mm-key { font-size: 11.5px; line-height: 1; color: rgba(243,233,210,.7); white-space: nowrap; }
.mm-l i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.mm-l-glyph { display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -3px; }
.mm-l-me i { background: #b8262f; box-shadow: 0 0 0 2px rgba(184,38,47,.45); }
.mm-l-friend i { background: #4b5f9a; border: 1.5px solid #ecdfbf; }
.mm-l-spawn i { border: 2px solid #ecdfbf; background: radial-gradient(circle, #ecdfbf 0 2px, transparent 2.5px); }
.mm-l-gate i { border-radius: 2px; background: #b8262f; }
.is-touch .mm-ico { top: calc(58px + var(--sat)); right: calc(12px + var(--sar)); }
.is-touch .mm-ico-l { font-size: 10px; }
/* a phone (landscape, short): the title and the words beside the plan, not above and under it */
.is-touch .mm-card { flex-direction: row; align-items: center; gap: 14px; }
@supports (height: 100dvh) { .mm-sheet { height: min(calc(100dvh - 150px), calc((100vw - 40px) / var(--ar, 1))); } }
.is-touch .mm-sheet { height: min(calc(100vh - 24px - var(--sat) - var(--sab)), calc((100vw - 220px) / var(--ar, 1))); }
@supports (height: 100dvh) { .is-touch .mm-sheet { height: min(calc(100dvh - 24px - var(--sat) - var(--sab)), calc((100vw - 220px - var(--sal) - var(--sar)) / var(--ar, 1))); } }
.mm-side { display: contents; } /* (desktop: its title above the plan, its words under it) */
.is-touch .mm-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 180px; }
.is-touch .mm-title { font-size: 19px; }
.is-touch .mm-legend { flex-direction: column; align-items: flex-start; font-size: 11.5px; gap: 3px; }
.is-touch .mm-still { font-size: 11px; }
.hud:has(.mm-full.on) .coach { visibility: hidden; } /* (the map is read alone) */
/* a ghost's own HUD piece (its set's manifest ghost.hud: client/css/sets/<set>.css styles the inside): top centre, clear of the
   talismans (left), the friends (right) and the banner below; on a phone it steps down while a coach card holds the top */
.hud-ghost { position: absolute; left: 50%; top: calc(12px + var(--sat)); transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: min(560px, calc(100% - 420px)); pointer-events: none; }
.hud-ghost:empty, .gh-hud:empty { display: none; }
.is-touch .hud-ghost { max-width: calc(100% - 300px); }
/* a phone: the ghost's HUD piece sits in a top-centre column (hud.js .hud-tc); the coach card is down in the band between the joystick and
   the buttons (below: it covers neither what lies ahead of her — the camera looks north — nor a control it talks about) */
.hud-tc { position: absolute; left: 50%; top: calc(12px + var(--sat)); transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: max-content; max-width: calc(100% - 300px); pointer-events: none; }
.hud-tc .hud-ghost { position: static; transform: none; left: auto; top: auto; bottom: auto; max-width: 100%; }
.banner { position: absolute; left: 50%; top: calc(13% + var(--sat)); transform: translateX(-50%); text-align: center; pointer-events: none; white-space: nowrap; }
.banner .b-in { animation: bannerIn 4.2s cubic-bezier(.2,.7,.2,1) both; }
.banner h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: .08em; color: var(--paper); text-shadow: 0 0 20px rgba(0,0,0,.9), 0 2px 4px #000; }
.banner p { margin: 4px 0 0; font-size: 15px; color: rgba(243,233,210,.75); }
/* a ghost's line ("내가 모를 줄 알았어?"): low on the screen, bigger the closer she is */
.ghost-say { position: absolute; left: 50%; bottom: calc(27% + var(--sab, 0px)); transform: translateX(-50%); width: min(88vw, 720px); text-align: center; pointer-events: none; z-index: 6; }
.ghost-say span { display: inline-block; font-family: var(--brush); font-size: calc(34px + 18px * var(--near, 0)); line-height: 1.15; color: #ffb4ac; opacity: 0;
  text-shadow: 0 0 18px rgba(255,40,40,.75), 0 0 4px #000, 0 2px 6px #000; animation: ghostSay 2.8s cubic-bezier(.2,.7,.2,1) both; }
.ghost-say span.found { color: #ff5a52; animation-duration: 1.9s; }
.no-brush .ghost-say span { font-family: var(--serif); font-weight: 800; font-size: calc(22px + 12px * var(--near, 0)); }
@keyframes ghostSay { 0% { opacity: 0; transform: scale(.94); filter: blur(5px); } 14% { opacity: 1; transform: none; filter: none; } 72% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); filter: blur(4px); } }
.banner .gold h2 { color: var(--gold); text-shadow: 0 0 26px rgba(255,214,107,.55), 0 2px 4px #000; }
.banner .night h2 { font-family: var(--brush); font-weight: 400; font-size: 54px; letter-spacing: .04em; }
.no-brush .banner .night h2 { font-family: var(--serif); font-weight: 800; font-size: 38px; }
.banner .b-in::before, .banner .b-in::after { content: ''; display: block; margin: 8px auto; width: 200px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,214,107,.6), transparent); }
.downed-ov { position: absolute; inset: 0; display: none; justify-content: center; pointer-events: none;
  background: radial-gradient(70% 70% at 50% 50%, transparent 40%, rgba(40,60,110,.35)); }
.downed-ov.on { display: flex; animation: fade .8s both; }
.downed-box { position: absolute; top: calc(70px + var(--sat)); text-align: center; max-width: 520px; padding: 0 20px; }
.downed-box h2 { margin: 0; font-size: 26px; color: var(--ghost); letter-spacing: .08em; text-shadow: 0 0 20px rgba(140,180,255,.6), 0 2px 4px #000; }
.downed-box p { margin: 6px 0 0; font-size: 14.5px; color: rgba(223,243,255,.82); line-height: 1.6; }
.downed-box .solo { color: var(--gold); }
/* out of the gate: watching a friend still inside (hud.js watchBar) */
.watch-bar { display: none; position: absolute; left: 50%; bottom: calc(34px + var(--sab)); transform: translateX(-50%); align-items: center;
  justify-content: center; gap: 12px; padding: 8px 10px; border-radius: 40px; background: rgba(11,13,26,.5); pointer-events: auto; }
.watch-bar.on { display: flex; }
.watch-bar .w-mid { min-width: 120px; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.watch-bar small { font-size: 11.5px; letter-spacing: .14em; color: rgba(223,243,255,.6); }
.watch-bar .w-name { font-size: 17px; color: #fff3dd; text-shadow: 0 1px 3px #000; }
.watch-bar .w-st { font-size: 12px; color: var(--gold); min-height: 1em; }
.watch-bar .w-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(243,233,210,.35); background: rgba(11,13,26,.55);
  color: #f3e9d2; font-size: 15px; cursor: pointer; }
.watch-bar .w-btn:active { transform: scale(.94); }
.watch-bar .w-btn.gone { visibility: hidden; }
.coach { position: absolute; left: calc(18px + var(--sal)); bottom: calc(108px + var(--sab)); max-width: 300px; padding: 12px 16px 12px 14px; display: none; gap: 10px; align-items: flex-start; font-size: 14.5px; text-shadow: none; pointer-events: none; }
.coach.on.sup { display: none; }
.coach.on { display: flex; animation: unroll .4s cubic-bezier(.2,.8,.3,1) both; }
.coach .seal { color: #fff1ea; flex: none; width: 30px; height: 30px; font-size: 13px; }
.coach b { display: block; font-size: 15px; margin-bottom: 2px; }
.coach span { color: var(--ink2); line-height: 1.55; display: block; }
.coach .step { position: absolute; right: 10px; top: 8px; font-size: 11px; color: var(--ink3); }

/* 밤 시작 카드 (결과→다음 밤 전환 막 겸용) */
.intro { position: absolute; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; text-align: center; pointer-events: auto; cursor: pointer;
  padding: calc(20px + var(--sat)) calc(24px + var(--sar)) calc(20px + var(--sab)) calc(24px + var(--sal));
  background: radial-gradient(70% 60% at 50% 50%, rgba(11,13,26,.86), rgba(3,4,10,.97)); text-shadow: 0 2px 12px #000; }
.intro.on { display: flex; animation: fade .25s both; }
.intro.out { animation: introOut .7s ease forwards; pointer-events: none; }
.intro-in { display: flex; flex-direction: column; align-items: center; max-width: 560px; animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.intro-kick { margin: 0; font-size: 13px; letter-spacing: .32em; color: rgba(255,214,160,.6); }
.intro h2 { margin: 2px 0 0; font-family: var(--brush); font-weight: 400; font-size: clamp(64px, 11vw, 104px); line-height: 1.1; color: #fbf3e2;
  text-shadow: 0 0 22px rgba(255,180,105,.4), 0 0 70px rgba(255,140,80,.2), 0 3px 0 rgba(0,0,0,.5); }
.no-brush .intro h2 { font-family: var(--serif); font-weight: 800; letter-spacing: .08em; font-size: clamp(44px, 8vw, 70px); }
.intro-rule { width: 220px; height: 1px; margin: 12px 0 14px; background: linear-gradient(90deg, transparent, rgba(255,214,107,.7), transparent); }
.intro-goal { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--paper); }
.intro-goal b { color: var(--gold); }
.intro-tal { width: 18px; height: 30px; flex: none; filter: drop-shadow(0 0 8px rgba(255,214,107,.6)); }
.intro-find { margin: 8px 0 0; font-size: 15px; color: rgba(255,226,150,.92); max-width: 34em; text-align: center; text-wrap: balance; }
.intro-find[hidden] { display: none; }
.intro-tip { margin: 22px 0 0; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 999px; font-size: 14.5px; color: rgba(243,233,210,.82);
  background: rgba(243,233,210,.06); box-shadow: inset 0 0 0 1px rgba(243,233,210,.12); text-align: left; text-shadow: none; animation: rise .6s .35s both; }
.intro-tip .seal { flex: none; width: 26px; height: 26px; font-size: 12px; }
.intro-skip { margin: 18px 0 0; font-size: 12px; color: rgba(243,233,210,.38); letter-spacing: .06em; animation: fade .5s 1s both; }
/* 늦게 들어온 사람 안내 · 연결 상태 */
.late-note { position: absolute; z-index: 35; left: 50%; top: calc(14px + var(--sat)); transform: translateX(-50%); display: flex; gap: 12px; align-items: center; width: max-content; max-width: calc(100% - 32px);
  padding: 10px 18px 10px 12px; border-radius: 10px; color: var(--ink); background: var(--paper); box-shadow: 0 12px 30px rgba(0,0,0,.5); pointer-events: none; animation: unroll .4s both; }
.late-note .seal { width: 34px; height: 34px; font-size: 15px; flex: none; }
.late-note b { display: block; font-size: 15.5px; }
.late-note span:not(.seal) { display: block; font-size: 13.5px; color: var(--ink2); }
.late-note.in-game { display: none; }
.net-pill { position: absolute; z-index: 70; left: 50%; top: calc(10px + var(--sat)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; min-height: 40px;
  border-radius: 999px; font-size: 14px; color: #ffe3e6; background: rgba(60,8,18,.88); box-shadow: 0 0 0 1px rgba(255,90,106,.5) inset, 0 8px 24px rgba(0,0,0,.5); pointer-events: auto; white-space: nowrap; animation: toastIn .3s both; }
.net-pill .btn-text { min-height: 32px; padding: 0 12px; border-radius: 999px; color: #fff; background: rgba(255,255,255,.12); font-weight: 700; font-size: 13.5px; }
#ui[data-screen=lobby] .net-pill, #ui[data-screen=result] .net-pill { top: calc(64px + var(--sat)); }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: pulseBad 1s infinite; flex: none; }
.net-pill > span { padding-right: 8px; }
.conn-acts { display: flex; gap: 10px; }
.err-sub { margin-top: 8px; font-size: 14px; color: var(--ink2); }
.banner .omen h2 { font-size: 26px; font-weight: 700; letter-spacing: .18em; color: #cfe0ff; text-shadow: 0 0 24px rgba(120,160,255,.55), 0 0 4px rgba(194,38,58,.6), 0 2px 4px #000; }
.banner .omen { animation-duration: 3.6s; }
.banner .omen::before, .banner .omen::after { background: linear-gradient(90deg, transparent, rgba(194,38,58,.7), transparent); }

/* 모바일 터치 컨트롤 */
.touch { position: absolute; inset: 0; display: none; pointer-events: none; }
.is-touch .touch { display: block; }
.joy-zone { position: absolute; left: 0; bottom: 0; width: 46%; height: 72%; pointer-events: auto; touch-action: none; }
.joy { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; left: calc(96px + var(--sal)); top: calc(100% - 92px - var(--sab));
  background: radial-gradient(circle, rgba(8,9,20,.15) 40%, rgba(8,9,20,.45)); box-shadow: 0 0 0 1.5px rgba(243,233,210,.25) inset; transition: opacity .2s; opacity: .55; }
.joy.on { opacity: 1; transition: none; }
.joy.run { box-shadow: 0 0 0 2px var(--lantern) inset, 0 0 26px rgba(255,180,105,.35); }
.joy-run { position: absolute; inset: -2px; border-radius: 50%; border: 2px dashed rgba(255,180,105,.0); }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff6e6, #e6d2ad); box-shadow: 0 4px 14px rgba(0,0,0,.5); will-change: transform; }
.joy.run .joy-knob { background: radial-gradient(circle at 40% 35%, #fff2d6, var(--lantern)); }
.joy-hint { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; font-size: 11.5px; color: rgba(243,233,210,.6); white-space: nowrap; }
.joy.on .joy-hint { opacity: 0; }
.acts { position: absolute; right: calc(18px + var(--sar)); bottom: calc(16px + var(--sab)); width: 262px; height: 200px; pointer-events: none; }
.tb { position: absolute; pointer-events: auto; touch-action: none; border: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(8,9,20,.6); color: var(--paper); box-shadow: 0 0 0 1.5px rgba(243,233,210,.28) inset, 0 6px 16px rgba(0,0,0,.35); font-size: 11.5px; font-weight: 700; transition: transform .08s, background .15s; }
.tb svg { width: 24px; height: 24px; }
.tb.down { transform: scale(.92); background: rgba(255,180,105,.3); }
.tb-main { right: 0; bottom: 0; width: 92px; height: 92px; font-size: 14px; }
.tb-main svg { width: 32px; height: 32px; }
.tb-main.ready { background: rgba(194,38,58,.78); box-shadow: 0 0 0 2px rgba(255,214,107,.7) inset, 0 0 26px rgba(255,140,80,.35); }
.tb-main.breath { background: rgba(60,90,170,.75); box-shadow: 0 0 0 2px #cfe0ff inset; }
.tb-main.dim { opacity: .6; }
.tb-main .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.tb-main .ring circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; }
.tb-s { width: 58px; height: 58px; }
.tb-lantern { right: 104px; bottom: 6px; }
.tb-salt { right: 92px; bottom: 74px; }
.tb-shout { right: 30px; bottom: 108px; }
.tb-exit { right: 104px; bottom: 6px; display: none; }
.tb-ping { right: 166px; bottom: 96px; width: 52px; height: 52px; font-size: 10.5px; }
.tb-ping svg { width: 20px; height: 20px; }
.tb-main[data-mode="ping"].pcd { opacity: .5; }
/* 달리기 (누르고 있기): 큰 버튼, 행동 버튼 묶음의 왼쪽 끝. 고리 = 스태미나 */
.tb-run { right: 178px; bottom: 2px; width: 80px; height: 80px; font-size: 13px; }
.tb-run svg { width: 30px; height: 30px; }
.tb-run .ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
.tb-run .ring circle { fill: none; stroke-width: 5; }
.tb-run .ring .bg { stroke: rgba(243,233,210,.14); }
.tb-run .ring .fg { stroke: var(--lantern); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke .2s; }
.tb-run.low .ring .fg { stroke: var(--danger); }
.tb-run.on { color: #fff2d6; background: rgba(255,180,105,.32); box-shadow: 0 0 0 1.5px rgba(255,180,105,.8) inset, 0 0 22px rgba(255,180,105,.35); }
.tb-run.tired { opacity: .45; color: rgba(243,233,210,.7); background: rgba(8,9,20,.6); box-shadow: 0 0 0 1.5px rgba(255,90,106,.45) inset; }
.tb-run.tired .ring .fg { stroke: var(--danger); }
.acts.hidden-mode .tb-run, .acts.ghost-mode .tb-run { display: none; }
.tb.on { color: var(--lantern); box-shadow: 0 0 0 1.5px rgba(255,180,105,.7) inset, 0 0 16px rgba(255,180,105,.25); }
.tb.empty { opacity: .4; }
.tb .cd { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(243,233,210,.22) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.acts.hidden-mode .tb-lantern, .acts.hidden-mode .tb-salt, .acts.hidden-mode .tb-shout, .acts.hidden-mode .tb-ping { display: none; }
.acts.hidden-mode .tb-exit { display: flex; }
.acts.ghost-mode .tb-lantern, .acts.ghost-mode .tb-salt, .acts.ghost-mode .tb-shout, .acts.ghost-mode .tb-ping { display: none; }
.acts.gone { display: none; }
.emo-pop { position: absolute; right: 0; top: 52px; display: none; flex-direction: column; gap: 6px; pointer-events: auto; }
.emo-pop.on { display: flex; animation: rise .2s both; }
.emo-pop .emo { height: 40px; font-size: 14px; padding: 0 14px; }
.is-touch .hud-bl, .is-touch .hud-br { display: none; }
.is-touch .hud-bc { bottom: calc(14px + var(--sab)); }
.is-touch .coach { left: calc(166px + var(--sal)); right: calc(292px + var(--sar)); top: auto; bottom: calc(26px + var(--sab)); transform: none; width: fit-content; max-width: 420px; margin: 0 auto;
  padding: 7px 12px 7px 10px; font-size: 12.5px; opacity: .96; } /* (centred in the band; above the stamina bar) */
.is-touch .hud:has(.breath:not([hidden])) .coach { bottom: calc(96px + var(--sab)); right: calc(126px + var(--sar)); } /* hidden: above the breath box, beside the breath button (the lantern, salt and shout are gone) */
.is-touch .coach .seal { width: 24px; height: 24px; font-size: 11px; }
.is-touch .coach .step { display: none; }
.is-touch .coach b { font-size: 13px; margin-bottom: 0; }
/* 터치: 손가락 크기(44px+), 길게 누르기·더블탭 확대·당겨서 새로고침 막기 */
.is-touch #ui { touch-action: manipulation; }
.is-touch .seg button { height: 44px; }
.is-touch .btn-sm { min-height: 44px; }
.is-touch .dice { min-height: 44px; }
.is-touch .chip { height: 44px; }
.is-touch .sw::before { content: ''; position: absolute; inset: -8px; }
.is-touch .emo-pop .emo { height: 44px; }
.is-touch .home-icons .btn-text { min-height: 44px; }
.scr-title, .scr-lobby, .res-card, .modal { overscroll-behavior: contain; }
html.is-touch, html.is-touch body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.rotate { position: absolute; inset: 0; z-index: 80; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; pointer-events: auto; text-align: center; padding: 30px;
  background: radial-gradient(60% 50% at 50% 45%, #1a1733, var(--night)); }
.rotate .phone { width: 64px; height: 104px; border-radius: 12px; border: 3px solid var(--paper); position: relative; animation: rot 2.4s ease-in-out infinite; }
.rotate .phone::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 16px; height: 3px; margin-left: -8px; border-radius: 2px; background: var(--paper); }
.rotate p { margin: 0; font-size: 19px; }
.rotate small { color: rgba(243,233,210,.6); font-size: 14px; }
.rotate .rot-lock { margin-top: -8px; font-size: 12.5px; color: rgba(243,233,210,.42); }
@media (orientation: portrait) { .is-touch #ui[data-screen=game] .rotate, #ui.is-touch[data-screen=game] .rotate { display: flex; } }

/* ── 반응형 ──────────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) {
  /* the home screen: a slim top bar, logo + ways left, her character right (the foot's legal link in the bottom corner) */
  .home-top { padding: calc(6px + var(--sat)) calc(14px + var(--sar)) 0 calc(14px + var(--sal)); }
  .home-body { column-gap: 28px; grid-template-columns: minmax(0, 360px) minmax(0, 320px); padding: 4px calc(20px + var(--sar)) calc(6px + var(--sab)) calc(24px + var(--sal)); }
  .home-ways { margin-top: 10px; gap: 7px; width: 100%; max-width: 340px; }
  .way-code-box { gap: 6px; }
  .way-code { min-height: 36px; padding: .2em .6em; font-size: 14px; }
  .stage { height: clamp(150px, calc(100vh - 118px), 300px); }
  @supports (height: 100dvh) { .stage { height: clamp(140px, calc(100dvh - 118px - var(--inv-h, 0px)), 300px); } }
  .btn-custom { min-height: 36px; font-size: 13.5px; padding: .3em 1em; }
  .home-foot { position: absolute; left: calc(14px + var(--sal)); right: calc(10px + var(--sar)); bottom: var(--sab); min-height: 0; padding: 0; justify-content: flex-end; pointer-events: none; }
  .home-foot > * { pointer-events: auto; }
  .home-foot .game-ver { order: -1; margin: 0 auto 3px 0; align-self: flex-end; pointer-events: none; } /* (the left corner: the right one has the look and legal buttons) */
  .home > .inv-stack { margin-top: 6px; }
  .inv-card { padding: 6px 4px 6px 10px; gap: 10px; } .inv-seal { width: 34px; height: 34px; font-size: 11px; } .inv-txt p { font-size: 13.5px; } .inv-txt small { display: none; }
  .inv-join { min-height: 36px; font-size: 14px; padding: .3em .9em; }
  .maker-modal { width: min(760px, 100%); }
  .maker-modal h3 { margin-bottom: 6px; }
  .maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: center; }
  .maker-opts > .opt:first-child { margin-top: 0; }
  .maker-modal .modal-actions { margin-top: 10px; }
  .maker-modal .modal-actions .btn { flex: 0 1 240px; margin-left: auto; min-height: 40px; }
  .prof-modal { width: min(720px, 100%); }
  .prof-modal h3 { margin-bottom: 6px; }
  .prof-sheet { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: 20px; align-items: center; }
  .prof-who { gap: 10px; }
  .prof-who .prof-fig-btn { width: 88px; height: 100px; } .prof-fig, .prof-fig .chibi { width: 88px; height: 98px; }
  .prof-custom { margin-top: 6px; min-height: 34px; font-size: 13px; }
  .pr-rec { margin-top: 0; }
  .pr-tile { padding: 5px 2px 4px; } .pr-tile b { font-size: 18px; } .pr-tile > span { font-size: 11.5px; }
  .pr-nights { margin-top: 7px; gap: 4px; }
  .pr-night { padding: 2px 1px 3px; } .pr-night .stars svg { width: 12px; height: 12px; }
  .pr-note { margin-top: 5px; font-size: 11px; }
  .prof-modal .modal-actions { margin-top: 8px; }
  .prof-modal .modal-actions .btn { flex: 0 1 240px; margin-left: auto; min-height: 40px; }
  .kicker { font-size: 11.5px; }
  .logo-txt { font-size: 62px; }
  .no-logo .logo-txt { font-size: 52px; }
  .logo .seal { width: 40px; height: 40px; font-size: 15px; margin-top: 8px; }
  .tagline { display: none; }
  .btn-hero { min-height: 48px; font-size: 17px; }
  .btn { min-height: 44px; font-size: 15.5px; }
  .invite { padding: 8px 10px; } .invite .seal { width: 34px; height: 34px; font-size: 11px; } .invite p { font-size: 13px; }
  .preview { width: 104px; height: 118px; } .preview .chibi { width: 104px; height: 116px; }
  .name-input { height: 38px; font-size: 19px; }
  .opt { margin-top: 6px; } .opt > span { font-size: 11.5px; margin-bottom: 3px; }
  .chip { height: 32px; font-size: 13.5px; }
  .sw { width: 28px; height: 28px; } .swatches { gap: 8px; }
  .dice { margin-top: 2px; font-size: 13px; }
  .body-seg .chip { height: 30px; font-size: 13px; } .has-bodies .maker-top .dice { padding: 2px 0; margin-top: 4px; } /* only with the girl/boy switch */
  .title-foot { display: none; }
  .scr-lobby { padding: calc(8px + var(--sat)) calc(16px + var(--sar)) calc(8px + var(--sab)) calc(16px + var(--sal)); }
  .lobby-main { grid-template-columns: 210px 1fr; gap: 14px; padding: 6px 0; }
  .code-card { padding: 12px 12px 10px; }
  .room-code { margin: 4px 0 6px; gap: 5px; } .room-code span { width: 36px; height: 44px; font-size: 28px; }
  .code-card .btn { margin-top: 5px; min-height: 40px; font-size: 14px; }
  .code-card .hint { display: none; }
  .seats { gap: 8px; }
  .seat { aspect-ratio: auto; height: 176px; padding: 6px 6px 8px; }
  .seat .chibi { max-height: 112px; }
  .seat-name { font-size: 14.5px; margin-top: 2px; } .seat-sub { font-size: 11px; }
  .seat .crown { width: 22px; top: 6px; left: 6px; } .seat .ready-seal { width: 34px; height: 34px; font-size: 12px; top: 6px; right: 6px; }
  .lobby-bottom { gap: 14px; grid-template-columns: 1fr 210px; }
  .lobby-actions { width: 210px; gap: 5px; }
  .diff-note { display: none; } .diff-seg button { height: 32px; font-size: 13px; }
  .howto-mini { gap: 6px; } .howto-mini .goal { font-size: 13px; } .howto-mini .goal small { display: none; }
  .tip { padding: 6px 8px; gap: 6px; } .tip i { width: 22px; height: 22px; } .tip i svg { width: 20px; height: 20px; }
  .tip b { font-size: 12.5px; } .tip span { font-size: 11px; line-height: 1.4; }
  .res-card { grid-template-columns: 280px 1fr; }
  .res-left { padding: 16px 16px 14px; gap: 8px; } .res-right { padding: 14px 16px; gap: 8px; }
  .res-head { font-size: 46px; } .no-brush .res-head { font-size: 32px; }
  .rank { width: 66px; height: 66px; font-size: 36px; top: 12px; right: 12px; }
  .res-meta b { font-size: 17px; } .res-meta { font-size: 12px; gap: 12px; }
  .ghost-card { padding: 9px; gap: 8px; } .ghost-card .gsvg { width: 40px; } .ghost-card h4 { font-size: 16px; } .ghost-card p { font-size: 11.5px; }
  .prow { padding: 5px 8px; grid-template-columns: 40px 1fr; gap: 8px; } .prow .chibi-head { width: 40px; height: 36px; } .prow-name { font-size: 15px; }
  .pstats { font-size: 11.5px; gap: 2px 10px; }
  .hl { gap: 2px; padding-bottom: 8px; } .hl-row { gap: 8px; } .hl-row p { font-size: 13.5px; } .hl-face, .hl-face .chibi-head { width: 30px; height: 27px; }
  .btn-share { padding: 4px; min-height: 44px; font-size: 13.5px; }
  .res-actions { bottom: -14px; margin-bottom: -14px; padding-bottom: 14px; }
  .intro h2 { font-size: 64px; } .intro-goal { font-size: 16px; } .intro-tip { margin-top: 14px; font-size: 13px; } .intro-skip { margin-top: 10px; }
  .modal { padding: 16px 20px 14px; } .modal h3 { font-size: 18px; margin-bottom: 8px; }
  .howto { font-size: 12.5px; line-height: 1.5; gap: 8px 18px; }
  .set-row { padding: 3px 0; }
  .banner h2 { font-size: 22px; } .banner .night h2 { font-size: 40px; } .banner p { font-size: 13px; }
  .hud-tl { top: calc(10px + var(--sat)); left: calc(12px + var(--sal)); gap: 6px; }
  .hud-tr { top: calc(10px + var(--sat)); right: calc(12px + var(--sar)); }
  .tal-n { font-size: 20px; } .tal-ic { width: 16px; height: 27px; }
  .feed-item { font-size: 12.5px; }
  .mate { font-size: 12.5px; } .mate .chibi-head { width: 24px; height: 22px; }
  .downed-box { top: calc(52px + var(--sat)); } .downed-box h2 { font-size: 21px; } .downed-box p { font-size: 12.5px; }
}
/* 375 px tall phones (iPhone landscape): seats a bit shorter so the lobby's start button stays on screen */
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape), (orientation: portrait) and (max-width: 720px) {
  .home-icons .btn-text { width: 42px; height: 42px; min-height: 0; justify-content: center; padding: 0; border-radius: 50%; background: rgba(11,13,26,.4); box-shadow: 0 0 0 1px rgba(243,233,210,.25) inset; }
  .home-icons .btn-text > span { display: none; }
  .home-icons .lang-pick { width: 42px; height: 42px; padding: 0; justify-content: center; }
  .home-icons .lang-sel { position: absolute; inset: 0; width: 100%; opacity: 0; padding: 0; }
  .is-touch .home-icons .btn-text, .is-touch .home-icons .lang-pick { width: 44px; height: 44px; }
  .profile-chip { padding-right: 12px; }
}
@media (max-height: 400px) and (orientation: landscape) {
  .seat { height: 152px; } .seat .chibi { max-height: 94px; }
  .lobby-main { padding: 2px 0; }
}
/* phones in landscape: the difficulty row must not push the start button below the fold (that regressed once).
   The seats already say who is still getting ready, so the status line gives way; switches and the code card slim down. */
@media (max-height: 460px) and (orientation: landscape) {
  .scr-lobby.has-diff .lobby-status { display: none; }
  .scr-lobby.has-diff .hm-seg button { height: 32px; }
  .diff-seg button { height: 30px; }
  .room-code span { height: 40px; }
  .code-card .btn { min-height: 36px; }
}
@media (max-height: 370px) and (orientation: landscape) { /* 360 px Android phones */
  .scr-lobby.has-diff .hm-seg button, .diff-seg button { height: 28px; }
  .scr-lobby.has-diff .lobby-actions { gap: 3px; }
}
@media (orientation: portrait) and (max-width: 720px) {
  /* the home screen: top bar · logo · her character (takes what is left) · the ways in · the foot */
  .home-top { padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 0 calc(14px + var(--sal)); gap: 8px; }
  .home-body { display: flex; flex-direction: column; justify-content: space-between; padding: 6px calc(18px + var(--sar)) 0 calc(18px + var(--sal)); }
  .home-brand { align-self: center; text-align: center; padding-top: 1vh; }
  .kicker { letter-spacing: .12em; font-size: 12.5px; }
  .logo { justify-content: center; } .logo-txt { font-size: clamp(64px, 19vw, 92px); }
  .no-logo .logo-txt { font-size: clamp(44px, 13vw, 64px); }
  .logo .seal { position: absolute; right: -40px; top: 0; width: 40px; height: 40px; font-size: 15px; margin: 0; }
  .tagline { font-size: 15px; }
  .has-inv .tagline { display: none; } /* (an invite card above: the room goes to her character) */
  .home-stage { flex: 1 1 0; align-self: stretch; min-height: 176px; justify-content: center; padding-top: 6px; }
  .stage { flex: 1 1 0; min-height: 130px; max-height: 360px; height: auto; }
  @supports (height: 100dvh) { .stage { height: auto; } }
  .home-ways { width: 100%; margin-top: 8px; gap: 8px; }
  .home-foot { padding-top: 2px; }
  .inv-card { padding: 8px 4px 8px 10px; gap: 10px; } .inv-seal { width: 36px; height: 36px; font-size: 12px; } .inv-txt p { font-size: 14px; }
  .maker-top .dice { font-size: 13px; }
  .chip { font-size: 14px; padding: 0 2px; }
  .swatches { gap: 8px; } .sw { width: 32px; height: 32px; }
  .preview { width: 120px; height: 136px; } .preview .chibi { width: 120px; height: 132px; }
  .pr-night .stars svg { width: 11px; height: 11px; } .pr-tile b { font-size: 19px; } /* (the profile: five night cells a row on a narrow phone) */
  .invite { padding: 8px 12px; } .invite .seal { width: 36px; height: 36px; font-size: 12px; }
  /* lobby on a narrow phone: the pinned footer (mode, difficulty, start) takes the bottom ~30%, so the room code card is
     compact and the seats come right after it — every player card is above the pinned bar at scroll top (4 players
     on one row when the screen is short), instead of sitting under it */
  .lobby-top { gap: 4px; }
  .lobby-top .night-label { white-space: nowrap; }
  .lobby-top > div .btn-text:first-child > span { display: none; } /* how to play: the book icon alone */
  .lobby-main { grid-template-columns: 1fr; gap: 12px; padding: 8px 0; align-items: start; flex: none; }
  .code-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px; }
  .code-card > p, .code-card .room-code { grid-column: 1 / -1; }
  .room-code { margin: 2px 0 4px; } .room-code span { width: 44px; height: 46px; font-size: 30px; }
  .code-card .btn { margin-top: 0; min-height: 44px; font-size: 15px; padding: .5em .6em; }
  .code-card .btn:only-of-type, .code-card .btn-invite { grid-column: 1 / -1; } /* (one button: 친구 초대하기, 2026-11-29) */
  .code-card .hint { display: none; }
  .seats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .seat { aspect-ratio: auto; height: 150px; }
  /* the seats take what the screen has left: above them ~236 px (insets, top row, code card), under them the pinned bar
     at its tallest (~289 px: mode + note, difficulty, a two-line pass strip, status, start; every text line in it is
     bounded below, so no language makes it taller) and a small margin — 390×844 gives 150 px, taller phones up to 158 */
  @supports (height: 100dvh) { .seat { height: clamp(128px, calc((100dvh - var(--sat) - var(--sab) - 544px) / 2), 158px); } }
  .lobby-actions .lobby-status, .lobby-actions .hm-mode-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* lobby-bottom dissolves so the sticky footer's containing block is the whole scroller (otherwise it can't rise
     above lobby-bottom's top and the start button sits below the fold at scroll top) */
  .lobby-bottom { display: contents; }
  .howto-mini { grid-template-columns: 1fr; margin-top: 14px; }
  /* pinned footer: bleeds to the screen edges with a solid night backdrop (soft fade on top) so the scrolling
     tips never show through; it stays in flow, so at scroll bottom the last tip sits fully above it */
  .scr-lobby { padding-bottom: 0; } /* the footer carries the bottom inset itself */
  .lobby-actions { width: auto; position: sticky; bottom: 0; z-index: 2; gap: 6px;
    margin: 4px calc(-32px - var(--sar)) 0 calc(-32px - var(--sal));
    padding: 18px calc(32px + var(--sar)) calc(12px + var(--sab)) calc(32px + var(--sal));
    background: linear-gradient(to bottom, rgba(5,6,12,0), #05060c 16px); }
  .diff-note { display: none; } /* the pressed button already says which; keeps the pinned bar short */
  .res-card { grid-template-columns: 1fr; }
  .res-left { border-right: 0; border-bottom: 1px solid rgba(120,85,40,.22); }
}
@media (orientation: portrait) and (max-width: 720px) and (max-height: 780px) {
  /* short phones (iPhone SE/8, 360×740 Android): the four seats share one row */
  .seats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .seat { height: 128px; padding: 6px 3px 7px; border-radius: 8px; }
  .seat .chibi { width: 96%; max-height: 74px; }
  .seat-name { margin-top: 2px; font-size: 13px; }
  .seat-sub { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .seat .crown { width: 18px; top: 5px; left: 5px; }
  .seat .ready-seal { width: 28px; height: 28px; font-size: 10px; top: 5px; right: 5px; }
  .seat.empty { font-size: 11px; gap: 4px; padding: 6px 4px; line-height: 1.35; }
  .seat.empty .ghost-lantern { width: 24px; height: 24px; }
}
@media (orientation: portrait) and (max-width: 720px) {
  .hl-row p { font-size: 15px; }
  .res-head { font-size: 56px; }
  .res-actions { bottom: -22px; }
  .howto { grid-template-columns: 1fr; }
}

/* ── 애니메이션 ──────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes unroll { from { opacity: 0; transform: translateY(10px) scaleY(.92); clip-path: inset(0 0 60% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-12deg) scale(2.4); } 60% { opacity: 1; transform: rotate(-8deg) scale(.92); } 100% { transform: rotate(-7deg) scale(1); } }
@keyframes slam { 0% { opacity: 0; transform: rotate(-24deg) scale(3.2); filter: blur(4px); } 70% { opacity: 1; transform: rotate(-9deg) scale(.9); filter: none; } 100% { opacity: 1; transform: rotate(-9deg) scale(1); } }
@keyframes bob { 50% { transform: translateY(-2.5px); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pop { 40% { transform: scale(1.08) rotate(-2deg); } }
@keyframes breathe { 50% { filter: drop-shadow(0 0 30px rgba(255,180,105,1)); } }
@keyframes dots { from { width: 0; } to { width: 1em; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes tick { 0% { transform: scale(1); } 30% { transform: scale(1.7); color: #fff; text-shadow: 0 0 18px var(--gold); } 100% { transform: scale(1); } }
@keyframes talFly { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-8px) rotate(-12deg) scale(1.25); } 100% { transform: none; } }
@keyframes talGlow { 0% { box-shadow: 0 0 0 1px rgba(255,214,107,.9) inset, 0 0 40px rgba(255,214,107,.6); } 100% { box-shadow: 0 0 0 1px rgba(255,214,107,0) inset, 0 0 0 rgba(255,214,107,0); } }
@keyframes rvlUsed { 0% { transform: scale(1); } 12% { transform: scale(1.35); box-shadow: 0 0 0 2px #fff inset, 0 0 34px rgba(223,243,255,.9); } 30% { transform: scale(1.12) translateX(-3px); } 40% { transform: scale(1.12) translateX(3px); } 50% { transform: scale(1.1) translateX(-2px); } 100% { transform: none; } }
@keyframes rvlFly { 0% { transform: none; opacity: 1; } 40% { transform: translateY(-14px) scale(1.5); opacity: .2; } 41% { transform: none; opacity: 0; } 100% { opacity: 1; } }
@keyframes feedIn { from { opacity: 0; transform: translateX(-14px); } }
@keyframes pulseBad { 50% { opacity: .65; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } }
@keyframes pinIn { from { opacity: 0; transform: translate(-50%, -140%) scale(.6); } }
@keyframes ripple { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes bannerIn { 0% { opacity: 0; transform: translateY(8px); letter-spacing: .3em; } 14% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }
@keyframes hlIn { from { opacity: 0; transform: translateX(-10px) rotate(-1deg); } }
@keyframes rot { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { #ui *, #ui *::before, #ui *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* integration: the jumpscare (WebGL, drawn last) owns the screen for ~1.2 s */
html.jumpscare #ui .scr-game { visibility: hidden; }

/* ── 언어 (i18n): en/ja typography, line breaking, the language pickers ───────────
   Every stack ends in system serifs and the Korean serif (Hangul player names), so a blocked web font still reads well.
   Korean (the default) is untouched: everything below is scoped to :lang(en) / :lang(ja) or to new elements. */
t-r { display: contents; } /* live rich text wrapper (js/i18n LR) */
html:lang(en) {
  --serif: 'EB Garamond', Garamond, 'Baskerville', 'Libre Baskerville', Georgia, 'Times New Roman', 'Gowun Batang', 'AppleMyungjo', 'Noto Serif KR', serif;
  --brush: 'Yesteryear', 'EB Garamond', Georgia, 'Times New Roman', serif;
}
/* The spaced middle dot " · " that joins short phrases, in the CJK locales: the system Song faces (macOS Songti SC/TC, also Heiti)
   draw U+00B7 a full em wide, so with the web fonts blocked (mainland China) every " · " opened a 1.5 em hole. 'mn-dot' is a
   one-glyph face (unicode-range: U+00B7 only) taken from a proportional serif the device has — a CJK face's proportional dot
   first, then Hiragino Mincho (macOS / iOS), then the Latin serifs every OS ships. Only the ja / zh stacks list it, so Korean and
   English (and every other character anywhere) are untouched. The share card's canvas uses the same face (sharecard.js). */
@font-face {
  font-family: 'mn-dot'; font-weight: 100 900; unicode-range: U+00B7;
  src: local('Noto Serif CJK SC'), local('NotoSerifCJKsc-Regular'), local('Source Han Serif SC'), local('SourceHanSerifSC-Regular'),
    local('Hiragino Mincho ProN W3'), local('HiraMinProN-W3'), local('Times New Roman'), local('TimesNewRomanPSMT'), local('Georgia'),
    local('Noto Serif'), local('NotoSerif-Regular'), local('DejaVu Serif'), local('Liberation Serif');
}
html:lang(ja) {
  --serif: 'mn-dot', 'Shippori Mincho', 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'Yu Mincho', 'YuMincho', 'Noto Serif JP', 'Noto Serif CJK JP', 'Source Han Serif JP', 'MS PMincho', 'Gowun Batang', 'AppleMyungjo', serif;
  --brush: 'Yuji Syuku', 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', 'YuMincho', 'Noto Serif JP', serif;
}
/* line breaking: keep-all is a Korean rule (it would never break unspaced Japanese) */
html:lang(en) #ui { word-break: normal; overflow-wrap: break-word; hyphens: manual; }
html:lang(ja) #ui { word-break: normal; line-break: strict; overflow-wrap: anywhere; }
@supports (word-break: auto-phrase) { html:lang(ja) #ui { word-break: auto-phrase; } }
html:lang(ja) #ui kbd, html:lang(ja) #ui .room-code { word-break: keep-all; }
/* no orphaned last word / character in running text */
html:lang(en) #ui :is(p, .tip span, .coach span, .downed-box p, .ghost-card p, .hm-how span), html:lang(ja) #ui :is(p, .tip span, .coach span, .downed-box p, .ghost-card p, .hm-how span) { text-wrap: pretty; }
/* short labels never break inside a word (Korean gets this from keep-all) */
html:lang(en) #ui :is(.lobby-top > *, .seg button, .diff-seg button, .hm-seg button, .chip, .emo, .mate, .ptitle, .pstate, .res-meta span, .tb, .slot-l),
html:lang(ja) #ui :is(.lobby-top > *, .seg button, .diff-seg button, .hm-seg button, .chip, .emo, .mate, .ptitle, .pstate, .res-meta span, .tb, .slot-l) { white-space: nowrap; }
/* script brush (Yesteryear) joins its letters: no tracking */
html:lang(en) #ui .res-head, html:lang(en) #ui .intro h2, html:lang(en) #ui .banner .night h2, html:lang(en) #ui .hm-role h2 { letter-spacing: 0; }
html:lang(en) .no-brush .res-head, html:lang(en) .no-brush .intro h2, html:lang(en) .no-brush .hm-role h2 { letter-spacing: .01em; font-style: italic; font-weight: 700; }
/* result heading beside the seal: unspaced Japanese must not leave one character on its own line */
html:lang(en) #ui .res-head, html:lang(ja) #ui .res-head, html:lang(en) #ui .hm-role h2, html:lang(ja) #ui .hm-role h2 { text-wrap: balance; }
html:lang(ja) #ui .res-head { font-size: 50px; line-height: 1.12; }
html:lang(ja) #ui .hm-res .res-head { font-size: 48px; }
/* wide Hangul tracking is too airy for Latin; Japanese keeps a little */
html:lang(en) #ui :is(.kicker, .res-kicker, .night-label, .code-card > p, .maker h2, .intro-kick, .hm-kick, .hm-role h4, .howto h4, .field > span, .opt > span, .title-foot, .banner h2, .downed-box h2, .rank small, .ghost-card small) { letter-spacing: .06em; }
html:lang(ja) #ui :is(.kicker, .res-kicker, .night-label, .code-card > p, .maker h2, .intro-kick, .hm-kick, .hm-role h4) { letter-spacing: .14em; }
/* the logo's name in the reader's language, under the Korean brush logo */
.logo-sub { margin: -6px 0 0 4px; font-size: 21px; letter-spacing: .14em; color: rgba(251,243,226,.78); text-shadow: 0 2px 10px #000; }
.logo-sub:empty { display: none; }
html:lang(en) .logo-sub { font-style: italic; letter-spacing: .08em; font-size: 23px; }
/* the home screen's language switch: always in the top bar (a globe and the native select; on a phone the globe alone, the select over it) */
.lang-pick { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 11px;
  border-radius: 999px; color: rgba(243,233,210,.86); background: rgba(11,13,26,.55); box-shadow: 0 0 0 1px rgba(243,233,210,.3) inset; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; }
.lang-pick:hover, .lang-pick:focus-within { color: var(--lantern); box-shadow: 0 0 0 1px rgba(255,180,105,.7) inset; }
.lang-pick i { display: grid; width: 18px; height: 18px; }
.lang-pick svg { width: 18px; height: 18px; }
.lang-sel { appearance: none; -webkit-appearance: none; border: 0; outline: none; background: transparent; color: inherit; cursor: pointer; height: 100%; padding: 0 24px 0 2px;
  font: 700 14px/1 var(--serif-ko); letter-spacing: .02em;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 12px top 55%, right 7px top 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.lang-sel option { color: #1d1a1f; background: #f3e9d2; }
.is-touch .lang-pick { height: 44px; }
/* settings: the language row comes first and reads in any language (globe + native names) */
.set-lang > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.set-globe { display: inline-grid; width: 17px; height: 17px; color: var(--ink2); flex: none; }
.set-globe svg { width: 17px; height: 17px; }
.seg-lang button { font-family: var(--serif-ko); }
.seg-lang button span[lang=en] { font-family: 'EB Garamond', Georgia, serif; font-size: 15px; }
.seg-lang button span[lang=ja] { font-family: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif; }
html:lang(en) .set-row, html:lang(ja) .set-row { grid-template-columns: minmax(92px, auto) 1fr 40px; }
html:lang(en) .set-row.seg-row, html:lang(ja) .set-row.seg-row { grid-template-columns: minmax(92px, auto) 1fr; }
/* six choices (auto + five languages): two rows of three, so native names never squeeze */
.seg.seg-lang { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg-lang button:nth-child(n+4) { box-shadow: -1px 0 0 rgba(29,26,31,.2), 0 -1px 0 rgba(29,26,31,.2); }
.seg-lang button:nth-child(4) { box-shadow: 0 -1px 0 rgba(29,26,31,.2); }
.seg-lang button span[lang^=zh-Hans] { font-family: 'Noto Serif SC', 'Songti SC', 'Noto Serif CJK SC', 'Microsoft YaHei', 'PingFang SC', serif; }
.seg-lang button span[lang^=zh-Hant] { font-family: 'Noto Serif TC', 'Songti TC', 'Noto Serif CJK TC', 'Microsoft JhengHei', 'PingFang TC', serif; }
/* a language switch repaints result screens / role cards in place: no replayed entrance animations */
.res-card.again, .res-card.again *, .hm-role.again, .hm-role.again * { animation: none !important; }
.res-card.again .rank { opacity: 1; transform: rotate(-9deg); }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) {
  .logo-sub { font-size: 16px; margin-top: -9px; line-height: 1.15; }
}
@media (orientation: portrait) and (max-width: 720px) {
  .logo-sub { margin: -4px 0 0; }
  /* lobby header on a phone: the night label's rules give way to longer words */
  html:lang(en) .night-label::before, html:lang(en) .night-label::after, html:lang(ja) .night-label::before, html:lang(ja) .night-label::after { display: none; }
}

/* ── 中文 (zh-Hans mainland, zh-Hant Taiwan): typography, line breaking ─────────────────────
   Web fonts first (Noto Serif SC/TC; brush Ma Shan Zheng / LXGW WenKai TC), but Google Fonts does not load in mainland China,
   so the system stacks are the real design for many Simplified readers:
   macOS Songti SC/TC (+ Kaiti for display) · iOS: Songti if present, else PingFang · Android: Noto Serif CJK, else the system
   Noto Sans CJK · Windows: Microsoft YaHei / JhengHei for text (SimSun / PMingLiU are left out on purpose: their bitmap strikes
   look broken at UI sizes) and KaiTi / DFKai-SB for display. Each stack ends in the Korean serif (Hangul player names). */
html:lang(zh-Hans) {
  --kai: 'Kaiti SC', 'STKaiti', 'KaiTi', 'KaiTi_GB2312', 'AR PL UKai CN';
  --serif: 'mn-dot', 'Noto Serif SC', 'Source Han Serif SC', 'Source Han Serif CN', 'Noto Serif CJK SC', 'Songti SC', 'STSong', 'Microsoft YaHei UI', 'Microsoft YaHei',
    'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Gowun Batang', 'AppleMyungjo', serif;
  --brush: 'Ma Shan Zheng', var(--kai), var(--serif);
}
html:lang(zh-Hant) {
  --kai: 'Kaiti TC', 'BiauKai', 'BiauKaiTC', 'DFKai-SB', 'AR PL UKai TW';
  --serif: 'mn-dot', 'Noto Serif TC', 'Source Han Serif TC', 'Source Han Serif TW', 'Noto Serif CJK TC', 'Songti TC', 'LiSong Pro', 'Microsoft JhengHei UI', 'Microsoft JhengHei',
    'PingFang TC', 'Heiti TC', 'Noto Sans CJK TC', 'Gowun Batang', 'AppleMyungjo', serif;
  --brush: 'LXGW WenKai TC', var(--kai), var(--serif);
}
/* unspaced Chinese breaks between any two characters (keep-all would never break it); strict keeps 。，、！？ off a line start */
html:lang(zh) #ui { word-break: normal; line-break: strict; overflow-wrap: anywhere; }
html:lang(zh) #ui kbd, html:lang(zh) #ui .room-code { word-break: keep-all; }
html:lang(zh) #ui :is(p, .tip span, .coach span, .downed-box p, .ghost-card p, .hm-how span) { text-wrap: pretty; }
html:lang(zh) #ui :is(.lobby-top > *, .seg button, .diff-seg button, .hm-seg button, .chip, .emo, .mate, .ptitle, .pstate, .res-meta span, .tb, .slot-l) { white-space: nowrap; }
html:lang(zh) #ui .res-head, html:lang(zh) #ui .hm-role h2 { text-wrap: balance; }
html:lang(zh) #ui :is(.kicker, .res-kicker, .night-label, .code-card > p, .maker h2, .intro-kick, .hm-kick, .hm-role h4) { letter-spacing: .14em; }
/* Chinese is never set in italics; the subtitle is a spaced-out four-character name */
html:lang(zh) .logo-sub { letter-spacing: .42em; font-size: 22px; }
html:lang(zh) .lang-sel { font-family: var(--serif); }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) { html:lang(zh) .logo-sub { font-size: 16px; letter-spacing: .34em; } }
/* no web brush (blocked or slow): the system Kai (KaiTi / Kaiti SC / DFKai-SB) is a real brush hand; without it, the bold serif */
html:lang(zh) .no-brush :is(.res-head, .intro h2, .banner .night h2, .hm-role h2) { font-family: var(--kai), var(--serif); font-weight: 700; }
/* the invite seal is a single glyph in Traditional (邀: the locale's seals table): a one-glyph seal's size, not the two-glyph 13px */
html:lang(zh-Hant) :is(.invite .seal, .inv-seal) { font-size: 21px; letter-spacing: 0; }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) { html:lang(zh-Hant) :is(.invite .seal, .inv-seal) { font-size: 17px; } }
@media (orientation: portrait) and (max-width: 720px) { html:lang(zh-Hant) :is(.invite .seal, .inv-seal) { font-size: 18px; } }

/* ── the place on the night card (every night, DESIGN-THEMES §2); the hospital's hiding notices without a breath bar ── */
.intro[data-theme=asylum] .intro-kick { color: rgba(190,214,236,.62); }
.intro-place { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 2px; animation: rise .8s .15s cubic-bezier(.2,.7,.2,1) both; }
.intro-place .seal { width: 34px; height: 34px; font-size: 15px; margin-bottom: 4px; animation: stampIn .5s .35s cubic-bezier(.3,1.6,.5,1) both; }
.intro-place b { font-family: var(--serif); font-weight: 800; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: .12em; color: #e9f2fb; text-shadow: 0 0 18px rgba(160,200,255,.35); }
.intro[data-theme=mansion] .intro-place b { color: #fbe9cf; text-shadow: 0 0 18px rgba(255,180,105,.32); }
.intro-place small { font-size: 14px; color: rgba(214,228,244,.72); max-width: 460px; line-height: 1.5; }
.intro[data-theme=mansion] .intro-place small { color: rgba(243,226,200,.74); }
.intro.place h2 { font-size: clamp(48px, 8vw, 76px); }
/* night 1 (the place hasn't changed yet): the place in one quiet line above the night, which stays the big word */
.intro:not(.place) .intro-place { flex-direction: row; gap: 8px; margin: 8px 0 0; }
.intro:not(.place) .intro-place .seal { width: 24px; height: 24px; font-size: 11px; margin: 0; }
.intro:not(.place) .intro-place b { font-size: clamp(15px, 2vw, 18px); font-weight: 700; letter-spacing: .2em; }
.res-place { margin-right: 96px; } /* clear of the rank seal (top-right of the card) */
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) { .res-place { margin-right: 72px; } }
.breath.nobar .breath-bar { display: none; }
.breath[data-mode=nurse] .breath-t { color: #dfe9f6; }
html:lang(en) #ui .intro-place b { letter-spacing: .04em; }
html:lang(en) #ui .intro:not(.place) .intro-place b { letter-spacing: .08em; }
@media (max-height: 520px) {
  .intro-place { margin-top: 4px; gap: 2px; } .intro-place .seal { width: 26px; height: 26px; font-size: 12px; margin-bottom: 0; }
  .intro-place b { font-size: 19px; } .intro-place small { font-size: 12px; } .intro.place h2 { font-size: 44px; }
  .intro:not(.place) .intro-place { margin-top: 2px; } .intro:not(.place) .intro-place .seal { width: 20px; height: 20px; font-size: 10px; } .intro:not(.place) .intro-place b { font-size: 14px; }
  .intro.place .intro-tip { margin-top: 8px; } .intro.place .intro-rule { margin: 6px 0 8px; } .intro.place .intro-skip { display: none; }
}

/* ── 빠른 매칭 (quick match): the title's ways in, the public lobby, the alone choice, the result countdown, idle ── */
/* title: each way is a label and one plain line */
.home-ways .way { flex-direction: column; gap: 1px; line-height: 1.2; padding-top: .55em; padding-bottom: .55em; }
.way-l { font-weight: 700; }
.way-s { font-size: 12.5px; font-weight: 400; opacity: .78; letter-spacing: 0; text-shadow: none; white-space: normal; }
.way-s[hidden] { display: none; }
.btn-hero.way { min-height: 64px; }
.btn-hero.way .way-s { opacity: .86; }
.btn-quick { color: #ffe6c4; background: linear-gradient(180deg, rgba(255,180,105,.16), rgba(255,180,105,.05)); box-shadow: 0 0 0 1.5px rgba(255,180,105,.62) inset, 0 0 26px rgba(255,160,90,.14); }
.btn-quick:not(:disabled):hover { background: linear-gradient(180deg, rgba(255,180,105,.26), rgba(255,180,105,.1)); box-shadow: 0 0 0 1.5px var(--lantern) inset, 0 0 32px rgba(255,170,90,.3); }
.btn-quick .way-l::before { content: ''; display: inline-block; width: .5em; height: .5em; margin-right: .45em; border-radius: 50%; background: var(--lantern); box-shadow: 0 0 10px var(--lantern); vertical-align: .12em; animation: breathe 2.4s ease-in-out infinite; }
/* public lobby: no code card, no host controls — a countdown card and a way out */
.qm-card, .qm-acts { display: none; }
.scr-lobby.public .code-card { display: none; }
.scr-lobby.public :is(.tonight, .story-btn) { display: none; } /* (nobody picks a night here: the tonight card stayed an empty box) */
.scr-lobby.public .lobby-actions > :not(.qm-acts) { display: none !important; }
.scr-lobby.public .qm-acts { display: flex; flex-direction: column; gap: 8px; }
.scr-lobby.public .qm-card { display: flex; }
.qm-card { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 20px 16px; position: relative; }
.qm-kick { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .22em; color: var(--crimson); font-weight: 700; }
.qm-kick .seal { width: 26px; height: 26px; font-size: 12px; letter-spacing: 0; }
.qm-clock { position: relative; width: 116px; height: 116px; display: grid; place-items: center; margin: 4px 0 2px; --p: 0; }
.qm-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.qm-ring circle { fill: none; stroke-width: 6; }
.qm-ring .bg { stroke: rgba(29,26,31,.1); }
.qm-ring .fg { stroke: var(--crimson); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1) 100; transition: stroke-dasharray .2s linear; }
.qm-num { position: relative; font: 800 46px/1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.qm-lantern { position: absolute; width: 54px; height: 54px; color: #c97a2e; filter: drop-shadow(0 0 10px rgba(255,170,90,.55)); animation: sway 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.qm-lantern svg { width: 100%; height: 100%; }
.qm-card.counting .qm-lantern { display: none; }
.qm-card:not(.counting) .qm-num, .qm-card:not(.counting) .qm-ring .fg { display: none; }
.qm-status { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.qm-sub { margin: 0; font-size: 13px; color: var(--ink2); line-height: 1.5; }
.qm-rule { margin: 6px 0 0; font-size: 12px; color: var(--ink3); letter-spacing: .02em; }
.qm-alone { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.qm-alone[hidden] { display: none; }
.qm-alone .btn { flex: 1; min-width: 0; }
.qm-safe { margin: 0; text-align: center; font-size: 12.5px; color: rgba(243,233,210,.6); line-height: 1.5; }
.qm-acts .btn { width: 100%; }
.qm-acts .btn-line { color: var(--paper); box-shadow: 0 0 0 1.5px rgba(243,233,210,.45) inset; background: rgba(11,13,26,.45); }
.qm-acts .btn-line:not(:disabled):hover { background: rgba(255,180,105,.1); }
.seat.empty.open { cursor: default; }
.seat.empty.open:hover { border-color: rgba(243,233,210,.22); color: rgba(243,233,210,.5); background: transparent; }
.seat.empty.open .ghost-lantern { animation: sway 3s ease-in-out infinite; transform-origin: 50% 0; }
/* alone too long */
.qm-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.qm-choices .way { width: 100%; flex-direction: column; gap: 1px; padding-top: .6em; padding-bottom: .6em; }
.qm-choices .btn-line { background: transparent; }
/* the title's quick match: who haunts — AI 귀신 · 사람 귀신, two big choices side by side (the remembered one pressed) */
.qm-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.qm-kinds .way { flex-direction: column; gap: 4px; min-height: 132px; padding: 14px 12px; white-space: normal; text-align: center; }
.qm-kinds .way-l { font-size: 18px; }
.qm-kinds .btn-line { background: transparent; }
.qm-kind-ic { width: 40px; height: 40px; font-size: 16px; margin-bottom: 4px; }
.qm-kinds .btn-primary .qm-kind-ic { box-shadow: 0 0 0 1.5px rgba(255,241,234,.55) inset; }
/* 사람 귀신 with billing on: the ghost of the pass nights — a quiet line under the role wish (and on the 술래 result) */
.qm-role[hidden] { display: none; }
.qm-hint-slot:empty { display: none; }
.qm-ghost-hint { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 8px; margin: 2px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.45; text-align: center; }
.qm-ghost-hint p { margin: 0; }
.qm-ghost-hint .btn-text { min-height: 32px; padding: 2px 6px; font-size: 12px; color: var(--crimson); text-decoration: underline; text-underline-offset: 3px; }
.res-actions.qm > .qm-ghost-hint { flex: 1 1 100%; }
.qm-ghost-hint .gh-s { display: none; }
/* result: the next night counts down by itself */
.res-actions.qm { flex-wrap: wrap; }
.qm-next { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
.qm-next-t { margin: 0; font-size: 16px; color: var(--ink); }
.qm-next-t b { font-size: 1.35em; color: var(--crimson); font-variant-numeric: tabular-nums; }
.qm-next-s { margin: 0; font-size: 12.5px; color: var(--ink2); }
.qm-bar { height: 4px; border-radius: 2px; background: rgba(29,26,31,.12); overflow: hidden; --p: 0; }
.qm-bar i { display: block; height: 100%; width: calc(var(--p) * 1%); background: var(--crimson); transition: width .2s linear; }
.qm-go { flex-direction: column; gap: 0; line-height: 1.2; }
.qm-go small { font-size: 12px; font-weight: 400; opacity: .8; }
/* what she would like to be when one of the matched players is the ghost (lobby card and the 술래 result; on paper) */
.qm-role { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed rgba(29,26,31,.18); }
.qm-role-q { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.qm-role-seg { display: flex; width: 100%; max-width: 360px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(29,26,31,.28) inset; background: rgba(255,255,255,.35); }
.qm-role-seg button { flex: 1; min-width: 0; border: 0; background: none; min-height: 42px; padding: 4px 6px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.qm-role-seg button + button { box-shadow: -1.5px 0 0 rgba(29,26,31,.18); }
.qm-role-seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.qm-role-seg button[data-role=ghost][aria-pressed=true] { background: var(--crimson); color: #fff1ea; }
.qm-role-seg button:focus-visible { outline: 2px solid var(--crimson); outline-offset: -3px; }
.qm-role-ic { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 4px; font-size: 11px; font-weight: 400; background: rgba(29,26,31,.1); }
.qm-role-seg button[aria-pressed=true] .qm-role-ic { background: rgba(255,255,255,.18); }
.qm-role-note { margin: 0; font-size: 12px; color: var(--ink3); }
.qm-role.compact { flex: 1 1 100%; margin-top: 0; padding-top: 0; border-top: 0; align-items: stretch; }
.qm-role.compact .qm-role-q, .qm-role.compact .qm-role-note { display: none; }
.qm-role.compact .qm-role-seg { max-width: none; }
.qm-role.compact .qm-role-seg button { min-height: 36px; font-size: 13px; }
.qm-next.opened .qm-next-s { color: var(--crimson2); font-weight: 700; }
/* in a public night: "still there?" (only she sees it) */
.idle-warn { position: absolute; left: 50%; top: calc(64px + var(--sat)); transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(460px, calc(100% - 32px));
  padding: 12px 16px 12px 14px; font-size: 14px; text-shadow: none; pointer-events: none; animation: unroll .4s cubic-bezier(.2,.8,.3,1) both; box-shadow: 0 0 0 2px var(--crimson), 0 14px 40px rgba(0,0,0,.5); }
.idle-warn[hidden] { display: none; }
.idle-warn .seal { flex: none; width: 32px; height: 32px; font-size: 14px; }
.idle-warn .idle-t { display: block; font-size: 16px; margin-bottom: 2px; }
.idle-warn div span { color: var(--ink2); line-height: 1.5; display: block; }
.idle-warn > b { flex: none; font: 800 30px/1 var(--serif); color: var(--crimson); min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) {
  .home-ways .way { padding-top: .35em; padding-bottom: .35em; min-height: 44px; }
  .btn-hero.way { min-height: 50px; }
  .way-s { font-size: 11px; }
  .qm-card { padding: 10px 10px 8px; gap: 3px; }
  .qm-kick { font-size: 11px; } .qm-kick .seal { width: 22px; height: 22px; font-size: 10px; }
  .qm-clock { width: 72px; height: 72px; margin: 0; } .qm-num { font-size: 30px; } .qm-lantern { width: 36px; height: 36px; }
  .qm-status { font-size: 14px; } .qm-sub { font-size: 11.5px; line-height: 1.4; } .qm-rule { display: none; }
  .qm-alone .btn { min-height: 36px; font-size: 13px; padding: .3em .5em; }
  .qm-safe { font-size: 11px; }
  .qm-next-t { font-size: 14px; } .qm-next-s { font-size: 11.5px; }
  .qm-role { gap: 3px; margin-top: 3px; padding-top: 5px; } .qm-role-q { font-size: 12px; } .qm-role-note { display: none; }
  .qm-role-seg button { min-height: 34px; font-size: 13px; }
  .qm-kinds { margin-top: 10px; gap: 8px; } .qm-kinds .way { min-height: 0; padding: 10px 10px; gap: 2px; } .qm-kinds .way-l { font-size: 16px; }
  .qm-kind-ic { width: 30px; height: 30px; font-size: 13px; margin-bottom: 2px; }
  .qm-ghost-hint { font-size: 11px; line-height: 1.35; } .qm-ghost-hint .btn-text { min-height: 28px; font-size: 11px; }
  .idle-warn { top: calc(10px + var(--sat)); padding: 8px 12px; font-size: 12.5px; } .idle-warn .idle-t { font-size: 14px; } .idle-warn > b { font-size: 24px; }
}
@media (max-height: 440px) and (orientation: landscape) {
  /* phones in landscape: the hint is one short link (the offer says the rest), and takes the role question's line */
  .qm-ghost-hint { margin: 0; } .qm-ghost-hint p, .qm-ghost-hint .gh-l { display: none; } .qm-ghost-hint .gh-s { display: inline; }
  .qm-ghost-hint .btn-text { min-height: 26px; padding: 0 4px; white-space: nowrap; }
  .qm-role:has(.qm-ghost-hint) .qm-role-q { display: none; }
}
@media (max-height: 440px) and (orientation: landscape) {
  /* phones in landscape: the ways in and her character need the room — the kicker line gives way */
  .kicker { display: none; }
  .home-ways { gap: 6px; margin-top: 8px; }
  .qm-clock { width: 62px; height: 62px; } .qm-num { font-size: 26px; }
  .qm-card > .qm-kick { display: none; } /* (the screen's own heading says 빠른 매칭; the role wish needs the room) */
  .qm-role-ic { display: none; } .qm-role-seg button { padding: 4px 2px; }
  .home-ways .way { min-height: 42px; } .btn-hero.way { min-height: 46px; }
}
@media (orientation: portrait) and (max-width: 720px) {
  .home-ways .way { min-height: 50px; }
  .btn-hero.way { min-height: 56px; }
  .qm-card { display: none; flex-direction: row; text-align: left; gap: 12px; padding: 12px 14px; }
  .scr-lobby.public .qm-card { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; row-gap: 2px; }
  .qm-card > :not(.qm-clock) { grid-column: 2; }
  .qm-card .qm-clock { grid-row: 1 / span 5; width: 84px; height: 84px; } .qm-num { font-size: 34px; } .qm-lantern { width: 40px; height: 40px; }
  .qm-kick { justify-content: flex-start; }
  .qm-alone { justify-content: flex-start; }
  .qm-rule { display: none; }
  .qm-card > .qm-role { grid-column: 1 / -1; }
}
html:lang(en) .qm-kick, html:lang(ja) .qm-kick { letter-spacing: .08em; }
html:lang(zh) #ui .qm-kick { letter-spacing: .14em; }
html:lang(zh) #ui :is(.way-l, .qm-status) { white-space: nowrap; }
@media (max-height: 520px) and (orientation: landscape) {
  .res-actions.qm { gap: 6px; padding-top: 8px; }
  .res-actions.qm .qm-next { gap: 2px; }
  .res-actions.qm .btn { min-height: 40px; padding-top: .25em; padding-bottom: .25em; }
}

/* ── the campaign (docs/DESIGN-CAMPAIGN.md §2): stars, the lobby's 오늘 밤 card, the night picker, the result checklist, the ending ── */
.stars { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.stars .star, .pick-total .star { width: 16px; height: 16px; fill: rgba(243,233,210,.18); }
.stars .star.on, .pick-total .star { fill: var(--gold); filter: drop-shadow(0 0 4px rgba(255,214,107,.45)); }
.stars .flame, .res-flame .flame { width: 15px; height: 15px; margin-left: 3px; fill: #ff6b3d; filter: drop-shadow(0 0 4px rgba(255,107,61,.5)); }
/* lobby: tonight's night, the way into the picker */
.howto-mini .tonight { grid-column: span 2; }
.tonight { pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 14px; border: 0; border-radius: 10px;
  text-align: left; font: inherit; color: var(--paper); cursor: pointer; background: linear-gradient(160deg, rgba(20,24,52,.82), rgba(11,13,26,.82));
  box-shadow: 0 0 0 1px rgba(255,214,107,.32) inset, 0 8px 24px rgba(0,0,0,.35); transition: box-shadow .2s, transform .2s; }
.tonight:hover { box-shadow: 0 0 0 1.5px rgba(255,214,107,.7) inset, 0 10px 28px rgba(0,0,0,.4); transform: translateY(-1px); }
.tonight .tn-seal { width: 38px; height: 38px; font-size: 19px; }
.tonight .tn-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tonight .tn-kick { font-size: 11.5px; letter-spacing: .16em; color: rgba(255,214,107,.8); }
.tonight .tn-place { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tonight .tn-ghost { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(223,243,255,.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tonight .tn-g { flex: none; width: 16px; color: var(--ghost); } .tonight .tn-g svg { width: 16px; height: 21px; } .tonight .tn-g.sil { color: rgba(223,243,255,.3); }
.tonight .tn-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tonight .tn-none, .tonight .tn-par { font-size: 12px; color: rgba(243,233,210,.6); white-space: nowrap; }
.tonight .tn-go { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink);
  background: var(--paper); white-space: nowrap; }
.tonight .tn-go i { font-style: normal; font-size: 18px; line-height: 1; color: var(--crimson); }
.lobby-bottom .tip-extra { align-self: stretch; }
/* the picker: ten cards (5 × 2 on a desk, a row to swipe on a phone in landscape, two columns in portrait) */
.modal.pick-modal { width: min(1080px, 100%); padding: 22px 22px 18px; }
.pick h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-right: 40px; }
.pick-total { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink2); }
.pick-total .star { width: 18px; height: 18px; fill: #d9a21e; filter: none; }
.pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 206px; padding: 12px 8px 12px; border: 0; border-radius: 8px;
  font: inherit; color: var(--paper); text-align: center; cursor: pointer; background: linear-gradient(165deg, #1a1f42, #0b0d1a 70%);
  box-shadow: 0 0 0 1px rgba(243,233,210,.14) inset, 0 6px 14px rgba(0,0,0,.25); transition: transform .15s, box-shadow .15s; }
.pc.open:not(.ro):hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px rgba(255,214,107,.6) inset, 0 10px 18px rgba(0,0,0,.3); }
.pc.cur { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 22px rgba(255,214,107,.28), 0 6px 14px rgba(0,0,0,.25); }
.pc.cur::before { content: ''; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: var(--gold); border-radius: 2px; }
.pc.ro { cursor: default; }
.pc-n { font-size: 12px; letter-spacing: .14em; color: rgba(255,214,107,.85); }
.pc-seal { width: 30px; height: 30px; font-size: 15px; margin: 2px 0; }
.pc-place { font-size: 14.5px; font-weight: 800; line-height: 1.25; min-height: 2.5em; display: grid; place-items: center; }
.pc-ghost { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; line-height: 1.3; color: rgba(223,243,255,.75); min-height: 54px; }
.pc-g { width: 26px; color: var(--ghost); filter: drop-shadow(0 0 6px rgba(223,243,255,.35)); } .pc-g svg { width: 26px; height: 34px; }
.pc-g.sil { color: rgba(223,243,255,.22); filter: none; }
.pc-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 18px; }
.pc-par { font-size: 11px; color: rgba(243,233,210,.55); }
.pc-lock { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.25;
  color: var(--paper); background: rgba(243,233,210,.1); }
.pc-lock i { width: 12px; height: 12px; flex: none; } .pc-lock i svg { width: 12px; height: 12px; display: block; }
.pc.locked .pc-seal, .pc.locked .pc-place, .pc.locked .pc-ghost, .pc.locked .pc-n { opacity: .45; }
.pc.soon { background: repeating-linear-gradient(135deg, rgba(20,24,52,.75) 0 10px, rgba(14,17,38,.75) 10px 20px); box-shadow: 0 0 0 1px rgba(243,233,210,.12) inset; }
.pc.soon .pc-seal { filter: grayscale(1); }
.pc.soon .pc-lock { color: rgba(243,233,210,.7); background: none; box-shadow: 0 0 0 1px rgba(243,233,210,.25) inset; }
.pc.pass .pc-lock { color: var(--ink); background: linear-gradient(180deg, #ffe39a, var(--gold)); }
.pc .pc-pass { width: 18px; height: 18px; font-size: 10px; border-radius: 4px; }
.pc.nope { animation: nope .35s; }
@keyframes nope { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.pick-note { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.55; color: var(--ink2); }
/* the result: stars in the seal, the three as a checklist */
.seal.rank.stars-seal .seal-stars { display: flex; gap: 0; align-items: center; margin-top: -2px; }
.seal-stars .star { width: 18px; height: 18px; fill: rgba(255,241,234,.22); }
.seal-stars .star.on { fill: #fff1ea; }
.seal-stars .star:nth-child(2) { transform: translateY(-5px); }
.stars-check { display: flex; flex-direction: column; gap: 5px; }
.stars-check .res-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 2px; }
.sc-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; background: rgba(120,85,40,.08); animation: rise .5s both; }
.sc-star svg { width: 22px; height: 22px; display: block; fill: rgba(29,26,31,.15); }
.sc-row.got .sc-star svg { fill: #d9a21e; filter: drop-shadow(0 0 3px rgba(217,162,30,.45)); }
.sc-name { min-width: 0; } .sc-name b { display: block; font-size: 15px; color: var(--ink); } .sc-name small { display: block; font-size: 12px; color: var(--ink2); }
.sc-state { font-size: 12px; font-weight: 700; color: var(--ink3); white-space: nowrap; }
.sc-row.got .sc-state { color: var(--crimson); }
.sc-row:not(.got) .sc-name b { color: var(--ink2); }
.new-best { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 1px 8px; border-radius: 3px; color: #fff1ea; background: var(--crimson); animation: stampIn .5s 1.2s both; }
.res-flame { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: #b6411f; }
.res-next-note { margin: 0; font-size: 13px; color: var(--ink2); text-align: center; }
.res-actions:has(.pass-replay) .res-again { display: none; } /* (after "not now" on a pass night, the pass UI's own replay button is the one) */
/* the night card: the third star's time, my best here */
.intro-par { margin: 10px 0 0; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 15px; color: rgba(243,233,210,.82); }
.intro-best { display: inline-flex; align-items: center; gap: 6px; } .intro-best small { font-size: 12px; color: rgba(243,233,210,.55); }
.intro-par[hidden] { display: none; }
/* the ending */
.end-modal { text-align: center; }
.end-kick { margin: 4px 0 0; font-size: 13px; letter-spacing: .22em; color: var(--ink3); }
.end-title { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 12px; font-size: 32px; }
.end-title .seal { width: 40px; height: 40px; font-size: 15px; }
.end-body { margin: 0 auto 6px; max-width: 34em; font-size: 16px; line-height: 1.85; color: var(--ink); }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) {
  .howto-mini .tonight { grid-column: 1 / -1; }
  .tonight { gap: 8px; padding: 6px 10px; }
  .tonight .tn-seal { width: 30px; height: 30px; font-size: 15px; }
  .tonight .tn-kick { display: none; } .tonight .tn-place { font-size: 14px; } .tonight .tn-ghost { font-size: 12px; } .tonight .tn-par { display: none; }
  .tonight .tn-go { padding: 6px 10px; font-size: 12px; }
  .modal.pick-modal { padding: 12px 12px 10px; }
  .pick h3 { margin-bottom: 8px; font-size: 17px; }
  .pick-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 128px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 8px 2px 6px; }
  .pc { scroll-snap-align: center; min-height: 0; padding: 8px 6px 10px; gap: 3px; }
  .pc-place { min-height: 0; font-size: 13.5px; } .pc-ghost { min-height: 0; } .pc-g svg { width: 22px; height: 28px; }
  .pick-note { margin-top: 6px; font-size: 11.5px; }
  .sc-row { padding: 3px 8px; } .sc-name b { font-size: 13.5px; } .sc-name small { font-size: 11px; }
}
@media (orientation: portrait) and (max-width: 720px) {
  .howto-mini .tonight { grid-column: 1 / -1; }
  .tonight { gap: 8px; padding: 8px 10px; }
  .tonight .tn-seal { width: 30px; height: 30px; font-size: 15px; }
  .tonight .tn-kick, .tonight .tn-par { display: none; }
  .tonight .tn-place { font-size: 14px; white-space: normal; } .tonight .tn-ghost { font-size: 12px; }
  .tonight .tn-go { font-size: 0; padding: 4px 9px; } .tonight .tn-go i { font-size: 20px; } /* (the whole card is the button: just its chevron) */
  .modal.pick-modal { padding: 16px 14px 14px; }
  .pick-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pc { min-height: 0; padding: 10px 6px 10px; }
  .pc-place { min-height: 0; }
  .end-title { font-size: 26px; }
}

/* ── 휴대폰: 전체 화면 다시 켜기 · 아이폰 홈 화면 안내 · 앱 안 브라우저 (js/ui/mobile.js, docs/NOTES-MOBILE.md) ── */
.fs-pill { position: absolute; z-index: 75; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px 4px 9px;
  left: calc(12px + var(--sal)); bottom: calc(10px + var(--sab));
  border: 0; border-radius: 999px; font-size: 12.5px; letter-spacing: .02em; color: rgba(243,233,210,.86); background: rgba(8,9,20,.58);
  box-shadow: 0 0 0 1px rgba(243,233,210,.24) inset; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: .82; }
.fs-pill i { width: 15px; height: 15px; display: block; }
.fs-pill i svg { width: 100%; height: 100%; }
.fs-pill::before { content: ''; position: absolute; inset: -7px; } /* a bigger finger target than it looks */
.fs-pill:active { opacity: 1; background: rgba(255,180,105,.2); }
/* (in a night: top middle, dimmer; on the result: bottom-left) */
#ui[data-screen=game] .fs-pill { left: 50%; bottom: auto; top: calc(2px + var(--sat)); transform: translateX(-50%); opacity: .55; }
#ui:not([data-screen=game]):not([data-screen=result]) .fs-pill { display: none; } /* (title, lobby: a button in their own rows, .fs-slot) */
.fs-slot svg { width: 17px; height: 17px; }
.m-card { position: absolute; z-index: 74; pointer-events: auto; left: 50%; bottom: calc(12px + var(--sab)); transform: translateX(-50%); width: max-content;
  max-width: min(560px, calc(100% - 32px - var(--sal) - var(--sar))); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 8px;
  font-size: 13.5px; line-height: 1.45; color: var(--paper); background: rgba(11,13,26,.92); box-shadow: 0 0 0 1px rgba(255,180,105,.45) inset, 0 12px 30px rgba(0,0,0,.5);
  animation: mCard .5s cubic-bezier(.2,.9,.3,1.1) both; }
.m-card .m-ico { flex: none; width: 26px; height: 26px; color: var(--lantern); }
.m-card .m-ico svg { width: 100%; height: 100%; }
.m-card .m-txt { display: flex; flex-direction: column; gap: 2px; }
.m-card .m-txt > b { font-size: 14px; color: #fff3df; }
.m-card .m-txt span b { color: var(--lantern); }
.m-card .btn { flex: none; min-height: 40px; }
#ui[data-screen=game] .m-card { display: none; }
@keyframes mCard { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ── 밤의 이야기 (ui/story.js; docs/NOTES-UI.md "말 줄이기"): the night card's first time, and the lobby's 「이야기 다시 읽기」 ── */
.intro-story { max-width: 540px; margin: 16px 0 2px; font-family: var(--serif); font-size: 16.5px; line-height: 1.8; color: rgba(243,233,210,.9); text-wrap: pretty; }
.intro-story[hidden] { display: none; }
.intro-story p { margin: 0 0 2px; animation: fade 1.1s calc(.5s + var(--i, 0) * .9s) both; }
.intro.story h2 { font-size: clamp(40px, 6.4vw, 60px); }
.intro.story .intro-rule { margin: 14px 0 10px; }
.intro.story .intro-goal { font-size: 16px; opacity: .86; }
.intro.story .intro-place small { display: none; } /* (the place line: the story says it) */
.intro.story .intro-skip { animation-delay: 2.4s; }
.intro[data-theme=asylum] .intro-story { color: rgba(222,232,244,.9); }
html:lang(en) .intro-story { font-style: italic; }
@media (max-height: 520px) {
  .intro-story { margin-top: 8px; font-size: 13.5px; line-height: 1.55; max-width: 620px; }
  .intro.story h2 { font-size: 34px; } .intro.story .intro-place { margin-top: 2px; }
  .intro.story .intro-rule { margin: 6px 0 6px; } .intro.story .intro-par { display: none; } .intro.story .intro-skip { display: block; margin-top: 6px; }
}
@media (max-height: 380px) { .intro-story { font-size: 12.5px; line-height: 1.45; } .intro.story .intro-kick, .intro.story .intro-diff { display: none; } }
.story-btn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: center; justify-self: start; min-height: 44px;
  font-size: 14px; color: rgba(243,233,210,.78); }
.story-btn svg { width: 20px; height: 20px; flex: none; }
.story-btn[hidden] { display: none; }
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape), (orientation: portrait) and (max-width: 720px) {
  .howto-mini { position: relative; } .howto-mini .goal { padding-right: 46px; }
  .howto-mini .story-btn { position: absolute; top: -10px; right: 0; width: 44px; padding: 0; }
  .howto-mini .story-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.modal.story-modal { width: min(560px, 100%); }
.story-modal-in { text-align: center; }
.story-modal-in .intro-kick { color: var(--ink3, rgba(0,0,0,.5)); text-shadow: none; }
.story-place { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0 0; }
.story-place .seal { width: 32px; height: 32px; font-size: 14px; }
.story-place b { font-family: var(--serif); font-weight: 800; font-size: 22px; letter-spacing: .1em; }
.story-place small { font-size: 13px; opacity: .7; }
.story-modal-in .intro-story { margin: 14px auto 18px; color: inherit; text-shadow: none; font-size: 15.5px; }
.story-modal-in .intro-story p { animation-delay: calc(.1s + var(--i, 0) * .25s); }
/* the loading screen before a night (ui/loading.js; owner's play-test 2026-11-29): the boot screen's lantern, the night's name and
   place, one line, a bar — transform / opacity animations only, so they keep moving while the page builds the night */
.night-load { position: absolute; inset: 0; z-index: 65; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
  padding: calc(20px + var(--sat)) calc(24px + var(--sar)) calc(20px + var(--sab)) calc(24px + var(--sal)); pointer-events: auto; cursor: progress;
  background: radial-gradient(60% 50% at 50% 56%, #1c1838, #0b0d1a 72%); transition: opacity .45s ease; }
.night-load[hidden] { display: none; }
.night-load.out { opacity: 0; pointer-events: none; }
.night-load[data-theme=asylum], .night-load[data-theme=bathhouse] { background: radial-gradient(60% 50% at 50% 56%, #16223a, #070b16 72%); }
.nl-lamp { position: relative; width: 26px; height: 34px; margin-top: 26px; transform-origin: 50% -26px; animation: nlSway 2.6s ease-in-out infinite; will-change: transform; }
.nl-lamp::before { content: ''; position: absolute; left: 50%; top: -24px; width: 2px; height: 22px; margin-left: -1px; background: rgba(243,233,210,.5); }
.nl-lamp i { position: absolute; inset: 0; border-radius: 9px; background: radial-gradient(circle at 50% 55%, #fff2c8, #ffb469 55%, #d9532b); box-shadow: 0 0 46px 14px rgba(255,170,90,.42); }
.nl-lamp i::before, .nl-lamp i::after { content: ''; position: absolute; left: 3px; right: 3px; height: 5px; border-radius: 2px; background: var(--crimson2); }
.nl-lamp i::before { top: -3px; } .nl-lamp i::after { bottom: -3px; background: #2f3f78; }
.nl-lamp::after { content: ''; position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,170,90,.22), transparent 65%); animation: nlGlow 2.2s ease-in-out infinite; will-change: opacity, transform; }
.nl-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nl-seal { width: 30px; height: 30px; font-size: 13px; }
.nl-night { font-family: var(--brush); font-weight: 400; font-size: clamp(48px, 8vw, 72px); line-height: 1.05; color: #fbf3e2;
  text-shadow: 0 0 22px rgba(255,180,105,.4), 0 0 60px rgba(255,140,80,.18), 0 3px 0 rgba(0,0,0,.5); }
.no-brush .nl-night { font-family: var(--serif); font-weight: 800; letter-spacing: .08em; font-size: clamp(34px, 6vw, 50px); }
.nl-place { font-size: 15px; font-weight: 700; letter-spacing: .24em; color: rgba(243,233,210,.72); }
.nl-line { margin: 0; font-size: 15px; letter-spacing: .12em; color: rgba(243,233,210,.6); }
html:lang(en) .nl-line, html:lang(en) .nl-place { letter-spacing: .04em; } html:lang(en) .nl-line { font-style: italic; }
.nl-bar { width: 120px; height: 2px; border-radius: 1px; background: rgba(243,233,210,.12); overflow: hidden; }
.nl-bar b { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--lantern), transparent); animation: nlBar 1.6s ease-in-out infinite; will-change: transform; }
@keyframes nlSway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes nlGlow { 50% { opacity: .55; transform: scale(1.18); } }
@keyframes nlBar { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@media (max-height: 520px) { .night-load { gap: 12px; } .nl-lamp { margin-top: 22px; } .nl-night { font-size: 44px; } .no-brush .nl-night { font-size: 32px; } }
@media (prefers-reduced-motion: reduce) { .night-load * { animation: none !important; } }
/* the night card's wait (hud.js prepMode; server/rooms.js PREP): 확인, who is ready, the clock burning down */
.intro-prep { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 18px 0 0; animation: rise .5s .25s both; }
.intro-prep[hidden], .intro-skip[hidden] { display: none; }
.intro-prep-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.intro-ok { min-width: 168px; min-height: 48px; font-size: 17px; pointer-events: auto; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.intro-ok.done, .intro-ok:disabled { color: var(--paper); background: rgba(243,233,210,.08); box-shadow: inset 0 0 0 1px rgba(243,233,210,.3); cursor: default; opacity: 1; }
.intro-ok.done::before { content: '✓'; color: var(--gold); margin-right: .1em; }
.intro-prep-n { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--gold); font-variant-numeric: tabular-nums; }
.intro-prep-n[hidden], .intro-prep-note[hidden] { display: none; }
.intro-prep-bar { width: 200px; height: 2px; border-radius: 1px; background: rgba(243,233,210,.1); overflow: hidden; }
.intro-prep-bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(255,180,105,.25), var(--lantern)); transform-origin: 0 50%; }
.intro-prep-note { font-size: 12.5px; color: rgba(243,233,210,.55); letter-spacing: .04em; }
.intro.prep .intro-tip { margin-top: 14px; }
@media (max-height: 520px) {
  .intro-prep { margin-top: 10px; gap: 6px; } .intro-ok { min-height: 44px; min-width: 150px; font-size: 16px; } .intro-prep-bar { width: 160px; }
  .intro.prep .intro-tip { display: none; } /* (a phone: the 확인 row wins the space) */
  .intro.prep.story .intro-goal { display: none; }
}
