:root {
  --night: #25162a;
  --night-soft: #3b2038;
  --cream: #efe6d1;
  --cream-deep: #d8c8aa;
  --ruby: #a72d45;
  --rose: #d17c7b;
  --green: #6e8f76;
  --line: color-mix(in srgb, var(--cream) 23%, transparent);
  --display: "Bodoni 72", Didot, Georgia, serif;
  --body: "Avenir Next Condensed", "Gill Sans", sans-serif;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--cream); font-family: var(--body); background: var(--night); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .7rem 1rem; color: var(--night); background: var(--cream); }
.skip-link:focus { top: 1rem; }
.museum-header {
  min-height: 116px; display: grid; grid-template-columns: 1.25fr 1fr auto; gap: 2rem; align-items: center;
  padding: 1rem clamp(1.2rem, 3vw, 3rem); border-bottom: 1px solid var(--line);
}
.wordmark span, .dossier-stamp {
  color: var(--rose); font-size: .69rem; font-weight: 700; letter-spacing: .17em; text-transform: uppercase;
}
h1 { margin: .1rem 0 0; font-family: var(--display); font-size: clamp(2.8rem, 5vw, 5.2rem); font-weight: 400; line-height: .82; letter-spacing: -.045em; }
.museum-header > p { max-width: 30rem; margin: 0; line-height: 1.38; }
.museum-header > button, .terminal button, .free-text button {
  min-height: 2.8rem; padding: .65rem 1rem; color: var(--cream); background: var(--ruby); border: 1px solid var(--ruby); font-weight: 700;
}
.museum-header > button { color: var(--cream); background: transparent; border-color: var(--cream); }
.heist-floor { display: grid; grid-template-columns: minmax(240px, .82fr) minmax(440px, 1.42fr) minmax(250px, .76fr); min-height: calc(100vh - 116px); }
.gallery-scene { min-width: 0; padding: 1rem; border-right: 1px solid var(--line); }
.scene { height: calc(100% - 5rem); min-height: 500px; background: var(--night-soft) url("assets/cover.webp") center / cover no-repeat; }
.velvet-label {
  position: relative; width: 80%; margin: -1.8rem auto 0; padding: .75rem 1rem;
  color: var(--night); background: var(--cream); box-shadow: 10px 10px 0 var(--ruby);
}
.velvet-label p { margin: 0; font-family: var(--display); font-size: 1.3rem; }
.velvet-label span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.terminal { position: relative; min-width: 0; padding: clamp(1rem, 2.5vw, 2.1rem); background: #2b192e; overflow: hidden; }
.terminal::after {
  content: ""; position: absolute; right: -8rem; top: 35%; width: 14rem; height: 14rem; border: 1px solid rgb(239 230 209 / .06);
  transform: rotate(45deg); pointer-events: none;
}
.terminal-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding-bottom: .8rem; border-bottom: 3px double var(--line); }
.ai-name { display: flex; gap: .65rem; align-items: center; }
.ai-name b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 400; letter-spacing: .12em; }
.ai-name small { display: block; color: var(--cream-deep); font-size: .67rem; }
.eye { width: 2.2rem; height: 1.15rem; border: 1px solid var(--rose); border-radius: 50%; transform: rotate(-7deg); }
.eye::after { content: ""; display: block; width: .52rem; height: .52rem; margin: .26rem auto; border-radius: 50%; background: var(--rose); animation: scan 2.5s ease-in-out infinite; }
#turnCounter { color: var(--rose); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin: .8rem 0; }
.meters label { display: flex; justify-content: space-between; margin-bottom: .25rem; color: var(--cream-deep); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.meter { height: 4px; background: rgb(239 230 209 / .13); }
.meter i { display: block; width: 22%; height: 100%; background: var(--green); transform-origin: left; transition: width .35s ease-out; }
.meter.suspicion i { width: 16%; background: var(--ruby); }
.transcript {
  height: 185px; overflow-y: auto; padding: .6rem 0; border-bottom: 1px solid var(--line); scroll-behavior: smooth;
}
.message { display: grid; grid-template-columns: 4.4rem 1fr; gap: .8rem; margin-bottom: .7rem; animation: messageIn .3s ease-out; }
.message b { color: var(--rose); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.message p { margin: 0; line-height: 1.4; }
.message.velvet p { font-family: var(--display); font-size: 1.08rem; }
.dialogue-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .75rem 0; }
.dialogue-choices button {
  min-height: 3.15rem; padding: .55rem .7rem; color: var(--night); background: var(--cream);
  border-color: var(--cream); text-align: left; line-height: 1.15;
}
.dialogue-choices button:hover { color: var(--cream); background: var(--ruby); border-color: var(--ruby); transform: translateY(-1px); }
.dialogue-choices button span { display: inline-block; min-width: 1rem; margin-right: .3rem; color: var(--ruby); font-weight: 800; }
.free-text label { display: block; margin-bottom: .25rem; color: var(--cream-deep); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.free-text > div { display: grid; grid-template-columns: 1fr auto; }
.free-text input { min-width: 0; min-height: 2.8rem; padding: .6rem .75rem; color: var(--cream); background: transparent; border: 1px solid var(--cream-deep); border-radius: 0; }
.free-text p { margin: .3rem 0 0; color: rgb(239 230 209 / .58); font-size: .72rem; }
.rewind { margin-top: .5rem; padding: .25rem 0 !important; min-height: 0 !important; color: var(--rose) !important; background: transparent !important; border: 0 !important; border-bottom: 1px solid currentColor !important; }
.rewind:disabled { opacity: .35; cursor: not-allowed; }
.dossier { min-width: 0; padding: clamp(1.1rem, 2.5vw, 2.2rem); color: var(--night); background: var(--cream); }
.dossier h2 { margin: .5rem 0; font-family: var(--display); font-size: clamp(2.2rem, 4vw, 4rem); font-weight: 400; line-height: .98; }
#targetDescription { line-height: 1.42; }
.credential { margin: 1.3rem 0; padding: .9rem; border: 1px solid var(--night); box-shadow: 5px 5px 0 var(--ruby); transform: rotate(-1deg); }
.credential span, .phrase-bank > p, .route > p { display: block; color: var(--ruby); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.credential b { display: block; margin: .2rem 0; font-family: var(--display); font-size: 1.35rem; font-weight: 400; }
.credential p { margin: 0; font-size: .82rem; line-height: 1.3; }
.phrase-bank ul { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 1.4rem; padding: 0; list-style: none; }
.phrase-bank li { padding: .28rem .48rem; color: var(--cream); background: var(--night); font-size: .75rem; }
.route ol { margin: .5rem 0 0; padding: 0; list-style-position: inside; }
.route li { padding: .4rem 0; border-bottom: 1px dotted color-mix(in srgb, var(--night) 22%, transparent); color: color-mix(in srgb, var(--night) 50%, transparent); font-size: .8rem; }
.route li.active { color: var(--ruby); font-weight: 700; }
.route li.done { color: var(--green); text-decoration: line-through; }
.ending {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem); color: var(--night); background: var(--cream); animation: curtain .45s ease-out;
}
.ending[hidden] { display: none; }
.ending > p:first-child { margin: 0; color: var(--ruby); font-size: .7rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.ending h2 { margin: .45rem 0; font-family: var(--display); font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 400; line-height: .95; }
.ending > p { max-width: 35rem; line-height: 1.45; }
.ending-stats { margin: .5rem 0 1.2rem; color: var(--ruby); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ending > div:last-child { display: flex; flex-wrap: wrap; gap: .5rem; }
.ending .secondary { color: var(--night); background: transparent; border-color: var(--night); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; padding: .75rem 1rem; color: var(--night); background: var(--cream); transform: translateY(170%); transition: transform .25s ease-out; }
.toast.show { transform: translateY(0); }
@keyframes scan { 50% { transform: translateX(.55rem); } }
@keyframes messageIn { from { opacity: 0; transform: translateY(5px); } }
@keyframes curtain { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 1000px) {
  .heist-floor { grid-template-columns: 13rem 1fr; }
  .dossier { grid-column: 1 / -1; }
  .route ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
}
@media (max-width: 680px) {
  .museum-header { grid-template-columns: 1fr auto; gap: .7rem; min-height: 108px; }
  .museum-header > p { grid-column: 1 / -1; grid-row: 2; font-size: .88rem; }
  .museum-header > button { grid-column: 2; grid-row: 1; }
  h1 { font-size: 2.9rem; }
  .heist-floor { display: flex; flex-direction: column; }
  .gallery-scene { padding: .6rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .scene { min-height: 150px; height: 150px; background-position: center 34%; }
  .velvet-label { width: 70%; margin-top: -2rem; }
  .terminal { min-height: 620px; }
  .terminal-top { align-items: flex-start; }
  .transcript { height: 210px; }
  .dialogue-choices { grid-template-columns: 1fr; }
  .dialogue-choices button { min-height: 2.8rem; }
  .dossier { order: 3; }
  .route ol { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
