:root {
  --bg: #07080c;
  --mint: #86efac;
  --mint-2: #1fd978;
  --ink: #052e16;
  --paper: #f4ecd8;
  --paper-2: #e7dcc0;
  --brown: #24180f;
  --pink: #fb7185;
  --wood: #3a2618;
  --wall: #141c18;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--paper);
  font-family: "Instrument Sans", "Avenir Next", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
::selection { background: var(--mint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
button:focus:not(:focus-visible) { outline: none; }

#grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: .11; mix-blend-mode: overlay;
  background: url("../assets/noise.png");
  background-size: 160px 160px;
}
#blackout {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: #000; opacity: 0; transition: opacity .38s ease;
}
#blackout.on { opacity: 1; }

#intro {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 28px 18px 12vh;
  background: #07080c;
  transition: opacity .5s ease;
}
#intro.hide { opacity: 0; pointer-events: none; }
.load-stack { text-align: center; width: min(720px, 100%); }
.seal {
  width: 84px; height: 84px;
  opacity: 0; transform: scale(.72);
  filter: drop-shadow(0 0 22px rgba(134,239,172,.45));
  animation: sealIn .7s cubic-bezier(.2,1.3,.3,1) .05s forwards;
}
@keyframes sealIn { to { opacity: 1; transform: none; } }
.word {
  margin: 14px 0 0;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(64px, 12vw, 112px);
  letter-spacing: -.07em;
  line-height: .86;
  color: #f4ecd8;
}
.word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px);
  animation: letter .5s ease forwards;
}
.word span:nth-child(1) { animation-delay: .28s; }
.word span:nth-child(2) { animation-delay: .36s; }
.word span:nth-child(3) { animation-delay: .44s; }
.word span:nth-child(4) { animation-delay: .52s; }
.word span:nth-child(5) { animation-delay: .6s; }
.word span:nth-child(6) { animation-delay: .68s; }
.word span:nth-child(7) { animation-delay: .76s; }
@keyframes letter { to { opacity: 1; transform: none; } }
.foot { display: grid; min-height: 150px; margin-top: 28px; }
.loader, .after { grid-area: 1 / 1; }
.loader { align-self: start; }
.track {
  width: min(280px, 70vw); height: 3px; margin: 0 auto;
  background: rgba(134,239,172,.18); border-radius: 99px; overflow: hidden;
}
#loadbar {
  display: block; height: 100%; width: 0; background: #86efac;
  box-shadow: 0 0 12px #86efac;
  animation: loadFill 2.15s cubic-bezier(.15,.7,.2,1) .4s forwards;
}
@keyframes loadFill { to { width: 100%; } }
.loader p {
  margin: 12px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #9eb8a8;
}
.after {
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
#intro.ready .loader { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#intro.ready .after { opacity: 1; transform: none; pointer-events: auto; }
.line {
  margin: 0;
  font-family: Syne, "Avenir Next", sans-serif;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.05;
  font-size: clamp(28px, 4.4vw, 44px);
  color: #f4ecd8;
}
.line.mint { color: #86efac; margin: 4px 0 22px; }
.legal {
  margin: 16px auto 0; max-width: 28rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; line-height: 1.45; letter-spacing: .04em;
  color: #9eb8a8;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--mint);
  font-family: Syne, sans-serif; font-weight: 700; letter-spacing: -.03em;
}
.btn:hover { background: #0c4a28; }
.btn.mint { background: var(--mint); color: var(--ink); }
.btn.mint:hover { background: #c9ffd8; }
.btn.ghost { background: transparent; color: var(--brown); box-shadow: inset 0 0 0 1.5px rgba(36,24,15,.35); }
.btn.ghost:hover { background: rgba(134,239,172,.28); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

#world { min-height: 100dvh; }
#stage { position: relative; }
.scene { display: none; }
#gate.on, #room.on {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 100dvh; padding: 18px 16px 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(134,239,172,.16), transparent 46%),
    linear-gradient(#1a2620, #0d1411 72%);
}
.tubes { display: flex; gap: 14px; justify-content: center; }
.tubes i {
  width: 64px; height: 7px; border-radius: 99px;
  background: linear-gradient(#f6fff9, var(--mint) 42%, #147346);
  box-shadow: 0 0 16px rgba(134,239,172,.8);
  animation: flick 6.5s infinite;
}
.tubes i:nth-child(2) { width: 110px; animation-delay: -2.2s; }
.tubes i:nth-child(3) { animation-delay: -4s; }
@keyframes flick { 0%, 91%, 100% { opacity: .95; } 93% { opacity: .45; } 95% { opacity: 1; } }
.loc {
  display: flex; justify-content: space-between; gap: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #d5eee0;
}

.door, .notice, .ext, .vent {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; color: var(--paper);
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(134,239,172,.16);
  border-radius: 16px; padding: 10px;
}
.door em, .notice em, .ext em, .vent em { font-style: normal; }
.door em { font-family: Syne, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -.04em; }
.frame { position: relative; display: block; width: 78px; height: 104px; flex: none; }
.slab {
  position: absolute; inset: 0; display: block; border-radius: 6px;
  background: linear-gradient(#4e8a6e, #24543c 42%, #173628);
  box-shadow: inset 0 0 0 4px #0c1612, 0 14px 22px rgba(0,0,0,.45);
  overflow: hidden;
}
.louver { display: block; height: 9px; margin: 12px 10px 0; border-radius: 2px; background: #07110e; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.occ {
  position: absolute; left: 8px; bottom: 10px;
  display: flex; align-items: center; gap: 5px;
  font-family: "IBM Plex Mono", monospace; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: #ffd0d6;
}
.occ i { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.knob {
  position: absolute; right: 8px; top: 46%; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3e7c8, #b08a3e 55%, #6d5420);
}
.door.dept .slab {
  background: linear-gradient(#2f7a52, #143828);
  box-shadow: inset 0 0 0 4px #86efac, 0 0 36px rgba(134,239,172,.45), 0 14px 22px rgba(0,0,0,.45);
}
.glass {
  position: absolute; inset: 10px 10px 18px; border-radius: 4px;
  background: linear-gradient(180deg, rgba(198,255,214,.72), rgba(12,40,24,.35) 46%, rgba(134,239,172,.28));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.etched {
  font-family: Syne, sans-serif; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; font-size: 8px; color: var(--mint);
}
.mini-curve { width: 70%; height: 28px; }
.mini-curve path { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; }
.door.dept .frame:after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 8px;
  background: var(--mint); filter: blur(6px); opacity: .85;
}
.door.elev .slab { background: linear-gradient(#3a403c, #1c211e); }
.display {
  position: absolute; left: 8px; right: 8px; top: 10px; padding: 4px;
  background: #070a08; color: var(--mint); text-align: center; border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
}
.display b { display: block; font-size: 14px; letter-spacing: .12em; }
.display small { font-size: 7px; letter-spacing: .14em; text-transform: uppercase; }
.tape {
  position: absolute; left: 0; right: 0; top: 54%; height: 16px;
  background: repeating-linear-gradient(-45deg, #111 0 6px, var(--mint) 6px 12px);
}
.oos { display: none; }
.call { position: absolute; width: 12px; height: 12px; border-radius: 50%; left: 10px; bottom: 10px; background: #222; box-shadow: inset 0 0 0 2px #111, 0 0 0 1px #666; }

.notice { color: var(--brown); background: var(--paper); }
.notice em { display: flex; flex-direction: column; gap: 4px; font-family: Syne, sans-serif; font-weight: 800; font-size: 22px; letter-spacing: -.04em; line-height: .95; }
.notice em b { font-weight: 800; }
.notice em small { font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.paperhead {
  width: 64px; height: 78px; flex: none; display: grid; place-items: center;
  background: #fffaf0; border: 1px solid rgba(36,24,15,.15);
  font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  transform: rotate(-2deg);
}
.fresh { animation: pulse 2.4s ease infinite; }
@keyframes pulse { 50% { outline: 3px solid rgba(134,239,172,.85); outline-offset: 3px; } }

.ext em, .vent em {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; letter-spacing: .04em; color: #d5eee0;
}
.can {
  width: 26px; height: 44px; flex: none; border-radius: 7px 7px 9px 9px;
  background: linear-gradient(#ff7d88, #c42334);
  box-shadow: inset 5px 0 0 rgba(255,255,255,.28), 0 6px 10px rgba(0,0,0,.25);
}
.slats {
  width: 72px; height: 28px; flex: none; border-radius: 3px;
  background: repeating-linear-gradient(#1c2822, #1c2822 4px, #0a0e0c 4px, #0a0e0c 8px);
  box-shadow: inset 0 0 0 2px #2a3830;
}
.vent.peek .slats { filter: brightness(1.45); }
.floor-ticket {
  width: 72px; min-height: 44px; border-radius: 4px; background: var(--paper); color: var(--brown);
  font-family: Syne, sans-serif; font-weight: 800; font-size: 20px;
  box-shadow: 0 8px 14px rgba(0,0,0,.35); transform: rotate(-7deg);
}
.phone-hint {
  margin: 8px 0 0; text-align: center;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #c9ddd0;
}
.window {
  width: min(460px, 100%); height: 500px; margin: 4px auto 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: #0c1210; border: 10px solid #16130f; border-radius: 18px;
  box-shadow: 0 22px 50px rgba(0,0,0,.38), inset 0 0 0 1px rgba(134,239,172,.25);
}
.win-bar {
  height: 34px; flex: none; display: flex; justify-content: space-between; align-items: center;
  padding: 0 12px; background: #14110e; color: var(--mint);
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
.win-view { position: relative; flex: 1; overflow: hidden; background: #141816; }
.fallback { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pupil { transform: translate(calc(var(--lx, 0) * 3px), calc(var(--ly, 0) * 2px)); }
#clerk-img {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  object-fit: cover; object-position: center 12%;
  transform: translate(calc(var(--lx, 0) * 10px), calc(var(--ly, 0) * 7px)) scale(1.08);
  transition: transform .16s linear;
}
.curve { position: absolute; left: 8%; right: 8%; bottom: 8%; height: 22%; z-index: 2; pointer-events: none; opacity: .8; }
.curve path { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(134,239,172,.8)); }
.glass-sheen {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.16), transparent 26%, transparent 62%, rgba(134,239,172,.12));
}

.desk { display: none; }

#bubble {
  position: fixed; z-index: 140; width: min(440px, calc(100vw - 24px));
  transform: translate(-50%, -100%);
}
#bubble[data-side="down"] { transform: translate(-50%, 0); }
#bubble p {
  margin: 0; background: var(--paper); color: var(--brown);
  font-family: "IBM Plex Mono", monospace; font-size: 16px; line-height: 1.45;
  padding: 14px 16px; border-radius: 16px;
  white-space: pre-line; text-wrap: pretty;
  box-shadow: 0 14px 30px rgba(0,0,0,.32);
}
#bubble:after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--paper);
}
#bubble[data-side="none"]:after { display: none; }
#bubble[data-side="right"]:after {
  left: auto; right: -8px; top: 22px; bottom: auto; transform: none;
  border: 8px solid transparent; border-left-color: var(--paper); border-top-color: transparent;
}
#bubble[data-side="down"]:after { bottom: auto; top: -7px; border-top-color: transparent; border-bottom-color: var(--paper); }

#tip {
  position: fixed; z-index: 170; pointer-events: none;
  background: var(--paper); color: var(--brown);
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  padding: 4px 8px; border-radius: 999px; transform: translate(12px, 18px);
}
.xlogin {
  position: fixed; top: 12px; left: 14px; z-index: 210;
  color: #052e16; background: #86efac; text-decoration: none;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .04em;
  border-radius: 999px; padding: 8px 12px;
}
.xlogin:hover { background: #c9ffd8; }
#sound {
  position: fixed; top: 12px; right: 12px; z-index: 210;
  display: flex; align-items: center; gap: 8px;
  color: #d7ffe8; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .14em;
}
#vol { width: 88px; accent-color: var(--mint); }

#ca {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 220;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  width: min(920px, calc(100vw - 24px));
}
.ca-addr {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; line-height: 1.35;
  background: #f4ecd8; color: #24180f; border-radius: 999px;
  padding: 10px 14px; max-width: 100%; word-break: break-all; text-align: center;
}
.ca-link {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; text-decoration: none;
  background: #86efac; color: #052e16; border-radius: 999px; padding: 10px 14px;
}
#coach {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 145;
  max-width: min(540px, calc(100vw - 160px));
  margin: 0; padding: 10px 16px; border-radius: 999px;
  background: #f4ecd8; color: #24180f;
  font-family: "IBM Plex Mono", monospace; font-size: 15px; line-height: 1.35;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.bell.next, .folder.next, #steps li.next button, #dock button.next {
  box-shadow: 0 0 0 3px #86efac;
}
#steps {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 125;
  display: flex; gap: 6px; margin: 0; padding: 6px; list-style: none;
  background: rgba(7,10,9,.82); border: 1px solid rgba(134,239,172,.4); border-radius: 999px;
}
#steps button {
  min-height: 36px; padding: 0 12px; border-radius: 999px; color: #d7ffe4;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .04em;
}
#steps li.done button { color: var(--mint); }
#steps li.now button { background: var(--mint); color: var(--ink); }
body.booting #steps, body.booting #dock { display: none; }
body[data-scene="room"] #steps { bottom: calc(78px + env(safe-area-inset-bottom)); }

#dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(#6a4932, #2a1a12);
  box-shadow: 0 -12px 30px rgba(0,0,0,.35);
}
#dock button {
  flex: 1 0 auto; min-width: 68px; min-height: 44px;
  background: var(--paper); color: var(--brown); border-radius: 12px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
}
body[data-scene="room"] #room.on { padding-bottom: 108px; }

#ov { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 18px; }
.ov-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.64); }
.ov-panel {
  position: relative; z-index: 1; width: min(680px, calc(100vw - 24px));
  max-height: min(86dvh, 880px); overflow: auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 80px),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(90,70,40,.06) 28px),
    var(--paper);
  color: var(--brown); border-radius: 18px; padding: 28px 22px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: pop .28s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.x {
  position: sticky; float: right; top: 0; z-index: 2;
  width: 36px; height: 36px; margin: -8px -6px 0 8px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: white; font-size: 22px; line-height: 1;
}
.prose h2, .sheet h2, .cap b, .ticket b.huge {
  font-family: Syne, sans-serif; font-weight: 800; letter-spacing: -.04em; line-height: 1.02;
}
.prose h2, .sheet h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); }
.prose p, .sheet p { margin: 0 0 12px; }
.kicker.dark, .sheet .kicker {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: #7c6b56; margin-bottom: 6px;
}
.q { font-family: "IBM Plex Mono", monospace; font-size: 18px; line-height: 1.4; margin: 8px 0 12px; }
.echo { font-family: "IBM Plex Mono", monospace; font-style: italic; color: #5c4d3c; }
.opt {
  display: flex; gap: 10px; width: 100%; text-align: left; align-items: flex-start;
  margin-top: 8px; padding: 10px 12px; border-radius: 12px; color: var(--brown);
  box-shadow: inset 0 0 0 1px rgba(36,24,15,.18);
}
.opt:hover { background: rgba(134,239,172,.35); }
.opt b {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px;
  background: var(--ink); color: var(--mint); font-family: "IBM Plex Mono", monospace; font-size: 13px;
}
textarea {
  width: 100%; min-height: 120px; resize: vertical; border-radius: 12px;
  border: 1px solid rgba(36,24,15,.25); background: rgba(255,255,255,.5);
  color: var(--brown); padding: 12px; font: 16px/1.45 "IBM Plex Mono", monospace;
}
.fine { color: #7c6b56; font-size: 13px; }
.count { float: right; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #7c6b56; }
.class-name { font-family: Syne, sans-serif; font-weight: 800; font-size: 32px; letter-spacing: -.04em; margin: 0; }
.stamp {
  width: 116px; height: 116px; margin-left: auto; display: grid; place-items: center;
  border: 4px solid #e11d48; color: #e11d48; border-radius: 50%;
  font-family: Syne, sans-serif; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  transform: rotate(-12deg); box-shadow: inset 0 0 0 2px #e11d48;
  animation: slam .4s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes slam { from { transform: rotate(-20deg) scale(1.5); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: .92; } }
.task { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 0; color: var(--brown); border-bottom: 1px solid rgba(36,24,15,.1); }
.task i {
  flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px rgba(36,24,15,.4);
}
.task.done i { background: var(--mint); box-shadow: none; }
.task.done span { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .65; }
.cork {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: #6b4a2e; padding: 16px; border-radius: 12px; box-shadow: inset 0 0 0 8px #4a301c;
}
.slip {
  min-height: 92px; padding: 12px; text-align: left; background: var(--paper); color: var(--brown);
  box-shadow: 0 8px 14px rgba(0,0,0,.25); font-family: Syne, sans-serif; font-weight: 700;
}
.slip:nth-child(odd) { transform: rotate(-1.4deg); }
.slip:nth-child(even) { transform: rotate(1.1deg); }

#ov[data-kind="ticket"] .ov-panel,
#ov[data-kind="socials"] .ov-panel,
#ov[data-kind="gallery"] .ov-panel,
#ov[data-kind="vent"] .ov-panel {
  background: transparent; box-shadow: none; overflow: visible; padding: 0;
}
#ov[data-kind="vent"] { align-items: end; padding-bottom: 7vh; }
#ov[data-kind="vent"] .ov-panel {
  width: min(560px, calc(100vw - 20px)); background: #101814; color: #e7fff1;
  border-radius: 18px; padding: 22px 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.whisper { font-family: "IBM Plex Mono", monospace; font-style: italic; font-size: 18px; min-height: 1.4em; margin: 0 0 12px; }
.vopts { display: flex; flex-direction: column; gap: 8px; }
.vopts button {
  text-align: left; color: var(--ink); background: var(--mint); border-radius: 12px; padding: 10px 12px;
  font-family: "IBM Plex Mono", monospace;
}
.ticket {
  width: min(380px, 92vw); background: var(--paper); color: var(--brown);
  padding: 26px 22px 18px; position: relative;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.45));
}
.ticket:before, .ticket:after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background: radial-gradient(circle, #07080c 5px, transparent 6px); background-size: 18px 14px;
}
.ticket:before { top: -7px; }
.ticket:after { bottom: -7px; }
.ticket .top { display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.huge { display: block; font-size: clamp(64px, 18vw, 92px); letter-spacing: -.06em; line-height: .9; margin: 8px 0; }
.barcode { height: 42px; margin: 12px 0; background: repeating-linear-gradient(90deg, #24180f 0 2px, transparent 2px 4px, #24180f 4px 5px, transparent 5px 9px, #24180f 9px 12px, transparent 12px 14px); }
.flipper { width: min(380px, 92vw); height: 300px; perspective: 1000px; cursor: pointer; }
.flipper .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s ease; }
.flipper.flip .inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; padding: 16px 16px 14px;
  display: flex; flex-direction: column; overflow: auto;
}
.face.front { background: #101814; color: var(--mint); box-shadow: inset 0 0 0 1px rgba(134,239,172,.35); }
.face.back { background: var(--paper); color: var(--brown); transform: rotateY(180deg); }
.corners { display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.word { font-family: Syne, sans-serif; font-weight: 800; font-size: 42px; letter-spacing: -.06em; margin: 8px 0 0; }
.sub { font-family: "IBM Plex Mono", monospace; font-size: 12px; opacity: .8; }
.discs { display: flex; gap: 8px; margin-top: auto; }
.discs a, .discs button {
  border-radius: 999px; padding: 8px 12px; background: var(--mint); color: var(--ink);
  font-family: "IBM Plex Mono", monospace; font-size: 12px; text-decoration: none;
}
.bc-lines { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.bc-lines li { margin: 0 0 6px; }
.who b { font-family: Syne, sans-serif; font-size: 22px; }
.who span, .who em { display: block; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.hint { text-align: center; color: var(--paper); font-family: "IBM Plex Mono", monospace; font-size: 12px; margin: 12px 0 0; }
.gal { display: flex; align-items: center; gap: 8px; perspective: 1000px; }
.gal > button {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.45); color: white; font-size: 28px;
}
#plate {
  width: min(380px, 72vw); aspect-ratio: 3/4; margin: 0 auto; overflow: hidden; position: relative;
  background: #111; border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 10px #1a1c16, 0 0 0 12px var(--mint);
}
#plate img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
#plate .glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.22), transparent 36%);
}
.cap { text-align: center; color: var(--paper); margin: 14px 0 0; }
.cap b { display: block; font-size: 28px; }
.cap span, .cap em { display: block; font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.toast { min-height: 1.2em; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #3d6b4a; }

@media (min-width: 960px) and (min-height: 620px) {
  #world { height: 100dvh; overflow: hidden; }
  #stage {
    position: absolute; left: 50%; top: 50%;
    width: 1600px; height: 900px;
    transform-origin: center center;
  }
  #gate.on, #room.on { display: block; min-height: 0; position: absolute; inset: 0; padding: 0; gap: 0; }
  body[data-scene="room"] #room.on { padding-bottom: 0; }
  .phone-hint { display: none; }
  #dock { display: none; }
  body[data-scene="room"] #steps { bottom: 22px; }
  .desk { display: block; }

  .tubes { position: absolute; top: 12px; left: 0; right: 0; z-index: 5; pointer-events: none; }
  .tubes i { width: 180px; height: 8px; }
  .tubes i:nth-child(2) { width: 280px; }
  .loc { position: absolute; left: 36px; top: 42px; right: 36px; z-index: 5; }
  .floor {
    position: absolute; left: 0; right: 0; bottom: 0; height: 220px; z-index: 1;
    background:
      linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.4)),
      repeating-linear-gradient(90deg, #1b2621 0 2px, #141c18 2px 88px);
  }
  .vignette {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.48) 100%);
  }
  .door, .notice, .ext, .vent, .clock, .floor-ticket { position: absolute; z-index: 4; width: auto; background: none; border: 0; padding: 0; border-radius: 0; }
  .door { display: block; }
  .door em {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
    opacity: 1; white-space: nowrap;
    font-family: "IBM Plex Mono", monospace; font-size: 14px; font-weight: 500; letter-spacing: .02em;
    background: rgba(0,0,0,.72); color: var(--paper); padding: 5px 10px; border-radius: 999px;
  }
  .door.dept em { background: var(--mint); color: var(--ink); font-weight: 700; }
  .door:hover { transform: translateY(-8px); }
  .door .frame { width: 100%; height: 100%; }
  .door.bath { left: 90px; top: 160px; width: 250px; height: 520px; }
  .door.dept { left: 600px; top: 120px; width: 290px; height: 560px; }
  .door.elev { left: 1040px; top: 160px; width: 250px; height: 520px; }
  .etched { font-size: 22px; letter-spacing: .22em; }
  .display b { font-size: 28px; }
  .display small { font-size: 12px; letter-spacing: .16em; }
  .occ { left: 16px; bottom: 22px; font-size: 0; }
  .occ i { width: 9px; height: 9px; }
  .oos {
    display: block; position: absolute; left: 18px; right: 18px; top: 62%;
    background: #0c0f0d; color: var(--mint);
    border: 1px solid rgba(134,239,172,.5); border-radius: 8px;
    text-align: center; font-family: "IBM Plex Mono", monospace;
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    white-space: nowrap; padding: 9px 6px;
  }
  .notice {
    left: 368px; top: 200px; width: 210px; height: 156px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: var(--paper); color: var(--brown); padding: 18px 16px;
    border: 8px solid #2a2118; box-shadow: 0 14px 22px rgba(0,0,0,.35); transform: rotate(-2deg);
  }
  .notice em { position: static; opacity: 1; background: none; color: var(--brown); font-size: 32px; gap: 8px; align-items: flex-start; width: 100%; }
  .notice em small { font-size: 11px; letter-spacing: .08em; white-space: normal; line-height: 1.35; max-width: 16em; }
  .paperhead { display: none; }
  .vent { left: 900px; top: 624px; width: 136px; height: 52px; margin: 0; }
  .vent em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vent .slats { width: 100%; height: 100%; }
  .ext { left: 1360px; top: 470px; width: 60px; height: 190px; display: block; }
  .ext em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ext .can { width: 48px; height: 128px; margin: 28px auto 0; }
  .clock {
    display: grid; place-items: center; left: 1428px; top: 92px;
    width: 96px; height: 96px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #f7f1e4, #d9d0c0 55%, #a79b88);
    box-shadow: 0 10px 16px rgba(0,0,0,.3), inset 0 0 0 6px #2a241c;
    color: var(--brown); font-family: "IBM Plex Mono", monospace; font-size: 13px;
  }
  .floor-ticket { left: 800px; top: 748px; margin: 0; }

  .window { position: absolute; left: 548px; top: 22px; width: 500px; height: 600px; border-radius: 8px; border-width: 14px; z-index: 2; }
  .portraits {
    position: absolute; left: 46px; top: 92px; width: 460px; z-index: 4;
    display: flex; gap: 10px;
  }
  .portraits span {
    flex: 1; height: 220px; overflow: hidden; background: #111;
    border: 8px solid #1a140f; box-shadow: 0 12px 18px rgba(0,0,0,.35);
  }
  .portraits img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
  .board {
    position: absolute; left: 1160px; top: 86px; width: 380px; height: 280px; z-index: 4;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px;
    background: #5c3d28; border: 8px solid #3a2618; box-shadow: 0 12px 20px rgba(0,0,0,.3);
  }
  .paperlet { background: var(--paper); border-radius: 2px; }
  .paperlet:nth-child(1) { transform: rotate(-2deg); }
  .paperlet:nth-child(2) { transform: rotate(1.5deg); }
  .paperlet:nth-child(3) { transform: rotate(1deg); }
  .paperlet:nth-child(4) { transform: rotate(-1.2deg); }
  .counter {
    position: absolute; left: 0; right: 0; bottom: 0; height: 310px; z-index: 3;
    background: linear-gradient(#6b4a30, #3a2618 16%, #24160f);
    box-shadow: 0 -16px 30px rgba(0,0,0,.2);
  }
  .counter:before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 16px;
    background: linear-gradient(#8d6848, #5a3b28);
  }
  .prop { position: absolute; z-index: 6; }
  .back {
    left: 48px; top: 700px; width: 92px; height: 48px; border-radius: 999px;
    background: var(--mint); color: var(--ink); font-family: Syne, sans-serif; font-weight: 700;
  }
  .tray { left: 190px; top: 640px; width: 160px; height: 110px; }
  .tray .sheet { position: absolute; left: 12px; right: 12px; height: 70px; background: var(--paper); }
  .tray .s1 { top: 6px; transform: rotate(-4deg); }
  .tray .s2 { top: 16px; transform: rotate(3deg); }
  .tray .lip { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; border-radius: 3px; background: linear-gradient(#6d5138, #3a2618); }
  .bell { left: 470px; top: 628px; width: 140px; height: 128px; }
  .bell-svg {
    display: block; width: 128px; height: 116px; margin: 0 auto;
    filter: drop-shadow(0 12px 8px rgba(0,0,0,.35));
    transition: transform .08s ease;
  }
  .bell.down .bell-svg, .bell:active .bell-svg { transform: translateY(5px); }
  .folder {
    left: 720px; top: 630px; width: 220px; height: 136px; color: #3a2a16; text-align: left; padding: 28px 14px 10px;
    background: linear-gradient(#f3e6c8, #d9c49a); border-radius: 3px 12px 12px 12px;
    box-shadow: 0 8px 0 #c6b48a, 0 16px 16px rgba(0,0,0,.28);
  }
  .folder .tab {
    position: absolute; left: 12px; top: -16px; background: #eadcb8; padding: 3px 10px; border-radius: 6px 6px 0 0;
    font-family: "IBM Plex Mono", monospace; font-size: 12px;
  }
  .folder .face { font-family: Syne, sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -.04em; }
  .folder[data-thick="2"] { box-shadow: 0 6px 0 #ddcba6, 0 12px 0 #c6b48a, 0 18px 16px rgba(0,0,0,.28); }
  .folder[data-thick="3"] { box-shadow: 0 5px 0 #e6d5b2, 0 10px 0 #d3c09a, 0 15px 0 #c6b48a, 0 22px 16px rgba(0,0,0,.28); }
  .folder[data-thick="4"] { box-shadow: 0 4px 0 #efe0bf, 0 8px 0 #ddcba6, 0 12px 0 #d3c09a, 0 16px 0 #c6b48a, 0 24px 16px rgba(0,0,0,.3); }
  .folder.done .face { color: #0e7a3a; }
  .plaque {
    left: 1120px; top: 660px; width: 210px; height: 96px; border-radius: 12px;
    background: #101814; color: var(--mint); box-shadow: inset 0 0 0 1px rgba(134,239,172,.4), 0 12px 16px rgba(0,0,0,.28);
    font-family: Syne, sans-serif; font-weight: 700; font-size: 18px;
  }
  .plaque small { display: block; margin-top: 4px; font-family: "IBM Plex Mono", monospace; font-weight: 400; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
  .prop em {
    position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%);
    font-style: normal; white-space: nowrap;
    font-family: "IBM Plex Mono", monospace; font-size: 13px; letter-spacing: .02em;
    background: rgba(0,0,0,.78); color: var(--paper); padding: 5px 10px; border-radius: 999px;
  }
  #crumples { position: absolute; left: 960px; top: 650px; width: 220px; height: 130px; z-index: 5; pointer-events: none; }
  #crumples i {
    position: absolute; left: var(--x); top: var(--y); width: 38px; height: 30px;
    border-radius: 40% 50% 45% 55%; transform: rotate(var(--r));
    background: radial-gradient(circle at 30% 30%, #fff, #e4d5b4 45%, #b7a688);
    box-shadow: 0 6px 8px rgba(0,0,0,.25);
  }
  #room .vignette { z-index: 5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important;
  }
  .seal, .word span { opacity: 1; transform: none; }
  #loadbar { width: 100%; }
}
