@font-face { font-family: 'Myeongjo'; src: url('../assets/fonts/myeongjo.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Myeongjo'; src: url('../assets/fonts/myeongjo-bold.woff2') format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Pen'; src: url('../assets/fonts/pen.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Brush'; src: url('../assets/fonts/brush.woff2') format('woff2'); font-display: block; }

:root {
  --ink: #ece4d2;
  --dim: #b5ab96;
  --brass: #c9a45c;
  --brass2: #8d6f3a;
  --blood: #7a1d1d;
  --panel: rgba(12, 10, 8, 0.86);
  --serif: 'Myeongjo', 'Nanum Myeongjo', 'Noto Serif KR', 'Batang', serif;
  --pen: 'Pen', 'Nanum Pen Script', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; }

#app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; overflow: hidden; background: #000; contain: strict; }

/* ---------------------------------------------------------------- world */
#world { position: absolute; inset: 0; overflow: hidden; }
.scene { position: absolute; inset: 0; overflow: hidden; will-change: transform, opacity, filter; }
.cam { position: absolute; inset: 0; transform-origin: 50% 50%; }
.drift .cam { animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift {
  0% { transform: scale(1.012) translate(0px, 0px); }
  33% { transform: scale(1.02) translate(-5px, 2px); }
  66% { transform: scale(1.016) translate(4px, -3px); }
  100% { transform: scale(1.024) translate(-2px, 3px); }
}
.reduce .drift .cam { animation: none; transform: none; }
.layer { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; }
img.layer { display: block; object-fit: cover; }
.clip { position: absolute; pointer-events: none; background-repeat: no-repeat; background-size: 1600px 900px; }
.watcher { z-index: 2; }   /* above the darkening, so the figure itself is not dimmed away */
.watchdim { position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(ellipse 70% 62% at 48% 46%, rgba(0, 0, 0, 0) 38%, rgba(4, 3, 2, 0.34) 78%, rgba(4, 3, 2, 0.5) 100%); }
.hs-svg { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; z-index: 30; pointer-events: none; }
.hs { fill: rgba(0, 0, 0, 0); stroke: none; cursor: pointer; pointer-events: all; transition: stroke 0.25s, fill 0.25s; }
.show-hs .hs { stroke: rgba(255, 228, 170, 0.55); stroke-width: 2px; stroke-dasharray: 6 5; fill: rgba(255, 220, 150, 0.06); }
.hs.item-target { cursor: copy; }
.hs.goto { cursor: zoom-in; }
.hs.walk { cursor: n-resize; }

/* ---------------------------------------------------------------- fx */
#grain { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; opacity: 0.075; mix-blend-mode: overlay; z-index: 50; }
#vignette { position: absolute; inset: 0; pointer-events: none; z-index: 49; background: radial-gradient(ellipse at 50% 48%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.38) 80%, rgba(0,0,0,0.72) 100%); }
#tint { position: absolute; inset: 0; pointer-events: none; z-index: 48; opacity: 0; background: radial-gradient(ellipse at 50% 50%, rgba(30,40,40,0.0) 30%, rgba(10,25,25,0.55) 100%); mix-blend-mode: multiply; transition: opacity 4s; }
#lightfx { position: absolute; inset: 0; pointer-events: none; z-index: 47; mix-blend-mode: screen; }
.flick { position: absolute; border-radius: 50%; pointer-events: none; }

/* ---------------------------------------------------------------- ui */
#ui { position: absolute; inset: 0; z-index: 130; pointer-events: none; }
body.nohud #inv, body.nohud #topbar, body.nohud .nav, body.nohud #loc, body.nohud #caption, body.nohud #hintbar, body.nohud #toast { display: none !important; }
#ui > * { pointer-events: auto; }
#loc { position: absolute; left: 44px; top: 30px; font-size: 22px; letter-spacing: 0.18em; color: rgba(236, 228, 210, 0.78); text-shadow: 0 1px 6px #000; opacity: 0; transition: opacity 1.4s; pointer-events: none !important; }
#loc.on { opacity: 1; }
#caption { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); font-size: 21px; color: rgba(230, 222, 205, 0.82); font-style: italic; text-shadow: 0 1px 8px #000, 0 0 2px #000; opacity: 0; transition: opacity 1s; pointer-events: none !important; white-space: nowrap; }
#caption.on { opacity: 1; }
#topbar { position: absolute; right: 30px; top: 22px; display: flex; gap: 10px; opacity: 0.55; transition: opacity 0.4s; }
#topbar:hover { opacity: 1; }
.tb { background: rgba(10, 8, 6, 0.55); color: var(--ink); border: 1px solid rgba(201, 164, 92, 0.45); border-radius: 3px; font-size: 19px; padding: 7px 14px; cursor: pointer; letter-spacing: 0.05em; }
.tb:hover { background: rgba(40, 30, 18, 0.85); border-color: var(--brass); }
.tb.glow { animation: tbglow 1.6s ease-in-out infinite alternate; }
@keyframes tbglow { from { box-shadow: 0 0 0 rgba(201, 164, 92, 0); } to { box-shadow: 0 0 18px rgba(201, 164, 92, 0.75); } }

.nav { position: absolute; background: none; border: none; color: rgba(236, 228, 210, 0.55); cursor: pointer; display: none; transition: color 0.3s, background 0.3s; }
.nav.on { display: block; }
.nav-side { top: 250px; width: 70px; height: 400px; font-size: 64px; }
.nav-side span { display: block; text-shadow: 0 0 12px #000; }
#navLeft { left: 0; background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(0,0,0,0)); }
#navRight { right: 0; background: linear-gradient(270deg, rgba(0,0,0,0.35), rgba(0,0,0,0)); }
.nav-side:hover { color: rgba(255, 240, 210, 0.95); }
#navBack { left: 30px; bottom: 30px; font-size: 19px; letter-spacing: 0.3em; padding: 8px 26px; border: 1px solid rgba(201, 164, 92, 0.35); background: rgba(8, 6, 4, 0.45); border-radius: 2px; }
#navBack:hover { color: #fff; border-color: var(--brass); background: rgba(30, 22, 12, 0.7); }

#inv { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 10px; padding: 8px 12px; background: linear-gradient(180deg, rgba(10,8,6,0.2), rgba(10,8,6,0.7)); border-radius: 4px; min-height: 92px; opacity: 0.8; transition: opacity 0.3s; }
#inv:hover { opacity: 1; }
#inv:empty { display: none; }
.slot { width: 76px; height: 76px; border: 1px solid rgba(201, 164, 92, 0.35); background: rgba(0,0,0,0.5) center/cover no-repeat; cursor: pointer; position: relative; border-radius: 3px; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.slot:hover { transform: translateY(-3px); border-color: var(--brass); }
.slot.sel { border-color: #f3d38a; box-shadow: 0 0 14px rgba(243, 211, 138, 0.8); transform: translateY(-5px); }
.slot .ex { position: absolute; right: -8px; top: -8px; width: 26px; height: 26px; border-radius: 50%; background: #1b140c; border: 1px solid var(--brass); font-size: 14px; line-height: 24px; text-align: center; display: none; color: var(--ink); }
.slot.sel .ex { display: block; }
.slot.new { animation: slotnew 1.8s ease-out; }
.slot.badge::after { content: ''; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle, #ffe7a8 0%, #d9a444 55%, rgba(217,164,68,0) 72%); box-shadow: 0 0 10px rgba(255, 210, 120, 0.8); animation: badgepulse 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes badgepulse { 0%, 100% { opacity: 0.55; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes slotnew { 0% { box-shadow: 0 0 0 rgba(243,211,138,0.9); } 30% { box-shadow: 0 0 22px rgba(243,211,138,0.9); } 100% { box-shadow: 0 0 0 rgba(243,211,138,0); } }

#sub { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); width: 1180px; text-align: center; opacity: 0; transition: opacity 0.5s; pointer-events: none !important; }
#sub.on { opacity: 1; }
#sub .who { font-size: 18px; color: var(--brass); letter-spacing: 0.2em; margin-bottom: 6px; min-height: 0; }
#sub .txt { display: inline-block; font-size: 29px; line-height: 1.55; color: var(--ink); text-shadow: 0 2px 6px #000, 0 0 3px #000; background: rgba(0, 0, 0, 0.42); padding: 8px 22px; border-radius: 2px; }
#sub.mono .txt { font-style: italic; color: #e3dccb; }
#sub.voice .txt { color: #f0e8d6; }
#sub.phone .txt { color: #d6e2e6; }
#sub.radio .txt { color: #f1dca0; }
#sub.sys .txt { font-size: 23px; color: #cfc6b2; }

#choices { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; flex-direction: column; gap: 12px; min-width: 520px; }
#choices.on { display: flex; }
#choices button { background: rgba(10, 8, 6, 0.86); border: 1px solid rgba(201, 164, 92, 0.5); color: var(--ink); font-size: 25px; padding: 14px 26px; cursor: pointer; text-align: left; border-radius: 2px; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
#choices button:hover, #choices button:focus { background: rgba(48, 34, 18, 0.95); border-color: var(--brass); transform: translateX(6px); outline: none; }

#hintbar { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); font-size: 20px; color: #e8dcc0; background: rgba(8, 6, 4, 0.72); border: 1px solid rgba(201, 164, 92, 0.35); padding: 8px 20px; border-radius: 2px; opacity: 0; transition: opacity 0.6s; pointer-events: none !important; white-space: nowrap; }
#hintbar.on { opacity: 1; }
#toast { position: absolute; right: 40px; bottom: 130px; font-size: 20px; color: #efe3c4; background: rgba(8, 6, 4, 0.8); border-left: 3px solid var(--brass); padding: 10px 18px; opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s; pointer-events: none !important; max-width: 520px; }
#toast.on { opacity: 1; transform: translateY(0); }
#hover { position: absolute; font-size: 19px; color: #f3e7c9; background: rgba(6, 5, 4, 0.72); padding: 4px 11px; border-radius: 2px; pointer-events: none !important; opacity: 0; transition: opacity 0.15s; white-space: nowrap; z-index: 5; text-shadow: 0 1px 2px #000; }
#hover.on { opacity: 1; }

/* ---------------------------------------------------------------- modal */
#modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.62); z-index: 20; }
#modal.on { display: flex; animation: fadein 0.45s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.mbox { background: var(--panel); border: 1px solid rgba(201, 164, 92, 0.45); padding: 34px 44px; min-width: 560px; max-width: 1100px; max-height: 820px; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); }
.mbox h2 { margin: 0 0 18px; font-size: 30px; letter-spacing: 0.12em; color: #efe0bb; font-weight: 700; }
.mbox p { font-size: 22px; line-height: 1.7; color: var(--dim); margin: 8px 0; }
.mbtn { display: block; width: 100%; margin: 10px 0; background: rgba(20, 15, 10, 0.9); border: 1px solid rgba(201, 164, 92, 0.45); color: var(--ink); font-size: 23px; padding: 12px 18px; cursor: pointer; text-align: left; border-radius: 2px; }
.mbtn:hover, .mbtn:focus { border-color: var(--brass); background: rgba(50, 36, 20, 0.95); outline: none; }
.mclose { position: absolute; right: 26px; top: 20px; font-size: 22px; background: rgba(8,6,4,0.7); color: var(--ink); border: 1px solid rgba(201,164,92,0.5); padding: 6px 16px; cursor: pointer; z-index: 5; }
.mclose:hover { border-color: var(--brass); }
.row { display: flex; align-items: center; gap: 16px; margin: 14px 0; font-size: 21px; color: var(--dim); }
.row label { width: 170px; }
.row input[type=range] { width: 360px; accent-color: #b8914a; }
.row input[type=checkbox] { width: 22px; height: 22px; accent-color: #b8914a; }

/* journal */
.journal { width: 980px; }
.journal .goal { font-size: 24px; color: #f1e2bb; border-left: 3px solid var(--brass); padding: 6px 14px; margin: 6px 0 22px; line-height: 1.6; }
.journal ul { list-style: none; padding: 0; margin: 0; }
.journal li { font-family: var(--pen); font-size: 34px; color: #d8cdb4; padding: 4px 0; border-bottom: 1px dashed rgba(201,164,92,0.18); line-height: 1.35; }
.journal .viol { margin-top: 18px; font-size: 20px; color: #c98a7a; }

/* documents */
.docwrap { position: relative; }
#modal:focus, #modal .docwrap:focus { outline: none; }
.paper { position: relative; width: 780px; height: 1040px; transform: scale(0.8); transform-origin: 50% 50%; margin: -104px -78px; background: #efe4c9 url('../assets/img/paper.webp') center/cover; color: #2a2118; box-shadow: 0 30px 80px rgba(0,0,0,0.75); padding: 60px 64px 50px; overflow: hidden; }
.paper.lined { background-image: url('../assets/img/paper_lined.webp'); background-size: 100% 100%; width: 700px; height: 940px; margin: -94px -70px; padding: 58px 56px 40px 92px; }
.paper.rules { width: 860px; height: auto; min-height: 560px; transform: none; margin: 0; padding: 30px 70px 112px; background-size: 100% 100%; }
.paper.rules.wide { width: 1380px; padding: 20px 64px 100px; }
.rules { font-family: var(--serif); }
.rules .hdr { text-align: center; letter-spacing: 0.35em; font-size: 13px; color: #6b5433; }
.rules h1 { text-align: center; font-size: 30px; margin: 2px 0 2px; letter-spacing: 0.25em; font-weight: 700; color: #2b2015; }
.rules .crest { display: block; margin: 4px auto 0; width: 42px; height: 42px; opacity: 0.8; }
.rules .intro { font-size: 15.5px; line-height: 1.65; margin: 6px 0 12px; text-align: center; color: #3a2e21; text-wrap: balance; }
.rules .addr { position: absolute; left: 38px; top: 18px; font-family: var(--pen); font-size: 25px; color: rgba(26, 36, 68, 0.82); transform: rotate(-2.2deg); white-space: nowrap; }
.rules .list { margin-top: 8px; }
.paper.rules.wide .list { column-count: 2; column-gap: 72px; }
.rules .rule { position: relative; break-inside: avoid; font-size: 17px; line-height: 1.62; margin: 0 0 10px; padding-left: 36px; text-align: justify; color: #2c2319; isolation: isolate; }
.paper.rules.wide .rule { font-size: 16.4px; line-height: 1.5; margin-bottom: 7px; }
.rules .rule .num { position: absolute; left: 0; top: 0; width: 28px; text-align: right; font-weight: 700; }
/* the watermark: a small crest right behind the number of each genuine rule, visible only under a light */
.rules .rule .seal { position: absolute; left: -7px; top: -8px; width: 42px; height: 42px; opacity: 0; color: rgba(92, 62, 30, 0.95); pointer-events: none; z-index: -1; transition: opacity 0.15s; }
.rules .rule .seal svg { display: block; width: 100%; height: 100%; }
/* pencil marks made by the guest after checking a rule under the light */
.rules .rule .mark { position: absolute; left: -34px; top: 1px; width: 28px; height: 22px; opacity: 0; pointer-events: none; }
.rules .rule .mark svg { display: block; width: 100%; height: 100%; fill: none; stroke: rgba(52, 52, 62, 0.82); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 44; stroke-dashoffset: 0; }
.rules .rule.ok .mark { opacity: 1; }
.rules .rule.ok.marking .mark svg path { animation: pencil 0.55s ease-out both; }
@keyframes pencil { from { stroke-dashoffset: 44; } to { stroke-dashoffset: 0; } }
.rules .rule .txt { background: linear-gradient(rgba(52, 52, 62, 0.8), rgba(52, 52, 62, 0.8)) no-repeat 0 58% / 0% 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rules .rule.struck .txt { background-size: 100% 2px; color: #50463d; }
.rules .rule.struck.marking .txt { animation: strike 0.9s ease-out both; }
@keyframes strike { from { background-size: 0% 2px; } to { background-size: 100% 2px; } }
/* a line that has just surfaced on the sheet */
.rules .rule.fresh { animation: inkin 2.8s ease-out both; }
@keyframes inkin { 0% { opacity: 0; filter: blur(3px); } 35% { opacity: 0.35; filter: blur(1.6px); } 100% { opacity: 1; filter: blur(0); } }
.rules .foot { position: absolute; left: 70px; right: 250px; bottom: 26px; font-size: 13.5px; color: #5a4832; line-height: 1.6; border-top: 1px solid rgba(80,60,40,0.3); padding-top: 6px; }
.rules .foot .sig { display: block; text-align: right; }
.rules .viol { position: absolute; right: 58px; bottom: 26px; display: flex; gap: 10px; align-items: center; font-size: 13px; color: #6b5433; }
.rules .viol i { display: inline-block; width: 34px; height: 34px; border: 1px solid rgba(90,60,40,0.45); position: relative; }
.rules .viol i.on::after { content: '違'; position: absolute; inset: -4px; border: 3px solid rgba(160, 20, 20, 0.85); border-radius: 50%; color: rgba(160, 20, 20, 0.9); font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; transform: rotate(-14deg); }
.rules .rule.add17, .paper.rules.wide .rule.add17 { font-family: var(--pen); font-size: 31px; color: #1c2a4a; margin-top: 4px; line-height: 1.15; opacity: 0; transition: opacity 3s; text-align: left; }
.rules .rule.add17 .num { font-weight: 400; }
.rules .rule.add17.on, .paper.rules.wide .rule.add17.on { opacity: 0.92; }

.paper .lightspot { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s; mix-blend-mode: multiply; }
.paper.lit .lightspot { opacity: 1; }
.memo { font-family: var(--pen); font-size: 33px; line-height: 1.28; color: #25324a; white-space: pre-wrap; transform: rotate(-0.6deg); }
.memo .sig { display: block; text-align: right; margin-top: 8px; }
.card { width: 720px; background: #f1e8d2 url('../assets/img/paper.webp') center/cover; color: #2a2118; padding: 40px 48px; box-shadow: 0 30px 80px rgba(0,0,0,0.75); border: 6px double #b39359; }
.card h3 { text-align: center; letter-spacing: 0.3em; margin: 0 0 4px; font-size: 26px; }
.card .sub { text-align: center; font-size: 15px; color: #6b5433; letter-spacing: 0.2em; margin-bottom: 18px; }
.card table { width: 100%; border-collapse: collapse; font-size: 21px; }
.card td { padding: 7px 0; border-bottom: 1px dotted rgba(90,70,40,0.4); }
.card td:last-child { text-align: right; font-weight: 700; }
.card .note { font-size: 15.5px; color: #5a4832; margin-top: 14px; line-height: 1.6; }
.idcard { width: 640px; height: 404px; border-radius: 22px; background: linear-gradient(135deg, #e9eef0 0%, #d7e2e6 40%, #eef2ea 100%); color: #1d2a33; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,0.75); overflow: hidden; font-family: var(--serif); }
.idcard::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(120,160,190,0.07) 0 3px, transparent 3px 9px); }
.idcard .t { position: absolute; left: 40px; top: 30px; font-size: 27px; letter-spacing: 0.35em; font-weight: 700; color: #213744; }
.idcard .photo { position: absolute; right: 42px; top: 88px; width: 150px; height: 190px; border-radius: 6px; background: radial-gradient(ellipse at 50% 38%, #b9b2a8 0 22%, #8f8a86 23% 36%, #a4a7aa 37% 60%, #b8bcbf 61%); filter: blur(5px) contrast(0.8); opacity: 0.9; }
.idcard .f { position: absolute; left: 44px; font-size: 22px; color: #22323c; }
.idcard .f b { display: inline-block; width: 90px; color: #4e6270; font-weight: 400; font-size: 18px; }
.idcard .nm { font-size: 40px; font-weight: 700; letter-spacing: 0.25em; }
.idcard .holo { position: absolute; left: 330px; top: 230px; width: 90px; height: 90px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255,120,200,0.25), rgba(120,220,255,0.3), rgba(255,240,120,0.25), rgba(255,120,200,0.25)); mix-blend-mode: multiply; }
.ticket { width: 640px; background: #fbf7ee; color: #2a2a2a; padding: 26px 34px; font-family: var(--serif); box-shadow: 0 30px 80px rgba(0,0,0,0.75); border-top: 10px solid #2e5d9b; }
.ticket .big { font-size: 38px; font-weight: 700; letter-spacing: 0.1em; margin: 10px 0; }
.ticket .sm { font-size: 18px; color: #555; }
.itemview { text-align: center; }
.itemview img { width: 420px; height: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.8); border-radius: 4px; }
.itemview .nm { font-size: 30px; color: #efe0bb; margin: 18px 0 6px; letter-spacing: 0.1em; }
.itemview .ds { font-size: 22px; color: var(--dim); max-width: 760px; margin: 0 auto; line-height: 1.6; }
.itemview .acts { margin-top: 20px; display: flex; gap: 14px; justify-content: center; }
.itemview .acts button { font-size: 21px; background: rgba(20,15,10,0.9); border: 1px solid rgba(201,164,92,0.5); color: var(--ink); padding: 10px 22px; cursor: pointer; }
.itemview .acts button:hover { border-color: var(--brass); }
.ruleswrap { position: relative; }
.lighthint { position: absolute; left: 50%; top: -58px; transform: translateX(-50%); display: flex; gap: 12px; z-index: 6; }
/* the wide (two-column) sheet fills the screen: its buttons sit in the empty top-right corner of the paper */
.ruleswrap.wide .lighthint { top: 14px; left: auto; right: 22px; transform: none; gap: 8px; }
.ruleswrap.wide .lighthint button { font-size: 15px; padding: 7px 12px; }
.lighthint button { font-size: 20px; background: rgba(20,15,10,0.9); border: 1px solid rgba(201,164,92,0.55); color: var(--ink); padding: 9px 20px; cursor: pointer; white-space: nowrap; }
.lighthint button:hover { border-color: var(--brass); }
.inputbox { width: 640px; text-align: center; }
.inputbox input { width: 100%; font-family: var(--pen); font-size: 52px; padding: 8px 18px; background: rgba(245,236,214,0.95); color: #1e2a44; border: none; border-bottom: 2px solid #6b5433; outline: none; text-align: center; }
.inputbox .btns { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.inputbox .btns button { font-size: 22px; background: rgba(20,15,10,0.9); border: 1px solid rgba(201,164,92,0.55); color: var(--ink); padding: 10px 26px; cursor: pointer; }

/* ---------------------------------------------------------------- overlays */
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 125; }
#fade.block { pointer-events: all; }
#lids { position: absolute; inset: 0; pointer-events: none; z-index: 122; display: none; }
#lids.on { display: block; }
.lid { position: absolute; left: -10%; width: 120%; height: 52%; background: #000; }
.lid.top { top: 0; border-radius: 0 0 50% 50% / 0 0 24% 24%; }
.lid.bot { bottom: 0; border-radius: 50% 50% 0 0 / 24% 24% 0 0; }
#screen { position: absolute; inset: 0; z-index: 120; display: none; }
#screen.on { display: block; }
#carry { position: absolute; width: 64px; height: 64px; pointer-events: none; z-index: 200; background: center/cover no-repeat; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,0.6); opacity: 0; transform: translate(-50%, -50%); }
#carry.on { opacity: 0.92; }

/* title */
.title { position: absolute; inset: 0; overflow: hidden; background: #000; }
.title .bg { position: absolute; inset: -2%; background: url('../assets/img/title.webp') center/cover; animation: titlezoom 40s ease-in-out infinite alternate; filter: brightness(0.9); }
@keyframes titlezoom { from { transform: scale(1.0) translate(0,0); } to { transform: scale(1.07) translate(-1%, 0.5%); } }
.title canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.title .neon { position: absolute; left: 540px; top: 50px; width: 80px; height: 440px; background: radial-gradient(ellipse at 50% 50%, rgba(255,40,40,0.35), rgba(255,0,0,0) 70%); mix-blend-mode: screen; animation: neon 7s infinite; }
@keyframes neon { 0%, 18%, 22%, 60%, 100% { opacity: 1; } 19%, 21% { opacity: 0.35; } 61% { opacity: 0.6; } }
.title .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.5) 26%, rgba(0,0,0,0) 48%); }
.title .logo { position: absolute; left: 84px; top: 140px; }
.title .logo .en { font-size: 17px; letter-spacing: 0.7em; color: rgba(236,228,210,0.75); }
.title .logo h1 { font-size: 66px; margin: 10px 0 0; letter-spacing: 0.12em; font-weight: 700; color: #efe6d2; text-shadow: 0 4px 30px rgba(0,0,0,0.9); }
.title .logo .ko { font-size: 25px; letter-spacing: 0.42em; color: #d9b36a; margin-top: 12px; }
.title .menu { position: absolute; left: 92px; top: 470px; display: flex; flex-direction: column; gap: 8px; }
.title .menu button { background: none; border: none; color: rgba(236,228,210,0.82); font-size: 30px; letter-spacing: 0.3em; text-align: left; padding: 8px 0; cursor: pointer; transition: color 0.3s, padding 0.3s; }
.title .menu button:hover, .title .menu button:focus { color: #f6d488; padding-left: 14px; outline: none; }
.title .menu button[disabled] { opacity: 0.3; cursor: default; }
.title .note { position: absolute; left: 92px; bottom: 40px; font-size: 17px; color: rgba(220,210,190,0.6); line-height: 1.7; }
.title .load { position: absolute; left: 92px; top: 470px; font-size: 22px; color: #d8c9a6; letter-spacing: 0.2em; }
.title .load .bar { width: 360px; height: 2px; background: rgba(255,255,255,0.15); margin-top: 14px; }
.title .load .bar i { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.2s; }

/* narration screen */
.narr { position: absolute; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.narr p { font-size: 32px; line-height: 2.1; color: #ddd3bd; margin: 0; letter-spacing: 0.06em; text-align: center; min-height: 67px; }
.narr .skip { position: absolute; right: 40px; bottom: 30px; font-size: 18px; color: rgba(220,210,190,0.45); }

/* end card */
.endcard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.78); animation: fadein 2.5s ease; }
.endcard .k { font-size: 20px; letter-spacing: 0.8em; color: rgba(210, 190, 160, 0.7); }
.endcard h2 { font-size: 64px; letter-spacing: 0.3em; margin: 16px 0 10px; color: #efe3c6; font-weight: 700; }
.endcard .d { font-size: 22px; color: #bdb09a; margin-bottom: 36px; max-width: 900px; text-align: center; line-height: 1.8; }
.endcard button { background: rgba(20,15,10,0.9); border: 1px solid rgba(201,164,92,0.55); color: var(--ink); font-size: 23px; padding: 12px 30px; margin: 6px; cursor: pointer; min-width: 360px; }
.endcard button:hover { border-color: var(--brass); background: rgba(50,36,20,0.95); }
.credits { position: absolute; inset: 0; background: #000; overflow: hidden; }
.credits .roll { position: absolute; left: 0; right: 0; top: 100%; text-align: center; font-size: 22px; line-height: 2; color: #cfc4ad; }
.credits .roll h3 { font-size: 34px; color: #efe0bb; letter-spacing: 0.3em; margin: 40px 0 10px; }
.credits .roll .s { font-size: 17px; color: #9e937f; }
.credits .skip { position: absolute; right: 40px; bottom: 30px; font-size: 18px; color: rgba(220,210,190,0.5); cursor: pointer; }

/* big overlay texts */
.story { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); width: 1200px; text-align: center; font-size: 31px; line-height: 1.8; color: #efe6d4; text-shadow: 0 2px 10px #000, 0 0 3px #000; opacity: 0; transition: opacity 1.6s; }
.story.on { opacity: 1; }

/* hold button (revolving door) */
.holdui { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); text-align: center; font-size: 21px; color: #e7dcc2; text-shadow: 0 1px 6px #000; white-space: nowrap; }
.holdui .ring { width: 360px; height: 3px; background: rgba(255,255,255,0.14); margin: 10px auto 0; }
.holdui .ring i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c9a45c, #f7e7bd); }
.lookback { position: absolute; font-size: 24px; background: rgba(10, 8, 6, 0.78); border: 1px solid rgba(201, 164, 92, 0.55); color: var(--ink); padding: 12px 24px; cursor: pointer; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
.lookback.on { opacity: 1; pointer-events: auto; }
.lookback:hover { border-color: #f3d38a; }

@media (prefers-reduced-motion: reduce) {
  .drift .cam { animation: none; }
  .title .bg { animation: none; }
}

/* ---------------------------------------------------------------- keyboard focus */
.hs:focus { outline: none; }
.hs:focus-visible { stroke: rgba(255, 232, 180, 0.95); stroke-width: 3px; stroke-dasharray: 7 5; fill: rgba(255, 220, 150, 0.08); }
.slot:focus { outline: none; }
.slot:focus-visible { border-color: #f3d38a; box-shadow: 0 0 0 2px rgba(243, 211, 138, 0.8); }
button:focus-visible, .kb:focus-visible { outline: 2px solid rgba(243, 211, 138, 0.9); outline-offset: 3px; }
.kb:focus:not(:focus-visible) { outline: none; }
.kb:focus-visible { outline: 3px solid rgba(243, 211, 138, 0.95); outline-offset: 3px; box-shadow: 0 0 14px rgba(243, 211, 138, 0.6); }
.walkbtn { font-size: 22px; padding: 12px 26px; background: rgba(8, 6, 4, 0.66); pointer-events: auto; }

/* ---------------------------------------------------------------- compact (small screens) */
body.compact #sub { width: 1540px; bottom: calc(112px * var(--uiz)); }
body.compact #sub .txt { font-size: calc(29px * var(--uiz)); padding: calc(8px * var(--uiz)) calc(20px * var(--uiz)); }
body.compact #sub .who { font-size: calc(18px * var(--uiz)); }
body.compact #choices { min-width: calc(520px * var(--uiz)); max-width: 1500px; }
body.compact #choices button { font-size: calc(25px * var(--uiz)); padding: calc(12px * var(--uiz)) calc(22px * var(--uiz)); }
body.compact #inv { min-height: calc(92px * var(--uiz)); gap: calc(10px * var(--uiz)); padding: calc(8px * var(--uiz)) calc(12px * var(--uiz)); }
body.compact .slot { width: calc(76px * var(--uiz)); height: calc(76px * var(--uiz)); }
body.compact .tb { font-size: calc(19px * var(--uiz)); padding: calc(7px * var(--uiz)) calc(14px * var(--uiz)); }
body.compact #topbar { opacity: 0.85; gap: calc(10px * var(--uiz)); }
body.compact #navBack { font-size: calc(19px * var(--uiz)); padding: calc(9px * var(--uiz)) calc(24px * var(--uiz)); }
body.compact .nav-side { width: calc(70px * var(--uiz)); font-size: calc(64px * var(--uiz)); }
body.compact #hintbar, body.compact #caption { font-size: calc(20px * var(--uiz)); white-space: normal; max-width: 1400px; text-align: center; }
body.compact #toast { font-size: calc(20px * var(--uiz)); max-width: calc(520px * var(--uiz)); bottom: calc(130px * var(--uiz)); }
body.compact #hover { font-size: calc(19px * var(--uiz)); }
body.compact #loc { font-size: calc(22px * var(--uiz)); }
body.compact #carry { width: calc(64px * var(--uiz)); height: calc(64px * var(--uiz)); }
body.compact .walkbtn { font-size: calc(22px * var(--uiz)); padding: calc(12px * var(--uiz)) calc(24px * var(--uiz)); }
body.compact .holdui { font-size: calc(21px * var(--uiz)); }
body.compact .holdui .ring { width: calc(360px * var(--uiz)); }
body.compact .lookback { font-size: calc(24px * var(--uiz)); }
body.compact .endcard .k { font-size: calc(20px * var(--uiz)); }
body.compact .endcard h2 { font-size: calc(56px * var(--uiz)); }
body.compact .endcard .d { font-size: calc(22px * var(--uiz)); max-width: 1400px; }
body.compact .endcard button { font-size: calc(23px * var(--uiz)); min-width: calc(360px * var(--uiz)); padding: calc(12px * var(--uiz)) calc(26px * var(--uiz)); }
body.compact .title .menu button { font-size: calc(30px * var(--uiz)); }
body.compact .title .note { font-size: calc(17px * var(--uiz)); }
body.compact .title .load { font-size: calc(22px * var(--uiz)); }
body.compact .narr p { font-size: calc(32px * var(--uiz)); padding: 0 40px; }
body.compact .narr .skip, body.compact .credits .skip { font-size: calc(18px * var(--uiz)); }
body.compact .credits .roll { font-size: calc(22px * var(--uiz)); }
body.compact .story { font-size: calc(31px * var(--uiz)); width: 1500px; }

/* documents are laid out in real screen pixels on small screens */
body.compact #modal { inset: auto; left: 0; top: 0; width: calc(1600px * var(--s)); height: calc(900px * var(--s)); transform: scale(calc(1 / var(--s))); transform-origin: 0 0; align-items: stretch; }
body.compact #modal .docwrap { width: 100%; margin-top: 46px; max-height: calc(100% - 46px); overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; padding: 0 0 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body.compact .mclose { right: 8px; top: 6px; font-size: 15px; padding: 8px 14px; min-height: 36px; }
body.compact .paper, body.compact .paper.lined, body.compact .paper.rules { transform: none; margin: 0 auto; height: auto; }
body.compact .paper.rules { width: 94%; max-width: 760px; padding: 16px 16px 18px; }
body.compact .rules .hdr { font-size: 10px; }
body.compact .rules h1 { font-size: 21px; }
body.compact .rules .crest { width: 30px; height: 30px; }
body.compact .rules .intro { font-size: 13.5px; text-align: center; }
body.compact .paper.rules.wide { width: 94%; padding: 16px 16px 18px 34px; }
body.compact .paper.rules { padding-left: 34px; }
body.compact .paper.rules.wide .list { column-count: 1; }
body.compact .rules .addr { position: static; display: block; transform: rotate(-1.5deg); font-size: 20px; margin: 0 0 4px; }
body.compact .rules .rule, body.compact .paper.rules.wide .rule { font-size: 14.5px; line-height: 1.55; padding-left: 26px; }
body.compact .rules .rule .num { width: 20px; }
body.compact .rules .rule .seal { left: -10px; top: -9px; width: 38px; height: 38px; }
body.compact .rules .rule .mark { left: -30px; width: 24px; height: 19px; }
body.compact .rules .foot { position: static; margin-top: 10px; font-size: 12px; }
body.compact .rules .viol { position: static; margin-top: 10px; justify-content: flex-end; }
body.compact .rules .rule.add17, body.compact .paper.rules.wide .rule.add17 { font-size: 25px; line-height: 1.2; padding-left: 26px; }
body.compact .lighthint { position: static; transform: none; justify-content: center; margin: 0 0 8px; }
body.compact .ruleswrap.wide .lighthint { position: static; transform: none; justify-content: center; margin: 0 0 8px; }
body.compact .lighthint button { font-size: 15px; padding: 9px 14px; }
body.compact .paper.lined { width: 94%; max-width: 460px; padding: 20px 16px 22px 40px; }
body.compact .memo { font-size: 21px; line-height: 1.3; }
body.compact .card { width: 94%; max-width: 560px; padding: 18px 16px; }
body.compact .card h3 { font-size: 19px; }
body.compact .card .sub { font-size: 12px; margin-bottom: 10px; }
body.compact .card table { font-size: 14.5px; }
body.compact .card .note { font-size: 12.5px; }
body.compact .mbox { min-width: 0; width: 94%; max-width: 640px; max-height: none; padding: 16px 16px; }
body.compact .mbox h2 { font-size: 19px; margin-bottom: 10px; }
body.compact .mbox p { font-size: 14px; }
body.compact .mbtn { font-size: 16px; padding: 10px 14px; min-height: 44px; }
body.compact .row { font-size: 14px; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
body.compact .row label { width: 100%; }
body.compact .row input[type=range] { width: 100%; }
body.compact .journal { width: 94%; }
body.compact .journal .goal { font-size: 15px; }
body.compact .journal li { font-size: 21px; }
body.compact .journal .viol { font-size: 14px; }
body.compact .itemview img { width: min(52vh, 70%); height: auto; aspect-ratio: 1; }
body.compact .itemview .nm { font-size: 19px; margin-top: 10px; }
body.compact .itemview .ds { font-size: 14.5px; padding: 0 12px; }
body.compact .inputbox { width: 94%; }
body.compact .inputbox input { font-size: 30px; }
body.compact .inputbox .btns button { font-size: 16px; min-height: 44px; }

/* portrait phones: ask to rotate */
#rotate { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.92); color: #e8dcc0; font-family: var(--serif); align-items: center; justify-content: center; flex-direction: column; gap: 18px; text-align: center; font-size: 18px; padding: 24px; }
#rotate .ph { width: 54px; height: 90px; border: 3px solid #c9a45c; border-radius: 10px; animation: rot 2.4s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
body.compact #modal .docwrap > * { flex-shrink: 0; }
body.compact .title .note { top: 318px; bottom: auto; left: 92px; right: 40px; font-size: calc(15px * var(--uiz)); line-height: 1.45; }
body.compact .title .menu { top: 430px; gap: 0; }
body.compact .title .menu button { padding: calc(5px * var(--uiz)) 0; }
body.compact .title .logo { top: 90px; }

/* small-screen puzzle panels */
.dpanel { position: absolute; right: 24px; top: 40%; transform: translateY(-50%); display: flex; flex-direction: column; gap: calc(10px * var(--uiz)); padding: 12px; background: rgba(10, 8, 6, 0.8); border: 1px solid rgba(201, 164, 92, 0.5); border-radius: 4px; z-index: 70; }
.drow { display: flex; flex-wrap: nowrap; gap: calc(8px * var(--uiz)); }
.dcol { display: flex; flex-direction: column; align-items: center; gap: calc(4px * var(--uiz)); width: calc(64px * var(--uiz)); }
.dpanel button { width: calc(62px * var(--uiz)); height: calc(56px * var(--uiz)); font-size: calc(24px * var(--uiz)); background: rgba(40, 30, 16, 0.95); color: #f0dfb4; border: 1px solid rgba(201, 164, 92, 0.6); border-radius: 3px; cursor: pointer; }
.dpanel .dg { font: 700 calc(40px * var(--uiz)) Georgia, serif; color: #f3dfae; line-height: calc(52px * var(--uiz)); }
.dpanel .dhandle { width: 100%; height: calc(56px * var(--uiz)); font-size: calc(22px * var(--uiz)); font-family: var(--serif); }
.lpanel { position: absolute; right: 24px; top: 42%; transform: translateY(-50%); display: flex; flex-direction: column; gap: calc(10px * var(--uiz)); z-index: 70; }
.lpanel button { min-height: calc(56px * var(--uiz)); font-size: calc(21px * var(--uiz)); padding: 0 calc(18px * var(--uiz)); background: rgba(10, 8, 6, 0.85); color: #efe3c6; border: 1px solid rgba(201, 164, 92, 0.6); border-radius: 3px; cursor: pointer; font-family: var(--serif); text-align: left; }

/* ------------------------------------------------------------------ the letter (first screen) */
.letter { position: absolute; inset: 0; overflow: hidden; background: #000; }
.letter .bg { position: absolute; inset: -1.5%; background: center/cover no-repeat; animation: letterdrift 36s ease-in-out infinite alternate; }
@keyframes letterdrift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.035) translate(-6px, 4px); } }
.letter .shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 49% 52%, rgba(0,0,0,0) 38%, rgba(0,0,0,0.55) 78%, rgba(0,0,0,0.85) 100%); pointer-events: none; }
.letter .envhit { position: absolute; left: 300px; top: 236px; width: 960px; height: 508px; transform: rotate(4.63deg); transform-origin: 0 0; background: transparent; border: none; cursor: text; border-radius: 6px; }
.letter.named .envhit { cursor: pointer; animation: envglow 3.2s ease-in-out infinite; }
@keyframes envglow { 0%, 100% { box-shadow: 0 0 0 rgba(255, 220, 150, 0); } 50% { box-shadow: 0 0 46px rgba(255, 220, 150, 0.18); } }
.letter .addrline { position: absolute; height: 0; transform-origin: 0 0; z-index: 3; }
.letter .addrline .pre, .letter .addrline .post { position: absolute; bottom: 6px; font-family: var(--serif); font-size: 26px; color: rgba(58, 44, 30, 0.82); letter-spacing: 0.08em; white-space: nowrap; }
.letter .addrline .pre { right: calc(100% + 16px); }
.letter .addrline .post { left: calc(100% + 14px); }
.letter .addrline .name { position: absolute; left: 0; right: 0; bottom: -6px; height: 84px; background: transparent; border: none; outline: none; text-align: center; font-family: var(--pen); font-size: 72px; line-height: 84px; color: rgba(22, 30, 62, 0.9); caret-color: rgba(22, 30, 62, 0.8); padding: 0 8px; }
.letter .addrline .name::placeholder { color: rgba(80, 64, 44, 0.32); }
.letter .addrline .name:focus-visible { outline: none; }
.letter.nudge .addrline { animation: nudge 0.5s ease-in-out; }
@keyframes nudge { 0%, 100% { translate: 0 0; } 25% { translate: -7px 0; } 75% { translate: 7px 0; } }
.letter.sealed .addrline .name { color: rgba(18, 24, 52, 0.95); }
.letter.sealed { animation: letterout 1.6s ease-in 0.5s both; }
@keyframes letterout { to { filter: brightness(0.35); } }
body.compact .letter .addrline .pre, body.compact .letter .addrline .post { font-size: 26px; }

/* ---- round 12 ---- */
/* rules sheet: the pressed line in the blank at the bottom — grooves under a raking light, graphite once rubbed */
.rules .press { position: relative; margin: 10px 0 0 36px; font-family: var(--pen); font-size: 27px; line-height: 1.2; text-align: left; --glint: 0; }
.paper.rules.wide .press { font-size: 25px; }
.rules .press .num { font-weight: 400; margin-right: 6px; }
.rules .press .scrawl { font-size: 24px; margin: 6px 0 0 34px; transform: rotate(-1.4deg); transform-origin: 0 50%; }
.rules .press .grooves { color: transparent; filter: blur(2.3px); text-shadow: 0 1px 0 rgba(255, 250, 232, calc(var(--glint) * 0.62)), 0 -1px 0 rgba(70, 46, 22, calc(var(--glint) * 0.42)); }
.rules .press .graphite { position: absolute; inset: -8px -16px; padding: 8px 16px; color: rgba(247, 240, 220, 0.97); text-shadow: 0 0 1px rgba(255, 255, 255, 0.35);
  /* soft, uneven graphite: blotches over fine diagonal strokes, fading out at every edge like a real rubbing */
  background: radial-gradient(ellipse 30% 70% at 18% 45%, rgba(54, 54, 62, 0.3), transparent 70%), radial-gradient(ellipse 34% 80% at 62% 58%, rgba(54, 54, 62, 0.26), transparent 72%),
    radial-gradient(ellipse 26% 60% at 88% 40%, rgba(54, 54, 62, 0.22), transparent 70%),
    repeating-linear-gradient(-24deg, rgba(60, 60, 68, 0.3) 0 1.5px, rgba(98, 98, 106, 0.16) 1.5px 3.6px), rgba(76, 76, 84, 0.3);
  clip-path: inset(0 100% 0 0);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 22%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 22%, #000 80%, transparent 100%);
  mask-composite: intersect; }
.rules .press.rubbing .graphite { animation: rubin 2s ease-in-out forwards; }
.rules .press.rubbed .graphite { clip-path: inset(0 0 0 0); }
.rules .press.rubbed .grooves { visibility: hidden; }
@keyframes rubin { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* corridor: what each move means, and how far the elevator hall still is */
.walkbtn small { display: block; font-size: 13px; letter-spacing: 0.02em; opacity: 0.72; margin-top: 3px; }
.corrprog { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 9px; padding: 7px 16px; background: rgba(10, 8, 6, 0.55); border: 1px solid rgba(201, 164, 92, 0.45); border-radius: 3px; color: #d9c79c; font-size: 15px; letter-spacing: 0.06em; pointer-events: none; white-space: nowrap; }
.corrprog span { margin-right: 4px; }
.corrprog i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(217, 199, 156, 0.75); transition: background 0.4s, box-shadow 0.4s; }
.corrprog i.on { background: #e8c36a; border-color: #f0d38a; box-shadow: 0 0 9px rgba(232, 195, 106, 0.85); }
.corrprog.reset i { animation: pipfail 1.1s ease-out; }
@keyframes pipfail { 0%, 30% { background: #b3261e; border-color: #d04a3c; box-shadow: 0 0 10px rgba(179, 38, 30, 0.9); } 100% { background: transparent; box-shadow: none; } }
body.compact .corrprog { top: calc(18px * var(--uiz)); font-size: calc(15px * var(--uiz)); padding: calc(6px * var(--uiz)) calc(12px * var(--uiz)); gap: calc(8px * var(--uiz)); }
body.compact .walkbtn small { font-size: calc(13px * var(--uiz)); }
.corrback { z-index: 40; object-fit: cover; }

/* the rules sheet, folded and left on the front desk */
.leftsheet { position: absolute; left: 1322px; top: 700px; width: 206px; height: 132px; background-size: 100% 100%, cover; background-position: center; border-radius: 2px;
  transform: perspective(900px) rotateX(58deg) rotateZ(-9deg); box-shadow: 0 10px 16px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(60, 40, 20, 0.25); filter: brightness(0.6) sepia(0.3) contrast(0.95); pointer-events: none; }

/* corridor walk buttons; on small screens they stack at the lower right (the nearest door's panel — no anomaly lives there),
   clear of the inventory row, and subtitles keep to the left of them */
.corrbar { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: space-between; padding: 0 40px; z-index: 60; pointer-events: none; transition: opacity 0.4s; }
body.compact .corrbar { left: auto; right: calc(18px * var(--uiz)); bottom: calc(16px + 104px * var(--uiz)); padding: 0; flex-direction: column; align-items: stretch; gap: calc(10px * var(--uiz)); }
body.compact.incorr #sub { width: 1000px; left: 42%; }

/* waking up: soft darkness and a closing vignette instead of eyelid bars */
#lids.soft .lid { display: none; }
#lids .wdark { position: absolute; inset: 0; background: #000; }
#lids .wvig { position: absolute; inset: 0; background: radial-gradient(ellipse 78% 72% at 50% 48%, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, 0.5) 68%, rgba(0, 0, 0, 0.93) 100%); }

/* ---- round 14: the truth of Lorelei ---- */
.slot .slabel { position: absolute; right: 3px; bottom: 2px; font: 700 14px/16px Georgia, 'Times New Roman', serif; color: #f4e3b2; background: rgba(0, 0, 0, 0.62); padding: 0 4px; border-radius: 2px; pointer-events: none; }
body.compact .slot .slabel { font-size: calc(14px * var(--uiz)); line-height: calc(16px * var(--uiz)); }
/* the journal's page of fragments */
.journal .frags { margin-top: 22px; border-top: 1px solid rgba(201, 164, 92, 0.35); padding-top: 12px; }
.journal .frags h3 { font-size: 22px; color: #e9d7a8; letter-spacing: 0.2em; margin: 0 0 8px; font-weight: 700; }
.journal .frags h3 span { font-size: 18px; letter-spacing: 0.05em; color: #bfae86; margin-left: 10px; }
.journal .frags ol { margin: 0; padding-left: 30px; color: #bfae86; }
.journal .frags ol li { font-size: 30px; }
.journal .frags ol li.blank { color: rgba(200, 190, 170, 0.35); font-style: italic; }
.journal .frags ul.returns li { font-size: 28px; color: #cfe2c6; border-bottom: 0; }
/* the opening-night ticket */
.ticket74 { position: relative; display: flex; opacity: 1; width: 900px; max-width: 94vw; min-height: 300px; background: #eadcb8 url('../assets/img/paper.webp') center/cover; color: #3a2616; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75); filter: sepia(0.35); border-radius: 4px; }
.ticket74 .face { flex: 1; padding: 34px 40px 30px; border: 3px double rgba(120, 70, 40, 0.65); margin: 14px; text-align: center; font-family: Myeongjo, serif; }
.ticket74 .tl { font-size: 22px; line-height: 1.7; letter-spacing: 0.06em; }
.ticket74 .tl0 { font-size: 16px; letter-spacing: 0.5em; color: #7a4a2a; }
.ticket74 .tl1 { font-size: 32px; font-weight: 700; letter-spacing: 0.12em; margin: 6px 0 10px; }
.ticket74 .stub { width: 150px; border-left: 3px dashed rgba(120, 70, 40, 0.55); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: Georgia, serif; color: #6b3d22; }
.ticket74 .stub span { font-size: 16px; letter-spacing: 0.3em; }
.ticket74 .stub b { font-size: 34px; letter-spacing: 0.08em; }
/* the 1979 clipping */
.clip79 { width: 980px; max-width: 94vw; padding: 28px 36px 30px; background: #e4d8bd url('../assets/img/paper.webp') center/cover; color: #231c14; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75); filter: sepia(0.55) contrast(1.02); font-family: Myeongjo, serif; position: relative; }
.clip79 .top { display: flex; justify-content: space-between; border-bottom: 2px solid #3a2f22; padding-bottom: 6px; font-size: 16px; letter-spacing: 0.1em; }
.clip79 h3 { font-size: 36px; font-weight: 700; margin: 14px 0 6px; letter-spacing: 0.02em; line-height: 1.3; }
.clip79 .sub { font-size: 20px; margin-bottom: 12px; color: #3b3026; }
.clip79 .row { display: flex; gap: 22px; }
.clip79 figure { margin: 0; width: 300px; flex: none; }
.clip79 .photo { width: 300px; height: 190px; background: 38% 30%/cover no-repeat; filter: grayscale(1) contrast(1.18) brightness(0.95); }
.clip79 figcaption { font-size: 15px; margin-top: 4px; color: #3b3026; }
.clip79 .body p { font-size: 19px; line-height: 1.75; margin: 0 0 8px; text-align: justify; color: #2a2118; }
.clip79 h3, .clip79 .top, .clip79 .sub, .clip79 figcaption { color: #231c14; }
.clip79 .pcirc { position: relative; white-space: nowrap; }
.clip79 .pcirc::after { content: ''; position: absolute; left: -8px; right: -8px; top: -2px; bottom: -4px; border: 1.6px solid rgba(58, 58, 70, 0.62); border-radius: 50%; transform: rotate(-5deg); pointer-events: none; }
.clip79 .margin { position: absolute; right: 26px; bottom: 16px; font-family: var(--pen); font-size: 30px; color: rgba(52, 52, 62, 0.8); transform: rotate(-6deg); }
body.compact .clip79 .row { flex-direction: column; }
/* the castle's one window, marked with glow paint (visible only in the dark) */
.paintglow { position: absolute; width: 28px; height: 28px; opacity: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse 55% 65% at 50% 52%, rgba(140, 255, 180, 0.42), rgba(120, 255, 170, 0) 72%); filter: blur(0.3px); }
/* one small arched castle window, painted over with glow paint */
.paintglow::before { content: ''; position: absolute; left: 11px; top: 8px; width: 6px; height: 10px; border-radius: 3px 3px 1px 1px; background: rgba(205, 255, 215, 0.95);
  box-shadow: 0 0 3px 1px rgba(160, 255, 195, 0.85), 0 0 9px 3px rgba(120, 255, 170, 0.38); }
/* the guest ledger as a photograph (true ending) */
.ledgerphoto { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); }
.ledgerphoto .lp-in { position: relative; flex: none; width: 1600px; height: 900px; transform: translateY(-62px) scale(0.6) rotate(-1.4deg); border: 22px solid #efe8d6; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85); filter: sepia(0.5) contrast(0.96) brightness(0.93); overflow: hidden; }
.ledgerphoto .lp-img { position: absolute; inset: 0; background: center/cover no-repeat; }
.ledgerphoto .lp-rows { position: absolute; inset: 0; transform: rotate(0.4deg); }
/* the end card shows how much of the truth was found */
.endcard .frc { font-size: 18px; letter-spacing: 0.15em; color: rgba(210, 190, 160, 0.55); margin: -22px 0 30px; }

/* ---- the title screen (opens after the first checkout): endings reached, watch again, the checkout list ---- */
.titlescr { position: absolute; inset: 0; overflow: hidden; background: #000; font-family: var(--serif); }
.titlescr .bg { position: absolute; inset: -2%; background: center/cover no-repeat; animation: letterdrift 40s ease-in-out infinite alternate; filter: brightness(0.8) saturate(0.95); }
.titlescr .shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.72) 25%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0) 60%), radial-gradient(ellipse at 62% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 100%); }
.titlescr .ttl { position: absolute; left: 96px; top: 180px; color: #efe3c6; }
.titlescr .ttl .k { font-size: 15px; letter-spacing: 0.36em; color: rgba(201, 164, 92, 0.85); }
.titlescr .ttl h1 { font-size: 62px; font-weight: 700; letter-spacing: 0.12em; margin: 18px 0 10px; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7); }
.titlescr .ttl .s { font-size: 22px; letter-spacing: 0.4em; color: #b9ab92; }
.titlescr .tmenu { position: absolute; left: 96px; top: 470px; display: flex; flex-direction: column; gap: 14px; }
.titlescr .tmenu button { width: 380px; display: flex; justify-content: space-between; align-items: baseline; text-align: left; background: rgba(12, 9, 6, 0.72); border: 1px solid rgba(201, 164, 92, 0.45); color: var(--ink); font: 24px var(--serif); letter-spacing: 0.12em; padding: 14px 26px; cursor: pointer; }
.titlescr .tmenu button:hover, .titlescr .tmenu button:focus-visible { border-color: var(--brass); background: rgba(40, 28, 16, 0.9); outline: none; }
.titlescr .tmenu .cnt { font-size: 18px; color: rgba(201, 164, 92, 0.9); letter-spacing: 0.08em; }
.titlescr .tpanel { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.86); }
.titlescr .tin { display: flex; flex-direction: column; align-items: center; max-height: 870px; width: 100%; }
.titlescr .tin h2 { font-size: 44px; letter-spacing: 0.3em; color: #efe3c6; margin: 0 0 8px; font-weight: 700; }
.titlescr .tin .sum { font-size: 20px; color: #b9ab92; letter-spacing: 0.1em; margin-bottom: 26px; }
.titlescr .egrid { display: grid; grid-template-columns: repeat(3, 340px); gap: 16px; }
.titlescr .ecard { position: relative; height: 150px; padding: 18px 20px; display: flex; flex-direction: column; background: rgba(18, 13, 9, 0.9); border: 1px solid rgba(201, 164, 92, 0.16); color: rgba(185, 171, 146, 0.42); }
.titlescr .ecard.got { border-color: rgba(201, 164, 92, 0.55); color: #ddd0b3; }
.titlescr .ecard .tier { font-size: 14px; letter-spacing: 0.4em; color: rgba(201, 164, 92, 0.5); }
.titlescr .ecard.got.tr .tier { color: #e6c47a; }
.titlescr .ecard.got.bd .tier { color: rgba(214, 128, 116, 0.85); }
.titlescr .ecard .nm { font-size: 28px; letter-spacing: 0.12em; margin: 12px 0 4px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlescr .ecard .dt { font-size: 14px; color: rgba(185, 171, 146, 0.6); letter-spacing: 0.06em; }
.titlescr .ecard button { position: absolute; right: 16px; bottom: 14px; font: 16px var(--serif); background: rgba(12, 9, 6, 0.9); border: 1px solid rgba(201, 164, 92, 0.5); color: var(--ink); padding: 6px 14px; cursor: pointer; }
.titlescr .ecard button:hover, .titlescr .ecard button:focus-visible { border-color: var(--brass); outline: none; }
.titlescr .tback { margin-top: 28px; min-width: 260px; background: rgba(20, 15, 10, 0.9); border: 1px solid rgba(201, 164, 92, 0.55); color: var(--ink); font: 22px var(--serif); padding: 10px 26px; cursor: pointer; }
.titlescr .tback:hover, .titlescr .tback:focus-visible { border-color: var(--brass); outline: none; }
.titlescr .tranks .rankboard { margin-top: 0; }

/* ---- the dark room's minute: a countdown in glow-paint green, top centre ---- */
#darkclock { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 30; pointer-events: none; font: 30px/1 Georgia, 'Times New Roman', serif; letter-spacing: 0.14em;
  color: rgba(190, 255, 205, 0.82); text-shadow: 0 0 6px rgba(120, 255, 170, 0.75), 0 0 16px rgba(120, 255, 170, 0.32); opacity: 0; transition: opacity 0.8s; }
#darkclock.on { opacity: 1; }
#darkclock.low { color: rgba(255, 222, 186, 0.92); text-shadow: 0 0 6px rgba(255, 150, 90, 0.7), 0 0 16px rgba(255, 120, 60, 0.32); animation: dcpulse 1s ease-in-out infinite; }
@keyframes dcpulse { 50% { opacity: 0.55; } }
body.nohud #darkclock { display: none; }
body.compact #darkclock { font-size: calc(30px * var(--uiz)); top: calc(84px * var(--uiz)); }
/* the back of the drawer memo (hints written by an earlier night's self) */
.memowrap { display: flex; flex-direction: column; align-items: center; }
.memowrap .memoflip { margin-top: 18px; background: rgba(20, 15, 10, 0.9); border: 1px solid rgba(201, 164, 92, 0.55); color: var(--ink); font: 20px var(--serif); padding: 8px 22px; cursor: pointer; }
.memowrap .memoflip:hover, .memowrap .memoflip:focus-visible { border-color: var(--brass); outline: none; }
.memo.back { color: #3a2f5c; transform: rotate(0.5deg); }
