:root {
  --museum-ink: #17243a;
  --museum-gold: #ffd477;
  --museum-mint: #86e6cf;
}
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #111b30;
}
body.museum-night {
  color: #f8f1df;
  background: radial-gradient(circle at 50% 10%, #33486a, #111b30 68%);
  touch-action: manipulation;
}
.museum-night .game-shell {
  height: 100dvh;
  min-height: 0;
  padding: max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-rows: 52px auto minmax(190px, 1fr) auto;
  gap: 7px;
  max-width: 760px;
}
.museum-night header {
  min-height: 52px;
}
.museum-night .brand {
  color: #fff;
}
.museum-night .brand small {
  color: #9fe5da;
}
.museum-night .round-button {
  background: #eef7f5;
  color: #17243a;
  border-color: #fff;
}
.museum-night .mission-card {
  margin: 0;
  background: rgba(246, 239, 215, 0.94);
  color: #17243a;
  border: 2px solid #ffd477;
  padding: 8px 12px;
  min-height: 75px;
}
.museum-night .mission-card > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.museum-night .mission-card p {
  font-size: 14px;
  line-height: 1.2;
  margin: 3px 0;
}
.museum-night .progress-track {
  height: 7px;
}
.museum-night .progress-track i {
  background: linear-gradient(90deg, #46bfa5, #ffd477);
}
#stage {
  position: relative;
  min-height: 0;
  height: auto;
  border: 2px solid rgba(255, 212, 119, 0.65);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(#263a5b, #42536c);
  isolation: isolate;
}
#stage canvas {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.scene-caption {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.13em;
  color: #fff5cf;
  background: rgba(18, 28, 47, 0.7);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
#targets {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transform: translateZ(0);
}
.museum-target {
  position: absolute;
  z-index: 5;
  display: block;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  min-width: 56px;
  min-height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background: rgba(17, 28, 48, 0.85);
  color: #fff;
  font:
    800 11px/1.05 Nunito,
    sans-serif;
  padding: 5px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
  touch-action: manipulation;
}
.museum-target .symbol {
  display: block;
  font-size: 23px;
  line-height: 1;
}
.museum-target.clue {
  border-color: #ffd477;
  animation: clueGlow 1.8s ease-in-out infinite;
}
.museum-target.clue.seen {
  background: rgba(41, 111, 99, 0.92);
  border-color: #9ff5df;
  animation: none;
}
.museum-target.suspect {
  min-width: 66px;
  bottom: auto;
}
.museum-target.ruled-out {
  opacity: 0.42;
  filter: grayscale(0.5);
}
.museum-target.hinted {
  outline: 4px solid #fff3a8;
  outline-offset: 2px;
}
.museum-target.wrong {
  animation: wrongShake 0.32s;
}
.museum-target:active {
  transform: translate(-50%, -50%) scale(0.96);
}
.museum-target.correct,
.museum-target.correct:active {
  background: #2a927e;
  transform: translate(-50%, -50%) scale(1.12);
}
@keyframes clueGlow {
  50% {
    box-shadow:
      0 0 0 7px rgba(255, 212, 119, 0.22),
      0 5px 14px #0006;
  }
}
@keyframes wrongShake {
  25% {
    margin-left: -7px;
  }
  75% {
    margin-left: 7px;
  }
}
.dock {
  margin: 0;
  background: rgba(246, 239, 215, 0.97);
  color: #17243a;
  border-radius: 18px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 7px;
  align-items: center;
  min-height: 61px;
}
.dock button {
  min-height: 46px;
  min-width: 48px;
  margin: 0;
}
.museum-night #hint,
.museum-night #restart {
  min-height: 46px;
}
.dock #restart {
  font-size: 12px;
  padding: 7px;
}
.dock #hint {
  background: #ffd477;
  color: #17243a;
  border-color: #b77c25;
}
#clue-strip {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  max-height: 46px;
  overflow: hidden;
}
#clue-strip span {
  display: block;
  white-space: normal;
}
#announcement {
  z-index: 20;
}
.intro-card {
  color: #2e2922;
}
.intro-benefits {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.intro-benefits span {
  background: #e5f5ef;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}
body.case-complete #stage {
  box-shadow: 0 0 28px rgba(255, 212, 119, 0.8);
}
@media (max-width: 360px) {
  .museum-night .game-shell {
    grid-template-rows: 46px 72px minmax(175px, 1fr) 57px;
    gap: 4px;
    padding-top: max(4px, env(safe-area-inset-top));
  }
  .museum-night header {
    min-height: 46px;
    padding: 0 10px;
  }
  .museum-night .brand {
    font-size: 12px;
    white-space: nowrap;
  }
  .museum-night .brand > span {
    font-size: 20px;
  }
  .museum-night .brand small {
    font-size: 8px;
  }
  .museum-night .round-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .museum-night .mission-card {
    padding: 5px 9px;
    min-height: 68px;
  }
  .museum-target {
    min-width: 50px;
    min-height: 44px;
    font-size: 9px;
    padding: 3px;
  }
  .museum-target .symbol {
    font-size: 20px;
  }
  .museum-target.suspect {
    min-width: 58px;
  }
  .dock {
    min-height: 55px;
    padding: 5px;
    gap: 4px;
  }
  .dock button {
    min-height: 44px;
    font-size: 11px;
    padding: 5px;
  }
  #clue-strip {
    font-size: 10px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .museum-night .game-shell {
    max-width: none;
    grid-template-columns: 190px minmax(360px, 1fr) 210px;
    grid-template-rows: 48px 1fr;
    padding: 5px max(8px, env(safe-area-inset-right)) 5px
      max(8px, env(safe-area-inset-left));
    gap: 5px;
  }
  .museum-night header {
    position: static;
    grid-column: 1/4;
  }
  .museum-night .mission-card {
    position: static;
    width: auto;
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
  }
  .museum-night #stage {
    margin: 0;
    grid-column: 2;
    grid-row: 2;
  }
  .museum-night .dock {
    position: static;
    width: auto;
    grid-column: 3;
    grid-row: 2;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    min-width: 0;
    overflow: hidden;
  }
  .museum-night .dock button {
    width: 100%;
    min-width: 0;
  }
  .dock #clue-strip {
    grid-column: 1/3;
    max-height: 75px;
  }
  .museum-night .mission-card p {
    font-size: 13px;
  }
  .scene-caption {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .museum-target.clue,
  .museum-target.wrong {
    animation: none !important;
  }
}
