:root {
  color-scheme: dark;
  font-family: "Space Grotesk", "Trebuchet MS", system-ui, sans-serif;
  color: #fff0e9;
  background: #140a0d;
  --muted: #d6b8bc;
  --edge: #624149;
  --rose: #ffb4ac;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 52% 4%, #42121d, transparent 44rem), #140a0d; }
main, .mix-top { width: min(100% - 2rem, 69rem); margin-inline: auto; }
.mix-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--edge); }
.mix-top a { padding-block: .9rem; color: #fff0e9; text-decoration: none; }
a:hover { text-decoration: underline; }
.mix-heading { text-align: center; padding: clamp(1.25rem, 4vw, 3rem) 0 .85rem; }
.wordmark, .room-number { font-weight: 800; color: var(--rose); letter-spacing: .13em; }
.wordmark { text-transform: uppercase; margin: 0 0 .4rem; font-size: .84rem; }
h1 { margin: 0; font-size: clamp(2.35rem, 7vw, 5rem); line-height: .92; letter-spacing: -.065em; text-shadow: 0 0 2rem #fd645e65; }
h2 { margin: 0; font-size: clamp(1.45rem, 4.5vw, 2.25rem); }
#progress-caption, .muted, .intro { color: var(--muted); }
#progress-caption { margin-bottom: .2rem; }
#rooms { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .3rem; max-width: 35rem; margin: 0 auto 1.1rem; }
#rooms button { padding-inline: 0; min-width: 0; }
#rooms button[aria-current] { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
#rooms .visited { background: #592735; }
button, .secondary { min-height: 44px; border: 1px solid var(--edge); border-radius: .65rem; background: #2a1720; color: inherit; font: inherit; font-weight: 700; padding: .5rem .8rem; cursor: pointer; }
button:hover:not(:disabled), .secondary:hover { background: #482331; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #ffd9a9; outline-offset: 2px; }
.primary { background: #ffb4ac; color: #290c11; border-color: #ffb4ac; }
.primary:hover:not(:disabled) { background: #ffd3c9; }
.room, .mix-rest { border: 1px solid var(--edge); background: #1c1018; padding: clamp(.7rem, 2vw, 1.25rem); border-radius: 1.1rem; margin-bottom: 2rem; }
.room-number { margin: 0 0 .25rem; font-size: .73rem; text-transform: uppercase; }
.intro { margin: .35rem 0 1rem; line-height: 1.5; }
.scene-window { overflow: auto; border-radius: .7rem; border: 1px solid #89505c; background: #160d18; }
.scene { position: relative; isolation: isolate; }
.room-art, .rest-art { width: 100%; display: block; aspect-ratio: var(--scene-ratio, 9 / 7); object-fit: cover; background: radial-gradient(ellipse at center, #692837, #170c16); }
.room-open .scene-window { box-shadow: 0 0 1.45rem #e85b6350; }
.scene-controls { display: flex; justify-content: end; margin: .45rem 0; }
.clues { margin-top: .4rem; border: 1px solid var(--edge); border-radius: .7rem; padding: 0 .65rem; }
summary { padding: .7rem 0; min-height: 44px; cursor: pointer; font-weight: 700; }
.clue-list, .choices, .actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.clue-list { padding-bottom: .65rem; }
.object-link { background: transparent; }
.exit { display: block; margin-top: .85rem; width: 100%; }
.mix-rest { text-align: center; }
.mix-rest h2 { margin-top: 1rem; }
.mix-rest .actions { justify-content: center; }
.secondary { display: inline-flex; align-items: center; text-decoration: none; }
.rest-art { max-height: 55vh; border-radius: .65rem; }
dialog { width: min(calc(100% - 1.25rem), 36rem); max-height: calc(100dvh - 1.25rem); padding: .85rem; border-radius: .85rem; border: 1px solid #c18187; background: #26151f; color: inherit; }
dialog::backdrop { background: #080408df; }
.object-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.object-art { height: clamp(5.5rem, 25vh, 10rem); border: 1px solid var(--edge); border-radius: .55rem; background-color: #3a202e; background-size: 190%; }
.evidence { white-space: pre-line; line-height: 1.65; }
.puzzle { border-top: 1px solid var(--edge); padding-top: .75rem; }
.puzzle h3 { margin-top: 0; line-height: 1.4; }
.feedback { color: #ffd6a8; margin: .55rem 0; }
.feedback:empty { display: none; }
.discovered { color: #ffcf9e; line-height: 1.5; }
.lens-card { margin: .6rem 0; padding: .6rem; border: 1px solid var(--edge); border-radius: .55rem; background: #160c19; text-align: center; }
.lens-card svg { display: block; width: min(100%, 16rem); height: 6rem; margin-inline: auto; color: #ffd8b0; }
.lens-card p { margin: .35rem 0; }
@media (min-width: 50rem) {
  .room { display: grid; grid-template-columns: 2fr 1fr; align-items: start; column-gap: 1rem; }
  .room-number, .room h2, .intro, .scene-window, .scene-controls { grid-column: 1; }
  .clues { grid-column: 2; grid-row: 1 / span 4; }
  .exit { grid-column: 1 / -1; }
}
@media (max-width: 360px) { #rooms { grid-template-columns: repeat(5, 1fr); } }
@media (prefers-reduced-motion: no-preference) {
  .mix-rest, .room { animation: arrive .42s ease-out; }
  .room-open .exit { animation: glow 1s ease-out; }
  @keyframes arrive { from { opacity: .55; transform: translateY(.3rem); } }
  @keyframes glow { 45% { box-shadow: 0 0 2rem #ff9699a0; } }
}
.control-preview { padding: .8rem; border: 1px solid #8d525d; border-radius: .55rem; background: #180b14; color: #ffdaac; font-weight: 800; }
.scene-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 48% 78%, #ff8a4150, transparent 66%); mix-blend-mode: screen; }
.mix-top { min-height: 52px; gap: .5rem; }
.mix-top a { padding-block: .5rem; }
.mix-top button { min-height: 44px; padding-block: .25rem; }
.mix-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .8rem; text-align: left; padding: .65rem 0; }
.mix-heading h1 { font-size: clamp(1rem, 3.5vw, 1.5rem); line-height: 1.15; letter-spacing: -.025em; }
.mix-heading .wordmark { display: block; font-size: .64rem; margin: 0 0 .16rem; }
#progress-caption { margin: 0; font-size: .82rem; }
.floor-game { margin: 0 auto 1.5rem; width: min(100%, 49rem); overflow: hidden; border-radius: 1rem; border: 1px solid #804653; background: #190d16; }
.floor-header { padding: .65rem .8rem; }
.floor-header h2 { font-size: clamp(1.22rem, 5vw, 2rem); }
.floor-header p { color: var(--muted); font-size: .87rem; margin: .25rem 0 0; }
.floor-picture { position: relative; isolation: isolate; aspect-ratio: 380 / 337; overflow: hidden; background: #25111c; }
.floor-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; transition: transform .48s ease, filter .48s ease; }
.floor-window { overflow: auto; }
.floor-picture.is-zoomed:not(.is-inspecting) { width: 135%; }
.floor-picture.is-inspecting { aspect-ratio: auto; min-height: 19rem; padding: clamp(.55rem, 3vw, 1.1rem); display: grid; align-items: end; }
.floor-picture.is-inspecting .floor-background { width: 100%; height: 100%; object-fit: cover; transform-origin: 52% 45%; transform: scale(1.36); filter: brightness(.6); }
.floor-picture.inspect-rocket .floor-background { transform-origin: 16% 43%; }
.floor-picture.inspect-dragon .floor-background { transform-origin: 43% 46%; }
.floor-picture.inspect-race .floor-background { transform-origin: 59% 49%; }
.floor-picture.inspect-claw .floor-background { transform-origin: 91% 40%; }
.floor-close { z-index: 1; width: min(100%, 27rem); margin-inline: auto; padding: .65rem; border-radius: .75rem; border: 1px solid #aa626b; background: #190c15f2; color: #fff0e9; }
.floor-close-top { display: flex; justify-content: space-between; align-items: center; gap: .45rem; margin-bottom: .55rem; }
.floor-close-top h3 { margin: 0; }
.floor-close p { margin: .55rem 0; font-size: .9rem; }
.floor-crt { display: grid; justify-items: center; align-content: center; min-height: 7.4rem; border: 2px solid #a7778b; border-radius: .7rem; background: repeating-linear-gradient(0deg,#fff0 0 3px,#fff1 4px 5px), #17172a; color: #fff0bb; box-shadow: inset 0 0 22px #000; overflow: hidden; font-family: monospace; letter-spacing: .13em; }
.floor-crt.rocket { background: radial-gradient(circle at 24% 25%, #ffffff 0 1px, transparent 2px), radial-gradient(circle at 74% 59%, #ffffff 0 1px, transparent 2px), radial-gradient(circle at 40% 70%, #ffffff 0 1px, transparent 2px), #151e37; background-size: 55px 41px, 71px 64px, 83px 49px, auto; }
.floor-flight { width: 86%; height: 3.8rem; display: grid; align-items: center; }
.floor-ship { width: max-content; color: #ff956f; text-shadow: 0 .4rem .6rem #ff8e68; animation: cruise 1.7s ease-in-out infinite alternate; }
.floor-dragon { font-size: 2rem; color: #ffac99; text-shadow: 0 0 15px #e75473; }
.floor-close .floor-note, .floor-hint-text { color: #ffcf9e; }
.floor-tray { margin-top: .5rem; padding: .45rem; border-radius: .45rem; background: #0c070b; text-align: center; }
.floor-token { background: #f9d487; color: #29180c; border-color: #ffe6ac; animation: coin-drop .48s cubic-bezier(.1,.75,.45,1.25); }
.floor-bench { min-height: 6rem; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse, #643244, #321722); border-radius: .5rem; }
.floor-paper { position: relative; display: inline-grid; place-items: center; width: 3.6rem; height: 4.45rem; color: #941b4a; background: #f7cfac; font-size: 1.6rem; isolation: isolate; }
.floor-paper::before { position: absolute; z-index: -1; content: ''; inset: 0; background: radial-gradient(circle at 92% 50%, #eae0e7 0 1.36rem, transparent 1.41rem); }
.floor-paper.ticket-left { clip-path: polygon(0 0,92% 0,80% 25%,92% 43%,79% 65%,92% 83%,87% 100%,0 100%); }
.floor-paper.right-edge { clip-path: polygon(13% 0,100% 0,100% 100%,8% 100%,13% 83%,0 65%,13% 43%,1% 25%); }
.floor-paper.right-edge::before, .floor-paper.wrong-edge::before { background: radial-gradient(circle at 13% 50%, #eae0e7 0 1.36rem, transparent 1.41rem); }
.floor-paper[data-scrap="Scrap C"]::before, .floor-bench .floor-paper.right-edge:not(:empty)::before { background: none; }
.floor-paper.wrong-edge { clip-path: polygon(4% 0,100% 0,100% 100%,5% 100%,16% 82%,7% 61%,21% 40%,7% 24%); }
.floor-bench .right-edge { margin-left: -.756rem; }
.floor-scraps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .35rem; }
.floor-scraps button { display: grid; justify-items: center; padding-inline: .15rem; gap: .3rem; font-size: .8rem; }
.floor-scraps button[aria-pressed="true"] { border-color: var(--rose); }
.floor-scraps .floor-paper { transform: scale(.72); margin: -.45rem; margin-bottom: -.2rem; }
.floor-fit { margin-top: .45rem; }
.floor-diagram { display: grid; gap: .2rem; text-align: center; }
.floor-diagram strong { font-size: 1.4rem; color: #ffd796; }
.floor-console { text-align: center; padding: .55rem; border-radius: .55rem; border: 1px solid #92595a; background: linear-gradient(155deg,#593241,#251621); }
.floor-slot { width: .5rem; height: 2.9rem; border: 2px solid #d49b77; border-radius: .2rem; background: #130b14; margin: 0 auto .55rem; }
.floor-keys { display: flex; gap: .4rem; justify-content: center; margin: .55rem 0; }
.floor-keys button { min-width: 52px; font-size: 1.2rem; }
.floor-console-readout, .floor-ready { color: #ffe293; padding: .4rem; background: #170d18; border-radius: .3rem; letter-spacing: .14em; }
.floor-strip { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; column-gap: .6rem; padding: .45rem .65rem; }
.floor-items, .floor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.floor-items { margin: .2rem 0; font-size: .84rem; }
.floor-items span { color: var(--muted); }
.floor-strip button { font-size: .8rem; padding-inline: .65rem; }
.floor-hint-text { flex-basis: 100%; margin: .35rem 0 .15rem; font-size: .88rem; }
.floor-picture.is-launching .floor-close { animation: vanish .65s forwards; pointer-events: none; }
.floor-picture.is-launching .floor-background { transform-origin: 96% 41%; transform: scale(2.8); filter: brightness(1.85); }
@keyframes vanish { to { opacity: 0; transform: translateY(2rem); } }
@keyframes cruise { to { transform: translate(180px,-.5rem) rotate(12deg); } }
@keyframes coin-drop { from { transform: translateY(-1rem) rotate(-18deg); opacity: .2; } }
@media (max-width: 640px) { main, .mix-top { width: calc(100% - 1rem); } }
@media (prefers-reduced-motion: reduce) { .floor-game *, .floor-game *::before { animation: none !important; transition: none !important; } }
.floor-claw-swing { position: absolute; z-index: 3; left: 51%; top: 0; width: 5rem; height: 6rem; pointer-events: none; animation: claw-swing .85s ease-in forwards; filter: drop-shadow(0 0 1rem #ffb57d); }
.floor-claw-swing::before { content: ''; display: block; margin: auto; width: .44rem; height: 4rem; border-radius: .2rem; background: linear-gradient(90deg,#9a6774,#ffe7b8,#865a6f); }
.floor-claw-jaw { position: absolute; width: 2rem; height: 2.9rem; top: 3.5rem; left: .6rem; border: .42rem solid #ffdfac; border-left: 0; border-bottom: 0; border-radius: 0 70% 0 0; transform: rotate(-106deg); }
.floor-claw-jaw + .floor-claw-jaw { left: 2.4rem; transform: scaleX(-1) rotate(-106deg); }
@keyframes claw-swing { from { transform: translate(65%,-110%) rotate(-22deg) scale(.7); } 72% { opacity: 1; } to { transform: translate(-55%,62%) rotate(12deg) scale(3.3); opacity: 0; } }

/* Keep the visible spark small while leaving a full-size touch target. */
.scene-marker {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ff7a58;
}
.scene-marker::before {
  content: '';
  width: 13px;
  height: 13px;
  border: 2px solid #49212b;
  border-radius: 50%;
  background: #fff2cf;
  outline: 1px solid currentColor;
  box-shadow: 0 0 8px 3px currentColor, 0 0 17px 7px #361021aa;
}
.scene-marker:hover:not(:disabled), .scene-marker:active { background: transparent; }
.scene-marker:hover::before, .scene-marker:focus-visible::before { box-shadow: 0 0 16px 6px currentColor, 0 0 20px 8px #361021aa; }
.scene-marker.passage { color: #f7cb65; }
.scene-marker.passage::before { width: 17px; height: 17px; }

.object-scene .room-art { aspect-ratio: 380 / 337; }
.scene-marker.object-highlight { min-height: 0; border-radius: .4rem; z-index: 2; }

.scene-marker.object-highlight::before { content: none; }
.object-highlight svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.object-highlight .object-hit { fill: transparent; stroke: none; }
.object-highlight .object-gleam {
  fill: none;
  stroke: #ffe0ad;
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: .68;
  filter: blur(1px) drop-shadow(0 0 4px #ffab55);
}
.object-highlight:hover .object-gleam, .object-highlight:focus-visible .object-gleam { opacity: 1; }
.object-scene .passage { z-index: 3; }
.object-highlight:has(.object-hit + .object-hit) { pointer-events: none; }
.object-highlight:has(.object-hit + .object-hit) .object-hit { pointer-events: fill; }

.object-highlight::after { content: ''; position: absolute; inset: -2px; }
.object-highlight:has(.object-hit + .object-hit)::after { pointer-events: none; }

.object-highlight.passage .object-gleam { stroke: #fff3bb; stroke-width: 3.2; opacity: .92; }
.neon-slots { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.45rem; margin:.6rem 0; }
.neon-slot { display:grid; place-items:center; min-height:4.5rem; padding:.3rem; border:1px dashed #ae707c; border-radius:.4rem; color:#ffe4cb; background:#140b15; font-weight:800; }
.neon-key-tab { color:#ffadbc; }
.neon-slots.is-lit .neon-slot { border-color:#ffc188; box-shadow:inset 0 0 1.2rem #f9695c70; text-shadow:0 0 .6rem #ff8367; }
.workshop-lock,.workshop-reflection,.workshop-key { background:linear-gradient(145deg,#593328,#20141b 55%,#3b2525); border:2px solid #ad7951; border-radius:.65rem; padding:.9rem; text-align:center; }
.workshop-wheels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.45rem; margin-bottom:.65rem; }
.workshop-wheels button { min-height:58px; border-color:#d6a16e; background:linear-gradient(#3d2724,#100c12 35%,#100c12 65%,#3d2724); color:#fff0c5; font:700 1.6rem monospace; }
.workshop-reflection { display:grid; gap:.35rem; margin:.5rem 0; }
.workshop-reflection strong { color:#ffc096; font:700 1.7rem monospace; text-shadow:0 0 .6rem #ff704a; }
.workshop-key { color:#ffe494; font-size:2.5rem; }
.prop-evidence { display:grid; align-items:end; height:auto; min-height:9rem; padding:.55rem; }
.prop-marks { display:flex; justify-content:center; flex-wrap:wrap; gap:.35rem; }
.prop-marks span { white-space:pre-wrap; padding:.4rem .55rem; border:1px solid #b17e6e; border-radius:.35rem; background:#20131bec; color:#ffe3ac; text-align:center; font-weight:800; }
.prop-interaction { padding:.75rem; border:1px solid #86606b; border-radius:.6rem; background-size:cover; background-position:center; }
.prop-interaction .choices button { min-width:50px; }
.prop-interaction .choices small { display:block; }
.prop-interaction [aria-pressed="true"] { outline:2px solid #ffcc90; }
.prop-symbol,.prop-interaction .control-preview { font-size:1.5rem; white-space:pre-wrap; text-align:center; color:#ffe2a6; text-shadow:0 0 .5rem #f67249; }
.prop-interaction .control-preview { min-height:3.6rem; display:grid; place-items:center; }
.prop-fitted { display:flex; gap:.4rem; margin:.6rem 0; }
.prop-fitted span { flex:1; min-width:0; background:#1f121c; border:1px solid #ae775c; border-radius:.35rem; padding:.3rem 0; }

.workshop-exit-hint { grid-column: 1 / -1; margin:.65rem 0 0; color:#ffe0a5; }
.workshop-window-exit::after { background:radial-gradient(ellipse,#ffb46738,transparent 65%); pointer-events:none; }

.carousel-shadows { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.35rem; padding:.7rem; border-radius:.65rem; background:radial-gradient(ellipse,#f3cb83,#b57950 67%,#663b42); }
.carousel-shadows svg { width:100%; max-height:5.5rem; fill:#331d27; filter:drop-shadow(1px 2px 2px #341e28a0); }
.carousel-dial { width:100%; margin:.4rem 0; padding:.4rem; background:linear-gradient(#624044,#22121d); border-color:#c49264; }
.carousel-dial .control-preview { display:block; margin:0; border:0; padding:0; }

.carousel-stage { position:relative; display:block; height:9rem; overflow:hidden; margin-bottom:.45rem; border-radius:.45rem; background:radial-gradient(ellipse at 50% 25%,#7a433a,#210f20 75%); }
.carousel-stage::before { content:''; position:absolute; z-index:2; left:9%; right:9%; top:6%; height:29%; clip-path:polygon(50% 0,100% 80%,100% 100%,0 100%,0 80%); background:repeating-conic-gradient(from 20deg at 50% 0%,#bd413a 0 20deg,#f4cf86 20deg 40deg); }
.carousel-ring { position:absolute; inset:28% 8% 10%; border-bottom:.5rem solid #cfa66a; border-radius:0 0 48% 48%; background:radial-gradient(ellipse at bottom,#522d30,transparent 65%); }
.carousel-rider { position:absolute; width:30%; left:35%; bottom:18%; }
.carousel-rider::before { content:''; position:absolute; z-index:-1; left:49%; bottom:0; height:5.6rem; width:3px; background:linear-gradient(90deg,#9a5832,#ffe8a2); }
.carousel-rider .carousel-shadows { display:block; padding:0; background:none; }
.carousel-rider svg { display:block; max-height:3.9rem; fill:#ffd790; filter:drop-shadow(0 0 5px #e88252); }

.carousel-wall-art { display:block; width:100%; max-height:48dvh; object-fit:contain; border-radius:.65rem; background:#210f20; }
.object-scene .room-art, .floor-picture { aspect-ratio: 4 / 3; }
.art-glint::after { inset:0; background: radial-gradient(ellipse at center,#ffd48e35,transparent 70%); pointer-events:none; mix-blend-mode:screen; }
.art-glint:hover::after,.art-glint:focus-visible::after { background:radial-gradient(ellipse at center,#ffdfa76b,transparent 72%); }
.art-glint.passage::after { background:radial-gradient(ellipse at center,#ffe5a780,transparent 74%); }
.scene-marker.art-glint { min-width:44px; min-height:44px; }
.carousel-in-scene { position:absolute; z-index:3; top:28%; left:7%; width:58%; pointer-events:none; background:#321b17; border:1px solid #ab7d50; border-radius:.5rem; }
.carousel-in-scene .carousel-stage { height:clamp(3rem,13vw,8rem); margin:0; background:radial-gradient(ellipse,#71422b,#241312); }
.carousel-in-scene .control-preview { margin:0; padding:0; min-height:0; }
.carousel-in-scene .carousel-rider svg { max-height:clamp(1.7rem,6vw,4rem); }
.carousel-in-scene .carousel-shadows { padding:.1rem; }
.carousel-in-scene .carousel-shadows svg { max-height:clamp(1.4rem,5vw,3rem); }
.carousel-scene-controls { grid-column:1; margin-top:.6rem; }

.room-evidence-view { height:auto; background-image:none!important; }
