:root {
  --scale: 1;
  --page-top: #f2d6b3;
  --page-bottom: #d5e6e2;
  --ink: #182026;
  --panel: rgba(252, 248, 242, 0.94);
  --panel-border: #24333f;
  --accent: #a01d1d;
  --accent-dark: #781111;
  --shadow: rgba(24, 32, 38, 0.18);
  --muted: #63707a;
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  background: #111;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

code,
pre {
  font-family: "Consolas", "Courier New", monospace;
}

.app-shell {
  width: 100%;
  height: 100%;
}

.viewport {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #111;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.dialog-panel,
.debug-panel {
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 18px 40px var(--shadow);
}

.stage-screen {
  width: 1440px;
  height: 1080px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center;
  overflow: hidden;
  background: #d9ded9;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.scene.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scene-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.steps {
  display: none;
}

.character {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.10)) brightness(0.9) saturate(0.9);
  opacity: 1;
  transition:
  opacity 200ms ease,
  transform 200ms ease,
  filter 200ms ease;
}

.character.active {
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 1)) brightness(1.02) saturate(1.05);
  animation: active-speaker-float 1.9s ease-in-out infinite;
}

@keyframes active-speaker-float {
  0%,
  20%,
  80%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.item {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.22));
  opacity: 1;
  transition:
  opacity 200ms ease,
  transform 160ms ease,
  filter 160ms ease;
}

.character.is-swapping,
.item.is-swapping {
  opacity: 0 !important;
}

.is-swap-clone {
  pointer-events: none;
}

.scene [data-run]:not(button):not(.is-hidden) {
  cursor: pointer;
}

.scene [data-run]:not(button):not(.is-hidden):hover,
.scene [data-run]:not(button):not(.is-hidden):focus-visible {
  transform: scale(1.04);
  filter:
  drop-shadow(0 0 0.9rem rgba(255, 249, 196, 0.95))
  drop-shadow(0 0.8rem 1rem rgba(0, 0, 0, 0.28));
  outline: none;
}

#toilet-scene {
  .character[data-char="caroline"] {
    left: 23%;
    bottom: 9rem;
    width: 320px;
  }
}

#gyde-scene {
  .character[data-char="caroline"] {
    left: 8%;
    bottom: 9rem;
    width: 300px;
  }

  .character[data-char="sofie"] {
    right: 8%;
    bottom: 6rem;
    width: 280px;
  }
}

#tjek-sofie-scene {
  .character[data-char="caroline"] {
    left: 8%;
    bottom: 9rem;
    width: 300px;
  }

  .character[data-char="sofie"] {
    right: 8%;
    bottom: 6rem;
    width: 280px;
  }
}

#search-gyden-scene {
  .character[data-char="caroline"] {
    left: 8%;
    bottom: 9rem;
    width: 300px;
  }

  .character[data-char="sofie"] {
    right: 8%;
    bottom: 6rem;
    width: 280px;
  }

  .item[data-item="handprint"] {
    right: 0%;
    bottom: 81%;
    width: 70px;
  }
}

#walk-to-the-bar-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: 21.5rem;
    width: 180px;
  }
}

#back-to-the-club-scene {
  .character[data-char="caroline"] {
    left: 32%;
    bottom: 10rem;
    width: 250px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#back-to-the-club-p2-scene {
  .character[data-char="caroline"] {
    left: 32%;
    bottom: 10rem;
    width: 250px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#whiskey-guy-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#whiskey-guy-spg-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#rune-spg-1-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#rune-spg-2-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#rune-spg-3-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#rune-spg-4-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#talk-to-doorman-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#talk-to-doorman-spg-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#doorman-spg-1-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#doorman-spg-2-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#doorman-spg-3-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="doorman"] {
    right: 28%;
    bottom: -7rem;
    width: 280px;
  }
}

#back-to-the-bar-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }

  .character[data-char="rune"] {
    right: 28%;
    bottom: 21.5rem;
    width: 180px;
  }
}

#retrace-your-steps-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#VIP-room-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#office-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#ending-police-good {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#ending-good {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#the-good-ending {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#check-the-trash-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .item[data-item="knife"] {
    right: 18%;
    bottom: 16%;
    width: 130px;
    transform: rotate(-18deg);
  }
}

#check-upstairs-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#check-trash-agian-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }
}

#call-the-police-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-question-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-rune-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-default-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-took-knife-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-branch-1-3-default-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-branch-1-3-upstairs-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-ending-1-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-ending-2-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#police-ending-3-scene {
  .character[data-char="caroline"] {
    right: 8%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="politimand"] {
    left: 4%;
    bottom: -7rem;
    width: 250px;
  }

  .character[data-char="politidame"] {
    left: 17%;
    bottom: -7rem;
    width: 250px;
  }
}

#talk-to-bartender-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

#talk-to-bartender-spg-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

#bartender-spg-1-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

#bartender-spg-2-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

#bartender-spg-3-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

#bartender-spg-4-scene {
  .character[data-char="caroline"] {
    left: 12%;
    bottom: -8rem;
    width: 320px;
  }

  .character[data-char="bartender"] {
    right: 6%;
    bottom: 7rem;
    width: 300px;
  }
}

.scene-panel {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  width: min(27rem, calc(100% - 2.5rem));
  padding: 1.15rem 1.2rem;
  background: rgba(252, 248, 242, 0.82);
  border: 3px solid rgba(36, 51, 63, 0.24);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(24, 32, 38, 0.16);
  backdrop-filter: blur(12px);
}

.scene-panel--right {
  left: auto;
  right: 1.25rem;
}

.scene-panel-copy {
  line-height: 1.6;
  color: var(--ink);
}

.scene-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.scene-actions button {
  width: 100%;
}

.ending-screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.25rem;
  padding: 4rem;
  text-align: center;
}

.ending-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
  linear-gradient(180deg, rgba(17, 22, 28, 0.26), rgba(17, 22, 28, 0.7)),
  radial-gradient(circle at top, rgba(255, 255, 255, 0.26), transparent 48%);
}

.ending-screen > * {
  position: relative;
}

.ending-screen--good {
  color: #f7f4ee;
}

.ending-screen--rough {
  color: #fff5eb;
}

.ending-kicker {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.ending-lead {
  max-width: 40rem;
  font-size: 1.08rem;
  line-height: 1.7;
  text-wrap: balance;
}

.ending-card {
  width: min(44rem, 100%);
  padding: 1.8rem 2rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background: rgba(18, 24, 30, 0.6);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  text-align: left;
}

.ending-screen--good .ending-card {
  background:
  linear-gradient(180deg, rgba(28, 48, 55, 0.74), rgba(19, 31, 36, 0.76)),
  rgba(18, 24, 30, 0.6);
}

.ending-screen--rough .ending-card {
  background:
  linear-gradient(180deg, rgba(62, 40, 30, 0.78), rgba(34, 22, 18, 0.82)),
  rgba(18, 24, 30, 0.6);
}

.ending-summary {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.ending-button {
  min-width: 12rem;
}

.is-hidden {
  display: none !important;
}

.dialog-panel,
.action-panel {
  position: absolute;
  z-index: 2;
}

.dialog-panel,
.action-panel,
.debug-panel {
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.utility-controls {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.music-toggle {
  border: 2px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  color: var(--ink);
  background: rgba(252, 248, 242, 0.78);
  box-shadow: 0 14px 24px rgba(24, 32, 38, 0.18);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  transition:
  transform 120ms ease,
  background 120ms ease;
}

.music-toggle:hover {
  transform: translateY(-1px);
  background: rgba(252, 248, 242, 0.94);
}

.music-toggle[aria-pressed="true"] {
  color: #fff8f1;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.story-ui {
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.story-ui.is-hidden {
  display: none;
}

.dialog-panel {
  --dialog-border-color: var(--panel-border);
  --dialog-bg-top: rgba(249, 244, 236, 0.94);
  --dialog-bg-bottom: rgba(242, 233, 219, 0.96);
  --speaker-bg: rgba(217, 109, 63, 0.12);
  --speaker-text: var(--accent-dark);
  position: relative;
  width: 100%;
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  border-color: var(--dialog-border-color);
  background: linear-gradient(180deg, var(--dialog-bg-top), var(--dialog-bg-bottom));
}

.speaker-label {
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--speaker-bg);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--speaker-text);
}

.dialog-text {
  font-size: 1.05rem;
  line-height: 1.65;
}

.action-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 0;
  backdrop-filter: none;
  width: min(720px, 100%);
}

.choice-list {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  width: 100%;
}

.action-panel > .primary-button {
  justify-self: center;
}

.choice-list:empty {
  display: none;
}

.primary-button,
.secondary-button,
.choice-list button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(24, 32, 38, 0.18);
  transition:
  transform 120ms ease,
  background 120ms ease,
  color 120ms ease;
}

.choice-list button {
  min-width: min(420px, 100%);
}

.primary-button,
.choice-list button {
  color: #fff8f1;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--panel-border);
}

.primary-button:hover,
.secondary-button:hover,
.choice-list button:hover {
  transform: translateY(-1px);
}

.debug-line {
  line-height: 1.55;
  color: var(--muted);
}

.debug-panel {
  width: auto;
  padding: 0;
  background: rgba(252, 248, 242, 0.64);
  overflow: hidden;
}

.debug-panel summary {
  list-style: none;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.debug-panel summary::-webkit-details-marker {
  display: none;
}

.debug-panel summary::before {
  content: "+ ";
}

.debug-panel[open] {
  width: 320px;
  background: rgba(252, 248, 242, 0.78);
}

.debug-panel[open] summary {
  border-bottom: 1px solid rgba(36, 51, 63, 0.14);
}

.debug-panel[open] summary::before {
  content: "- ";
}

.debug-content {
  padding: 0.8rem;
}

.debug-content h2 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.debug-panel pre {
  margin-top: 0.75rem;
  margin-bottom: 0;
  padding: 0.7rem;
  min-height: 88px;
  max-height: 240px;
  overflow: auto;
  border-radius: 12px;
  background: #1f2a33;
  color: #f4e8d9;
  font-size: 0.78rem;
}
