:root {
  --brand-red: #E31F26; --brand-orange: #E87724; --brand-amber: #ED9A21;
  --ink: #1F2328; --panel: rgba(24, 28, 34, 0.82); --line: #D6DAE0; --ok: #2E8B57; --disabled: #B7BCC3;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; font-size: 16px; color: #fff; background: #BFD8F0; -webkit-user-select: none; user-select: none; }
button { font: inherit; -webkit-touch-callout: none; touch-action: manipulation; }
.stage { position: fixed; inset: 0; touch-action: none; -webkit-touch-callout: none; }
.stage:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: -3px; }
.scene-canvas { display: block; width: 100%; height: 100%; }
.hud-top {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5; pointer-events: none;
  display: flex; gap: 8px; align-items: flex-start;
  padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) 0 calc(8px + var(--safe-left));
}
.badge { pointer-events: auto; flex: none; padding: 6px 10px; border-radius: 999px; background: var(--panel); font-size: 13px; font-weight: 700; border: 1px solid rgba(255,255,255,.25); }
.stepbar { pointer-events: auto; flex: 1; min-width: 0; max-width: 560px; margin-left: auto; padding: 8px 12px; border-radius: 12px; background: var(--panel); }
.step-label { margin: 0 0 6px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-dots { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0; padding: 0; list-style: none; }
.step-dots[hidden] { display: none; }
.step-dots li { height: 6px; border-radius: 3px; background: rgba(255,255,255,.28); }
.step-dots li.done { background: var(--ok); }
.step-dots li[aria-current="step"] { background: var(--brand-orange); }
.hud-tools { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.tool-btn { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 13px; cursor: pointer; }
.tool-btn[hidden] { display: none; }
.tool-btn[aria-pressed="true"] { background: rgba(255,255,255,.18); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(132px + var(--safe-top)); z-index: 5; width: max-content; max-width: min(92vw, 560px); margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--panel); font-size: 15px; line-height: 1.45; text-align: center; pointer-events: none; }
.toast:empty { display: none; }
.toast.ok { border: 2px solid var(--ok); }
.toast.warn { border: 2px solid var(--brand-red); }
.actions { position: fixed; z-index: 6; right: calc(14px + var(--safe-right)); bottom: calc(20px + var(--safe-bottom)); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; max-width: min(64vw, 300px); }
.act-btn {
  min-height: 52px; min-width: 120px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--brand-red); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25); position: relative; overflow: hidden;
}
.act-btn:active, .act-btn.held { filter: brightness(.85); }
.act-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.act-btn:disabled { background: var(--disabled); color: #fff; cursor: not-allowed; box-shadow: none; }
.act-secondary { background: #fff; color: var(--brand-red); border: 2px solid var(--brand-red); }
.act-btn kbd { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.25); font-size: 12px; font-family: inherit; }
.act-secondary kbd { background: rgba(227,31,38,.12); }
.act-btn .fill { position: absolute; left: 0; bottom: 0; height: 4px; background: #fff; width: 0; }
@media (pointer: coarse) { .act-btn kbd, .remote-note { display: none; } }
.remote { position: fixed; z-index: 6; right: calc(14px + var(--safe-right)); bottom: calc(20px + var(--safe-bottom)); width: min(62vw, 260px); padding: 10px; border-radius: 16px; background: var(--panel); border: 2px solid #F0B323; }
.remote[hidden] { display: none; }
.remote-read { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--brand-amber); font-variant-numeric: tabular-nums; }
.remote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-btn { min-height: 56px; border: 0; border-radius: 12px; background: #F4F5F6; color: var(--ink); font-size: 18px; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.rm-btn small { display: block; font-size: 11px; font-weight: 500; }
.rm-up { grid-column: 1 / -1; min-height: 76px; font-size: 24px; }
.rm-btn.held { background: var(--brand-orange); color: #fff; transform: translateY(2px); }
.rm-btn.locked, .rm-btn.locked.held { background: var(--disabled); color: var(--ink); transform: none; }
.rm-small { font-size: 14px; }
.rm-wide { grid-column: 1 / -1; min-height: 48px; }
.rm-btn[hidden] { display: none; }
.remote-note { margin: 6px 0 0; font-size: 11px; opacity: .8; }
.inspect { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--safe-bottom)); display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 12px; background: var(--panel); max-width: 94vw; }
.inspect[hidden] { display: none; }
.inspect p { margin: 0; font-size: 14px; }
.panel { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left)); background: rgba(10, 12, 16, .55); }
.panel[hidden] { display: none; }
body.panel-open .actions, body.panel-open .remote, body.panel-open .joystick { display: none !important; }
.panel-box { width: min(100%, 560px); max-height: 100%; overflow: auto; border-radius: 16px; background: #1D222A; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.panel-box.wide { width: min(100%, 1100px); }
.panel-head { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; background: #1D222A; border-bottom: 1px solid rgba(255,255,255,.12); }
.panel-head h2 { flex: 1; margin: 0; font-size: 18px; }
.panel-close { min-width: 48px; min-height: 48px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; cursor: pointer; }
.panel-body { padding: 12px 16px 16px; }
.panel-lead { margin: 0 0 10px; font-size: 15px; opacity: .9; }
.panel-note { margin: 10px 0 0; font-size: 12px; opacity: .7; }
.book-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.book-row { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; align-items: center; }
.book-nav { min-height: 96px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; cursor: pointer; }
.book-nav:disabled { opacity: .3; cursor: default; }
.book-stage { position: relative; overflow: hidden; border-radius: 8px; background: #fff; aspect-ratio: 1067 / 600; touch-action: pan-y; perspective: 1400px; }
.book-stage.zoomed { overflow: auto; touch-action: pan-x pan-y; }
.book-img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.book-stage.zoomed .book-img { width: 200%; height: auto; max-width: none; }
.book-img.flip-next { animation: flipNext .35s ease-out; transform-origin: left center; }
.book-img.flip-prev { animation: flipPrev .35s ease-out; transform-origin: right center; }
@keyframes flipNext { from { transform: rotateY(-28deg); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes flipPrev { from { transform: rotateY(28deg); opacity: .4; } to { transform: none; opacity: 1; } }
.book-missing { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink); font-weight: 700; }
.book-missing[hidden], .book-img[hidden] { display: none; }
.book-count { margin: 8px 0 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .book-row { grid-template-columns: 1fr 1fr; }
  .book-stage { grid-column: 1 / -1; order: -1; }
  .book-nav { min-height: 52px; }
  .panel-body { padding: 10px 10px 14px; }
}
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.board-tabs [aria-selected="true"] { background: var(--brand-red); border-color: var(--brand-red); }
.board-card { min-height: 160px; padding: 14px; border-radius: 12px; background: #fff; color: var(--ink); }
.board-card h3 { margin: 0 0 8px; font-size: 17px; }
.board-card ul, .board-card ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 1.5; }
.board-note { margin: 10px 0 0; font-size: 12px; color: #5C5F66; }
.board-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.board-count { margin: 0; font-weight: 700; }
.finish { position: fixed; z-index: 9; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 520px); padding: 20px; border-radius: 16px; background: var(--panel); text-align: center; }
.finish[hidden] { display: none; }
.finish h2 { margin: 0 0 12px; font-size: 22px; }
.finish-nums { display: grid; gap: 8px; margin-bottom: 14px; }
.finish-nums p { margin: 0; display: grid; }
.finish-nums strong { font-size: 30px; color: var(--brand-amber); }
.finish-nums span { font-size: 13px; opacity: .85; }
.finish-btns { display: grid; gap: 8px; }
.finish-note { margin: 12px 0 0; font-size: 12px; opacity: .8; }
.joystick { position: absolute; left: calc(18px + var(--safe-left)); bottom: calc(24px + var(--safe-bottom)); width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.7); display: none; place-items: center; touch-action: none; z-index: 2; }
.joystick-knob { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.9); border: 2px solid var(--ink); }
@media (pointer: coarse) { .joystick { display: grid; } }
body.riding .joystick, body.inspecting .joystick { display: none; }
.perf-bar { position: fixed; left: calc(8px + var(--safe-left)); top: calc(56px + var(--safe-top)); z-index: 4; margin: 0; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }
.perf-bar[hidden], .perf-bar:empty { display: none; }
.nogl { position: fixed; inset: auto 16px 40% 16px; padding: 16px; border-radius: 12px; background: var(--panel); text-align: center; }
@media (max-width: 520px) {
  .hud-top { flex-direction: column; }
  .stepbar { width: 100%; max-width: none; }
  .perf-bar { top: calc(164px + var(--safe-top)); }
  .toast { top: calc(164px + var(--safe-top)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.space-pill { pointer-events: auto; flex: none; display: grid; gap: 1px; margin: 0; padding: 6px 14px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255,255,255,.18); max-width: min(46vw, 320px); }
.space-pill b { font-size: 15px; }
.space-pill span { font-size: 12px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepbar { margin-top: 54px; }
body:not([data-space="plaza"]) .stepbar { display: none; }
.space-tools { position: fixed; z-index: 7; top: calc(8px + var(--safe-top)); right: calc(8px + var(--safe-right)); display: flex; gap: 6px; }
.sp-btn { min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; }
.sp-btn[hidden] { display: none; }
.sp-primary { border: 0; background: var(--brand-red); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.sp-secondary { border: 1px solid rgba(255,255,255,.5); background: var(--panel); color: #fff; }
.sp-round { padding: 0; width: 44px; border: 1px solid rgba(255,255,255,.4); background: var(--panel); color: #fff; font-size: 18px; }
.sp-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.veil { position: fixed; inset: 0; z-index: 40; background: #0C0E12; opacity: 0; pointer-events: none; transition: opacity .2s; }
.veil.on { opacity: 1; pointer-events: auto; }
.veil.quick { transition: none; }
.sw-back { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); background: rgba(12,14,18,.55); animation: sw-in .2s ease-out; }
.sw-back.quick { animation: none; }
@keyframes sw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sw-win { position: relative; width: min(94vw, 980px); max-height: 100%; overflow: auto; padding: 22px 22px 16px; border-radius: 24px; background: #FBFAF7; color: var(--ink); box-shadow: 0 16px 48px rgba(0,0,0,.28); border-top: 4px solid var(--brand-orange); }
.sw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sw-kicker { margin: 0; font-size: 12px; color: #6B7079; letter-spacing: .12em; }
.sw-head h2 { margin: 2px 0 0; font-size: 24px; }
.sw-close { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #D6DAE0; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.sw-lead { margin: 6px 0 14px; font-size: 15px; color: #4A4F57; }
.sw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 899px) { .sw-grid { grid-template-columns: repeat(2, 1fr); } }
.sw-card { display: flex; flex-direction: column; padding: 0; border: 1px solid #E4E2DD; border-radius: 18px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; transition: transform .15s, border-color .15s; font: inherit; }
.sw-card:hover, .sw-card:focus-visible { border: 2px solid var(--brand-orange); transform: translateY(-2px); outline: none; }
.sw-card:focus-visible { box-shadow: 0 0 0 3px var(--brand-orange); }
.sw-card.here, .sw-card.locked { cursor: default; }
.sw-card.locked:hover, .sw-card.here:hover { transform: none; border: 1px solid #E4E2DD; }
.sw-pic { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; }
.sw-pic svg { display: block; width: 100%; height: 100%; }
.sw-card.locked .sw-pic svg { filter: grayscale(1); opacity: .6; }
.sw-no { position: absolute; left: 10px; top: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 13px; font-weight: 700; color: var(--ink); }
.sw-text { display: grid; gap: 4px; padding: 12px 16px 14px; }
.sw-cat { font-size: 12px; font-weight: 700; color: var(--brand-orange); }
.sw-card.locked .sw-cat { color: #8C9198; }
.sw-name { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.sw-lock { display: inline-flex; color: #8C9198; }
.sw-desc { font-size: 14px; line-height: 1.5; color: #4A4F57; min-height: 3em; }
.sw-cond { padding-top: 6px; border-top: 1px solid #ECEAE6; font-size: 12px; color: #6B7079; }
.sw-go { font-size: 14px; font-weight: 700; color: var(--brand-red); }
.sw-card.locked .sw-go { color: #8C9198; font-weight: 400; }
.sw-here { justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--brand-orange); color: #fff; font-size: 13px; font-weight: 700; }
.sw-locked-note { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; color: var(--brand-red); }
.sw-foot { margin: 4px 0 0; font-size: 13px; color: #6B7079; }
@media (max-width: 599px) {
  .sw-win { padding: 16px 14px 12px; }
  .sw-grid { grid-template-columns: 1fr; gap: 10px; }
  .sw-card { flex-direction: row; }
  .sw-pic { flex: none; width: 112px; height: 84px; aspect-ratio: auto; }
  .sw-text { padding: 8px 12px; gap: 2px; }
  .sw-desc { min-height: 0; font-size: 13px; }
}
.en-back { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; background: rgba(12,14,18,.25); }
.en-card { width: min(92vw, 420px); padding: 22px 22px 16px; border-radius: 20px; background: rgba(24,28,34,.86); border-top: 3px solid var(--brand-orange); box-shadow: 0 16px 48px rgba(0,0,0,.3); text-align: center; }
.en-kicker { margin: 0; font-size: 12px; letter-spacing: .14em; opacity: .75; }
.en-card h1 { margin: 6px 0 8px; font-size: 26px; }
.en-lead { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.en-box { margin: 0 0 16px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 12px; font-size: 13px; line-height: 1.5; opacity: .92; }
.en-go { min-height: 52px; width: 100%; border: 0; border-radius: 999px; background: var(--brand-red); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.en-go:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.en-note { margin: 10px 0 0; font-size: 12px; opacity: .7; }
.ctl-hint { position: fixed; z-index: 6; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: 92vw; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--panel); font-size: 14px; pointer-events: none; transition: opacity 1.2s; }
.ctl-hint.dim { opacity: 0; }
.bottom-bar { position: fixed; z-index: 6; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); display: flex; gap: 8px; }
.bb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: var(--panel); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.bb-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.bb-ico { color: var(--brand-orange); }
.todo-pop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(86vw, 300px); padding: 8px; border-radius: 16px; background: rgba(24,28,34,.92); border-top: 3px solid var(--brand-orange); display: grid; gap: 4px; }
.todo-pop[hidden] { display: none; }
.todo-head { margin: 2px 6px 4px; font-size: 13px; opacity: .75; }
.todo-item { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; text-align: left; font-size: 14px; cursor: pointer; }
.todo-item:hover, .todo-item:focus-visible { background: rgba(232,119,36,.35); outline: none; }
@media (max-width: 599px) { .bb-txt { display: none; } .bb-btn { width: 48px; justify-content: center; padding: 0; font-size: 18px; } }
.ctl-hint { bottom: calc(72px + var(--safe-bottom)); }
body.wn-open .bottom-bar, body.wn-open .space-tools, body.wn-open .hud-top, body.wn-open .actions, body.wn-open .toast, body.wn-open .joystick { display: none; }
body.wn-open .scene-canvas { filter: blur(6px) brightness(.85); }
.wn-back { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom)); background: rgba(12,14,18,.45); }
.wn-back.dark { background: rgba(8,9,12,.62); }
.wn-win { width: min(94vw, 980px); max-height: 100%; overflow: auto; padding: 18px 20px 20px; border-radius: 24px; background: #FBFAF7; color: var(--ink); border-top: 4px solid var(--brand-orange); box-shadow: 0 16px 48px rgba(0,0,0,.28); }
.wn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wn-path { flex: 1; margin: 0; font-size: 13px; color: #6B7079; min-width: 0; }
.wn-chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D6DAE0; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.wn-chip[aria-pressed="true"] { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.wn-chip.dark { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.wn-close { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #D6DAE0; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.wn-close.dark { background: var(--brand-red); border: 0; color: #fff; }
.wn-chip:focus-visible, .wn-close:focus-visible, .vw-play:focus-visible, .if-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.wn-todo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 10px; border-radius: 14px; background: #F2EFE9; }
.wn-todo[hidden] { display: none; }
.wn-todo-item { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid #E4E2DD; background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; }
.wn-title { margin: 12px 0 2px; font-size: 24px; }
.wn-desc { margin: 0 0 12px; font-size: 15px; color: #4A4F57; line-height: 1.5; }
.vw-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vw-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.vw-search { min-height: 40px; width: min(100%, 260px); padding: 0 14px; border-radius: 999px; border: 1px solid #D6DAE0; font: inherit; font-size: 14px; -webkit-user-select: text; user-select: text; }
.vw-search:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 1px; }
.vw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 899px) { .vw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .vw-grid { grid-template-columns: 1fr; } .wn-win { padding: 14px; } }
.vw-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid #E4E2DD; border-radius: 18px; background: #fff; }
.vw-card.on { border: 2px solid var(--brand-orange); }
.vw-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: linear-gradient(#2A2320, #120F0E); border-top: 3px solid var(--brand-orange); display: grid; place-items: center; }
.vw-yt { padding: 3px 10px; border-radius: 999px; background: #E31F26; color: #fff; font-size: 12px; font-weight: 700; }
.vw-neon { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 14px; font-weight: 700; color: #FFF1E6; text-shadow: 0 0 8px #FF7A2E; }
.vw-tag { align-self: flex-start; padding: 1px 10px; border-radius: 999px; background: rgba(232,119,36,.14); color: #B85A12; font-size: 12px; font-weight: 700; }
.vw-card h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.vw-card p { margin: 0; flex: 1; font-size: 13px; line-height: 1.5; color: #4A4F57; }
.vw-play { min-height: 44px; border: 0; border-radius: 999px; background: var(--brand-red); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.vw-empty { margin: 12px 0; color: #6B7079; }
.cw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; overflow-y: auto; min-height: 0; }
@media (max-width: 899px) { .cw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .cw-grid { grid-template-columns: 1fr; } }
.cw-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid #E4E2DD; border-radius: 18px; background: #fff; }
.cw-card h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.cw-card p { margin: 0; flex: 1; font-size: 13px; line-height: 1.5; color: #4A4F57; }
.cw-img { display: block; border: 1px solid #E4E2DD; border-radius: 10px; overflow: hidden; background: #fff; }
.cw-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.vw-play.link { display: grid; place-items: center; text-decoration: none; }
.vp-win { width: min(96vw, 1100px); max-height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 22px; background: rgba(20,18,17,.82); color: #fff; box-shadow: 0 16px 48px rgba(0,0,0,.4); }
.vp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vp-head .wn-path { color: rgba(255,255,255,.65); }
.vp-head h2 { margin: 2px 0 0; font-size: 18px; }
.vp-btns { display: flex; gap: 6px; flex: none; }
.vp-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100dvh - 190px); margin: 0 auto; background: #000; border-radius: 12px; overflow: hidden; }
.vp-frame.vertical { aspect-ratio: 9 / 16; width: auto; height: min(calc(100dvh - 190px), 720px); }
.vp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.vp-foot p { margin: 0; font-size: 13px; opacity: .78; }
.wn-win.wide { width: min(96vw, 1100px); }
.if-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.if-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #D6DAE0; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.if-btn.primary { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.if-btn.call { border-color: var(--brand-orange); color: #B85A12; }
.if-box { height: min(60dvh, 560px); border-radius: 14px; overflow: hidden; border: 1px solid #E4E2DD; background: #fff; }
.if-frame { width: 100%; height: 100%; border: 0; }
.if-blocked { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center; color: #4A4F57; }
.if-open { min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--brand-red); color: #fff; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; }
.if-note { margin: 8px 0 0; font-size: 12px; color: #6B7079; }
.if-note a { color: var(--brand-red); }
body[data-space="unit"] #remote, body[data-space="unit"] .stepbar { display: none !important; }
.unit-panel { position: fixed; z-index: 8; left: 50%; bottom: calc(76px + var(--safe-bottom)); transform: translateX(-50%); width: min(94vw, 620px); padding: 12px 14px; border-radius: 18px; background: rgba(24,28,34,.88); border-top: 3px solid var(--brand-orange); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.unit-panel[hidden] { display: none; }
body.lift-view .unit-panel { left: auto; right: 12px; transform: none; width: min(62vw, 300px); padding: 8px 10px; }
body.lift-view .unit-panel .ux-steps li { font-size: 11px; }
body.lift-view .unit-panel .ux-count { margin: 0 0 4px; font-size: 22px; }
body.lift-view .unit-panel .ux-btn { min-height: 40px; padding: 0 12px; font-size: 13px; }
body.lift-view .unit-panel .ux-note, body.lift-view .unit-panel .ux-where, body.lift-view .unit-panel .ux-guide, body.lift-view .unit-panel .ux-row.small { display: none; }
body.wn-open .unit-panel { display: none; }
body.entry-open .unit-panel { display: none; }
.en-halls { display: grid; gap: 8px; margin-top: 10px; }
.en-row { display: grid; grid-template-columns: 4.6em 1fr 1fr; align-items: center; gap: 8px; }
.en-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 16px; font-weight: 800; text-align: left; }
.en-row .en-go.en-hall { width: 100%; font-size: 16px; }
.en-go.en-hall { min-height: 48px; background: #fff; color: var(--brand-red); border: 2px solid var(--brand-red); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.en-go.en-hall.soon { background: rgba(255,255,255,.12); color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.3); cursor: default; }
.en-soon { padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12px; font-weight: 700; }
@media (max-height: 700px) { .en-card { padding: 16px 18px 12px; } .en-card h1 { font-size: 22px; } .en-lead { margin-bottom: 10px; } .en-go { min-height: 46px; } .en-go.en-hall { min-height: 44px; } }
@media (min-width: 600px) { .unit-panel.rgs-panel { left: auto; right: 12px; transform: none; width: min(42vw, 420px); padding: 10px 12px; } .unit-panel.rgs-panel .ux-note { display: none; } .unit-panel.rgs-panel .ux-btn { min-height: 36px; font-size: 13px; padding: 0 12px; } }
@media (max-width: 599px) { .unit-panel.rgs-panel { padding: 8px 10px; } .unit-panel.rgs-panel .ux-note { display: none; } .unit-panel.rgs-panel .ux-title { font-size: 14px; margin: 0 0 4px; } .unit-panel.rgs-panel .ux-guide { font-size: 12px; margin: 0 0 6px; } .unit-panel.rgs-panel .ux-row { gap: 6px; } .unit-panel.rgs-panel .ux-btn { min-height: 34px; padding: 0 10px; font-size: 12px; } }
@media (min-width: 600px) { .unit-panel.side { left: auto; right: 12px; transform: none; width: min(40vw, 400px); padding: 10px 12px; } .unit-panel.side .ux-where { display: none; } }
@media (max-width: 599px) { .unit-panel.side { padding: 8px 10px; } .unit-panel.side .ux-steps, .unit-panel.side .ux-where { display: none; } .unit-panel.side .ux-guide { font-size: 12px; margin: 0 0 6px; } .unit-panel.side .ux-btn { min-height: 38px; font-size: 13px; } .unit-panel.side .ux-row.small { display: none; } }
@media (min-width: 600px) { .unit-panel.orbit { left: auto; right: 12px; transform: none; width: min(40vw, 400px); padding: 10px 12px; } .unit-panel.orbit .ux-note { display: none; } .unit-panel.orbit .ux-btn { min-height: 36px; font-size: 13px; padding: 0 12px; } }
@media (max-width: 599px) { .unit-panel.orbit { padding: 8px 10px; } .unit-panel.orbit .ux-guide, .unit-panel.orbit .ux-note { display: none; } .unit-panel.orbit .ux-title { font-size: 14px; margin: 0 0 4px; } .unit-panel.orbit .ux-row { gap: 6px; } .unit-panel.orbit .ux-btn { min-height: 34px; padding: 0 10px; font-size: 12px; } }
.ux-title { margin: 0 0 2px; font-size: 17px; font-weight: 700; }
.ux-guide { margin: 4px 0 8px; font-size: 14px; line-height: 1.5; }
.ux-note { margin: 6px 0 0; font-size: 12px; opacity: .72; }
.pip-frame { position: fixed; z-index: 6; border: 2px solid var(--brand-orange); border-radius: 10px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.pip-frame.danger { border-color: #E31F26; border-width: 3px; }
.pip-frame.danger span { background: #B3161D; }
.cmp-chip { position: fixed; z-index: 6; left: 50%; top: 14px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: #1F7A3E; color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,.3); pointer-events: none; white-space: nowrap; }
.cmp-chip[hidden] { display: none; }
@media (max-width: 599px) { .cmp-chip { top: 108px; left: 12px; transform: none; font-size: 12px; padding: 4px 10px; } .pip-frame.danger span { right: 4px; top: 4px; bottom: auto; white-space: normal; line-height: 1.3; border-radius: 6px; text-align: center; } }
.pip-frame span { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(20,18,17,.82); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pip-frame.bolt span { right: 6px; white-space: normal; line-height: 1.3; border-radius: 8px; text-align: center; }
@media (max-width: 599px) { .pip-frame span { left: 4px; bottom: 4px; padding: 1px 6px; font-size: 10px; } .pip-frame.bolt span { right: 4px; top: 4px; bottom: auto; white-space: normal; line-height: 1.3; border-radius: 6px; text-align: center; } }
.door-btn { position: fixed; z-index: 7; left: 50%; top: 40%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--brand-red); color: #fff; font: inherit; font-size: 22px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.35); cursor: pointer; white-space: nowrap; animation: door-in .25s ease-out; }
.door-btn[hidden] { display: none; }
.door-btn kbd { padding: 2px 9px; border-radius: 8px; background: rgba(255,255,255,.25); font: inherit; font-size: 15px; }
.door-btn.soon { background: #4A4F57; }
.door-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 3px; }
@media (max-width: 599px) { .door-btn { font-size: 18px; min-height: 56px; padding: 0 22px; top: 38%; } .door-btn kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .door-btn { animation: none; } }
@keyframes door-in { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
body.no-hud > *:not(#stage) { display: none !important; }
.ux-where { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: #FFB27A; }
.ux-warn { margin: 4px 0 8px; padding: 6px 10px; border-radius: 10px; background: rgba(227,31,38,.18); font-size: 13px; font-weight: 700; }
.ux-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ux-row.small { justify-content: flex-end; }
.ux-btn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; }
.ux-btn.primary, .ux-btn.up { background: var(--brand-red); border-color: var(--brand-red); }
.ux-btn.hold.held { background: var(--brand-orange); border-color: var(--brand-orange); transform: translateY(1px); }
.ux-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.ux-steps { display: flex; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; }
.ux-steps li { flex: 1; padding: 4px 0; border-radius: 999px; background: rgba(255,255,255,.16); text-align: center; font-size: 13px; font-weight: 700; opacity: .85; }
.ux-steps li.now { background: var(--brand-orange); opacity: 1; }
.ux-steps li.done { background: var(--ok); opacity: 1; }
.ux-bar { display: grid; grid-template-columns: 74px 1fr 20px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; }
.ux-bar-track { position: relative; height: 12px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.ux-bar-track::after { content: ''; position: absolute; top: 0; bottom: 0; left: 80%; right: 0; background: rgba(46,139,87,.45); }
.ux-bar-track.attach::after { left: 0; right: 80%; }
.ux-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #F0B060; }
.ux-bar-fill.ok { background: #49B97A; }
.ux-bar-ok { color: #6EE7A0; font-weight: 700; }
.ux-count { margin: 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ux-level { position: relative; height: 26px; margin: 4px 0 6px; border-radius: 13px; background: linear-gradient(#DFF3D6, #B9DDAA); border: 2px solid #8C9198; }
.ux-level-mid { position: absolute; left: calc(50% - 16px); top: 2px; bottom: 2px; width: 32px; border-left: 2px solid #3A3F47; border-right: 2px solid #3A3F47; }
.ux-level-bubble { position: absolute; top: 3px; width: 26px; height: 16px; margin-left: -13px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: inset 0 -2px 3px rgba(0,0,0,.2); transition: left .05s linear; }
.ux-done { text-align: center; }
.ux-big { margin: 4px 0; font-size: 22px; font-weight: 800; }
.ux-nums { margin: 6px 0; font-size: 15px; }
body:not([data-space="plaza"]) #finish { display: none !important; }
.ux-steps li { padding: 0; }
.ux-step-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; padding: 0 6px; border-radius: inherit; cursor: pointer; font: inherit; color: inherit; text-align: center; }
.ux-step-btn:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
@media (max-width: 599px) { .unit-panel.side .ux-steps { display: flex; } .ux-step-btn { min-height: 40px; } }
.rgs-steps li { font-size: 11px; }
@media (max-width: 599px) { .rgs-steps { gap: 3px; } .rgs-steps li { font-size: 10px; } .rgs-steps .ux-step-btn { min-height: 36px; padding: 0 2px; } }
.ph-bar { position: fixed; z-index: 9; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 6px; align-items: stretch; padding: 6px; border-radius: 14px; background: rgba(24,28,34,.9); border-top: 2px solid var(--brand-orange); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.ph-bar[hidden] { display: none; }
.ph-bar button { min-height: 44px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; color: #fff; cursor: pointer; }
.ph-step { flex: 1 1 auto; min-width: 0; padding: 0 10px; background: rgba(255,255,255,.1); text-align: left; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-run { flex: 0 1 auto; max-width: 58%; padding: 0 12px; background: var(--brand-red); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-run[hidden] { display: none; }
.ph-fold { flex: 0 0 auto; padding: 0 10px; background: rgba(255,255,255,.16); font-size: 13px; }
@media (max-width: 599px) and (orientation: portrait) {
  body.ph-fold .unit-panel { display: none !important; }
  body.ph-open .unit-panel { bottom: calc(64px + env(safe-area-inset-bottom)) !important; max-height: 58vh; overflow: auto; }
  .unit-panel:not(.guide-on) .ux-guide { display: none; }
  body.ph-mock .joystick, body.ph-mock .bottom-bar { display: none !important; }
  body.ph-mock .space-pill { padding: 4px 10px; max-width: 46vw; }
  body.ph-mock .space-pill > :not(:first-child) { display: none; }
  body.ph-mock .space-pill > :first-child { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
}
.ph-tags { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.ph-tags svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ph-tags line { stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 0 1px rgba(0,0,0,.8)); }
.ph-tags circle { fill: var(--brand-orange); stroke: #fff; stroke-width: 1.5; }
.ph-tag { position: absolute; left: 0; top: 0; padding: 4px 9px; border-radius: 999px; background: rgba(24,28,34,.88); color: #fff; font-size: 14px; font-weight: 800; white-space: nowrap; border: 1.5px solid var(--brand-orange); }
.ph-tag.long { white-space: pre-line; width: max-content; max-width: 58vw; border-radius: 12px; font-size: 13px; line-height: 1.35; }
@media (max-width: 599px) and (orientation: portrait) {
  .inspect { left: auto; right: 12px; top: calc(60px + env(safe-area-inset-top)); bottom: auto; transform: none; padding: 0; background: none; max-width: none; }
  .inspect p { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 8px 12px; border-radius: 12px; background: var(--panel); text-align: center; font-size: 13px; line-height: 1.45; }
  .inspect:not(.fresh) p { display: none; }
  #inspect-close { width: 44px !important; height: 44px; min-height: 44px; min-width: 0; padding: 0; border-radius: 50%; border: 0; background: var(--panel); color: #fff; font-size: 0; display: grid; place-items: center; }
  #inspect-close::before { content: '✕'; font-size: 20px; font-weight: 800; }
  #inspect-close kbd { display: none; }
}
