/* 편앞 V23 · Night Break. One design system; no remote fonts or build step. */
:root {
  color-scheme: dark;
  --bg: #141a22; --surface: #1b232d; --surface-raised: #232d38; --surface-hover: #2a3641;
  --text: #f3f2ed; --muted: #a2adb8; --quiet: #778793;
  --accent: #c6e5a8; --accent-hover: #d8edc4; --accent-soft: #c6e5a812;
  --accent2: #b5cfd5; --danger: #ffb2a8; --ok: #c6e5a8; --ink: #233122;
  --line: #ffffff12; --line-strong: #ffffff22; --shadow: 0 24px 100px #0006;
  --radius: 18px; --header-height: 80px; --app-vh: 100dvh; --layout-vh: min(100dvh, var(--app-vh));
  --font: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; background: var(--bg); }
body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button { transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease; }
button:not(:disabled):active { filter: brightness(.94); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; vertical-align: middle; }
h1,h2,h3,p,figure { margin: 0; }
h1,h2,h3 { line-height: 1.3; letter-spacing: -.045em; }
input,select,textarea { min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); padding: 12px; }
input::placeholder,textarea::placeholder { color: var(--quiet); }
select { max-width: 100%; }
::selection { background: #c6e5a844; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 12px; background: #65737e66; }
* { scrollbar-width: thin; scrollbar-color: #65737e66 transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 1000; padding: 12px 20px; color: var(--ink); background: var(--accent); border-radius: 10px; }
.skip-link:focus { top: 10px; }
.material-symbols-rounded { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 20px; height: 20px; font-size: 0; vertical-align: middle; }
.material-symbols-rounded svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .16em; font-weight: 650; line-height: 1.5; }
.eyebrow .material-symbols-rounded { margin-right: 5px; width: 15px; height: 15px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; min-width: 44px; min-height: 44px; padding: 10px; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.primary-btn,.buy-btn,.danger-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 22px; border-radius: 12px; background: var(--accent); color: var(--ink); font-weight: 750; text-align: center; }
.primary-btn:hover,.buy-btn:hover { background: var(--accent-hover); }
.danger-btn { background: var(--danger); color: #452321; }
.secondary-action-btn,.ghost-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 10px 16px; background: var(--surface-raised); color: var(--muted); border-radius: 12px; }
.secondary-action-btn:hover,.ghost-btn:hover { background: var(--surface-hover); color: var(--text); }
.status-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #c6e5a809; }

/* Brand & persistent application header */
.app-header { height: var(--header-height); display: flex; align-items: center; gap: 32px; padding: 0 3.5%; border-bottom: 1px solid var(--line); position: relative; z-index: 30; background: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
#brandTitle { font-size: 27px; font-weight: 900; letter-spacing: -.075em; }
.brand-english { margin-left: 3px; font-size: 18px; font-weight: 650; letter-spacing: -.05em; }
.brand-dot { color: var(--accent); }
.brand-symbol { position: relative; width: 31px; height: 31px; background: var(--accent); border-radius: 8px; display: flex; padding: 6px 5px 17px; }
.brand-symbol i { width: 7px; height: 6px; border-radius: 1px 1px 3px 3px; background: #26372c; }
.brand-symbol i:nth-child(2) { background: #769464; }
.brand-symbol b { position: absolute; left: 7px; bottom: 5px; height: 11px; width: 17px; border: 2px solid #26372c; }
.brand-symbol b::after { content: ''; position: absolute; right: 3px; top: 0; height: 100%; width: 2px; background: #26372c; }
.header-tagline { color: var(--quiet); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.header-guide { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; background: transparent; color: #bdc6cc; font-size: 12px; }
.header-guide:hover { color: var(--accent); }
.header-guide .material-symbols-rounded { width: 17px; height: 17px; }
.header-presence { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding-right: 12px; border-right: 1px solid var(--line); }
.header-presence b { color: var(--text); }
.onboarding-active .header-presence { display: none; }
.preview-badge { font-size: 10px; color: #efcc92; background: #efcc9210; border: 1px solid #efcc922b; border-radius: 5px; padding: 3px 8px; }
.motion-toggle[aria-pressed=true] { color: var(--accent); background: var(--accent-soft); }

/* Onboarding, intentionally editorial rather than a blocking alert box. */
.pixel-modal-backdrop { position: fixed; inset: 0 0 auto; height: var(--layout-vh); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 28px; background: #0a101abc; backdrop-filter: blur(12px); overflow: auto; overscroll-behavior: contain; }
.pixel-modal { position: relative; width: min(700px,100%); max-height: min(90dvh,1000px); padding: 32px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: var(--shadow); overflow: auto; overscroll-behavior: contain; animation: panel-in .22s ease-out both; }
.pixel-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.pixel-modal-header h2 { margin-top: 8px; font-size: 28px; font-weight: 780; }
.pixel-modal-header p:not(.eyebrow) { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.8; word-break: keep-all; }
.pixel-modal-header-actions { display: flex; align-items: center; }
.modal-close-btn { background: #ffffff07; }
.location-backdrop { padding: 30px; }
.location-modal { width: min(1248px,100%); padding: 32px 36px 22px; max-height: 92dvh; }
.location-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.selection-progress { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--quiet); }
.selection-progress span { display: inline-flex; align-items: center; gap: 6px; }
.selection-progress b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-raised); font-size: 10px; }
.selection-progress .active { color: var(--accent); }
.selection-progress .active b { color: var(--ink); background: var(--accent); }
.selection-progress i { width: 28px; height: 1px; background: var(--line-strong); }
.location-layout { display: grid; grid-template-columns: 1fr 1.02fr; gap: clamp(32px,6vw,84px); }
.welcome-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.welcome-kicker span { width: 5px; height: 5px; background: var(--accent); }
.welcome-title { margin-top: 19px; font-size: clamp(38px,4vw,58px); line-height: 1.28; letter-spacing: -.065em; font-weight: 800; }
.welcome-title em { color: var(--accent); font-style: normal; }
.welcome-description { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.9; letter-spacing: -.015em; }
.hero-window { position: relative; overflow: hidden; margin-top: 29px; height: 248px; border-radius: 16px; border: 1px solid #ffffff14; background: #11182c; }
.hero-window > img { width: 100%; height: 100%; object-fit: cover; }
.hero-window::after { content: ''; position: absolute; inset: 30% 0 0; background: linear-gradient(transparent,#080f1ddd); pointer-events: none; }
.hero-label { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 6px; color: #e0e8e2; background: #111c29ce; font-size: 9px; backdrop-filter: blur(8px); }
.hero-label .status-dot { width: 4px; height: 4px; }
.hero-window figcaption { position: absolute; z-index: 1; bottom: 19px; left: 21px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: #d6dfeb; letter-spacing: -.02em; }
.hero-caption-line { width: 21px; height: 1px; background: var(--accent); }
.welcome-bottom { display: flex; align-items: center; gap: 13px; margin-top: 23px; }
.companion-stack { display: flex; padding-left: 0; }
.companion-stack img { width: 37px; height: 37px; padding: 2px; object-fit: contain; background: #27313a; border-radius: 50%; border: 3px solid var(--bg); }
.companion-stack img + img { margin-left: -8px; }
.welcome-bottom p { color: var(--quiet); font-size: 10px; line-height: 1.8; }
.welcome-bottom p strong { color: var(--muted); font-weight: 500; }
.welcome-spark { margin-left: auto; font-size: 38px; line-height: 1; color: var(--accent); font-family: sans-serif; font-weight: 300; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.section-heading .eyebrow { font-size: 9px; letter-spacing: .14em; color: var(--quiet); }
.section-heading h2 { font-size: 25px; margin-top: 9px; font-weight: 750; }
.section-count { color: var(--quiet); font-size: 10px; white-space: nowrap; padding-bottom: 4px; }
.section-description { margin: 9px 0 23px; color: var(--muted); font-size: 12px; }
.location-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.room-btn { position: relative; text-align: left; background: var(--surface); border-radius: 13px; overflow: hidden; border: 1px solid var(--line-strong); padding: 0; }
.room-card-image { display: block; height: 116px; position: relative; overflow: hidden; background: #161e32; }
.room-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease,filter .25s ease; filter: saturate(.9); }
.room-card-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#08132133,transparent 70%); }
.room-card-tag { position: absolute; top: 10px; left: 10px; color: #edf3f7; font-size: 7px; font-weight: 650; letter-spacing: .08em; padding: 3px 6px; background: #131b29b0; border-radius: 3px; z-index: 1; }
.room-card-body { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 12px 14px; }
.room-card-body strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.025em; }
.room-card-body small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.room-arrow { display: inline-flex; color: #8b9a98; width: 22px; height: 22px; }
.room-arrow .material-symbols-rounded { width: 16px; height: 16px; }
.room-check { display: none; position: absolute; top: 9px; right: 9px; z-index: 2; width: 24px; height: 24px; align-items: center; justify-content: center; background: var(--accent); color: var(--ink); border-radius: 50%; }
.room-btn.active { border-color: var(--accent); background: #25332d; }
.room-btn.active .room-check { display: flex; }
.room-btn.active .room-arrow { color: var(--accent); }
.room-btn:hover:not(:disabled) { border-color: #c6e5a877; background: #232f31; }
.room-btn:hover:not(:disabled) img { transform: scale(1.055); filter: saturate(1.12); }
.room-btn:focus-visible { outline-offset: 3px; }
.room-btn.loading { border-color: var(--accent); }
.location-next-hint { display: flex; justify-content: center; gap: 8px; align-items: center; margin-top: 19px; color: var(--quiet); font-size: 10px; }
.location-next-hint .material-symbols-rounded { width: 15px; height: 15px; color: var(--accent); }
.welcome-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 23px; margin-top: 32px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 10px; }
.welcome-footer > div { display: flex; gap: 22px; }
.welcome-footer > div > span { display: inline-flex; align-items: center; gap: 6px; }
.welcome-footer .material-symbols-rounded { width: 14px; height: 14px; }
.welcome-footer button { background: none; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 10px; }
.welcome-footer button:hover { color: var(--accent); }
.onboarding-active .location-backdrop { top: var(--header-height); height: calc(var(--layout-vh) - var(--header-height)); padding: 24px 4%; background: var(--bg); backdrop-filter: none; z-index: 40; }
.onboarding-active .location-modal { width: min(1248px,100%); padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; max-height: none; overflow: visible; margin: auto; }
.onboarding-active .world-app { visibility: hidden; }
.setup-complete .location-modal { max-width: 810px; }
.setup-complete .welcome-story,.setup-complete .selection-progress,.setup-complete .welcome-footer { display: none; }
.setup-complete .location-layout { display: block; }
.setup-complete .location-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.setup-complete .location-top { margin-bottom: 10px; }
.setup-complete .room-card-image { height: 112px; }

/* Food, companion, people, and safety dialogs */
.food-modal { width: min(840px,100%); }
.food-current-strip { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; background: #141b2380; padding: 14px 16px; margin-bottom: 23px; }
.location-pin { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.food-current-strip b { font-size: 13px; display: block; }
.food-current-strip small { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.step-badge { margin-left: auto; color: var(--accent); font-size: 9px; letter-spacing: .1em; white-space: nowrap; }
.food-filters { display: flex; gap: 5px; margin-bottom: 17px; flex-wrap: wrap; }
.food-filters button { min-height: 38px; padding: 7px 13px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.food-filters button.active { background: var(--accent-soft); color: var(--accent); }
.food-filters button:hover { background: var(--surface-hover); }
.food-choice-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.food-choice { position: relative; display: flex; flex-direction: column; align-items: center; padding: 14px 5px 12px; border: 1px solid var(--line); border-radius: 13px; background: #222c36; text-align: center; }
.food-choice img { width: 76px; height: 76px; object-fit: contain; margin-bottom: 8px; image-rendering: pixelated; }
.food-choice b { font-size: 12px; letter-spacing: -.02em; }
.food-choice small { font-size: 10px; color: var(--muted); margin-top: 4px; }
.food-choice:hover:not(:disabled),.mascot-choice:hover:not(:disabled) { border-color: #c6e5a866; background: #2a353c; }
.food-choice.active,.mascot-choice.active { background: #2c3933; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.food-choice.active::after,.mascot-choice.active::after { content: '✓'; position: absolute; right: 8px; top: 6px; color: var(--accent); font-size: 12px; }
.food-choice em { position: absolute; top: 6px; left: 6px; background: var(--accent); color: var(--ink); border-radius: 4px; padding: 2px 4px; font-size: 8px; font-style: normal; }
.virtual-item-note { font-size: 10px; color: var(--quiet); display: flex; align-items: center; gap: 6px; margin: 16px 0 25px; }
.virtual-item-note .material-symbols-rounded { width: 14px; height: 14px; }
.food-modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.food-confirm-btn { min-width: 210px; }
.food-confirm-btn:disabled { background: var(--surface-raised); color: var(--muted); opacity: .7; }
.guide-modal-backdrop,.table-modal-backdrop,.mascot-modal-backdrop { z-index: 80; }
.guide-modal { width: min(780px,100%); }
.guide-title-wrap { display: flex; gap: 17px; align-items: center; }
.guide-mascot { width: 68px; height: 68px; object-fit: contain; }
.guide-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-card { position: relative; padding: 21px; border-radius: 13px; background: var(--surface-raised); }
.guide-step-badge { color: var(--accent); font-size: 11px; display: block; margin-bottom: 8px; }
.guide-card strong { display: flex; gap: 7px; align-items: center; font-size: 14px; }
.guide-card p { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 9px; word-break: keep-all; }
.guide-icon-manual { margin-top: 23px; }
.guide-icon-manual h3 { font-size: 15px; margin-bottom: 10px; }
.guide-icon-row { display: grid; grid-template-columns: 28px 60px 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.guide-icon-row > .material-symbols-rounded { color: var(--accent); }
.guide-icon-row small { font-size: 11px; color: var(--muted); }
.guide-quality-note,.modal-flow-note { color: var(--muted); font-size: 11px; line-height: 1.9; padding: 18px 0; }
.guide-ok-btn,.mascot-ok-btn,.table-ok-btn { width: 100%; }
.mascot-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.mascot-choice { position: relative; display: grid; justify-items: center; gap: 5px; padding: 20px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-raised); }
.mascot-choice img { width: 82px; height: 82px; object-fit: contain; image-rendering: pixelated; margin-bottom: 8px; }
.mascot-choice b { font-size: 13px; }
.mascot-choice small { color: var(--muted); font-size: 10px; }
.table-people-list { display: grid; gap: 10px; margin-bottom: 22px; }
.table-person { display: flex; align-items: center; gap: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.table-person.mine { border-color: #c6e5a84d; }
.table-person-media { display: flex; align-items: center; flex-shrink: 0; }
.table-person-media img { width: 40px; height: 40px; object-fit: contain; }
.table-person strong { font-size: 13px; }
.table-person small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; }
.table-person em { margin-left: auto; color: var(--accent); font-size: 9px; font-style: normal; }
.report-backdrop { z-index: 90; }
.report-modal { width: min(480px,100%); }
#reportForm label { display: block; font-size: 12px; margin-bottom: 8px; }
#reportForm label small { color: var(--quiet); }
#reportForm select,#reportForm textarea { width: 100%; margin-bottom: 18px; resize: vertical; }
.selection-error { color: var(--danger); border: 1px solid #ffb2a833; background: #ffb2a80b; padding: 12px; margin-top: 14px; border-radius: 10px; font-size: 12px; overflow-wrap: anywhere; }

/* The inhabited world: scene and readable conversation are independent layers. */
.world-app { height: calc(var(--layout-vh) - var(--header-height)); padding: 20px; display: grid; grid-template-columns: minmax(0,1fr) 372px; gap: 18px; max-width: 1920px; margin: 0 auto; min-height: 0; }
.world-stage { min-width: 0; min-height: 0; position: relative; isolation: isolate; overflow: hidden; border-radius: 20px; border: 1px solid var(--line-strong); background: #121a2c; }
.world-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transition: opacity .35s ease; z-index: -2; }
.world-bg.is-changing { opacity: .3; }
.world-vignette { position: absolute; inset: 0; background: linear-gradient(180deg,#101724bd,transparent 38%,transparent 64%,#101724ba); z-index: -1; pointer-events: none; }
.scene-heading { position: absolute; top: 28px; left: 28px; right: 24px; z-index: 4; pointer-events: none; }
.scene-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; color: #d6e4cc; border: 1px solid #d8e9c726; padding: 6px 10px; border-radius: 7px; background: #15242183; backdrop-filter: blur(10px); }
.scene-heading h1 { font-size: clamp(22px,2.5vw,35px); margin-top: 13px; font-weight: 760; }
.scene-heading p { font-size: 11px; color: #bbc6d8; margin-top: 8px; }
.scene-footer { position: absolute; bottom: 18px; left: 22px; right: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 6; }
.scene-footer > span { display: flex; align-items: center; gap: 7px; color: #c6cfdb; font-size: 9px; }
.scene-footer > span > .material-symbols-rounded { width: 15px; height: 15px; }
.scene-control { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 8px; color: #d0d8df; background: #131c2ad4; border: 1px solid #ffffff1c; font-size: 10px; min-height: 40px; flex-shrink: 0; }
.scene-control:hover { background: #2a3942; }
.scene-control .material-symbols-rounded { width: 16px; height: 16px; }
.seat-layer { position: absolute; inset: 20% 3% 4%; z-index: 3; }
.seat { position: absolute; transform: translate(-50%,-50%); width: clamp(80px,8vw,124px); cursor: pointer; filter: drop-shadow(0 6px 4px #0005); border-radius: 15px; }
.seat.center-seat { width: clamp(104px,10vw,146px); z-index: 3; }
.seat.center-seat::after { content: '내 자리'; position: absolute; left: 50%; top: 85%; transform: translateX(-50%); padding: 3px 10px; border-radius: 7px; background: var(--accent); color: var(--ink); font-size: 9px; font-weight: 750; white-space: nowrap; }
.seat:hover,.seat:focus-visible { filter: drop-shadow(0 0 9px #c6e5a899); }
.seat-table { width: 100%; }
.seat-occupants { position: absolute; inset: 0; pointer-events: none; }
.seat-occupant { position: absolute; width: 44%; height: 56%; transform: translate(-50%,-50%); }
.seat.shared-seat .seat-occupant { width: 37%; }
.seat-food-img,.seat-mascot-img { position: absolute; left: 50%; transform: translate(-50%,-50%); height: auto; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(1px 3px 1px #0005); }
.seat-food-img { top: 18%; width: 58%; z-index: 3; }
.seat-mascot-img { top: 70%; width: 86%; z-index: 2; }
.seat-name,.seat-occupant em,.seat-shared-count,.seat-extra-count { position: absolute; top: 88%; left: 50%; transform: translateX(-50%); background: #162131df; color: #e6e9ec; padding: 3px 7px; border: 1px solid #ffffff1e; border-radius: 5px; font-size: 9px; white-space: nowrap; font-style: normal; max-width: 140%; overflow: hidden; text-overflow: ellipsis; }
.seat-shared-count { display: inline-flex; gap: 3px; top: 73%; left: 87%; color: var(--accent); }
.seat-shared-count .material-symbols-rounded { width: 11px; height: 11px; }
.seat-occupant em { top: 100%; font-size: 7px; }
.empty-seat-hint { position: absolute; left: 50%; top: 62%; transform: translate(-50%,-50%); border-radius: 10px; padding: 12px 18px; background: #151f2ddc; width: 280px; font-size: 12px; text-align: center; }
.floating-bubble { position: absolute; z-index: 12; transform: translate(-50%,-100%); max-width: min(220px,70vw); min-width: 44px; background: #f3f1e9; color: #243039; border-radius: 12px 12px 12px 3px; box-shadow: 0 5px 20px #0003; padding: 10px 13px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; pointer-events: none; animation: bubble-in .2s ease-out; }
.floating-bubble.mine { background: var(--accent); border-radius: 12px 12px 3px 12px; }
.floating-bubble-name { display: block; font-size: 9px; color: #536154; margin-bottom: 3px; }

/* Chat surface */
.chat-dock { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.dialogue-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 23px 22px 17px; }
.dialogue-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat-title-icon { width: 37px; height: 37px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 11px; }
.dialogue-title h2 { font-size: 17px; font-weight: 750; }
.dialogue-title small { display: block; color: var(--quiet); font-size: 10px; margin-top: 4px; }
.live-pill { color: var(--accent); letter-spacing: .08em; font-size: 8px; display: inline-flex; gap: 5px; align-items: center; }
.live-pill .status-dot { width: 4px; height: 4px; }
.system-line { padding: 0 22px 12px; color: var(--muted); font-size: 10px; line-height: 1.7; min-height: 29px; overflow-wrap: anywhere; }
.scope-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.scope-tabs { display: inline-flex; border-radius: 9px; padding: 3px; background: #141b23; gap: 2px; }
.scope-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; background: none; color: var(--quiet); border-radius: 6px; padding: 7px 12px; font-size: 11px; }
.scope-btn .material-symbols-rounded { width: 14px; height: 14px; }
.scope-btn.active { background: #29382f; color: var(--accent); }
.scope-btn[data-scope=private].active { background: #333140; color: #dbcae9; }
.history-toggle { position: relative; width: 36px; min-width: 36px; min-height: 38px; padding: 9px; }
.history-toggle.active { color: var(--accent); }
.history-toggle.has-new::after { content: ''; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.unread-count { position: absolute; top: 0; right: 0; min-width: 14px; background: var(--accent); color: var(--ink); border-radius: 6px; font-size: 8px; padding: 0 3px; }
.message-history-panel { flex: 1 1 180px; min-height: 100px; position: relative; display: flex; flex-direction: column; }
.history-toolbar { text-align: center; color: var(--quiet); font-size: 9px; padding: 13px 16px 1px; }
.messages { flex: 1; overflow: auto; min-height: 0; padding: 14px 18px; overflow-anchor: auto; }
.message-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 18px; }
.message-meta { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--quiet); margin: 0 1px 6px; width: 100%; min-height: 16px; }
.message-meta strong { color: #c6d0d4; font-size: 10px; font-weight: 550; }
.message-meta time { font-size: 8px; }
.scope-label { display: none; }
.message-row.private .scope-label { display: inline-flex; align-items: center; gap: 2px; color: #cebadf; font-size: 8px; }
.scope-label .material-symbols-rounded { width: 10px; height: 10px; }
.message-row p { background: #29343f; border: 1px solid #ffffff04; padding: 10px 13px; max-width: 94%; border-radius: 3px 12px 12px 12px; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.message-row.mine { align-items: flex-end; }
.message-row.mine .message-meta { justify-content: flex-end; }
.message-row.mine p { background: #c6e5a8; color: #263526; border-radius: 12px 3px 12px 12px; border-color: transparent; }
.message-row.private p { border-color: #b79fce4f; }
.message-row.private.mine p { background: #d7c9e3; color: #34273f; }
.report-btn { background: transparent; color: var(--quiet); margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 3px 2px; font-size: 8px; opacity: .5; }
.report-btn .material-symbols-rounded { width: 11px; height: 11px; }
.message-row:hover .report-btn,.report-btn:focus-visible { opacity: 1; color: var(--danger); }
.local-line { color: var(--quiet); text-align: center; font-size: 9px; padding: 8px 12px; margin: 10px 0; line-height: 1.8; overflow-wrap: anywhere; }
.chat-empty { position: absolute; top: 44%; left: 50%; transform: translate(-50%,-50%); text-align: center; width: 85%; pointer-events: none; }
.chat-empty img { width: 65px; height: 65px; object-fit: contain; opacity: .85; margin-bottom: 15px; }
.chat-empty strong { display: block; color: #c9d0ce; font-size: 14px; }
.chat-empty p { font-size: 11px; line-height: 1.9; color: var(--quiet); margin-top: 10px; }
.private-target-wrap { margin: 12px 18px 0; padding: 10px 12px; border: 1px solid #ccb5dd38; border-radius: 10px; background: #b79fce09; }
.private-target-wrap label { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #d3c2e1; margin-bottom: 7px; }
.private-target-wrap label .material-symbols-rounded { width: 13px; height: 13px; }
.private-target-wrap select { width: 100%; padding: 8px; font-size: 11px; }
.private-target-wrap small { display: block; margin-top: 5px; color: var(--quiet); font-size: 9px; }
.composer { padding: 14px 16px 15px; margin-top: auto; }
.chat-form { display: grid; grid-template-columns: 28px minmax(0,1fr) 36px; align-items: center; gap: 4px; padding: 7px; border: 1px solid #c6e5a843; background: #141c23; border-radius: 12px; transition: box-shadow .18s; }
.chat-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #c6e5a80a; }
.chat-form input { width: 100%; border: 0; padding: 8px 3px; font-size: 12px; background: transparent; outline: none; box-shadow: none; }
.chat-icon-btn { display: grid; place-items: center; min-height: 36px; padding: 0; border-radius: 8px; background: none; color: var(--muted); }
.scope-toggle-btn .material-symbols-rounded { width: 16px; height: 16px; }
.scope-toggle-btn.private { color: #d3c2e1; }
.send-icon-btn { background: var(--accent); color: var(--ink); }
.send-icon-btn:hover:not(:disabled) { background: var(--accent-hover); }
.send-icon-btn .material-symbols-rounded { width: 19px; height: 19px; }
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--quiet); font-size: 8px; margin: 7px 3px 0; }
#charCount { white-space: nowrap; font-variant-numeric: tabular-nums; }
#charCount.near-limit { color: #e4c79d; }
.quick-action-bar { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 13px 13px 11px; border-top: 1px solid var(--line); gap: 4px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: transparent; border-radius: 10px; padding: 8px 2px; color: #b0bcbf; min-height: 55px; font-size: 9px; }
.quick-action-btn .material-symbols-rounded { width: 19px; height: 19px; }
.quick-action-btn:hover { background: var(--surface-hover); color: var(--accent); }
.my-profile { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 13px 20px; background: #18212a; }
.profile-avatar { display: block; flex-shrink: 0; background: #2b3736; border-radius: 12px; width: 40px; height: 40px; padding: 3px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: contain; }
.my-profile strong { display: block; font-size: 11px; }
.my-profile small { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.me-label { margin-left: auto; color: var(--accent); font-size: 9px; background: var(--accent-soft); padding: 2px 7px; border-radius: 5px; }
.connection-notice { margin: 0 18px 12px; border: 1px solid #ffb2a833; background: #ffb2a809; padding: 10px; border-radius: 8px; color: var(--danger); font-size: 11px; }
.focus-mode .world-app { grid-template-columns: minmax(0,1fr); }
.focus-mode .chat-dock { display: none; }
.focus-mode .world-bg { object-fit: cover; }
.focus-mode .scene-control { color: var(--accent); }

/* Feedback & restrained motion */
.pixel-loading-backdrop { position: fixed; inset: 0; z-index: 110; background: #10182180; backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; padding: 25px; }
.pixel-loading-card { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 34px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); max-width: 360px; text-align: center; }
.pixel-loading-card strong { font-size: 17px; }
.pixel-loading-card small { color: var(--muted); font-size: 12px; }
.pixel-loader { width: 27px; height: 27px; border: 2px solid #c6e5a822; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.app-toast { position: fixed; left: 50%; bottom: max(28px,env(safe-area-inset-bottom)); transform: translate(-50%,10px); z-index: 150; display: flex; gap: 10px; align-items: center; width: max-content; max-width: min(520px,calc(100vw - 32px)); padding: 14px 20px; background: #d5e8c7; border: 1px solid #e4f3d8; border-radius: 13px; color: #263625; box-shadow: 0 8px 40px #0007; font-size: 12px; line-height: 1.7; opacity: 0; transition: opacity .2s, transform .2s; overflow-wrap: anywhere; }
.app-toast.show { opacity: 1; transform: translate(-50%,0); }
.app-toast.danger { background: #48322f; border-color: #9c5c50; color: #ffd8d2; }
.noscript-note { position: fixed; inset: auto 20px 20px; z-index: 200; padding: 20px; border-radius: 12px; color: var(--ink); background: var(--accent); text-align: center; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bubble-in { from { opacity: 0; margin-top: 5px; } to { opacity: 1; margin-top: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
body.reduce-motion *,body.reduce-motion *::before,body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Responsive layouts. The keyboard resizes --app-vh via visualViewport. */
@media (min-width: 1600px) {
  .onboarding-active .location-modal { width: 1320px; }
  .room-card-image { height: 135px; }
  .hero-window { height: 280px; }
  .world-app { grid-template-columns: minmax(0,1fr) 410px; }
}
@media (max-width: 1100px) {
  .header-tagline { display: none; }
  .onboarding-active .location-backdrop { padding: 28px 4%; align-items: flex-start; }
  .location-layout { gap: 32px; }
  .welcome-title { font-size: 43px; }
  .hero-window { height: 228px; }
  .section-heading h2 { font-size: 21px; }
  .room-card-image { height: 108px; }
  .room-card-body { padding: 11px; }
  .room-card-body small { font-size: 9px; }
  .world-app { grid-template-columns: minmax(0,1fr) 330px; padding: 14px; gap: 14px; }
  .scene-footer > span > span { max-width: 155px; }
  .seat { width: 85px; }
  .seat.center-seat { width: 110px; }
}
@media (max-width: 760px) {
  :root { --header-height: 64px; }
  .app-header { padding: 0 20px; gap: 16px; }
  #brandTitle { font-size: 24px; }
  .brand-english { font-size: 16px; }
  .brand-symbol { width: 29px; height: 29px; }
  .header-actions { gap: 4px; }
  .header-guide span:not(.material-symbols-rounded) { display: none; }
  .header-guide { padding: 0 7px; }
  .header-presence { font-size: 10px; padding-right: 6px; gap: 5px; }
  .header-presence > span:not(.sr-only) { display: none; }
  .preview-badge { font-size: 8px; max-width: 112px; text-align: center; line-height: 1.5; }
  .pixel-modal-backdrop { padding: 16px; }
  .pixel-modal { padding: 25px; border-radius: 20px; max-height: calc(var(--layout-vh) - 32px); }
  .onboarding-active .location-backdrop { padding: 22px 24px 26px; }
  .location-top > .eyebrow { display: none; }
  .location-top { margin-bottom: 26px; justify-content: flex-end; }
  .selection-progress { font-size: 10px; }
  .location-layout { grid-template-columns: minmax(0,1fr); gap: 34px; }
  .welcome-story { position: relative; }
  .welcome-kicker { font-size: 10px; }
  .welcome-title { font-size: 45px; margin-top: 14px; }
  .welcome-description { font-size: 12px; margin-top: 14px; }
  .hero-window { height: 220px; margin-top: 24px; }
  .welcome-bottom { display: none; }
  .section-heading h2 { font-size: 23px; }
  .section-description { margin-bottom: 18px; }
  .location-choice-grid { gap: 12px; }
  .room-card-image { height: 135px; }
  .room-card-body { padding: 12px; }
  .room-card-body small { font-size: 10px; }
  .welcome-footer { flex-direction: column; gap: 6px; margin-top: 26px; padding-top: 17px; }
  .welcome-footer > div { gap: 12px; font-size: 9px; }
  .welcome-footer > div .material-symbols-rounded { width: 12px; height: 12px; }
  .setup-complete .location-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .setup-complete .location-top { justify-content: space-between; }
  .setup-complete .location-top > .eyebrow { display: block; font-size: 8px; }
  .setup-complete .location-modal { padding: 22px; }
  .world-app { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(165px,42%) minmax(0,1fr); height: calc(var(--layout-vh) - var(--header-height)); padding: 10px 12px max(10px,env(safe-area-inset-bottom)); gap: 10px; }
  .world-stage { border-radius: 15px; }
  .world-bg { object-position: 50% 61%; }
  .scene-heading { top: 14px; left: 16px; }
  .scene-tag { font-size: 8px; padding: 4px 7px; }
  .scene-heading h1 { font-size: 22px; margin-top: 7px; }
  .scene-heading p { display: none; }
  .scene-footer { bottom: 10px; left: 13px; right: 11px; }
  .scene-footer > span { font-size: 8px; }
  .scene-footer > span > span { max-width: 190px; }
  .scene-control { font-size: 0; padding: 8px; min-height: 34px; }
  .scene-control > span:not(.material-symbols-rounded) { display: none; }
  .seat-layer { inset: 18% 4% 4%; }
  .seat { width: 60px; }
  .seat.center-seat { width: 78px; }
  .seat-name,.seat-occupant em { display: none; }
  .seat.center-seat::after { font-size: 7px; padding: 1px 5px; }
  .floating-bubble { font-size: 10px; padding: 7px 10px; max-width: 145px; }
  .chat-dock { border-radius: 15px; }
  .dialogue-header { padding: 11px 14px 8px; }
  .dialogue-title { gap: 8px; }
  .chat-title-icon { width: 27px; height: 27px; border-radius: 8px; }
  .chat-title-icon .material-symbols-rounded { width: 16px; height: 16px; }
  .dialogue-title h2 { font-size: 14px; }
  .dialogue-title small { display: none; }
  .system-line { display: none; }
  .scope-toolbar { padding: 0 11px 7px; }
  .scope-btn { min-height: 28px; font-size: 10px; padding: 5px 12px; }
  .history-toggle { min-height: 32px; height: 32px; }
  .message-history-panel { flex-basis: 60px; min-height: 36px; }
  .history-toolbar { display: none; }
  .messages { padding: 9px 13px; }
  .message-row { margin-bottom: 11px; }
  .message-row p { padding: 7px 10px; font-size: 11px; }
  .message-meta { margin-bottom: 4px; }
  .chat-empty img { display: none; }
  .chat-empty strong { font-size: 12px; }
  .chat-empty p { margin-top: 4px; font-size: 10px; }
  .composer { padding: 8px 10px 6px; }
  .chat-form { padding: 4px; grid-template-columns: 27px minmax(0,1fr) 36px; }
  .chat-form input { font-size: 16px; padding: 4px 3px; line-height: 26px; }
  .composer-meta { font-size: 8px; margin-top: 4px; }
  .quick-action-bar { padding: 6px 9px; gap: 4px; }
  .quick-action-btn { flex-direction: row; gap: 4px; padding: 7px 0; font-size: 8px; min-height: 38px; }
  .quick-action-btn .material-symbols-rounded { width: 15px; height: 15px; }
  .my-profile { display: none; }
  .private-target-wrap { margin: 7px 11px 0; padding: 7px 9px; }
  .private-target-wrap label { display: none; }
  .private-target-wrap select { padding: 6px; font-size: 12px; }
  .private-target-wrap small { font-size: 8px; }
  .connection-notice { font-size: 10px; margin: 0 12px 6px; padding: 6px; }
  .focus-mode .world-app { grid-template-rows: 1fr; }
  .focus-mode .scene-control { font-size: 10px; }
  .focus-mode .scene-control > span:not(.material-symbols-rounded) { display: inline; }
  .keyboard-open { --header-height: 52px; }
  .keyboard-open .world-app { grid-template-rows: 0 minmax(0,1fr); gap: 0; }
  .keyboard-open .world-stage { visibility: hidden; border: 0; }
  .keyboard-open .quick-action-bar,.keyboard-open .dialogue-header { display: none; }
  .food-choice-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .food-modal { padding: 22px; }
  .pixel-modal-header h2 { font-size: 25px; }
  .pixel-modal-header p:not(.eyebrow) { font-size: 12px; }
  .food-modal-actions { gap: 10px; }
  .food-modal-actions .secondary-action-btn { font-size: 11px; padding: 10px; }
  .food-confirm-btn { min-width: 0; flex: 1; font-size: 12px; padding: 12px; }
  .food-current-strip { padding: 11px; }
  .food-filters { gap: 2px; }
  .food-filters button { font-size: 10px; padding: 7px 9px; }
  .guide-mascot { display: none; }
  .guide-card { padding: 15px; }
  .guide-card strong { font-size: 13px; }
  .guide-card p { font-size: 11px; }
  .mascot-choice-grid { gap: 9px; }
  .mascot-choice { padding: 14px 6px; }
  .mascot-choice img { width: 65px; height: 65px; }
}
@media (max-width: 430px) {
  .app-header { padding: 0 16px; }
  .brand { gap: 8px; }
  .brand-english { font-size: 14px; margin-left: 2px; }
  .preview-badge { max-width: none; white-space: nowrap; padding: 3px 5px; font-size: 8px; }
  .header-actions .icon-btn { min-width: 34px; padding: 8px; }
  .onboarding-active .location-backdrop { padding: 20px 20px 24px; }
  .location-top { margin-bottom: 22px; }
  .welcome-title { font-size: 40px; }
  .hero-window { height: 190px; border-radius: 12px; }
  .hero-window figcaption { font-size: 9px; left: 14px; }
  .room-card-image { height: 100px; }
  .room-card-body { padding: 11px 10px; }
  .room-card-body strong { font-size: 13px; }
  .room-card-body small { font-size: 9px; }
  .room-card-tag { font-size: 6px; top: 7px; left: 7px; }
  .room-arrow { width: 15px; }
  .location-choice-grid { gap: 10px; }
  .section-heading h2 { font-size: 22px; }
  .welcome-footer > div { gap: 10px; font-size: 8px; }
  .food-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .food-choice img { width: 68px; height: 68px; }
  .food-choice { padding: 12px 5px; }
  .food-modal-actions { position: sticky; bottom: -22px; background: var(--surface); padding-bottom: 4px; box-shadow: 0 -10px 14px var(--surface); }
  .food-modal-actions .secondary-action-btn { font-size: 10px; }
  .food-modal-actions .secondary-action-btn .material-symbols-rounded { width: 15px; height: 15px; }
  .guide-card-grid { grid-template-columns: 1fr; }
  .mascot-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .table-person { gap: 8px; padding: 11px; }
  .table-person-media img { width: 28px; height: 35px; }
  .world-app { padding-left: 8px; padding-right: 8px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .onboarding-active .location-backdrop { align-items: flex-start; }
  .onboarding-active .location-modal { margin-top: 0; }
  .my-profile { display: none; }
  .dialogue-header { padding: 12px 18px 9px; }
  .quick-action-bar { padding: 4px 10px; }
  .quick-action-btn { min-height: 40px; gap: 3px; }
  .system-line { max-height: 35px; overflow: hidden; }
}

/* Small landscape windows prioritize composing instead of clipping the controls. */
@media (max-width: 760px) and (max-height: 500px) {
  .setup-complete:not(.focus-mode) .world-app { grid-template-rows: 0 minmax(0,1fr); gap: 0; }
  .setup-complete:not(.focus-mode) .world-stage { visibility: hidden; border: 0; }
  .setup-complete:not(.focus-mode) .dialogue-header { display: none; }
  .setup-complete .message-history-panel { min-height: 0; }
}
@media (max-width: 430px) {
  .demo-mode .brand-english { display: none; }
}
