:root {
  --ink: #2a1909;
  --paper: #f3dca8;
  --paper-light: #fff0c8;
  --gold: #d99d35;
  --gold-bright: #ffd879;
  --blue: #143b4a;
  --deep-blue: #071b26;
  --green: #254a26;
  --red: #8d2f20;
  --line: rgba(49, 27, 8, 0.38);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --intro-slide-duration: 12s;
  --intro-scene-count: 14;
}

* {
  box-sizing: border-box;
}

html,
body,
.app {
  min-height: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(rgba(7, 27, 38, 0.58), rgba(7, 27, 38, 0.7)),
    url("assets/huskesporet-map-reference.png") center / cover fixed,
    #15313a;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  position: relative;
  isolation: isolate;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 219, 128, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(5, 13, 18, 0.16), rgba(5, 13, 18, 0.48));
  pointer-events: none;
}

.hud {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}

.home-link,
.icon-button,
.close-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px solid #1b1008;
  border-radius: 50%;
  background: linear-gradient(#60411d, #21150b);
  color: #ffe7a8;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.35rem;
  box-shadow: 0 6px 0 #080504, 0 12px 24px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.home-link {
  margin-right: auto;
}

.save-button {
  width: 64px;
  border-radius: 999px;
  font-size: 1rem;
}

.save-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.screen {
  min-height: 100svh;
  padding: clamp(76px, 8vw, 96px) clamp(14px, 3vw, 38px) clamp(22px, 4vw, 46px);
  overflow-x: hidden;
}

.screen:has(.start-screen),
.screen:has(.intro-video-screen),
.screen:has(.moses-cutscene-screen),
.screen:has(.moses-escape-screen),
.screen:has(.moses-reward-screen),
.screen:has(.task-world-screen),
.screen:has(.map-screen) {
  padding: 0;
}

.app:has(.moses-escape-screen) .home-link {
  display: none;
}

.start-screen,
.intro-video-screen,
.cutscene-screen,
.map-screen,
.world-screen,
.finale-screen,
.ending-screen {
  min-height: calc(100vh - 118px);
  display: grid;
  align-items: center;
}

.map-screen {
  min-height: 100vh;
  align-items: stretch;
}

.task-world-screen {
  min-height: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(76px, 8vw, 96px) clamp(14px, 3vw, 38px) clamp(22px, 4vw, 46px);
  background:
    linear-gradient(rgba(5, 15, 20, 0.62), rgba(5, 15, 20, 0.72)),
    var(--task-bg, url("assets/moses-escape-tablets-360-seamless.png")) center / cover;
}

.start-screen {
  min-height: 100vh;
  justify-items: start;
  background:
    linear-gradient(90deg, rgba(4, 12, 18, 0.84), rgba(4, 12, 18, 0.5), rgba(4, 12, 18, 0.28)),
    url("assets/huskesporet-start-bg-ai.png") center / cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.intro-video-screen {
  min-height: 100svh;
  align-items: stretch;
  overflow: auto;
  background: #061018;
}

.intro-video-frame {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--scene-bg) center / cover no-repeat;
  opacity: 0;
  animation: sceneArrive 900ms ease-out forwards;
}

.intro-video-frame::before {
  content: "";
  position: absolute;
  inset: -4%;
  background: inherit;
  animation: cinematicDrift var(--intro-slide-duration) ease-in-out both;
}

.intro-video-frame.intro-scene-leaving {
  animation: sceneLeave 900ms ease-in forwards;
}

.intro-video-frame.intro-scene-leaving::before {
  animation-play-state: paused;
}

.intro-film-layers {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.intro-film-layer {
  position: absolute;
  inset: -5%;
  background: var(--film-bg) center / cover no-repeat;
  opacity: 0;
  transform: scale(1.045) translate3d(calc(var(--film-pan-x) * -1), calc(var(--film-pan-y) * -1), 0);
  animation:
    introFilmFrame var(--intro-slide-duration) linear both,
    introFilmDrift var(--intro-slide-duration) ease-in-out both;
}

.intro-film-layer.frame-0 {
  animation-name: introFilmFrameFirst, introFilmDrift;
}

.intro-film-layer.frame-1 {
  animation-name: introFilmFrameSecond, introFilmDrift;
}

.intro-film-layer.frame-2 {
  animation-name: introFilmFrameThird, introFilmDrift;
}

.intro-film-layer.frame-3 {
  animation-name: introFilmFrameFourth, introFilmDrift;
}

.intro-film-layer.frame-4 {
  animation-name: introFilmFrameLast, introFilmDrift;
}

.intro-video-motion {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(112deg, transparent 0 38%, rgba(255, 224, 150, 0.12) 45%, transparent 53%),
    radial-gradient(circle at 30% 72%, rgba(255, 220, 128, 0.18), transparent 9%),
    radial-gradient(circle at 67% 34%, rgba(86, 192, 255, 0.14), transparent 13%);
  mix-blend-mode: screen;
  opacity: 0.7;
  transform: translate3d(-4%, 0, 0);
  animation: filmSweep 9s ease-in-out infinite alternate;
  pointer-events: none;
}

.intro-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 72%, rgba(255, 212, 116, 0.24), transparent 11%),
    radial-gradient(circle at 68% 38%, rgba(84, 188, 255, 0.16), transparent 18%),
    radial-gradient(circle at 82% 74%, rgba(255, 230, 166, 0.18), transparent 13%),
    repeating-radial-gradient(circle at 48% 46%, rgba(255, 226, 158, 0.14) 0 1px, transparent 1px 38px);
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: livingLight 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.intro-video-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(3, 10, 15, 0.74), rgba(3, 10, 15, 0.22) 48%, rgba(3, 10, 15, 0.08)),
    linear-gradient(180deg, rgba(3, 10, 15, 0.04), rgba(3, 10, 15, 0.34));
  animation: shadePulse 7s ease-in-out infinite alternate;
}

.intro-video-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  width: min(760px, 100%);
  min-height: 100svh;
  padding: clamp(94px, 11vw, 150px) clamp(22px, 6vw, 92px) clamp(28px, 7vw, 78px);
  color: #fff1c3;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.66);
  animation: captionReveal 900ms ease-out both;
}

.intro-video-copy h2 {
  margin-top: 12px;
  color: #ffd879;
  font-size: clamp(2.6rem, 7vw, 6.8rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.intro-copy-compact h2 {
  display: none;
}

.intro-title-leaving h2 {
  animation: titleFadeAway 780ms ease-in both;
}

.intro-title-leaving p,
.intro-title-leaving .eyebrow {
  animation: captionSoftFade 780ms ease-in both;
}

.intro-video-copy p {
  max-width: 38rem;
  margin: 18px 0;
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
  line-height: 1.42;
  font-weight: 800;
}

.intro-video-progress {
  display: grid;
  grid-template-columns: repeat(var(--intro-scene-count), minmax(12px, 1fr));
  gap: 8px;
  width: min(420px, 100%);
  margin: 4px 0 18px;
}

.intro-video-progress span {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 240, 199, 0.24);
  overflow: hidden;
}

.intro-video-progress .seen,
.intro-video-progress .active {
  background: #ffd879;
}

.intro-video-progress .active {
  transform-origin: left;
  animation: progressFill var(--intro-slide-duration) linear both;
}

.intro-video-frame.narration-paused::before,
.intro-video-frame.narration-paused .intro-video-motion,
.intro-video-frame.narration-paused .intro-video-progress .active,
.cutscene-card.narration-paused .scene-art::before,
.cutscene-card.narration-paused .scene-art::after {
  animation-play-state: paused;
}

.intro-sync-panel {
  display: grid;
  gap: 10px;
  width: min(760px, 100%);
  margin-top: 14px;
  padding: 12px;
  border: 2px solid rgba(255, 216, 121, 0.72);
  border-radius: 8px;
  background: rgba(4, 16, 22, 0.82);
  color: #fff0c7;
}

.intro-sync-panel .button-row {
  gap: 8px;
}

.intro-sync-panel button {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.intro-sync-panel small {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

@keyframes cinematicDrift {
  from {
    opacity: 0;
    transform: scale(1.035) translate3d(calc(var(--pan-x) * -1), calc(var(--pan-y) * -1), 0);
  }

  12% {
    opacity: 1;
  }

  55% {
    transform: scale(1.09) translate3d(0, 0, 0);
  }

  to {
    opacity: 1;
    transform: scale(1.145) translate3d(var(--pan-x), var(--pan-y), 0);
  }
}

@keyframes filmSweep {
  from {
    opacity: 0.28;
    transform: translate3d(-5%, 1%, 0) scale(1);
  }

  48% {
    opacity: 0.78;
  }

  to {
    opacity: 0.46;
    transform: translate3d(5%, -1%, 0) scale(1.04);
  }
}

@keyframes introFilmDrift {
  from {
    transform: scale(1.045) translate3d(calc(var(--film-pan-x) * -1), calc(var(--film-pan-y) * -1), 0);
    filter: saturate(1.02) brightness(0.96);
  }

  to {
    transform: scale(1.14) translate3d(var(--film-pan-x), var(--film-pan-y), 0);
    filter: saturate(1.12) brightness(1.04);
  }
}

@keyframes introFilmFrameFirst {
  0%, 19% { opacity: 1; }
  29%, 100% { opacity: 0; }
}

@keyframes introFilmFrameSecond {
  0%, 14% { opacity: 0; }
  24%, 39% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes introFilmFrameThird {
  0%, 34% { opacity: 0; }
  44%, 59% { opacity: 1; }
  69%, 100% { opacity: 0; }
}

@keyframes introFilmFrameFourth {
  0%, 54% { opacity: 0; }
  64%, 79% { opacity: 1; }
  89%, 100% { opacity: 0; }
}

@keyframes introFilmFrameLast {
  0%, 74% { opacity: 0; }
  86%, 100% { opacity: 1; }
}

@keyframes sceneArrive {
  from {
    opacity: 0;
    filter: brightness(0.82) blur(3px);
  }

  to {
    opacity: 1;
    filter: brightness(1) blur(0);
  }
}

@keyframes sceneLeave {
  from {
    opacity: 1;
    filter: brightness(1) blur(0);
  }

  to {
    opacity: 0;
    filter: brightness(1.08) blur(3px);
  }
}

@keyframes livingLight {
  from {
    opacity: 0.36;
    transform: translate3d(-1.2%, 0.8%, 0) scale(1);
    filter: brightness(0.96);
  }

  to {
    opacity: 0.78;
    transform: translate3d(1.4%, -0.7%, 0) scale(1.035);
    filter: brightness(1.12);
  }
}

@keyframes shadePulse {
  from {
    opacity: 0.98;
  }

  to {
    opacity: 0.82;
  }
}

@keyframes captionReveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titleFadeAway {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: translateY(-18px) scale(0.985);
    filter: blur(2px);
  }
}

@keyframes captionSoftFade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes progressFill {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

.start-copy {
  width: min(700px, 100%);
  padding: clamp(92px, 12vw, 150px) clamp(24px, 6vw, 96px) clamp(28px, 6vw, 72px);
  color: #fff2ca;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.58);
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border: 2px solid rgba(255, 232, 180, 0.65);
  background: rgba(21, 59, 74, 0.78);
  color: #ffe3a0;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  margin-top: 12px;
  color: #ffd56f;
  font-size: min(12vw, 8.8rem);
  text-transform: uppercase;
}

.start-copy p {
  width: min(36rem, 100%);
  margin: 18px 0 26px;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.choice-button {
  min-height: 48px;
  padding: 12px 20px;
  border: 3px solid #21150b;
  border-radius: 8px;
  background: linear-gradient(#f5cf76, #a96722);
  color: #221306;
  font-weight: 900;
  box-shadow: 0 5px 0 #160d07, 0 12px 22px rgba(0, 0, 0, 0.22);
}

.secondary-button {
  background: linear-gradient(#244f60, #092736);
  color: #fff0bd;
}

.primary-button:disabled,
.secondary-button:disabled,
.choice-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.62;
  box-shadow: none;
}

.danger-button {
  background: linear-gradient(#b5533f, #6f2118);
  color: #fff0bd;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.audio-toggle-button {
  min-width: min(190px, 100%);
}

.save-code-form {
  display: grid;
  gap: 8px;
  width: min(430px, 100%);
  margin-top: 22px;
  padding: 14px;
  border: 2px solid rgba(255, 232, 180, 0.48);
  border-radius: 8px;
  background: rgba(7, 27, 38, 0.72);
}

.save-code-form label {
  color: #ffe3a0;
  font-weight: 900;
}

.save-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.save-code-row input {
  min-width: 0;
  border: 3px solid #21150b;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8dc;
  color: #261608;
  font-weight: 900;
}

.save-code-status {
  min-height: 1.3em;
  margin: 0;
  color: #fff2ca;
  font-weight: 900;
}

.panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3.5vw, 34px);
  border: 4px solid #2a1909;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 244, 206, 0.92), rgba(235, 201, 136, 0.94)),
    repeating-linear-gradient(90deg, rgba(72, 42, 12, 0.05) 0 1px, transparent 1px 9px);
  box-shadow: var(--shadow), inset 0 0 0 5px rgba(104, 60, 18, 0.16);
}

.panel.dark {
  background: linear-gradient(rgba(13, 35, 46, 0.94), rgba(7, 22, 30, 0.96));
  color: #fff0c7;
  border-color: #4a3319;
}

.cutscene-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
}

.scene-art {
  position: relative;
  min-height: clamp(260px, 40vw, 510px);
  border: 3px solid rgba(255, 220, 145, 0.42);
  border-radius: 8px;
  background: var(--scene-bg), #07131a;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  isolation: isolate;
}

.scene-art::before {
  content: "";
  position: absolute;
  inset: -5%;
  z-index: 0;
  background: var(--scene-bg);
  background-size: cover;
  background-position: center;
  animation: sceneFilmMove 18s ease-in-out infinite alternate;
  transform-origin: center;
}

.scene-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(110deg, transparent 0 35%, rgba(255, 225, 148, 0.14) 46%, transparent 58%),
    radial-gradient(circle at 24% 72%, rgba(255, 211, 118, 0.22), transparent 18%),
    radial-gradient(circle at 74% 28%, rgba(99, 190, 255, 0.14), transparent 18%),
    linear-gradient(180deg, transparent 55%, rgba(4, 10, 14, 0.28));
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: sceneLightSweep 7s ease-in-out infinite alternate;
}

.moses-cutscene-screen {
  min-height: 100vh;
}

.moses-cutscene-card {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  background: #071b26;
}

.moses-cutscene-card .scene-art {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.moses-cutscene-card .scene-art::before {
  inset: -8%;
  animation-duration: 22s;
}

.moses-cutscene-card .scene-art::after {
  background:
    linear-gradient(90deg, rgba(3, 11, 15, 0.74), rgba(3, 11, 15, 0.28) 45%, rgba(3, 11, 15, 0.1)),
    radial-gradient(circle at 28% 72%, rgba(255, 211, 118, 0.24), transparent 18%),
    radial-gradient(circle at 75% 28%, rgba(101, 188, 255, 0.13), transparent 20%),
    linear-gradient(180deg, rgba(3, 10, 14, 0.1), rgba(4, 10, 14, 0.52));
  mix-blend-mode: normal;
  opacity: 1;
}

.moses-cutscene-card .scene-text {
  position: absolute;
  left: clamp(22px, 5vw, 86px);
  bottom: clamp(22px, 6vw, 76px);
  z-index: 3;
  width: min(720px, calc(100% - 44px));
  padding: clamp(16px, 2.4vw, 26px);
  border-left: 5px solid rgba(255, 216, 121, 0.78);
  background: linear-gradient(90deg, rgba(5, 20, 28, 0.84), rgba(5, 20, 28, 0.42), transparent);
  color: #fff0c7;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.72);
}

.moses-cutscene-card .scene-text h2 {
  font-size: clamp(2.4rem, 6vw, 5.8rem);
}

.maria-cutscene-card .scene-art::after {
  background:
    linear-gradient(90deg, rgba(3, 13, 31, 0.68), rgba(19, 55, 94, 0.24) 48%, rgba(255, 217, 124, 0.08)),
    radial-gradient(circle at 26% 70%, rgba(255, 224, 147, 0.26), transparent 18%),
    radial-gradient(circle at 72% 24%, rgba(117, 191, 255, 0.24), transparent 22%),
    linear-gradient(180deg, rgba(3, 10, 24, 0.06), rgba(3, 10, 24, 0.46));
}

.maria-cutscene-card .scene-text {
  border-left-color: rgba(132, 197, 255, 0.86);
  background: linear-gradient(90deg, rgba(5, 24, 48, 0.86), rgba(5, 24, 48, 0.5), transparent);
}

.maria-cutscene-card .scene-text h2 {
  color: #ffe3a0;
}

.frans-cutscene-card .scene-art::after {
  background:
    linear-gradient(90deg, rgba(3, 19, 10, 0.66), rgba(31, 76, 34, 0.24) 48%, rgba(255, 219, 128, 0.08)),
    radial-gradient(circle at 28% 74%, rgba(255, 224, 147, 0.22), transparent 18%),
    radial-gradient(circle at 74% 24%, rgba(139, 217, 121, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(3, 12, 8, 0.04), rgba(3, 12, 8, 0.48));
}

.frans-cutscene-card .scene-text {
  border-left-color: rgba(174, 224, 112, 0.86);
  background: linear-gradient(90deg, rgba(5, 30, 14, 0.86), rgba(5, 30, 14, 0.46), transparent);
}

.frans-cutscene-card .scene-text h2 {
  color: #dbff9a;
}

@keyframes sceneFilmMove {
  from {
    transform: scale(1.04) translate3d(-1.5%, 0.6%, 0);
    filter: saturate(1.02) brightness(0.98);
  }

  48% {
    transform: scale(1.105) translate3d(1%, -0.8%, 0);
  }

  to {
    transform: scale(1.14) translate3d(-0.4%, -1.2%, 0);
    filter: saturate(1.1) brightness(1.04);
  }
}

@keyframes sceneLightSweep {
  from {
    opacity: 0.34;
    transform: translate3d(-4%, 1%, 0);
  }

  to {
    opacity: 0.78;
    transform: translate3d(4%, -1%, 0);
  }
}

.scene-text {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
}

.scene-text h2 {
  color: #ffd879;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.5);
}

.scene-text p,
.world-intro p,
.task-card p,
.finale-screen p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.45;
}

.progress-dots {
  display: flex;
  gap: 8px;
}

.progress-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 240, 199, 0.28);
}

.progress-dots .active {
  background: var(--gold-bright);
}

.map-layout {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(7, 20, 24, 0.08), rgba(7, 20, 24, 0.18)),
    url("assets/huskesporet-world-map-ai.png") center / cover;
  box-shadow: inset 0 0 0 5px rgba(42, 25, 9, 0.72);
}

.map-header {
  position: absolute;
  top: clamp(74px, 5.5vw, 96px);
  left: 50%;
  z-index: 3;
  width: min(780px, calc(100% - 176px));
  padding: clamp(12px, 1.9vw, 22px) clamp(18px, 3vw, 34px);
  transform: translateX(-50%);
  text-align: center;
  background:
    linear-gradient(rgba(255, 241, 188, 0.9), rgba(224, 182, 91, 0.84)),
    repeating-linear-gradient(90deg, rgba(72, 42, 12, 0.05) 0 1px, transparent 1px 9px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), inset 0 0 0 4px rgba(104, 60, 18, 0.12);
}

.map-header h2 {
  margin: 2px 0 4px;
}

.map-header p {
  margin: 0;
}

.map-header h2,
.world-title,
.finale-screen h2,
.ending-screen h2 {
  color: #2b1707;
  font-size: clamp(2.1rem, 6vw, 5.2rem);
}

.world-path {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

.map-layout::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(5, 16, 21, 0.2), transparent 22%, transparent 76%, rgba(5, 16, 21, 0.56)),
    radial-gradient(circle at 50% 48%, transparent 0 48%, rgba(4, 13, 18, 0.34) 100%);
  pointer-events: none;
}

.world-node {
  position: absolute;
  z-index: 4;
  width: min(270px, 27%);
  min-height: 0;
  padding: 12px 14px;
  border: 2px solid rgba(255, 223, 150, 0.9);
  border-radius: 8px;
  background: linear-gradient(rgba(255, 239, 196, 0.78), rgba(176, 120, 42, 0.74));
  backdrop-filter: blur(3px);
  color: #261608;
  box-shadow: 0 5px 0 rgba(22, 13, 7, 0.92), 0 15px 34px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, background 160ms ease;
}

.world-node:hover {
  transform: translate(-50%, -4px);
  background: linear-gradient(rgba(255, 243, 206, 0.9), rgba(198, 142, 55, 0.86));
}

.world-node.moses {
  left: 22%;
  top: 56%;
  transform: translateX(-50%);
}

.world-node.maria {
  left: 50%;
  top: 56%;
  transform: translateX(-50%);
}

.world-node.frans {
  left: 78%;
  top: 56%;
  transform: translateX(-50%);
}

.world-node h3 {
  min-height: 0;
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  text-align: center;
  text-transform: uppercase;
}

.world-node p {
  margin: 5px 0 0;
  text-align: center;
  font-size: clamp(0.86rem, 1.2vw, 1rem);
}

.status-line,
.clue-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 7px 0 0;
  font-weight: 900;
}

.footprint,
.value-chip {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #2a1909;
  border-radius: 50%;
  background: rgba(67, 38, 12, 0.25);
}

.world-node .footprint {
  width: 22px;
  height: 22px;
}

.footprint.found,
.value-chip.found {
  background: #ffd879;
}

.final-lock {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 1.3vw, 18px);
  z-index: 5;
  width: min(760px, calc(100% - 56px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: clamp(12px, 1.6vw, 18px);
}

.lock-symbol {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 3px solid #2a1909;
  border-radius: 50%;
  background: #1d1711;
  color: #ffd879;
  font-size: 2rem;
}

.world-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.world-title {
  text-transform: uppercase;
}

.task-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.task-tab {
  width: 54px;
  height: 54px;
  border: 3px solid #2a1909;
  border-radius: 50%;
  background: #d8aa62;
  color: #241406;
  font-weight: 900;
}

.task-tab.done {
  background: linear-gradient(#ffe18a, #b77822);
  color: #fff8d8;
  box-shadow: 0 0 22px rgba(255, 216, 121, 0.66), 0 5px 0 #160d07;
}

.task-tab.active {
  outline: 4px solid rgba(255, 216, 121, 0.6);
}

.task-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(0, 1.14fr);
  gap: 18px;
}

.task-sort-screen .panel {
  width: min(1320px, calc(100% - 24px));
  margin-top: 10px;
}

.task-sort-screen .task-grid {
  grid-template-columns: minmax(300px, 0.72fr) minmax(600px, 1.28fr);
  align-items: stretch;
}

.task-sort-screen .task-card {
  align-self: start;
  min-height: auto;
}

.task-world-screen .panel {
  padding: 16px;
}

.task-world-screen .world-header {
  margin-bottom: 10px;
}

.task-world-screen .task-card,
.task-world-screen .answer-area {
  padding: 14px;
}

.clue-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.clue-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid #5c3917;
  border-radius: 999px;
  background: rgba(72, 45, 18, 0.2);
  color: #3a210b;
  font-weight: 900;
}

.clue-token span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #5a3511;
  color: #fff2c5;
}

.clue-token.found {
  background: linear-gradient(#ffe8a4, #c98b2d);
  box-shadow: 0 0 22px rgba(255, 216, 121, 0.62);
  animation: clueGlow 1.8s ease-in-out infinite alternate;
}

.task-card,
.answer-area,
.reward-card,
.memory-card {
  padding: 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 242, 204, 0.74);
}

.answer-list,
.sortable-list,
.match-grid,
.symbol-grid,
.hotspot-board,
.quiz-list,
.card-grid {
  display: grid;
  gap: 10px;
}

.task-sort-screen .answer-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-quiz {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-quiz .task-card {
  padding: 10px 12px;
}

.compact-quiz legend {
  padding: 0 4px;
  font-weight: 800;
  line-height: 1.15;
}

.compact-quiz label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 12px 0 0;
}

.answer-button,
.sort-item,
.match-card,
.symbol-button,
.hotspot,
.person-button {
  touch-action: manipulation;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #573512;
  border-radius: 8px;
  background: #f8e2ad;
  color: #241406;
  font-weight: 800;
}

.answer-button.selected,
.symbol-button.selected,
.match-card.selected,
.person-button.selected {
  background: #244f60;
  color: #fff2c5;
}

.sort-source {
  min-height: 326px;
  align-content: start;
}

.answer-button.correct,
.symbol-button.correct {
  background: #476b2b;
  color: #fff8d8;
}

.answer-button.wrong,
.symbol-button.wrong {
  background: #923726;
  color: #fff8d8;
}

.sortable-list {
  counter-reset: sort;
}

.sort-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}

.sort-item::before {
  counter-increment: sort;
  content: counter(sort);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #5a3511;
  color: #fff2c5;
}

.mini {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
}

.match-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  grid-auto-rows: 190px;
}

.task-sort-screen .match-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  grid-auto-rows: auto;
}

.drop-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 190px;
  min-height: 190px;
  padding: 12px;
  border: 2px dashed #7a4d1c;
  border-radius: 8px;
  background: rgba(255, 236, 184, 0.52);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.task-sort-screen .drop-column {
  min-height: 260px;
  height: auto;
  overflow: visible;
}

.drop-column h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 10px;
  padding-bottom: 4px;
  background: rgba(255, 236, 184, 0.94);
}

.hotspot-board {
  position: relative;
  min-height: 330px;
  border: 3px solid #42270e;
  border-radius: 8px;
  background:
    radial-gradient(circle at 47% 38%, rgba(255, 243, 196, 0.74), transparent 14%),
    linear-gradient(135deg, #193f5b, #1d294b 45%, #76552b);
}

.hotspot {
  position: absolute;
  min-height: 42px;
  background: rgba(255, 225, 142, 0.9);
}

.hotspot-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 14px;
}

.hotspot-board.investigative {
  min-height: clamp(340px, 42vw, 560px);
  background:
    linear-gradient(rgba(7, 19, 24, 0.08), rgba(7, 19, 24, 0.16)),
    var(--hotspot-bg, linear-gradient(135deg, #193f5b, #1d294b 45%, #76552b)) center / cover;
  overflow: hidden;
}

.hotspot-board.investigative::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 35%, rgba(255, 218, 116, 0.18), transparent 18%);
  pointer-events: none;
}

.hotspot-placeholder {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 232, 164, 0.7);
  border-radius: 8px;
  color: #fff2c5;
  font-weight: 900;
  text-align: center;
}

.clue-hotspot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 2px solid #fff1b5;
  border-radius: 50%;
  background: radial-gradient(circle, #fff5b9 0 28%, #ffc95c 30% 54%, rgba(122, 76, 18, 0.8) 58% 100%);
  box-shadow: 0 0 0 7px rgba(255, 209, 92, 0.22), 0 0 26px rgba(255, 211, 104, 0.9);
  transform: translate(-50%, -50%);
  animation: hotspotPulse 1.7s ease-in-out infinite;
}

.clue-hotspot span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5a3511;
}

.clue-hotspot:hover,
.clue-hotspot:focus-visible,
.clue-hotspot.hint {
  outline: 4px solid rgba(255, 244, 196, 0.85);
  animation: hotspotHint 0.45s ease-in-out infinite alternate;
}

.clue-hotspot.found {
  background: radial-gradient(circle, #ffffff 0 24%, #ffe27b 28% 54%, #55742a 58% 100%);
  box-shadow: 0 0 30px rgba(255, 231, 128, 0.95);
}

.clue-hotspot.found span::before {
  content: "✓";
  display: block;
  margin: -7px 0 0 -3px;
  color: #244214;
  font-size: 1rem;
  font-weight: 900;
}

.hotspot-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.hotspot-counter {
  margin: 0;
  font-weight: 900;
}

.hotspot-note {
  padding: 14px;
  border: 2px solid #6a4318;
  border-radius: 8px;
  background: rgba(255, 242, 204, 0.88);
  color: #261608;
}

.hotspot-note h4 {
  margin: 0 0 8px;
}

.symbol-lock-task {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.symbol-lock-task.symbol-lock-only {
  grid-template-columns: minmax(280px, 620px);
  justify-content: center;
}

.symbol-lock-board {
  position: relative;
  min-height: 520px;
  border: 3px solid #42270e;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(13, 28, 34, 0.12), rgba(13, 28, 34, 0.2)),
    var(--hotspot-bg) center / cover;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.38);
}

.symbol-lock-sign {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 241, 181, 0.86);
  border-radius: 50%;
  background: rgba(255, 215, 87, 0.16);
  box-shadow: 0 0 0 9px rgba(255, 219, 91, 0.14), 0 0 26px rgba(255, 232, 128, 0.62);
  transform: translate(-50%, -50%);
}

.symbol-lock-sign span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff1b5;
}

.symbol-lock-sign:hover,
.symbol-lock-sign:focus-visible {
  background: rgba(255, 219, 91, 0.42);
  box-shadow: 0 0 0 13px rgba(255, 219, 91, 0.2), 0 0 34px rgba(255, 232, 128, 0.9);
}

.symbol-lock-sign.found {
  background: rgba(68, 119, 48, 0.82);
}

.symbol-lock-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 2px solid #6a4318;
  border-radius: 8px;
  background: rgba(255, 247, 219, 0.72);
}

.symbol-lock-note {
  min-height: 92px;
  padding: 12px;
  border: 2px solid rgba(106, 67, 24, 0.42);
  border-radius: 8px;
  background: #fff8dc;
}

.symbol-lock-note p {
  margin: 8px 0 0;
}

.symbol-lock-cards,
.symbol-lock-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.symbol-lock-card,
.symbol-lock-slot {
  min-height: 58px;
  border: 2px solid #573512;
  border-radius: 8px;
  background: linear-gradient(#fff0bd, #e1b75f);
  color: #261608;
  font-weight: 900;
}

.symbol-lock-card[hidden] {
  display: none;
}

.symbol-lock-slot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: rgba(255, 248, 220, 0.72);
}

.symbol-lock-slot span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a1909;
  color: #ffe7a8;
}

.symbol-lock-slot.filled {
  background: linear-gradient(#f5cf76, #d99d35);
}

.clue-unlock {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 2px solid #8d641f;
  border-radius: 8px;
  background: linear-gradient(rgba(255, 239, 178, 0.94), rgba(204, 140, 42, 0.82));
  color: #241406;
  box-shadow: 0 0 30px rgba(255, 216, 121, 0.36);
  animation: unlockPop 520ms ease-out both;
}

.clue-unlock.solved {
  margin-top: 0;
}

.clue-unlock-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid #2a1909;
  border-radius: 50%;
  background: #ffd879;
  color: #244214;
  font-size: 1.5rem;
  font-weight: 900;
}

.reward-clues {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

.reward-clues span {
  padding: 10px 16px;
  border: 2px solid #ffdf86;
  border-radius: 999px;
  background: rgba(255, 216, 121, 0.16);
  color: #ffdf86;
  font-weight: 900;
}

.moses-reward-screen {
  min-height: 100vh;
  padding: clamp(76px, 8vw, 96px) clamp(14px, 3vw, 38px) clamp(22px, 4vw, 46px);
  background:
    linear-gradient(rgba(6, 18, 24, 0.42), rgba(6, 18, 24, 0.68)),
    url("assets/moses-escape-tablets-360-seamless.png") center / cover;
}

.moses-reward-screen .panel.dark {
  background:
    linear-gradient(rgba(255, 246, 210, 0.94), rgba(232, 200, 132, 0.93)),
    repeating-linear-gradient(90deg, rgba(72, 42, 12, 0.04) 0 1px, transparent 1px 9px);
  color: #241406;
}

.moses-reward-screen h2 {
  color: #2b1707;
  font-size: clamp(2.4rem, 6.5vw, 5.6rem);
}

.moses-reward-screen p {
  color: #241406;
  font-weight: 700;
}

.moses-reward-screen .reward-clues span {
  border-color: #6a4318;
  background: rgba(255, 232, 164, 0.72);
  color: #2a1909;
}

.moses-reward-screen .moses-value-card {
  border-color: #6a4318;
  box-shadow: 0 18px 34px rgba(69, 41, 10, 0.22);
}

.moses-value-card {
  width: min(360px, 100%);
  margin-top: 18px;
  border-color: #ffdf86;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 249, 209, 0.55), transparent 22%),
    linear-gradient(#f3dca8, #b27427 62%, #3d250c);
}

.moses-map-panel {
  width: min(1280px, 100%);
}

.finale-screen .panel.dark h2 {
  color: #ffd879;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.72);
}

.finale-screen .panel.dark > p {
  color: #fff2c5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.moses-map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 18px;
  align-items: stretch;
}

.moses-investigation-map {
  position: relative;
  min-height: clamp(430px, 52vw, 660px);
  border: 4px solid #2a1909;
  border-radius: 8px;
  background:
    linear-gradient(rgba(7, 22, 28, 0.06), rgba(7, 22, 28, 0.2)),
    url("assets/moses-investigation-map.png") center / cover;
  box-shadow: inset 0 0 0 5px rgba(255, 224, 154, 0.12), var(--shadow);
  overflow: hidden;
}

.moses-investigation-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 58%, rgba(255, 228, 140, 0.14), transparent 13%),
    radial-gradient(circle at 66% 34%, rgba(255, 228, 140, 0.16), transparent 14%),
    radial-gradient(circle at 78% 70%, rgba(255, 228, 140, 0.13), transparent 13%),
    linear-gradient(180deg, transparent 66%, rgba(4, 13, 18, 0.28));
  pointer-events: none;
}

.map-clue {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 3px solid rgba(255, 239, 177, 0.92);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 196, 0.95) 0 24%, rgba(238, 175, 58, 0.88) 28% 55%, rgba(74, 45, 13, 0.74) 60%);
  color: #2a1909;
  box-shadow: 0 0 0 9px rgba(255, 207, 85, 0.16), 0 0 30px rgba(255, 218, 105, 0.72);
  transform: translate(-50%, -50%);
  animation: mapClueGlow 1.8s ease-in-out infinite alternate;
}

.map-clue span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #5a3511;
  color: #fff2c5;
  font-weight: 900;
}

.map-clue:hover,
.map-clue:focus-visible {
  outline: 4px solid rgba(255, 244, 196, 0.85);
  filter: brightness(1.18);
}

.map-clue.found {
  background: radial-gradient(circle, #fff8d6 0 24%, #ffe070 30% 58%, #55742a 62%);
}

.map-brief {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 242, 204, 0.78);
}

.map-brief h3,
.map-brief p {
  margin: 0;
}

.map-legend {
  display: grid;
  gap: 10px;
}

.map-legend-item {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px 12px;
  border: 2px solid #573512;
  border-radius: 8px;
  background: rgba(248, 226, 173, 0.9);
  color: #241406;
  text-align: left;
}

.map-legend-item.done {
  background: linear-gradient(#ffe8a4, #c98b2d);
}

.map-legend-item span {
  font-size: 0.92rem;
  line-height: 1.25;
}

.moses-escape-shell {
  position: relative;
  min-height: 100vh;
}

.moses-escape-room {
  position: relative;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(7, 22, 28, 0.02), rgba(7, 22, 28, 0.16)),
    var(--room-bg) var(--panorama-position, center) / auto 100% repeat-x;
  box-shadow: inset 0 0 0 5px rgba(255, 224, 154, 0.12);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: none;
}

.moses-escape-screen {
  min-height: 100vh;
  align-items: stretch;
}

.moses-escape-panel {
  position: relative;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #071b26;
  box-shadow: none;
  overflow: hidden;
}

.moses-escape-topbar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  width: 178px;
  height: 62px;
  min-height: 0;
  padding: 7px;
  border: 1px solid rgba(255, 226, 154, 0.44);
  border-radius: 8px;
  background: rgba(5, 18, 25, 0.84);
  color: #fff0c7;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.moses-escape-topbar .world-title,
.moses-escape-topbar p {
  margin: 0;
}

.moses-escape-topbar .world-title {
  font-size: 0.82rem;
  line-height: 1.05;
  color: #fff0c7;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.moses-escape-topbar .secondary-button {
  align-self: start;
  min-height: 30px;
  padding: 5px 11px;
  margin-bottom: 0;
  font-size: 0.86rem;
}

.moses-escape-topbar .task-tabs {
  display: none;
}

.moses-escape-panel > .clue-trail {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 7;
  max-width: min(680px, calc(100% - 28px));
  margin: 0;
}

.moses-escape-panel > .clue-trail .clue-token {
  border-color: rgba(255, 226, 154, 0.56);
  background: rgba(5, 18, 25, 0.72);
  color: #fff0c7;
}

.escape-topbar-main p {
  display: none;
}

.moses-escape-room.dragging {
  cursor: grabbing;
  transition: none;
}

.escape-room-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 48% 45%, transparent 0 44%, rgba(2, 8, 11, 0.3) 100%),
    linear-gradient(180deg, rgba(3, 10, 14, 0.05), rgba(3, 10, 14, 0.34));
  pointer-events: none;
}

.escape-room-hud {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  display: none;
  gap: 6px;
  max-width: min(420px, calc(100% - 28px));
  padding: 12px;
  border: 2px solid rgba(255, 226, 154, 0.64);
  border-radius: 8px;
  background: rgba(6, 20, 27, 0.72);
  color: #fff0c7;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.escape-room-hud strong {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.escape-clue {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 4px;
  width: clamp(82px, 9vw, 116px);
  height: clamp(82px, 9vw, 116px);
  padding: 8px;
  border: 3px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  opacity: 0.08;
  outline: 0;
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.escape-clue span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-weight: 900;
}

.escape-clue strong {
  max-width: 100px;
  font-size: 0.72rem;
  line-height: 1.05;
  text-align: center;
}

.escape-clue:hover,
.escape-clue:focus-visible,
.escape-clue.found {
  border-color: rgba(255, 239, 177, 0.94);
  background: radial-gradient(circle, rgba(255, 250, 205, 0.96) 0 26%, rgba(247, 181, 54, 0.72) 34% 58%, rgba(71, 41, 12, 0.42) 68%);
  color: #2a1909;
  box-shadow: 0 0 0 16px rgba(255, 207, 85, 0.14), 0 0 48px rgba(255, 229, 128, 0.92);
  opacity: 1;
}

.escape-clue:hover span,
.escape-clue:focus-visible span,
.escape-clue.found span {
  background: #5a3511;
  color: #fff2c5;
}

.escape-clue.found {
  background: radial-gradient(circle, #fff8d6 0 24%, #ffe070 30% 58%, rgba(85, 116, 42, 0.82) 62%);
}

.escape-clue.hidden {
  display: none;
}

.escape-sign {
  opacity: 0.12;
}

.escape-sign:hover,
.escape-sign:focus-visible,
.escape-sign.found {
  opacity: 1;
}

.escape-final-lock {
  background: rgba(255, 222, 99, 0.86);
  opacity: 0.26;
}

.escape-final-lock:hover,
.escape-final-lock:focus-visible {
  opacity: 1;
}

.escape-room-controls {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  transform: translateX(-50%);
}

.escape-room-controls button {
  pointer-events: auto;
}

.escape-brief {
  position: absolute;
  top: 10px;
  right: 206px;
  bottom: auto;
  left: 196px;
  z-index: 12;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: stretch;
  align-content: start;
  gap: 8px;
  width: auto;
  height: 62px;
  min-height: 0;
  max-height: 62px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255, 226, 154, 0.44);
  border-radius: 8px;
  background: rgba(5, 18, 25, 0.84);
  color: #fff0c7;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.escape-brief h3,
.escape-brief p {
  margin: 0;
}

.escape-brief .eyebrow {
  display: none;
}

.escape-brief h3 {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.95rem;
  line-height: 1.05;
}

.escape-brief > p {
  display: none;
}

.escape-room-list {
  display: grid;
  gap: 8px;
}

.escape-brief .escape-room-list {
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  align-content: stretch;
}

.escape-room-item {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 6px 9px;
  border: 2px solid rgba(255, 226, 154, 0.44);
  border-radius: 8px;
  background: rgba(255, 242, 204, 0.9);
  color: #241406;
  text-align: left;
}

.escape-room-item strong,
.escape-room-item span {
  overflow-wrap: anywhere;
}

.escape-room-item.active {
  outline: 4px solid rgba(255, 216, 121, 0.5);
  background: linear-gradient(#fff0bd, #d59a3e);
}

.escape-room-item.done {
  background: linear-gradient(#ffe8a4, #c98b2d);
}

.escape-room-item.locked,
.escape-room-item:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.45);
}

.escape-room-item span,
.escape-room-tip {
  font-size: 0.76rem;
  line-height: 1.08;
}

.escape-room-tip {
  display: none;
}

.maria-escape-panel {
  background: #071521;
}

.maria-escape-room {
  background:
    linear-gradient(rgba(7, 18, 30, 0.06), rgba(7, 18, 30, 0.22)),
    var(--room-bg) center / cover no-repeat;
  cursor: default;
  touch-action: auto;
}

.maria-escape-room.maria-panorama-room {
  background:
    linear-gradient(rgba(7, 18, 30, 0.04), rgba(7, 18, 30, 0.2)),
    var(--room-bg) var(--panorama-position, center) / auto 100% repeat-x;
  cursor: grab;
  touch-action: none;
}

.escape-panorama-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.escape-clue.panorama-out-of-view {
  pointer-events: none;
  visibility: hidden;
}

.maria-escape-room .escape-room-shade {
  background:
    radial-gradient(circle at 48% 45%, transparent 0 42%, rgba(4, 9, 20, 0.26) 100%),
    linear-gradient(180deg, rgba(5, 11, 24, 0.04), rgba(5, 11, 24, 0.36));
}

.maria-room-clue {
  opacity: 0.06;
}

.maria-room-clue:hover,
.maria-room-clue:focus-visible,
.maria-room-clue.found {
  opacity: 1;
  box-shadow: 0 0 0 16px rgba(111, 180, 255, 0.13), 0 0 48px rgba(255, 232, 153, 0.88);
}

.maria-escape-room .escape-clue:hover,
.maria-escape-room .escape-clue:focus-visible,
.maria-escape-room .escape-clue.found {
  opacity: 1;
}

.escape-intro-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 18;
  width: min(460px, calc(100% - 32px));
  padding: 18px;
  border: 2px solid rgba(255, 226, 154, 0.72);
  border-radius: 8px;
  background: rgba(6, 20, 31, 0.92);
  color: #fff0c7;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, -50%);
}

.escape-intro-card h3 {
  margin: 0 0 8px;
  color: #ffe7a6;
}

.escape-intro-card p {
  margin: 0 0 14px;
  line-height: 1.35;
}

@keyframes mapClueGlow {
  from {
    filter: brightness(0.95);
    box-shadow: 0 0 0 7px rgba(255, 207, 85, 0.12), 0 0 20px rgba(255, 218, 105, 0.56);
  }

  to {
    filter: brightness(1.16);
    box-shadow: 0 0 0 13px rgba(255, 207, 85, 0.06), 0 0 36px rgba(255, 230, 142, 0.9);
  }
}

@keyframes clueGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.16); }
}

@keyframes unlockPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hotspotPulse {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 7px rgba(255, 209, 92, 0.22), 0 0 26px rgba(255, 211, 104, 0.9);
  }

  50% {
    filter: brightness(1.18);
    box-shadow: 0 0 0 12px rgba(255, 209, 92, 0.1), 0 0 34px rgba(255, 229, 148, 1);
  }
}

@keyframes hotspotHint {
  from { filter: brightness(1.05); }
  to { filter: brightness(1.45); }
}

.feedback {
  min-height: 34px;
  margin-top: 12px;
  font-weight: 900;
}

.success {
  color: #285d22;
}

.error {
  color: #84291d;
}

.value-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reward-card {
  min-height: 230px;
  background: linear-gradient(#f0d083, #735022);
  color: #261608;
  text-align: center;
}

.reward-card.locked {
  filter: grayscale(0.7);
  opacity: 0.72;
}

.memory-card label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-weight: 900;
}

.memory-card input,
.memory-card textarea,
.memory-card select {
  width: 100%;
  border: 2px solid #6a4318;
  border-radius: 8px;
  padding: 10px;
  background: #fff8dc;
  color: #261608;
}

.memory-card textarea {
  min-height: 74px;
  resize: vertical;
}

.finale-hall-screen {
  align-items: start;
  padding-block: clamp(74px, 8vw, 96px) clamp(24px, 4vw, 44px);
  background:
    linear-gradient(rgba(3, 12, 18, 0.72), rgba(3, 12, 18, 0.84)),
    url("assets/huskesporet-intro-03-portal.png") center / cover;
}

.finale-hall-panel {
  width: min(1280px, 100%);
  background:
    linear-gradient(rgba(255, 246, 212, 0.94), rgba(229, 191, 118, 0.96)),
    repeating-linear-gradient(90deg, rgba(72, 42, 12, 0.05) 0 1px, transparent 1px 9px);
}

.finale-heading {
  display: grid;
  gap: 8px;
  max-width: 850px;
  margin-bottom: 18px;
}

.finale-heading h2 {
  font-size: clamp(2.4rem, 7vw, 6rem);
}

.finale-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
}

.finale-left {
  display: grid;
  gap: 16px;
}

.finale-value-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finale-person-card {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: center;
  min-height: 250px;
  padding: 14px;
  border: 3px solid #6a4318;
  cursor: pointer;
  text-align: center;
}

.finale-person-card strong {
  align-self: end;
  padding-top: 8px;
  color: #3a210b;
  font-size: 0.95rem;
}

.finale-person-card.selected {
  border-color: #123f52;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 249, 210, 0.9), transparent 45%),
    linear-gradient(#ffe7a3, #c98b2d);
  box-shadow: 0 0 0 5px rgba(18, 63, 82, 0.24), var(--shadow);
}

.memory-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 150px;
  padding: 16px;
  border: 3px solid #2a1909;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 248, 220, 0.88), rgba(238, 205, 135, 0.9)),
    radial-gradient(circle at 14% 20%, rgba(255, 222, 125, 0.42), transparent 30%);
  box-shadow: inset 0 0 0 5px rgba(104, 60, 18, 0.12);
}

.memory-preview .world-portrait {
  width: 82px;
  height: 82px;
  justify-self: center;
  background: var(--portrait-bg);
}

.world-portrait.image-portrait {
  background:
    linear-gradient(rgba(20, 12, 4, 0.04), rgba(20, 12, 4, 0.14)),
    var(--portrait-image, none) center / cover no-repeat,
    var(--portrait-bg);
}

.finale-person-card .image-portrait {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  justify-self: center;
  background-position: center;
}

.memory-preview h3,
.memory-preview p {
  margin: 0;
}

.memory-preview h3 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.finale-memory-card {
  padding: 18px;
  border: 3px solid #6a4318;
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.72);
}

.finale-memory-card h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.prompt-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.prompt-bank button {
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #5c3917;
  border-radius: 999px;
  background: #f6dda0;
  color: #261608;
  font-weight: 900;
}

.prompt-bank button:hover,
.prompt-bank button:focus-visible {
  background: #fff1bd;
  outline: 3px solid rgba(18, 63, 82, 0.28);
}

.ending-screen .panel.dark h2 {
  color: #ffe08a;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.78);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 9, 13, 0.72);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  padding: 24px;
  border: 4px solid #2a1909;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.save-panel p {
  max-width: 34rem;
  margin: 10px 0 18px;
  font-weight: 700;
}

.save-code {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 16px;
  border: 3px dashed #6a4318;
  border-radius: 8px;
  background: #fff8dc;
  color: #261608;
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.folder-grid {
  display: grid;
  gap: 14px;
}

.folder-row {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 247, 219, 0.58);
}

@media print {
  body * {
    visibility: hidden;
  }

  .memory-card,
  .memory-card * {
    visibility: visible;
  }

  .memory-card {
    position: absolute;
    inset: 20px;
  }
}

@media (max-width: 1120px), (max-height: 760px) {
  .hud {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 8px;
  }

  .home-link,
  .icon-button,
  .close-button {
    width: 44px;
    height: 44px;
    font-size: 1.12rem;
  }

  .intro-video-copy {
    width: min(680px, 100%);
    padding: clamp(72px, 10svh, 104px) clamp(16px, 4vw, 52px) clamp(18px, 5svh, 42px);
  }

  .intro-video-copy h2 {
    font-size: clamp(2rem, 8svh, 5rem);
  }

  .intro-video-copy p {
    max-width: 34rem;
    margin: 12px 0;
    font-size: clamp(1rem, 2.2svh, 1.22rem);
  }

  .intro-video-progress {
    gap: 6px;
    margin-bottom: 12px;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .moses-cutscene-card .scene-text {
    left: clamp(14px, 3vw, 36px);
    bottom: clamp(14px, 3svh, 30px);
    width: min(660px, calc(100% - 28px));
    max-height: calc(100svh - 92px);
    padding: 14px;
    overflow: auto;
  }

  .moses-cutscene-card .scene-text h2 {
    font-size: clamp(1.8rem, 7svh, 4rem);
  }

  .moses-cutscene-card .scene-text p {
    font-size: clamp(1rem, 2.4svh, 1.22rem);
  }

  .task-world-screen {
    padding: 68px 12px 18px;
  }

  .task-grid {
    grid-template-columns: 1fr;
  }

  .finale-hall-screen {
    padding: 68px 10px 18px;
  }

  .finale-layout {
    grid-template-columns: 1fr;
  }

  .finale-value-cards {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .finale-person-card {
    min-height: 210px;
  }

  @media (min-width: 1121px) {
    .finale-layout {
      grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
    }

    .finale-value-cards {
      grid-template-columns: 1fr;
      overflow-x: visible;
      padding-bottom: 0;
    }

    .finale-person-card {
      min-height: 150px;
    }

    .finale-memory-card textarea {
      min-height: 58px;
    }
  }

  .task-world-screen .panel {
    width: min(980px, 100%);
  }

  .world-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-tabs {
    justify-content: start;
  }
}

@media (max-height: 820px) and (min-width: 980px) {
  .task-sort-screen {
    padding: 54px 10px 10px;
  }

  .task-sort-screen .panel {
    padding: 10px 14px 12px;
    margin-top: 0;
  }

  .task-sort-screen .world-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 6px;
  }

  .task-sort-screen .world-title {
    font-size: clamp(2.8rem, 5.2vw, 4.6rem);
    line-height: 0.9;
  }

  .task-sort-screen .task-card,
  .task-sort-screen .answer-area {
    padding: 12px;
  }

  .task-sort-screen .match-card {
    min-height: 40px;
    padding: 8px 10px;
  }

  .task-sort-screen .answer-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .task-sort-screen .drop-column {
    min-height: 210px;
    padding: 10px;
  }

  .task-sort-screen .primary-button,
  .task-sort-screen .secondary-button {
    min-height: 42px;
    padding: 9px 14px;
  }
}

@media (max-width: 900px) {
  .cutscene-card,
  .task-grid,
  .world-header,
  .final-lock {
    grid-template-columns: 1fr;
  }

  .value-cards {
    grid-template-columns: 1fr;
  }

  .hotspot-shell {
    grid-template-columns: 1fr;
  }

  .symbol-lock-task {
    grid-template-columns: 1fr;
  }

  .symbol-lock-board {
    min-height: 420px;
  }

  .moses-map-shell {
    grid-template-columns: 1fr;
  }

  .moses-escape-shell {
    min-height: 100vh;
  }

  .moses-escape-room {
    min-height: 100vh;
  }

  .moses-escape-topbar {
    right: 10px;
    left: 10px;
    top: 68px;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: 18vh;
    border-radius: 8px;
    overflow: auto;
  }

  .moses-escape-topbar .task-tabs {
    justify-content: start;
  }

  .moses-escape-panel > .clue-trail {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
  }

  .escape-brief {
    right: 10px;
    left: 10px;
    top: calc(68px + 18vh + 8px);
    bottom: auto;
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: 28vh;
    padding: 12px;
    border-left: 2px solid rgba(255, 226, 154, 0.54);
    border-radius: 8px;
    overflow: auto;
  }

  .escape-brief .escape-room-list {
    display: grid;
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .escape-brief h3,
  .escape-brief > p {
    display: block;
    flex: none;
    grid-column: 1;
    grid-row: auto;
  }

  .escape-room-item {
    min-height: 56px;
  }

  .escape-room-controls {
    left: 50%;
    right: auto;
    width: calc(100% - 20px);
  }

  .escape-room-controls button {
    min-width: 0;
    padding-inline: 10px;
  }

  .map-header {
    top: 70px;
    width: min(640px, calc(100% - 112px));
  }

  .map-header h2 {
    font-size: clamp(2rem, 8vw, 4rem);
  }

  .world-node {
    width: min(230px, 32%);
    padding: 10px;
  }

  .world-node h3 {
    font-size: 0.94rem;
  }

  .world-node p {
    display: none;
  }

  .task-tabs {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  .screen {
    padding-inline: 10px;
  }

  .screen:has(.moses-escape-screen) {
    padding: 0;
  }

  .moses-escape-panel {
    padding: 0;
  }

  .hud {
    gap: 7px;
  }

  .home-link,
  .icon-button {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .save-code-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 9vw;
  }

  .panel {
    padding: 14px;
  }

  .moses-escape-panel {
    padding: 0;
  }

  .match-grid {
    grid-template-columns: 1fr;
  }

  .symbol-lock-board {
    min-height: 340px;
  }

  .symbol-lock-cards,
  .symbol-lock-slots {
    grid-template-columns: 1fr;
  }

  .world-path {
    background-position: center;
  }

  .map-header {
    top: 66px;
    width: calc(100% - 28px);
  }

  .map-header .eyebrow {
    display: none;
  }

  .map-header p {
    font-size: 0.9rem;
  }

  .world-node {
    width: 30%;
    padding: 8px 5px;
  }

  .world-node.moses {
    left: 18%;
    top: 56%;
  }

  .world-node.maria {
    left: 50%;
    top: 56%;
  }

  .world-node.frans {
    left: 82%;
    top: 56%;
  }

  .world-node h3 {
    font-size: 0.72rem;
  }

  .world-node .status-line:last-child {
    display: none;
  }

  .world-node .footprint {
    width: 18px;
    height: 18px;
  }
}
