:root {
  color-scheme: dark;
  --background: #131512;
  --surface: #1b1e18;
  --line: #393d32;
  --gold: #e4bd74;
  --ivory: #f4edde;
  --muted: #c1beb0;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  font: 16px/1.55 Inter, system-ui, sans-serif;
  background: var(--background);
  color: var(--ivory);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid #f4d998; outline-offset: 4px; }
button:disabled { opacity: .48; cursor: default; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.07; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 4.3rem); letter-spacing: -.035em; }
h2 { font-size: 1.35rem; }
p { margin: 0 0 .85rem; }
.masthead {
  min-height: 70px; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .8rem clamp(1rem, 5vw, 4.5rem); border-bottom: 1px solid var(--line);
}
.masthead a { text-decoration: none; }
.masthead nav a { color: var(--muted); font-size: .875rem; }
.masthead nav a:hover { text-decoration: underline; }
.brand { display: inline-flex; gap: 11px; align-items: center; font: 1.25rem var(--serif); }
.lock { display: inline-block; position: relative; width: 13px; height: 10px; border: 1px solid var(--gold); margin-top: 5px; }
.lock::before { content: ""; position: absolute; top: -7px; left: 2px; width: 7px; height: 6px; border: 1px solid var(--gold); border-radius: 6px 6px 0 0; }
.eyebrow { color: var(--gold); text-transform: uppercase; font-size: .875rem; letter-spacing: .14em; margin-bottom: .65rem; }
.worlds, .game { max-width: 1600px; padding: clamp(1rem, 4.5vw, 4.1rem); margin: auto; }
.world { position: relative; isolation: isolate; min-height: min(690px, calc(100svh - 160px)); display: flex; align-items: end; overflow: hidden; border: 1px solid #5b4d36; background: #20241c; }
.world + .world { margin-top: 1.5rem; }
.world-image, .world::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.world-image { object-fit: cover; object-position: center 45%; }
.world::after { content: ""; background: linear-gradient(90deg, #11120fe8, #11120f85 48%, transparent 86%), linear-gradient(0deg, #11120fed, transparent 75%); }
.world-content { max-width: 790px; padding: clamp(1.35rem, 5.4vw, 5rem); }
.world-content h1 { max-width: 12ch; font-size: clamp(3rem, 7vw, 6.7rem); text-wrap: balance; }
.world-description { max-width: 45ch; margin: 1.05rem 0 1.6rem; color: #eee8db; }
.world-meta { color: #e4dccd; font-size: .875rem; margin: 1rem 0 0; }
.primary, .object, input, select { border-radius: 3px; }
.primary {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1.05rem;
  color: #23190e; background: var(--gold); border: 1px solid var(--gold); font-weight: 650; text-decoration: none;
}
.primary:hover:not(:disabled) { background: #f4d292; }
.room-header { margin-bottom: 1.35rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.room-header h1 { font-size: clamp(2rem, 4.5vw, 3.9rem); }
.progress { display: grid; grid-template-columns: minmax(110px, 165px); gap: .2rem; }
.progress label { font-size: .875rem; }
.progress small { color: var(--muted); font-size: .875rem; }
progress { accent-color: var(--gold); width: 100%; height: .55rem; }
.game-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(275px, 1fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.scene {
  position: relative; background: #24251e; border: 1px solid #615036;
  box-shadow: 0 18px 60px #0004;
}
.scene img { width: 100%; height: auto; display: block; }
.blank-scene { min-height: 240px; display: grid; place-items: center; }
.blank-scene p { margin: 1rem; }
.hotspot {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; padding: 0; color: #fff2c7;
}
.hotspot span {
  width: 29px; height: 29px; display: grid; place-items: center; line-height: 1;
  font-size: 1.15rem; border: 1px solid currentColor; border-radius: 50%; background: #191a13e8; box-shadow: 0 0 0 3px #21180a75;
}
.hotspot:hover span, .hotspot:focus-visible span { background: var(--gold); color: #191a13; }
.hotspot.seen span { color: #d5e0b6; }
.inspect-panel { margin-top: 1.2rem; }
.inspect-panel h2 { margin-bottom: .7rem; }
.object-bar, .sequence-buttons { display: flex; flex-wrap: wrap; gap: .44rem; }
.object {
  background: #22261e; color: var(--ivory); border: 1px solid #515646; min-height: 42px;
  padding: .4rem .65rem; font-size: .9rem;
}
.object:hover:not(:disabled), .object.seen { border-color: var(--gold); }
.object.seen { color: #efd297; }
.journal { display: grid; gap: .75rem; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 1.05rem; }
.panel h2 { margin-bottom: .65rem; }
.panel p { color: var(--muted); }
.panel p:last-child { margin-bottom: 0; }
.feedback { padding: .7rem .8rem; background: #272921; border-left: 2px solid var(--gold); }
.panel .success, .panel .item { color: #e1eccf; border-color: #a9c676; }
.panel .error { color: #ffbda8; border-color: #f89477; }
.panel .hint { color: #f4d998; }
.link-button { border: 0; color: var(--gold); background: none; padding: .32rem 0; text-decoration: underline; text-underline-offset: .24em; }
.solve { display: flex; flex-wrap: wrap; gap: .6rem; }
.sequence-buttons { margin-bottom: .75rem; }
input, select { min-width: 0; width: 100%; padding: .55rem .65rem; border: 1px solid #777664; color: var(--ivory); background: #141711; }
.notebook summary { color: var(--gold); }
dt { color: var(--ivory); font-weight: 650; }
dd { margin: 0 0 .65rem; color: var(--muted); }
.finish { max-width: 760px; margin: clamp(2rem, 8vw, 7rem) auto; padding: 1.2rem; }
.finish h1 { margin-bottom: 1rem; }
.finish details { margin-top: 1rem; }
.finish details form { margin-top: .5rem; }
.preview-clues { margin-top: 1rem; }
@media (max-width: 850px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .journal { scroll-margin-top: .5rem; }
  .world { min-height: min(640px, calc(100svh - 105px)); }
  .world::after { background: linear-gradient(0deg, #11120ff7, #11120fa0 52%, transparent 96%); }
}
@media (max-width: 480px) {
  .masthead { min-height: 60px; }
  .brand { font-size: 1.08rem; gap: 7px; }
  .room-header { align-items: start; flex-direction: column; }
  .progress { grid-template-columns: auto minmax(50px, 90px) auto; align-items: center; gap: .55rem; }
  .hotspot span { width: 24px; height: 24px; }
}

.masthead nav { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; }
.masthead nav button { font-size: .875rem; color: var(--muted); }
.login { width: min(100%, 500px); margin: clamp(2rem, 9vw, 7rem) auto; padding: 1rem; }
.login h1 { margin-bottom: 1rem; }
.login-form { display: grid; gap: .65rem; margin-top: 1.3rem; }
.login-form .primary { justify-self: start; margin-top: .35rem; }
