:root {
  --bg-deep: #171711;
  --line: rgba(247, 240, 214, 0.16);
  --paper: #d7c79c;
  --paper-ink: #2d2518;
  --paper-muted: #6f6247;
  --gold: #d0a35d;
  --good: #6b8b5d;
  --bad: #af4737;
  --neutral: #5b6767;
  --warn: #d88e47;
  --text-main: #f7f0d6;
  --text-muted: #c8bfa2;
  --shadow: 0 24px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Aptos", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(208, 163, 93, 0.15), transparent 28%),
    linear-gradient(145deg, #1d1a14 0%, #12120e 55%, #0d0e0b 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(540px, 1.1fr);
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 16, 14, 0.18), rgba(18, 17, 13, 0.76)),
    radial-gradient(circle at top, rgba(255, 241, 208, 0.28), transparent 34%),
    url("assets/inchella-top.gif");
  background-size: cover;
  background-position: center top;
  opacity: 0.94;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-logo {
  width: min(100%, 420px);
  display: block;
  margin-bottom: 4px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.4));
}

.title-group h1 {
  margin: 2px 0 2px;
  font-family: "Bahnschrift Condensed", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(2.3rem, 3.5vw, 3.5rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

.eyebrow,
.section-label,
.document-type,
.status-card span,
.queue-pill span {
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.subtitle {
  margin: 0;
  max-width: 56ch;
  color: rgba(247, 240, 214, 0.9);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

.utility-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.topbar-actions {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
}

.utility-button {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(15, 17, 16, 0.42);
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.pause-button {
  min-width: 124px;
  padding-inline: 18px;
  border-color: rgba(215, 199, 156, 0.26);
  background: linear-gradient(180deg, rgba(29, 31, 26, 0.74), rgba(17, 18, 16, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 213, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.22);
}

.pause-button:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 12px;
}

.status-card,
.card,
.document,
.overlay-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.status-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(38, 41, 36, 0.82), rgba(24, 26, 22, 0.92));
  backdrop-filter: blur(6px);
}

.status-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
  color: var(--gold);
}

.status-card.urgent strong {
  color: #f0a26e;
}

.status-card.paused {
  border-color: rgba(151, 186, 144, 0.3);
}

.status-card.paused strong {
  color: #dcebc6;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(340px, 0.92fr);
  gap: 22px;
}

.booth-panel,
.documents-panel {
  display: grid;
  gap: 18px;
}

.card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(40, 42, 34, 0.96), rgba(26, 27, 22, 0.98));
}

.checkpoint-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(215, 199, 156, 0.12);
  background: #171711;
}

.checkpoint-scene {
  position: relative;
  aspect-ratio: 590 / 768;
  min-height: 520px;
  overflow: hidden;
  border-radius: 24px;
  background: #25261d;
  isolation: isolate;
  --special-entrant-left: 8.5%;
  --special-entrant-right: 8.5%;
  --special-entrant-top: 9%;
  --special-entrant-height: 53.5%;
}

.checkpoint-scene::before {
  content: "";
  position: absolute;
  left: 75.2%;
  top: 41.9%;
  width: 19.25%;
  height: 22.65%;
  background: url("./assets/checkpoint-side-monitor.png") center / contain no-repeat;
  pointer-events: none;
  z-index: 3;
}

.checkpoint-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 54% 18%, rgba(255, 244, 194, 0.18), transparent 22%),
    linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
  z-index: 1;
}

.checkpoint-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.84);
}

.custom-decoration-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.custom-decoration-item {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.custom-decoration-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.checkpoint-monitor-lower-foreground {
  position: absolute;
  left: 8.398%;
  top: 44.644%;
  width: 66.699%;
  height: 4.644%;
  pointer-events: none;
  z-index: 3;
  background: url("./assets/checkpoint-monitor-foreground.png") center / 100% 100% no-repeat;
}

.checkpoint-scanner {
  position: absolute;
  left: 77.28%;
  top: 45.02%;
  width: 15.05%;
  height: 16.35%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 13, 10, 0.96), rgba(16, 22, 16, 0.98)),
    url("./assets/checkpoint-scanning.png") center / cover no-repeat;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(112, 168, 122, 0.08);
  filter: saturate(0.82) brightness(0.88);
  transform: scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.checkpoint-scanner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(146, 255, 186, 0.05), transparent 34%),
    repeating-linear-gradient(180deg, rgba(179, 255, 196, 0.06) 0 1px, transparent 1px 7px);
  opacity: 0.72;
}

.checkpoint-scanner.active {
  opacity: 1;
  filter: saturate(1) brightness(1);
  transform: scale(1);
}

.checkpoint-escort-button {
  position: absolute;
  left: 77.28%;
  top: 45.02%;
  width: 15.05%;
  height: 16.35%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid rgba(41, 36, 29, 0.98);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 245, 225, 0.12) 0 7%, transparent 17%),
    radial-gradient(circle at 81% 78%, rgba(103, 71, 39, 0.18) 0 6%, transparent 16%),
    linear-gradient(138deg, transparent 0 33%, rgba(255, 255, 255, 0.05) 34% 35%, transparent 36% 100%),
    repeating-linear-gradient(168deg, rgba(255, 255, 255, 0.028) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, rgba(123, 117, 105, 0.98) 0%, rgba(91, 86, 77, 0.99) 52%, rgba(58, 55, 49, 1) 100%);
  background-size: 100% 100%, 100% 100%, 160% 160%, 120% 120%, 100% 100%, 100% 100%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  color: rgba(22, 20, 15, 0.97);
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: clamp(0.74rem, 1.42vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(236, 228, 209, 0.1),
    inset 0 1px 0 rgba(255, 245, 222, 0.12),
    inset 0 -16px 20px rgba(0, 0, 0, 0.24),
    inset 0 0 18px rgba(29, 24, 18, 0.14),
    0 1px 6px rgba(0, 0, 0, 0.16);
  text-shadow:
    0 1px 0 rgba(255, 244, 218, 0.08),
    0 0 4px rgba(255, 243, 208, 0.04);
  filter: saturate(0.82) contrast(1.02);
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
  will-change: filter, background-position;
}

.checkpoint-escort-button::before,
.checkpoint-escort-button::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.checkpoint-escort-button::before {
  inset: -12%;
  opacity: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 248, 225, 0.18) 0 1px, rgba(0, 0, 0, 0.2) 1px 2px, transparent 2px 6px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 10px),
    linear-gradient(135deg, transparent 0 30%, rgba(255, 246, 213, 0.12) 31% 33%, transparent 34% 100%);
  mix-blend-mode: screen;
  transform: translateX(0);
  z-index: 0;
}

.checkpoint-escort-button::after {
  inset: -24% 0;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0 26%, rgba(255, 245, 203, 0.82) 42%, rgba(255, 236, 176, 0.28) 51%, transparent 66%);
  transform: translateY(-34%);
  z-index: 0;
}

.checkpoint-escort-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.checkpoint-escort-button.visible::before {
  opacity: 0.18;
  animation: escort-button-noise-overlay 2.8s steps(2, end) infinite;
}

.checkpoint-escort-button.activating {
  animation: escort-button-reveal 640ms cubic-bezier(0.16, 0.86, 0.24, 1) both;
}

.checkpoint-escort-button.activating::before {
  opacity: 0.62;
  animation:
    escort-button-noise-burst 640ms steps(4, end) 1,
    escort-button-noise-overlay 2.8s steps(2, end) 640ms infinite;
}

.checkpoint-escort-button.activating::after {
  animation: escort-button-flash 640ms ease-out 1;
}

.checkpoint-escort-button:hover {
  filter: brightness(1.015) saturate(0.86) contrast(1.03);
  box-shadow:
    inset 0 0 0 1px rgba(244, 235, 214, 0.12),
    inset 0 1px 0 rgba(255, 247, 226, 0.14),
    inset 0 -14px 18px rgba(0, 0, 0, 0.19),
    inset 0 0 18px rgba(34, 31, 26, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.16);
}

.checkpoint-escort-button:active {
  transform: scale(0.985);
  filter: brightness(0.95) saturate(0.8);
  box-shadow:
    inset 0 0 0 1px rgba(228, 218, 198, 0.1),
    inset 0 3px 7px rgba(0, 0, 0, 0.22),
    inset 0 -8px 12px rgba(0, 0, 0, 0.14);
}

.checkpoint-escort-button:focus-visible {
  outline: 2px solid rgba(246, 236, 185, 0.92);
  outline-offset: 1px;
}

.checkpoint-escort-button:disabled {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  filter: none;
  animation: none;
}

@keyframes escort-button-noise {
  0%,
  100% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    filter: saturate(0.82) contrast(1.02);
  }

  18% {
    background-position: 0 0, 0 0, 1px -2px, -2px 1px, 0 -1px, 0 0;
    filter: saturate(0.85) contrast(1.03) brightness(1.01);
  }

  37% {
    background-position: 0 0, 0 0, -2px 1px, 1px -2px, 0 1px, 0 0;
    filter: saturate(0.83) contrast(1.02);
  }

  56% {
    background-position: 0 0, 0 0, 2px 0, -1px -1px, 0 -1px, 0 0;
    filter: saturate(0.86) contrast(1.04) brightness(1.015);
  }

  74% {
    background-position: 0 0, 0 0, -1px 2px, 2px 0, 0 1px, 0 0;
    filter: saturate(0.82) contrast(1.02);
  }
}

@keyframes escort-button-reveal {
  0% {
    opacity: 0;
    transform: scale(0.72);
    filter: brightness(1.5) saturate(1.2) contrast(1.3) blur(1px);
  }

  24% {
    opacity: 1;
    transform: scale(1.08);
    filter: brightness(1.24) saturate(1.06) contrast(1.18);
  }

  58% {
    transform: scale(0.96);
    filter: brightness(0.92) saturate(0.9) contrast(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(0.82) contrast(1.02);
  }
}

@keyframes escort-button-noise-overlay {
  0%,
  100% {
    transform: translateX(0);
    filter: brightness(1);
  }

  20% {
    transform: translateX(-1px);
    filter: brightness(1.08);
  }

  45% {
    transform: translateX(1px);
    filter: brightness(0.98);
  }

  72% {
    transform: translateX(-2px);
    filter: brightness(1.04);
  }
}

@keyframes escort-button-noise-burst {
  0% {
    transform: translateX(-7px) scaleX(1.08);
    filter: brightness(1.45) contrast(1.35);
  }

  18% {
    transform: translateX(5px) scaleX(0.94);
    filter: brightness(0.74) contrast(1.48);
  }

  36% {
    transform: translateX(-4px) scaleX(1.04);
    filter: brightness(1.3) contrast(1.28);
  }

  54% {
    transform: translateX(3px) scaleX(0.98);
    filter: brightness(0.86) contrast(1.2);
  }

  100% {
    transform: translateX(0);
    filter: brightness(1);
  }
}

@keyframes escort-button-flash {
  0% {
    opacity: 0;
    transform: translateY(-44%);
  }

  14% {
    opacity: 0.95;
  }

  46% {
    opacity: 0.42;
    transform: translateY(8%);
  }

  100% {
    opacity: 0;
    transform: translateY(38%);
  }
}

.checkpoint-scanner-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  color: #adffbb;
  font-family: "Courier New", monospace;
  font-size: clamp(0.48rem, 0.82vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(120, 255, 162, 0.45),
    0 0 12px rgba(74, 214, 115, 0.22);
  transform: translateY(-2%);
}

.scanner-dots {
  display: inline-flex;
  min-width: 2.2ch;
}

.scanner-dot {
  opacity: 0;
  animation: scanner-dot-blink 1.2s infinite steps(1, end);
}

.scanner-dot:nth-child(1) {
  animation-delay: 0s;
}

.scanner-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.scanner-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes scanner-dot-blink {
  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entrant-stage,
.identity-terminal {
  position: absolute;
}

.entrant-stage {
  top: 6.5%;
  left: 8%;
  right: 8%;
  height: 39%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 1.02fr) minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  overflow: hidden;
  z-index: 2;
  isolation: isolate;
}

.entrant-stage.special-entrant-active {
  display: block;
  left: var(--special-entrant-left);
  right: var(--special-entrant-right);
  top: var(--special-entrant-top);
  height: var(--special-entrant-height);
  z-index: auto;
  isolation: auto;
}

.entrant-stage.special-entrant-active .entrant-portrait.custom-photo {
  top: 0;
  bottom: 0;
  clip-path: inset(0 0 25% 0);
}

.entrant-stage.special-entrant-active .stage-dialogue {
  top: 2%;
  max-height: 28%;
}

.entrant-portrait {
  --skin: #d9a276;
  --hair: #2b1a14;
  --coat: #4a5c4b;
  --collar: #d5c499;
  position: relative;
  width: min(52%, 252px);
  min-width: 150px;
  height: 100%;
  grid-column: 2;
  justify-self: center;
  align-self: end;
  opacity: 1;
  z-index: 0;
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34));
  will-change: opacity, filter;
}

.checkpoint-shutter {
  position: absolute;
  inset: -5% -2% 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  clip-path: inset(0 0 25% 0);
  pointer-events: none;
  transform: translateY(-112%);
  transition:
    opacity 180ms ease,
    transform 820ms cubic-bezier(0.24, 0.82, 0.24, 1),
    visibility 0s linear 820ms;
}

.checkpoint-shutter.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 140ms ease,
    transform 820ms cubic-bezier(0.24, 0.82, 0.24, 1),
    visibility 0s linear 0s;
}

.checkpoint-shutter-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) contrast(1.08);
}

.checkpoint-arrest-silhouette {
  position: absolute;
  left: 50%;
  bottom: -2%;
  width: min(48%, 244px);
  height: 84%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 240ms ease 420ms, filter 240ms ease;
}

.checkpoint-shutter.active .checkpoint-arrest-silhouette {
  opacity: 0.94;
}

.checkpoint-shutter.fading .checkpoint-arrest-silhouette {
  opacity: 0;
  filter: blur(5px);
}

.checkpoint-arrest-silhouette-head,
.checkpoint-arrest-silhouette-neck,
.checkpoint-arrest-silhouette-shoulders {
  position: absolute;
  background: rgba(0, 0, 0, 0.96);
}

.checkpoint-arrest-silhouette-head {
  left: 50%;
  top: 16%;
  width: 44%;
  aspect-ratio: 0.82;
  transform: translateX(-50%);
  border-radius: 46% 46% 48% 48%;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.34);
}

.checkpoint-arrest-silhouette-neck {
  left: 50%;
  top: 47%;
  width: 15%;
  height: 16%;
  transform: translateX(-50%);
  border-radius: 10px;
}

.checkpoint-arrest-silhouette-shoulders {
  left: 50%;
  bottom: 0;
  width: 92%;
  height: 56%;
  transform: translateX(-50%);
  border-radius: 44% 44% 16% 16%;
}

.entrant-portrait.revealing {
  animation: entrant-portrait-fade-in 3s ease-out both;
}

.entrant-portrait.leaving {
  animation: entrant-portrait-fade-out 2s ease-in both;
}

@keyframes entrant-portrait-fade-in {
  0% {
    opacity: 0;
    filter: brightness(0) saturate(0) drop-shadow(0 12px 12px rgba(0, 0, 0, 0.18));
  }

  26% {
    opacity: 1;
    filter: brightness(0) saturate(0) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34));
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34));
  }
}

@keyframes entrant-portrait-fade-out {
  0% {
    opacity: 1;
    filter: brightness(1) saturate(1) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34));
  }

  100% {
    opacity: 0;
    filter: brightness(0.18) saturate(0.2) drop-shadow(0 12px 12px rgba(0, 0, 0, 0.18));
  }
}

.portrait-head {
  position: absolute;
  left: 50%;
  top: 22%;
  width: 50%;
  aspect-ratio: 0.82;
  transform: translateX(-50%);
  border-radius: 44% 44% 48% 48%;
  background: var(--skin);
  border: 3px solid rgba(29, 24, 15, 0.6);
  z-index: 3;
}

.portrait-hair {
  position: absolute;
  inset: -12% -11% 54%;
  border-radius: 48% 48% 22% 22%;
  background: var(--hair);
  box-shadow: inset 16px -4px 0 rgba(255, 255, 255, 0.06);
}

.portrait-eye {
  position: absolute;
  top: 43%;
  width: 10%;
  height: 7%;
  border-radius: 50%;
  background: #161410;
}

.portrait-eye.left {
  left: 30%;
}

.portrait-eye.right {
  right: 30%;
}

.portrait-nose {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7%;
  height: 17%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(92, 57, 39, 0.28);
}

.portrait-mouth {
  position: absolute;
  left: 38%;
  right: 38%;
  bottom: 22%;
  height: 4%;
  border-radius: 999px;
  background: rgba(64, 29, 25, 0.72);
}

.portrait-neck {
  position: absolute;
  left: 50%;
  top: 48.5%;
  width: 17%;
  height: 19%;
  transform: translateX(-50%);
  border-radius: 10px;
  background: var(--skin);
  border-left: 2px solid rgba(0, 0, 0, 0.28);
  border-right: 2px solid rgba(0, 0, 0, 0.28);
  z-index: 1;
}

.portrait-shoulders {
  position: absolute;
  left: 50%;
  bottom: -9%;
  width: 94%;
  height: 57%;
  transform: translateX(-50%);
  border-radius: 44% 44% 18% 18%;
  background:
    linear-gradient(130deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(230deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(180deg, color-mix(in srgb, var(--coat) 90%, white 10%), var(--coat));
  border: 4px solid rgba(25, 22, 16, 0.62);
  z-index: 2;
}

.entrant-portrait.empty {
  opacity: 0;
  visibility: hidden;
  filter: none;
}

.portrait-caption {
  display: none;
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 4%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(35, 34, 23, 0.44);
  color: #242414;
  text-align: center;
  backdrop-filter: blur(2px);
}

.portrait-caption .section-label {
  color: rgba(36, 36, 20, 0.72);
}

.portrait-caption h2 {
  margin: 3px 0 2px;
  color: #1c1b12;
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.portrait-caption p:last-child {
  margin: 0;
  color: rgba(36, 36, 20, 0.78);
  font-size: 0.82rem;
}

.stage-dialogue {
  position: absolute;
  top: 7%;
  width: min(100%, 230px);
  max-width: min(230px, calc(50% - 16px));
  height: auto;
  max-height: 58%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1a1d17;
  font-family: "Courier New", monospace;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 6;
}

.stage-dialogue.traveler {
  left: 0;
}

.stage-dialogue.inspector {
  right: 0;
}

.stage-dialogue .terminal-label {
  display: none;
}

.dialogue-stack {
  display: grid;
  align-content: start;
  gap: 3px;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 1px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(72, 64, 45, 0.58) rgba(255, 255, 255, 0.12);
  font-size: clamp(0.64rem, 1.1vw, 0.82rem);
  line-height: 1.34;
}

.app-shell.pause-active {
  filter: grayscale(0.14) brightness(0.9);
}

.app-shell.pause-active,
.app-shell.pause-active *,
.app-shell.pause-active *::before,
.app-shell.pause-active *::after {
  animation-play-state: paused !important;
}

.dialogue-stack::-webkit-scrollbar {
  width: 7px;
}

.dialogue-stack::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.dialogue-stack::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(105, 94, 66, 0.9), rgba(62, 56, 39, 0.92));
}

.dialogue-bubble {
  position: relative;
  display: inline-block;
  width: fit-content;
  max-width: calc(100% - 2px);
  padding: 5px 7px;
  border-radius: 12px;
  background: rgba(248, 244, 217, 0.7);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);
  transform-origin: left top;
}

.dialogue-bubble.entering {
  animation: dialogue-bubble-enter 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--bubble-enter-delay, 0ms);
}

.stage-dialogue.traveler .dialogue-bubble {
  justify-self: start;
  border-bottom-left-radius: 4px;
}

.stage-dialogue.inspector .dialogue-bubble {
  justify-self: end;
  border-bottom-right-radius: 4px;
  background: rgba(197, 218, 197, 0.7);
}

@keyframes dialogue-bubble-enter {
  0% {
    opacity: 0;
    transform: translateY(9px) scale(0.94);
    filter: blur(2px);
  }

  60% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.identity-terminal {
  left: 16.1%;
  bottom: 23.6%;
  width: 28.8%;
  min-height: 14%;
  padding: 10px 13px 9px;
  border: 2px solid rgba(29, 29, 19, 0.82);
  background: rgba(225, 218, 168, 0.82);
  color: #242414;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  z-index: 4;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 197, 0.26), 0 8px 12px rgba(0, 0, 0, 0.22);
}

.mistake-display {
  position: absolute;
  left: 22.4%;
  top: 78.6%;
  bottom: auto;
  width: 22.4%;
  height: 5.5%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 0 11px 6px 10px;
  z-index: 2;
  border: 2px solid rgba(28, 30, 23, 0.92);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(12, 14, 13, 0.96), rgba(2, 3, 3, 0.98)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 5px);
  color: rgba(224, 233, 219, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(109, 118, 109, 0.18),
    inset 0 0 16px rgba(0, 0, 0, 0.42),
    0 7px 12px rgba(0, 0, 0, 0.2);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
  overflow: hidden;
}

.mistake-display::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 10px);
  opacity: 0.42;
  pointer-events: none;
}

.mistake-display-label,
.mistake-display-count {
  position: relative;
  z-index: 1;
}

.mistake-display-label {
  position: relative;
  top: auto;
  left: auto;
  font-family: "Courier New", monospace;
  align-self: end;
  font-size: clamp(0.38rem, 0.66vw, 0.58rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.76;
}

.mistake-display-count {
  min-width: 1.15ch;
  font-family: "Courier New", monospace;
  font-size: clamp(1.22rem, 2.1vw, 1.84rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(187, 229, 203, 0.96);
  text-align: right;
  line-height: 0.92;
  transform: translateY(1px);
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 4px rgba(167, 238, 198, 0.28),
    0 0 10px rgba(114, 205, 153, 0.16);
}

.mistake-display.alert,
.mistake-display.critical {
  color: rgba(255, 237, 237, 0.97);
  border-color: rgba(158, 47, 47, 0.92);
  background:
    linear-gradient(180deg, rgba(118, 19, 19, 0.96), rgba(48, 7, 10, 0.98)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 181, 181, 0.22),
    inset 0 0 16px rgba(84, 0, 0, 0.38),
    0 0 16px rgba(221, 61, 61, 0.22),
    0 7px 12px rgba(0, 0, 0, 0.2);
}

.mistake-display.alert .mistake-display-count,
.mistake-display.critical .mistake-display-count {
  color: rgba(255, 239, 239, 0.98);
  text-shadow:
    0 0 5px rgba(255, 177, 177, 0.34),
    0 0 12px rgba(214, 63, 63, 0.22);
}

.mistake-display.alert {
  animation: mistake-display-alert 900ms ease;
}

.mistake-display.critical {
  box-shadow:
    inset 0 0 0 1px rgba(255, 199, 199, 0.26),
    inset 0 0 18px rgba(116, 0, 0, 0.42),
    0 0 20px rgba(226, 62, 62, 0.28),
    0 7px 12px rgba(0, 0, 0, 0.22);
}

@keyframes mistake-display-alert {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  28% {
    transform: scale(1.012);
    filter: brightness(1.1);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.checkpoint-dev-button {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(28px, 5.8%, 44px);
  aspect-ratio: 1.42 / 1;
  border: 2px solid rgba(27, 28, 20, 0.88);
  border-radius: 4px;
  padding: 0;
  font-family: "Courier New", monospace;
  font-size: clamp(0.62rem, 1vw, 0.84rem);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: filter 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.checkpoint-dev-button:hover {
  filter: brightness(1.06);
}

.checkpoint-dev-button:focus-visible {
  outline: 2px solid rgba(244, 233, 174, 0.92);
  outline-offset: 1px;
}

.checkpoint-dev-button:active {
  filter: brightness(0.97);
}

.checkpoint-dev-button.active {
  box-shadow:
    0 0 0 1px rgba(255, 252, 234, 0.2),
    0 0 12px rgba(255, 233, 150, 0.26);
}

.checkpoint-dev-button.amber {
  background: linear-gradient(180deg, rgba(228, 163, 72, 0.95), rgba(155, 92, 34, 0.98));
  color: #fff4cd;
}

.checkpoint-dev-button.green {
  background: linear-gradient(180deg, rgba(120, 206, 92, 0.95), rgba(58, 128, 52, 0.98));
  color: #f5ffe9;
}

.checkpoint-dev-button.top-left {
  left: 43.9%;
  top: 2.35%;
  width: clamp(27px, 5.68%, 43px);
  height: clamp(17px, 2.96%, 28px);
}

.checkpoint-dev-button.top-right {
  left: 55.4%;
  top: 2.35%;
  width: clamp(27px, 5.68%, 43px);
  height: clamp(17px, 2.96%, 28px);
}

.checkpoint-dev-button.lower-top {
  left: 47.3%;
  top: 60.2%;
  width: clamp(23px, 4.7%, 35px);
}

.checkpoint-dev-button.lower-bottom {
  left: 47.3%;
  top: 64.1%;
  width: clamp(23px, 4.7%, 35px);
}

.checkpoint-interrogate-button {
  position: absolute;
  left: 59.7%;
  bottom: 32.5%;
  width: 8.2%;
  min-width: 60px;
  height: 8.1%;
  min-height: 54px;
  z-index: 3;
  border: 3px solid rgba(44, 40, 28, 0.92);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(107, 101, 74, 0.96), rgba(57, 53, 39, 0.98));
  color: #f2e7bd;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(179, 164, 110, 0.2), 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

.checkpoint-interrogate-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.checkpoint-interrogate-button.active {
  border-color: rgba(243, 224, 177, 0.82);
  background:
    linear-gradient(180deg, rgba(95, 92, 68, 0.98), rgba(52, 48, 35, 0.96)),
    rgba(38, 35, 26, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 240, 191, 0.28),
    0 0 18px rgba(255, 225, 146, 0.22);
}

.checkpoint-interrogate-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  filter: none;
}

.app-shell.interrogation-mode .checkpoint-scene > :not(.checkpoint-interrogate-button):not(.checkpoint-escort-button):not(.entrant-stage) {
  filter: grayscale(0.98) brightness(0.64);
  transition: filter 180ms ease;
}

.app-shell.interrogation-mode .checkpoint-interrogate-button {
  filter: brightness(1.1);
}

.app-shell.tutorial-call-focus .checkpoint-scene > :not(.checkpoint-monitor),
.app-shell.tutorial-decision-focus .checkpoint-scene > :not(.checkpoint-monitor),
.app-shell.tutorial-interrogate-focus .checkpoint-scene > :not(.checkpoint-interrogate-button),
.app-shell.tutorial-escort-focus .checkpoint-scene > :not(.checkpoint-escort-button) {
  filter: grayscale(0.9) brightness(0.46);
  transition: filter 180ms ease;
}

.app-shell.tutorial-call-focus .checkpoint-monitor,
.app-shell.tutorial-decision-focus .checkpoint-monitor {
  z-index: 12;
  filter: none;
}

.app-shell.tutorial-call-focus .checkpoint-monitor .monitor-action:not(.next) {
  opacity: 0.3;
  filter: grayscale(1) brightness(0.48);
  pointer-events: none;
}

.app-shell.tutorial-call-focus .checkpoint-monitor .monitor-action.next {
  animation: tutorialCallButtonPulse 1.25s ease-in-out infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 14px 18px rgba(255, 255, 255, 0.04),
    0 0 0 2px rgba(255, 230, 158, 0.25),
    0 0 28px rgba(255, 202, 88, 0.5),
    0 0 54px rgba(255, 202, 88, 0.28);
}

.app-shell.tutorial-decision-focus .checkpoint-monitor .monitor-action.next {
  opacity: 0.3;
  filter: grayscale(1) brightness(0.48);
  pointer-events: none;
}

.app-shell.tutorial-decision-focus .checkpoint-monitor .monitor-action.approve,
.app-shell.tutorial-decision-focus .checkpoint-monitor .monitor-action.reject {
  animation: tutorialDecisionButtonPulse 1.25s ease-in-out infinite;
}

.app-shell.tutorial-decision-focus .checkpoint-monitor .monitor-action.approve {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 14px 18px rgba(255, 255, 255, 0.04),
    0 0 0 2px rgba(163, 255, 187, 0.24),
    0 0 26px rgba(91, 239, 148, 0.48),
    0 0 50px rgba(91, 239, 148, 0.24);
}

.app-shell.tutorial-decision-focus .checkpoint-monitor .monitor-action.reject {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 14px 18px rgba(255, 255, 255, 0.04),
    0 0 0 2px rgba(255, 174, 174, 0.22),
    0 0 26px rgba(255, 87, 87, 0.44),
    0 0 50px rgba(255, 87, 87, 0.22);
}

.app-shell.tutorial-interrogate-focus .checkpoint-interrogate-button {
  z-index: 14;
  animation: tutorialInterrogateButtonPulse 1.2s ease-in-out infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 199, 0.18),
    0 0 0 2px rgba(255, 236, 172, 0.26),
    0 0 26px rgba(255, 221, 116, 0.46),
    0 0 52px rgba(255, 221, 116, 0.22);
}

.app-shell.tutorial-escort-focus .checkpoint-escort-button {
  z-index: 14;
  animation: tutorialInterrogateButtonPulse 1.2s ease-in-out infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 199, 0.18),
    0 0 0 2px rgba(255, 236, 172, 0.28),
    0 0 28px rgba(255, 221, 116, 0.5),
    0 0 56px rgba(255, 221, 116, 0.28);
}

.app-shell.tutorial-passport-focus .topbar,
.app-shell.tutorial-passport-focus .booth-panel,
.app-shell.tutorial-passport-focus .documents-panel > :not(.document-stack),
.app-shell.tutorial-passport-focus .document-stack > .document:not(.passport) {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-passport-focus .document.passport {
  position: relative;
  z-index: 28;
  filter: none;
  animation: tutorialPassportPulse 1.35s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 236, 172, 0.28),
    0 0 28px rgba(255, 221, 116, 0.4),
    0 0 58px rgba(255, 221, 116, 0.22);
  cursor: pointer;
}

.app-shell.tutorial-rulebook-focus .topbar,
.app-shell.tutorial-rulebook-focus .booth-panel,
.app-shell.tutorial-rulebook-focus .documents-panel > :not(.notes-utility-stack),
.app-shell.tutorial-rulebook-focus .notes-utility-stack > :not(.rulebook-dock-panel) {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-rulebook-focus .rulebook-dock-panel {
  position: relative;
  z-index: 30;
  filter: none;
}

.app-shell.tutorial-rulebook-focus .rulebook-dock-panel .rulebook-button {
  animation: tutorialPassportPulse 1.35s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 236, 172, 0.3),
    0 0 28px rgba(255, 221, 116, 0.42),
    0 0 58px rgba(255, 221, 116, 0.24);
}

.app-shell.tutorial-wanted-focus .topbar,
.app-shell.tutorial-wanted-focus .booth-panel,
.app-shell.tutorial-wanted-focus .documents-panel > :not(.notes-utility-stack),
.app-shell.tutorial-wanted-focus .notes-utility-stack > :not(.rulebook-dock-panel),
.app-shell.tutorial-wanted-focus .rulebook-dock-panel > :not(.wanted-button) {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-wanted-focus .rulebook-dock-panel {
  position: relative;
  z-index: 30;
  filter: none;
}

.app-shell.tutorial-wanted-focus .wanted-button {
  position: relative;
  z-index: 31;
  animation: tutorialPassportPulse 1.35s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 190, 151, 0.32),
    0 0 28px rgba(220, 92, 58, 0.46),
    0 0 58px rgba(255, 160, 104, 0.24);
}

.app-shell.tutorial-permit-focus .topbar,
.app-shell.tutorial-permit-focus .booth-panel,
.app-shell.tutorial-permit-focus .documents-panel > :not(.document-stack),
.app-shell.tutorial-permit-focus .document-stack > .document:not(.permit) {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-permit-focus .document.permit {
  position: relative;
  z-index: 28;
  filter: none;
  animation: tutorialPassportPulse 1.35s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 236, 172, 0.28),
    0 0 28px rgba(255, 221, 116, 0.4),
    0 0 58px rgba(255, 221, 116, 0.22);
}

.app-shell.tutorial-permit-stamp-focus .topbar,
.app-shell.tutorial-permit-stamp-focus .booth-panel,
.app-shell.tutorial-permit-stamp-focus .documents-panel > :not(.document-stack),
.app-shell.tutorial-permit-stamp-focus .document-stack > .document:not(.permit),
.app-shell.tutorial-permit-stamp-focus .document.permit .document-header,
.app-shell.tutorial-permit-stamp-focus .document.permit .permit-fields {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-permit-stamp-focus .document.permit {
  position: relative;
  z-index: 28;
}

.app-shell.tutorial-permit-stamp-focus .permit-stamp {
  position: absolute;
  z-index: 32;
  animation: tutorialPassportPulse 1.2s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 236, 172, 0.32),
    0 0 28px rgba(255, 221, 116, 0.46),
    0 0 58px rgba(255, 221, 116, 0.25);
  cursor: pointer;
}

.app-shell.tutorial-citizen-focus .topbar,
.app-shell.tutorial-citizen-focus .booth-panel,
.app-shell.tutorial-citizen-focus .documents-panel > :not(.document-stack),
.app-shell.tutorial-citizen-focus .document-stack > .document:not(.support) {
  filter: grayscale(0.9) brightness(0.42);
  transition: filter 180ms ease;
  pointer-events: none;
}

.app-shell.tutorial-citizen-focus .document.support {
  position: relative;
  z-index: 28;
  filter: none;
  animation: tutorialPassportPulse 1.35s ease-in-out infinite;
  box-shadow:
    0 0 0 2px rgba(255, 236, 172, 0.28),
    0 0 28px rgba(255, 221, 116, 0.4),
    0 0 58px rgba(255, 221, 116, 0.22);
}

@keyframes tutorialCallButtonPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1.08);
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.28);
  }
}

@keyframes tutorialDecisionButtonPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1.06);
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.22);
  }
}

@keyframes tutorialInterrogateButtonPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1.08);
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.28);
  }
}

@keyframes tutorialPassportPulse {
  0%,
  100% {
    transform: translateY(0);
    filter: brightness(1.02);
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.14);
  }
}

.checkpoint-monitor {
  position: absolute;
  left: 48.2%;
  right: 9.6%;
  bottom: 16.8%;
  height: 14.9%;
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, 0.83fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  z-index: 3;
  isolation: isolate;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(205, 203, 191, 0.08), rgba(160, 159, 148, 0.1));
  box-shadow:
    inset 0 0 0 1px rgba(220, 216, 195, 0.16),
    inset 0 16px 22px rgba(255, 255, 255, 0.03),
    0 8px 18px rgba(0, 0, 0, 0.12);
}

.checkpoint-monitor::before,
.checkpoint-monitor::after {
  content: "";
  position: absolute;
  background: rgba(226, 221, 196, 0.22);
  pointer-events: none;
  z-index: 0;
}

.checkpoint-monitor::before {
  top: 8px;
  bottom: 8px;
  left: 58.5%;
  width: 1px;
}

.checkpoint-monitor::after {
  left: 8px;
  right: 41.5%;
  top: calc(50% - 0.5px);
  height: 1px;
}

.monitor-action {
  --monitor-ink: #f5f8f2;
  --monitor-fill-top: rgba(111, 134, 101, 0.94);
  --monitor-fill-bottom: rgba(55, 68, 50, 0.96);
  --monitor-border: rgba(215, 235, 207, 0.22);
  --monitor-glow: rgba(122, 224, 152, 0.22);
  --monitor-corner: rgba(167, 255, 193, 0.88);
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 10px 8px;
  border: 1px solid var(--monitor-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, var(--monitor-fill-top), var(--monitor-fill-bottom));
  font-size: 0.82rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  white-space: normal;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--monitor-ink);
  text-shadow:
    0 0 10px var(--monitor-glow),
    0 0 18px rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 14px 18px rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 8px 14px rgba(0, 0, 0, 0.18),
    0 0 16px var(--monitor-glow);
  overflow: hidden;
  isolation: isolate;
}

.monitor-action::before,
.monitor-action::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.monitor-action::before {
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px);
  opacity: 0.65;
  mix-blend-mode: screen;
}

.monitor-action::after {
  inset: 7px;
  border-radius: 10px;
  background:
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) left top / 22px 3px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) left top / 3px 22px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) right top / 22px 3px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) right top / 3px 22px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) left bottom / 22px 3px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) left bottom / 3px 22px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) right bottom / 22px 3px no-repeat,
    linear-gradient(var(--monitor-corner), var(--monitor-corner)) right bottom / 3px 22px no-repeat;
  opacity: 0.92;
}

.monitor-action.approve {
  --monitor-fill-top: rgba(30, 104, 63, 0.96);
  --monitor-fill-bottom: rgba(10, 47, 30, 0.98);
  --monitor-border: rgba(160, 255, 188, 0.28);
  --monitor-glow: rgba(94, 235, 152, 0.28);
  --monitor-corner: rgba(142, 255, 183, 0.96);
  grid-column: 1;
  grid-row: 1;
}

.monitor-action.reject {
  --monitor-fill-top: rgba(125, 37, 37, 0.96);
  --monitor-fill-bottom: rgba(63, 15, 17, 0.98);
  --monitor-border: rgba(255, 177, 177, 0.24);
  --monitor-glow: rgba(255, 87, 87, 0.28);
  --monitor-corner: rgba(255, 163, 163, 0.96);
  grid-column: 1;
  grid-row: 2;
}

.monitor-action.next {
  --monitor-fill-top: rgba(126, 106, 49, 0.95);
  --monitor-fill-bottom: rgba(74, 54, 23, 0.98);
  --monitor-border: rgba(255, 228, 164, 0.24);
  --monitor-glow: rgba(233, 186, 86, 0.22);
  --monitor-corner: rgba(255, 227, 150, 0.92);
  grid-column: 2;
  grid-row: 1 / span 2;
}

.desk-doll {
  position: absolute;
  left: 49%;
  bottom: 7%;
  z-index: 6;
  width: clamp(54px, 10vw, 86px);
  transform: translateX(-50%) rotate(-4deg);
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45));
}

.desk-doll.hidden {
  display: none;
}

.desk-motorbike {
  position: absolute;
  left: 25.2%;
  bottom: 2.8%;
  z-index: 6;
  width: clamp(96px, 15.6vw, 148px);
  transform: translateX(-50%) rotate(-5deg);
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.48));
}

.desk-motorbike.hidden {
  display: none;
}

.desk-cube {
  position: absolute;
  left: 39.4%;
  bottom: 3.2%;
  z-index: 6;
  width: clamp(51px, 9.5vw, 79px);
  transform: translateX(-50%) rotate(-7deg);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.42));
}

.desk-cube.hidden {
  display: none;
}

.terminal-label {
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(36, 36, 20, 0.72);
}

.scan-grid {
  display: grid;
  gap: 6px;
  margin: 0;
}

.scan-grid div {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px dashed rgba(36, 36, 20, 0.46);
}

.scan-grid dt,
.scan-grid dd {
  margin: 0;
}

.scan-grid dt {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.scan-grid dd {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.94em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#scanName,
#scanId {
  font-size: 0.88em;
  letter-spacing: 0.01em;
}

.bulletin-card h2,
.window-card {
  display: none;
}

.window-card h2 {
  margin: 8px 0 10px;
}

.rule-list,
.hint-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-main);
}

.rule-list li,
.hint-list li {
  margin-bottom: 8px;
}

.window-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.queue-pill {
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-align: right;
}

.queue-pill strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.statement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.statement-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.statement-panel p:last-child {
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.decision-button,
.overlay-button,
.overlay-secondary-button,
.overlay-choice {
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease, background 140ms ease;
}

.decision-button:hover,
.overlay-button:hover,
.overlay-secondary-button:hover,
.overlay-choice:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.decision-button:disabled,
.overlay-choice:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  filter: none;
}

.rulebook-button:disabled,
.checkpoint-dev-button:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
  filter: none;
}

.decision-button.approve {
  background: linear-gradient(180deg, #7b9b69, #57704b);
  color: #f1f5eb;
}

.decision-button.reject {
  background: linear-gradient(180deg, #c05c4d, #913628);
  color: #fff2ef;
}

.decision-button.interrogate {
  background: linear-gradient(180deg, #7f7a5e, #605b44);
  color: #f9f3de;
}

.decision-button.next,
.overlay-button {
  background: linear-gradient(180deg, #d1a55f, #a87b3d);
  color: #24180a;
}

.notes-utility-stack {
  display: grid;
  gap: 14px;
}

.notes-utility-stack .verdict-card,
.notes-utility-stack .rulebook-dock {
  margin-top: 0;
}

.rulebook-dock-panel .rulebook-button {
  width: 100%;
  justify-content: flex-start;
}

.rulebook-dock-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.rulebook-dock-panel > .rulebook-panel {
  grid-column: 1 / -1;
}

.verdict-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.18);
}

.verdict-card h3 {
  margin: 6px 0 8px;
}

.verdict-card.neutral {
  border-color: rgba(145, 158, 158, 0.2);
}

.verdict-card.good {
  border-color: rgba(107, 139, 93, 0.45);
  background: rgba(107, 139, 93, 0.12);
}

.verdict-card.bad {
  border-color: rgba(175, 71, 55, 0.45);
  background: rgba(175, 71, 55, 0.12);
}

.rulebook-dock {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.rulebook-button {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(208, 163, 93, 0.36);
  background: rgba(13, 14, 11, 0.64);
  color: var(--text-main);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rulebook-button:hover,
.rulebook-button[aria-expanded="true"] {
  border-color: rgba(208, 163, 93, 0.72);
  background: rgba(208, 163, 93, 0.16);
}

.rulebook-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(255, 235, 179, 0.95), rgba(168, 123, 61, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(45, 37, 24, 0.1) 6px 7px);
  color: #24180a;
  font-size: 0.68rem;
  box-shadow: inset 0 0 0 1px rgba(36, 24, 10, 0.24);
}

.rulebook-panel {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(208, 163, 93, 0.26);
  background:
    linear-gradient(180deg, rgba(20, 19, 14, 0.92), rgba(10, 11, 9, 0.92)),
    rgba(0, 0, 0, 0.2);
}

.rulebook-panel.hidden {
  display: none;
}

.rulebook-panel h3 {
  margin: 6px 0 10px;
}

.rulebook-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-main);
  line-height: 1.6;
}

.rulebook-list li + li {
  margin-top: 6px;
}

.wanted-button {
  border-color: rgba(168, 88, 65, 0.4);
}

.wanted-button:hover,
.wanted-button[aria-expanded="true"] {
  border-color: rgba(191, 90, 60, 0.78);
  background: rgba(140, 50, 32, 0.16);
}

.wanted-icon {
  background:
    linear-gradient(135deg, rgba(255, 216, 184, 0.96), rgba(158, 74, 51, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(60, 22, 15, 0.12) 6px 7px);
  color: #31140d;
}

.special-collection-button {
  border-color: rgba(82, 117, 92, 0.42);
}

.special-collection-dock-card {
  display: grid;
  gap: 14px;
  border-color: rgba(129, 170, 138, 0.18);
  background:
    linear-gradient(180deg, rgba(34, 46, 36, 0.96), rgba(18, 25, 19, 0.98)),
    rgba(20, 26, 22, 0.92);
}

.special-collection-dock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.special-collection-dock-head h3 {
  margin: 6px 0 0;
}

.special-collection-dock-note,
.special-collection-panel-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.special-collection-launch {
  width: 100%;
  justify-content: flex-start;
}

.special-collection-window-shell {
  display: grid;
  gap: 16px;
}

.special-collection-window-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.special-collection-window-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 18px;
  align-items: start;
}

.special-collection-window-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.special-collection-window-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(128, 171, 139, 0.22);
  background: rgba(60, 87, 64, 0.18);
  color: #d8eed3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.special-collection-window-count {
  flex: 0 0 auto;
}

.special-collection-sort-button {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(128, 171, 139, 0.26);
  background: rgba(27, 39, 29, 0.72);
  color: #dff0d7;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.special-collection-sort-button:hover,
.special-collection-sort-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(169, 212, 173, 0.6);
  background: rgba(56, 82, 60, 0.78);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.special-collection-sort-button.active {
  border-color: rgba(192, 234, 195, 0.8);
  background:
    linear-gradient(180deg, rgba(103, 143, 108, 0.62), rgba(48, 77, 54, 0.84)),
    rgba(37, 57, 40, 0.86);
  color: #f4fff0;
}

.special-collection-button:hover,
.special-collection-button[aria-expanded="true"] {
  border-color: rgba(130, 176, 145, 0.72);
  background: rgba(55, 96, 68, 0.16);
}

.special-collection-icon {
  background:
    linear-gradient(135deg, rgba(218, 244, 208, 0.96), rgba(88, 138, 99, 0.92)),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.68), transparent 55%);
  color: #163121;
}

.wanted-panel {
  padding: 18px;
}

.wanted-poster-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.wanted-empty-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(207, 168, 111, 0.34);
  background: rgba(255, 236, 205, 0.06);
  color: rgba(247, 231, 201, 0.86);
  line-height: 1.6;
}

.special-collection-panel {
  padding: 18px;
  border-color: rgba(128, 171, 139, 0.2);
  background:
    linear-gradient(180deg, rgba(16, 24, 19, 0.92), rgba(10, 16, 11, 0.94)),
    rgba(0, 0, 0, 0.22);
}

.special-collection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.special-collection-header h3 {
  margin: 6px 0 0;
}

.special-collection-panel > h3 {
  margin-bottom: 0;
}

.special-collection-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(128, 171, 139, 0.28);
  background: rgba(83, 110, 83, 0.18);
  color: #dff3d9;
  font-size: 0.9rem;
  font-weight: 700;
}

.special-collection-panel-note {
  margin-bottom: 14px;
}

.special-collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.special-collection-window-list {
  align-content: start;
}

.special-collection-country-groups {
  display: grid;
  gap: 18px;
}

.special-collection-country-group {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(128, 171, 139, 0.18);
  background:
    linear-gradient(180deg, rgba(26, 38, 29, 0.66), rgba(14, 21, 15, 0.76)),
    rgba(0, 0, 0, 0.18);
}

.special-collection-country-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.special-collection-country-group-header h4 {
  margin: 6px 0 0;
  font-size: 1.1rem;
}

.special-collection-country-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(128, 171, 139, 0.24);
  background: rgba(83, 110, 83, 0.16);
  color: #dff3d9;
  font-weight: 700;
}

.special-collection-country-group-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.special-collection-card {
  appearance: none;
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(213, 189, 140, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 234, 0.08), rgba(255, 250, 234, 0.02)),
    rgba(20, 24, 28, 0.3);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.special-collection-card.unlocked {
  border-color: rgba(135, 179, 138, 0.3);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.18);
}

.special-collection-card.unlocked:hover,
.special-collection-card.unlocked:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(160, 208, 170, 0.6);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.24);
}

.special-collection-card.selected {
  border-color: rgba(183, 226, 181, 0.72);
  background:
    linear-gradient(180deg, rgba(110, 154, 114, 0.22), rgba(255, 250, 234, 0.04)),
    rgba(21, 31, 24, 0.44);
  box-shadow:
    inset 0 0 0 1px rgba(232, 252, 228, 0.12),
    0 22px 32px rgba(0, 0, 0, 0.26);
}

.special-collection-card.locked {
  border-style: dashed;
  border-color: rgba(163, 171, 160, 0.2);
  background:
    linear-gradient(180deg, rgba(210, 220, 212, 0.05), rgba(210, 220, 212, 0.02)),
    rgba(20, 24, 28, 0.22);
}

.special-collection-card:disabled {
  cursor: default;
}

.special-collection-card h4 {
  margin: 0;
  font-size: 1.08rem;
}

.special-collection-card-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.special-collection-meta,
.special-collection-note {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.special-collection-note {
  min-height: 2.9em;
}

.special-collection-portrait {
  position: relative;
  overflow: hidden;
  min-height: 182px;
  border-radius: 18px;
  border: 1px solid rgba(213, 189, 140, 0.18);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(69, 82, 72, 0.72), rgba(27, 34, 39, 0.92));
}

.special-collection-portrait.custom-photo {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(96, 112, 101, 0.62), rgba(30, 38, 44, 0.94));
}

.special-collection-portrait.avatar {
  isolation: isolate;
}

.special-collection-portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.special-collection-portrait.locked {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(233, 227, 204, 0.08) 0 12px,
      rgba(120, 125, 123, 0.08) 12px 24px
    ),
    linear-gradient(180deg, rgba(48, 56, 62, 0.9), rgba(23, 29, 33, 0.96));
  color: rgba(255, 245, 214, 0.7);
  text-align: center;
}

.special-collection-lock-label {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.special-collection-portrait.locked strong {
  font-size: 1.3rem;
}

.special-collection-detail-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(128, 171, 139, 0.22);
  background:
    linear-gradient(180deg, rgba(22, 31, 24, 0.94), rgba(11, 17, 12, 0.96)),
    rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.special-collection-detail-panel.empty {
  align-content: start;
}

.special-collection-detail-panel h3 {
  margin: 6px 0 0;
}

.special-collection-detail-empty {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.special-collection-detail-header {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.special-collection-detail-portrait-wrap .special-collection-portrait {
  min-height: 228px;
}

.special-collection-detail-heading {
  display: grid;
  gap: 8px;
}

.special-collection-detail-meta,
.special-collection-detail-submeta {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.special-collection-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.special-collection-detail-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(213, 189, 140, 0.16);
  background: rgba(255, 251, 237, 0.05);
}

.special-collection-detail-stat span {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.special-collection-detail-stat strong {
  color: var(--text-main);
  font-size: 1rem;
}

.special-collection-detail-sections {
  display: grid;
  gap: 12px;
}

.special-collection-detail-section {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(213, 189, 140, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.special-collection-detail-label {
  margin: 0;
  color: #d9efda;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.special-collection-detail-body {
  color: var(--text-main);
  line-height: 1.7;
}

.special-collection-detail-empty-copy {
  color: var(--text-muted);
}

.wanted-poster {
  display: grid;
}

.wanted-poster-sheet {
  --wanted-photo-left: 46.8%;
  --wanted-photo-top: 25.7%;
  --wanted-photo-width: 42.9%;
  --wanted-photo-height: 37.6%;
  position: relative;
  isolation: isolate;
  min-height: 0;
  aspect-ratio: 512 / 768;
  background: url("./assets/wanted-poster-template.png") center / cover no-repeat;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28));
}

.wanted-poster-sheet::after {
  content: "";
  position: absolute;
  left: var(--wanted-photo-left);
  top: var(--wanted-photo-top);
  width: var(--wanted-photo-width);
  height: var(--wanted-photo-height);
  border: 1px solid rgba(92, 62, 43, 0.28);
  box-shadow:
    inset 0 0 0 2px rgba(126, 92, 62, 0.24),
    inset 0 18px 22px rgba(255, 244, 226, 0.08);
  pointer-events: none;
  z-index: 1;
}

.wanted-status-chip {
  position: absolute;
  right: 5%;
  top: 5.2%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(70, 31, 18, 0.2);
  background: rgba(74, 31, 18, 0.82);
  color: #f8e2b8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  z-index: 2;
}

.wanted-poster.active .wanted-status-chip {
  background: rgba(87, 41, 20, 0.84);
  color: #ffe0a9;
}

.wanted-poster.caught .wanted-status-chip {
  background: rgba(46, 92, 54, 0.84);
  color: #e7ffd6;
}

.wanted-poster.escaped .wanted-status-chip {
  background: rgba(130, 37, 37, 0.84);
  color: #ffe0df;
}

.wanted-name-value,
.wanted-alias-value,
.wanted-crime-value,
.wanted-country-value {
  position: absolute;
  left: 10.8%;
  right: 59.2%;
  color: #3b2015;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.14;
  text-shadow: 0 1px 0 rgba(255, 248, 236, 0.25);
  overflow-wrap: break-word;
  word-break: keep-all;
  z-index: 2;
}

.wanted-name-value {
  top: 29.1%;
  min-height: 11.5%;
  font-size: clamp(0.8rem, 1.56vw, 0.93rem);
}

.wanted-alias-value {
  top: 51.2%;
  min-height: 11.4%;
  font-size: clamp(0.78rem, 1.5vw, 0.9rem);
}

.wanted-crime-value {
  top: 70.8%;
  left: 10.2%;
  right: 10.8%;
  min-height: 11.8%;
  font-size: clamp(0.79rem, 1.52vw, 0.91rem);
}

.wanted-country-value {
  top: 81.9%;
  left: 41.8%;
  right: 11.6%;
  font-size: clamp(0.8rem, 1.52vw, 0.92rem);
}

.wanted-portrait {
  position: absolute;
  left: var(--wanted-photo-left);
  top: var(--wanted-photo-top);
  width: var(--wanted-photo-width);
  height: var(--wanted-photo-height);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.16), transparent 54%),
    linear-gradient(180deg, rgba(74, 55, 45, 0.28), rgba(33, 24, 20, 0.18));
  box-shadow: inset 0 0 0 2px rgba(121, 87, 58, 0.22);
  filter: saturate(0.94) brightness(0.96);
  z-index: 0;
}

.wanted-photo-shoulders {
  position: absolute;
  left: 9.5%;
  right: 9.5%;
  bottom: -12.5%;
  height: 72%;
  z-index: 1;
  border-radius: 48% 48% 9% 9% / 40% 40% 10% 10%;
  background:
    linear-gradient(135deg, rgba(255, 239, 182, 0.82) 0 13%, transparent 13% 38%, rgba(255, 239, 182, 0.82) 38% 51%, transparent 51% 100%),
    var(--coat, #5b665e);
}

.wanted-photo-neck {
  position: absolute;
  left: 39.5%;
  top: 36.4%;
  width: 21%;
  height: 24.5%;
  z-index: 0;
  border-radius: 12px;
  background: var(--skin, #d1ad84);
  box-shadow: inset -4px 0 0 rgba(114, 76, 51, 0.32);
}

.wanted-photo-head {
  position: absolute;
  left: 23.5%;
  top: 4.8%;
  width: 52.5%;
  height: 37.8%;
  z-index: 2;
  border-radius: 36% 36% 42% 42%;
  background: var(--skin, #d1ad84);
  box-shadow: inset -6px 0 0 rgba(114, 76, 51, 0.32);
}

.wanted-photo-hair {
  position: absolute;
  inset: -5% 0 46.5% 0;
  border-radius: 34% 34% 20% 20%;
  background: var(--hair, #443027);
  box-shadow: inset -10px 0 0 rgba(0, 0, 0, 0.14);
}

.wanted-photo-eye,
.wanted-photo-mouth {
  position: absolute;
  background: rgba(31, 21, 18, 0.92);
}

.wanted-photo-eye {
  top: 44%;
  width: 10%;
  height: 5%;
  border-radius: 999px;
}

.wanted-photo-eye.left {
  left: 26%;
}

.wanted-photo-eye.right {
  right: 26%;
}

.wanted-photo-mouth {
  left: 37%;
  right: 37%;
  bottom: 19%;
  height: 4%;
  border-radius: 999px;
  opacity: 0.72;
}

.stamp-layer {
  position: relative;
  height: 0;
  pointer-events: none;
}

.stamp-mark {
  --stamp-entry-x: 24px;
  --stamp-entry-y: -132px;
  --stamp-hit-x: 0px;
  --stamp-hit-y: 18px;
  --stamp-rebound-x: 0px;
  --stamp-rebound-y: -7px;
  --stamp-settle-x: 0px;
  --stamp-settle-y: 3px;
  --stamp-final-x: 0px;
  --stamp-final-y: 0px;
  --stamp-tilt-start: -18deg;
  --stamp-tilt-land: -12deg;
  --stamp-origin-x: 72%;
  --stamp-origin-y: 78%;
  position: absolute;
  top: -18px;
  right: 4px;
  width: clamp(138px, 18vw, 196px);
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: translate(var(--stamp-entry-x), var(--stamp-entry-y)) rotate(var(--stamp-tilt-start)) scale(1.86);
  transform-origin: var(--stamp-origin-x) var(--stamp-origin-y);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 118%;
  filter: blur(8px) brightness(1.12) drop-shadow(0 18px 14px rgba(0, 0, 0, 0.24));
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.stamp-mark::before,
.stamp-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stamp-mark::before {
  left: 20%;
  right: 20%;
  top: auto;
  bottom: 13%;
  height: 20%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.34), transparent 72%);
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.3);
}

.stamp-mark::after {
  inset: 18%;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.18);
  mix-blend-mode: screen;
}

.stamp-mark.show {
  animation: stamp-pop 640ms cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}

.stamp-mark.show::before {
  animation: stamp-shadow-pop 640ms ease-out forwards;
}

.stamp-mark.show::after {
  animation: stamp-ink-burst 640ms ease-out forwards;
}

.stamp-mark.approve {
  background-image: url("assets/approved-stamp.png");
  --stamp-entry-x: 36px;
  --stamp-entry-y: -146px;
  --stamp-hit-x: -6px;
  --stamp-hit-y: 15px;
  --stamp-rebound-x: -3px;
  --stamp-rebound-y: -8px;
  --stamp-settle-x: -2px;
  --stamp-settle-y: 2px;
  --stamp-final-x: -2px;
  --stamp-final-y: 0px;
  --stamp-tilt-start: -23deg;
  --stamp-tilt-land: -11deg;
  --stamp-origin-x: 75%;
  --stamp-origin-y: 80%;
}

.stamp-mark.approve::after {
  background: radial-gradient(circle, rgba(164, 205, 146, 0.34) 0%, rgba(164, 205, 146, 0.18) 38%, transparent 72%);
}

.stamp-mark.reject {
  background-image: url("assets/denied-stamp.png");
  --stamp-entry-x: -10px;
  --stamp-entry-y: -124px;
  --stamp-hit-x: 10px;
  --stamp-hit-y: 21px;
  --stamp-rebound-x: 8px;
  --stamp-rebound-y: -4px;
  --stamp-settle-x: 6px;
  --stamp-settle-y: 4px;
  --stamp-final-x: 6px;
  --stamp-final-y: 1px;
  --stamp-tilt-start: 7deg;
  --stamp-tilt-land: 3deg;
  --stamp-origin-x: 30%;
  --stamp-origin-y: 78%;
}

.stamp-mark.reject::after {
  background: radial-gradient(circle, rgba(229, 122, 111, 0.34) 0%, rgba(229, 122, 111, 0.18) 38%, transparent 72%);
}

@keyframes stamp-pop {
  0% {
    opacity: 0;
    transform: translate(var(--stamp-entry-x), var(--stamp-entry-y)) rotate(var(--stamp-tilt-start)) scale(1.86);
    filter: blur(8px) brightness(1.12) drop-shadow(0 18px 14px rgba(0, 0, 0, 0.24));
  }
  34% {
    opacity: 1;
    transform: translate(var(--stamp-hit-x), var(--stamp-hit-y)) rotate(var(--stamp-tilt-land)) scale(0.88);
    filter: blur(0) brightness(1.1) drop-shadow(0 7px 10px rgba(0, 0, 0, 0.2));
  }
  56% {
    opacity: 0.98;
    transform: translate(var(--stamp-rebound-x), var(--stamp-rebound-y)) rotate(var(--stamp-tilt-land)) scale(1.04);
    filter: brightness(1.04) drop-shadow(0 9px 10px rgba(0, 0, 0, 0.18));
  }
  74% {
    opacity: 0.9;
    transform: translate(var(--stamp-settle-x), var(--stamp-settle-y)) rotate(var(--stamp-tilt-land)) scale(0.98);
    filter: brightness(1) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.16));
  }
  100% {
    opacity: 0.88;
    transform: translate(var(--stamp-final-x), var(--stamp-final-y)) rotate(var(--stamp-tilt-land)) scale(1);
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.16));
  }
}

@keyframes stamp-shadow-pop {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  36% {
    opacity: 0;
    transform: scale(0.42);
  }
  48% {
    opacity: 0.34;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.16;
    transform: scale(0.92);
  }
}

@keyframes stamp-ink-burst {
  0%,
  28% {
    opacity: 0;
    transform: scale(0.18);
  }
  44% {
    opacity: 0.54;
    transform: scale(1.02);
  }
  72% {
    opacity: 0.12;
    transform: scale(1.36);
  }
  100% {
    opacity: 0;
    transform: scale(1.58);
  }
}

.hint-card {
  position: relative;
  overflow: hidden;
}

.hint-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -36px auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(208, 163, 93, 0.18), transparent 70%);
}

.document-stack {
  display: grid;
  gap: 18px;
}

.document {
  position: relative;
  min-height: 240px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--paper), #cbb98a);
  color: var(--paper-ink);
}

.document.passport {
  min-height: 300px;
  transform: rotate(-1.5deg);
}

.document.permit {
  min-height: 460px;
  transform: rotate(1.2deg);
}

.document.support {
  transform: rotate(-0.8deg);
}

.document.empty {
  opacity: 0.78;
}

.document-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.document-header h3 {
  margin: 6px 0 0;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 1.18rem;
}

.document-status {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(45, 37, 24, 0.08);
  color: var(--paper-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.document-body {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.interrogation-clickable {
  outline: none;
}

.app-shell.interrogation-mode .interrogation-clickable {
  cursor: pointer;
}

.app-shell.interrogation-mode .document .interrogation-clickable,
.app-shell.interrogation-mode .wanted-panel .interrogation-clickable {
  border-radius: 10px;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.app-shell.interrogation-mode .document .interrogation-clickable:hover,
.app-shell.interrogation-mode .document .interrogation-clickable:focus-visible,
.app-shell.interrogation-mode .wanted-panel .interrogation-clickable:hover,
.app-shell.interrogation-mode .wanted-panel .interrogation-clickable:focus-visible {
  background: rgba(255, 236, 180, 0.16);
  box-shadow: 0 0 0 2px rgba(212, 167, 87, 0.48);
  transform: translateY(-1px);
}

.app-shell.editor-busy {
  pointer-events: none;
  user-select: none;
}

.app-shell.editor-busy,
.app-shell.editor-busy *,
.app-shell.editor-busy *::before,
.app-shell.editor-busy *::after {
  animation-play-state: paused !important;
}

.document-empty-target {
  display: grid;
  place-items: center;
  text-align: center;
}

.document.passport .document-body {
  margin-top: 14px;
}

.passport-page {
  position: relative;
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(92px, 0.75fr) minmax(0, 1.4fr);
  gap: 18px;
  padding: 18px 18px 34px;
  overflow: hidden;
  border: 1px solid rgba(45, 37, 24, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 224, 0.86), rgba(222, 208, 169, 0.72)),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(45, 37, 24, 0.04) 9px 10px);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 226, 0.62);
}

.passport-page::after {
  content: "";
  position: absolute;
  inset: auto 18px 22px;
  height: 2px;
  border-top: 1px solid rgba(45, 37, 24, 0.28);
  border-bottom: 1px solid rgba(45, 37, 24, 0.12);
}

.passport-photo,
.passport-fields,
.passport-machine-line {
  position: relative;
  z-index: 1;
}

.passport-verdict-stamp {
  top: 32%;
  right: 6%;
  width: clamp(98px, 28%, 146px);
  aspect-ratio: 1 / 1;
  z-index: 2;
  background-size: 132%;
  mix-blend-mode: multiply;
  opacity: 0.82;
}

.empty-passport {
  min-height: 220px;
  grid-template-columns: 1fr;
  place-items: center;
  text-align: center;
}

.passport-photo {
  --skin: #d9a276;
  --hair: #2b1a14;
  --coat: #4a5c4b;
  --collar: #d5c499;
  position: relative;
  align-self: start;
  min-height: 142px;
  border: 3px solid rgba(45, 37, 24, 0.44);
  background:
    linear-gradient(180deg, rgba(233, 231, 204, 0.94), rgba(186, 187, 164, 0.86)),
    repeating-linear-gradient(90deg, rgba(45, 37, 24, 0.04) 0 2px, transparent 2px 8px);
  box-shadow: 8px 10px 0 rgba(45, 37, 24, 0.12);
}

.passport-photo-head {
  position: absolute;
  left: 50%;
  top: 22%;
  width: 42%;
  aspect-ratio: 0.82;
  transform: translateX(-50%);
  border-radius: 44% 44% 48% 48%;
  background: var(--skin);
  border: 2px solid rgba(29, 24, 15, 0.46);
  z-index: 3;
}

.passport-photo-hair {
  position: absolute;
  inset: -14% -12% 56%;
  border-radius: 48% 48% 22% 22%;
  background: var(--hair);
}

.passport-photo-eye {
  position: absolute;
  top: 44%;
  width: 10%;
  height: 8%;
  border-radius: 50%;
  background: #161410;
}

.passport-photo-eye.left {
  left: 30%;
}

.passport-photo-eye.right {
  right: 30%;
}

.passport-photo-mouth {
  position: absolute;
  left: 38%;
  right: 38%;
  bottom: 23%;
  height: 4%;
  border-radius: 999px;
  background: rgba(64, 29, 25, 0.72);
}

.passport-photo-neck {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 17%;
  height: 15%;
  transform: translateX(-50%);
  background: var(--skin);
  z-index: 2;
}

.passport-photo-shoulders {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 76%;
  height: 36%;
  transform: translateX(-50%);
  border-radius: 44% 44% 14% 14%;
  background:
    linear-gradient(130deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(230deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(180deg, var(--coat), #2f362f);
  border: 3px solid rgba(25, 22, 16, 0.42);
  z-index: 1;
}

.passport-fields {
  display: grid;
  gap: 8px;
}

.passport-field {
  display: grid;
  gap: 3px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(45, 37, 24, 0.34);
}

.passport-field span {
  color: var(--paper-muted);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.passport-field strong {
  min-height: 1.1em;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.passport-machine-line {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  margin: 0;
  overflow: hidden;
  color: rgba(53, 58, 78, 0.78);
  font-family: "Lucida Console", "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.document.permit .document-body {
  margin-top: 14px;
}

.permit-sheet {
  position: relative;
  aspect-ratio: 512 / 768;
  width: min(88%, 360px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(247, 226, 182, 0.1), rgba(152, 102, 55, 0.08)),
    url("assets/entry-permit-template.png");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(60, 34, 17, 0.14);
}

.permit-empty-space {
  aspect-ratio: 512 / 768;
  width: min(88%, 360px);
  margin: 0 auto;
  border-radius: 14px;
}

.permit-fields {
  position: absolute;
  top: 18%;
  left: 17%;
  right: 15%;
  bottom: 24%;
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  gap: 10px;
}

.permit-line {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: end;
  padding: 0 6px 5px 6px;
  border-bottom: 1px dashed rgba(87, 58, 30, 0.42);
}

.permit-line span {
  color: rgba(86, 56, 29, 0.82);
  font-size: 0.61rem;
  letter-spacing: 0.04em;
}

.permit-line strong {
  color: rgba(37, 24, 11, 0.94);
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 247, 225, 0.26);
}

.permit-stamp {
  position: absolute;
  right: 9%;
  bottom: 13%;
  z-index: 2;
}

.permit-stamp.official {
  width: 27%;
  max-width: 112px;
  object-fit: contain;
  opacity: 0.74;
  filter: saturate(0.92) contrast(1.05);
  mix-blend-mode: multiply;
  transform: rotate(-8deg);
}

.permit-stamp.forged {
  width: 25%;
  max-width: 102px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 4px double rgba(149, 43, 30, 0.76);
  border-radius: 50%;
  color: rgba(149, 43, 30, 0.82);
  background: rgba(255, 243, 233, 0.14);
  text-align: center;
  line-height: 1.05;
  mix-blend-mode: multiply;
  transform: rotate(9deg);
}

.permit-stamp.forged span {
  font-size: 0.56rem;
  letter-spacing: 0.08em;
}

.permit-stamp.forged strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.permit-stamp.interrogation-stamp-placeholder {
  width: 25%;
  max-width: 102px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 3px dashed rgba(122, 72, 32, 0.5);
  border-radius: 50%;
  color: rgba(97, 56, 24, 0.74);
  background: rgba(255, 237, 211, 0.18);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  transform: rotate(-8deg);
}

.document.support .document-body {
  margin-top: 14px;
}

.citizen-sheet {
  position: relative;
  aspect-ratio: 1152 / 768;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(26, 45, 102, 0.12), rgba(6, 17, 48, 0.1)),
    url("assets/citizen-id-template.png");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(224, 236, 255, 0.14);
}

.citizen-sheet::before {
  content: "";
  position: absolute;
  left: 9.4%;
  top: 32.4%;
  width: 20.9%;
  aspect-ratio: 0.81;
  transform: translateX(16%) scaleX(1.04);
  transform-origin: center;
  border-radius: 8px;
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.08),
    inset 3px 0 6px rgba(255, 255, 255, 0.04),
    inset 0 -6px 8px rgba(41, 57, 94, 0.1),
    inset -4px 0 6px rgba(41, 57, 94, 0.07);
  pointer-events: none;
  z-index: 2;
}

.citizen-empty-space {
  aspect-ratio: 1152 / 768;
  width: 100%;
  border-radius: 16px;
}

.citizen-photo {
  --skin: #d9a276;
  --hair: #2b1a14;
  --coat: #4a5c4b;
  --collar: #d5c499;
  position: absolute;
  left: 9.1%;
  top: 32.4%;
  width: 20.9%;
  aspect-ratio: 0.81;
  transform: translateX(16%) scaleX(1.04);
  transform-origin: center;
  overflow: hidden;
  border-radius: 8px;
  clip-path: inset(0 0 5% 0 round 8px);
  background:
    linear-gradient(180deg, rgba(230, 237, 248, 0.94), rgba(169, 183, 209, 0.9)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%);
  filter: saturate(0.9) contrast(0.96);
  z-index: 1;
}

.citizen-photo-head {
  position: absolute;
  left: 50%;
  top: 21%;
  width: 44%;
  aspect-ratio: 0.82;
  transform: translateX(-50%);
  border-radius: 44% 44% 48% 48%;
  background: var(--skin);
  border: 2px solid rgba(29, 24, 15, 0.46);
  z-index: 3;
}

.citizen-photo-hair {
  position: absolute;
  inset: -14% -12% 56%;
  border-radius: 48% 48% 22% 22%;
  background: var(--hair);
}

.citizen-photo-eye {
  position: absolute;
  top: 44%;
  width: 10%;
  height: 8%;
  border-radius: 50%;
  background: #161410;
}

.citizen-photo-eye.left {
  left: 30%;
}

.citizen-photo-eye.right {
  right: 30%;
}

.citizen-photo-mouth {
  position: absolute;
  left: 38%;
  right: 38%;
  bottom: 23%;
  height: 4%;
  border-radius: 999px;
  background: rgba(64, 29, 25, 0.72);
}

.citizen-photo-neck {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 17%;
  height: 15%;
  transform: translateX(-50%);
  background: var(--skin);
  z-index: 2;
}

.citizen-photo-shoulders {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 76%;
  height: 34%;
  transform: translateX(-50%);
  border-radius: 44% 44% 14% 14%;
  background:
    linear-gradient(130deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(230deg, transparent 0 38%, var(--collar) 39% 46%, transparent 47%),
    linear-gradient(180deg, var(--coat), #263238);
  border: 3px solid rgba(25, 22, 16, 0.38);
  z-index: 1;
}

.citizen-fields {
  position: absolute;
  top: 22.2%;
  left: 38.8%;
  right: 8%;
  bottom: 21%;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
  z-index: 3;
}

.citizen-line {
  display: grid;
  gap: 3px;
  align-content: start;
  padding-top: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(214, 227, 255, 0.34);
}

.citizen-line span {
  color: rgba(231, 239, 255, 0.86);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.citizen-line strong {
  color: #ffffff;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.citizen-stamp {
  position: absolute;
  right: 8%;
  bottom: 11%;
  z-index: 3;
}

.citizen-stamp.official {
  width: 16%;
  max-width: 96px;
  object-fit: contain;
  opacity: 0.78;
  mix-blend-mode: screen;
  filter: saturate(0.9) contrast(1.06);
}

.citizen-stamp.forged {
  width: 15%;
  max-width: 88px;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 3px double rgba(172, 62, 62, 0.8);
  color: rgba(172, 62, 62, 0.88);
  background: rgba(255, 235, 235, 0.08);
  text-align: center;
  line-height: 1.05;
  mix-blend-mode: screen;
  transform: rotate(-3deg);
}

.citizen-stamp.forged span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.citizen-stamp.forged strong {
  font-size: 0.52rem;
  letter-spacing: 0.08em;
}

.citizen-stamp.interrogation-stamp-placeholder {
  width: 15%;
  max-width: 88px;
  aspect-ratio: 1.45 / 1;
  display: grid;
  place-items: center;
  padding: 6px 8px;
  border: 2px dashed rgba(219, 230, 255, 0.62);
  color: rgba(232, 241, 255, 0.84);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.document-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(45, 37, 24, 0.18);
}

.document-row span {
  color: var(--paper-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.document-row strong {
  text-align: right;
  font-family: "Lucida Console", "Courier New", monospace;
}

.empty-copy {
  margin: 6px 0 0;
  color: var(--paper-muted);
  line-height: 1.6;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 11, 8, 0.76);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  position: relative;
  width: min(100%, 620px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(41, 43, 35, 0.98), rgba(23, 24, 20, 0.98));
}

.overlay.expanded-panel .overlay-card {
  width: min(100%, 780px);
  max-height: min(92vh, 900px);
  padding: 34px;
}

.overlay.shop-panel .overlay-card {
  width: min(100%, 860px);
  max-height: min(92vh, 920px);
  padding: 32px 32px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(208, 163, 93, 0.78) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.overlay.shop-panel .overlay-card::-webkit-scrollbar {
  width: 9px;
}

.overlay.shop-panel .overlay-card::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.overlay.shop-panel .overlay-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(218, 176, 105, 0.95), rgba(135, 96, 50, 0.95));
}

.overlay.cutscene-panel {
  padding: 0;
  background: #030609;
  backdrop-filter: none;
}

.overlay.cutscene-panel .overlay-card {
  width: 100vw;
  height: 100vh;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #030609;
  box-shadow: none;
}

.overlay.cutscene-panel #overlayLabel,
.overlay.cutscene-panel #overlayTitle,
.overlay.cutscene-panel #overlayText,
.overlay.cutscene-panel .overlay-actions {
  display: none;
}

.overlay.cutscene-panel .overlay-custom-panel {
  flex: 1;
  min-height: 0;
  margin: 0;
}

.overlay.cutscene-panel .overlay-close-button {
  top: 22px;
  right: 22px;
  z-index: 8;
  width: auto;
  min-width: 92px;
  height: auto;
  padding: 10px 18px;
  border-radius: 999px;
  color: #f9f4df;
  background: rgba(12, 16, 18, 0.62);
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.intro-cutin {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #07111b;
  opacity: 0;
  animation: introCutinSceneFade 4s ease forwards;
}

.intro-cutin.ending {
  animation: introCutinSceneFadeOut 3s ease forwards;
}

.intro-cutin-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.intro-cutin-bg-blur {
  object-fit: cover;
  filter: blur(18px) saturate(1.08) brightness(0.82);
  transform: scale(1.08);
}

.intro-cutin-bg-image {
  object-fit: contain;
  object-position: center center;
  filter: saturate(1.04) brightness(1.04);
  animation: introCutinBackgroundDrift 8s ease-out forwards;
}

.intro-cutin-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 44%, rgba(255, 255, 255, 0.04), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.intro-cutin-character {
  position: absolute;
  left: 50%;
  bottom: -1.5vh;
  z-index: 2;
  width: auto;
  height: min(86vh, 940px);
  max-width: min(72vw, 620px);
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  filter: drop-shadow(0 28px 34px rgba(18, 38, 54, 0.34));
  transition:
    opacity 1.55s ease,
    transform 2.8s ease;
  pointer-events: none;
  user-select: none;
}

.intro-cutin[data-phase="back"] .intro-cutin-character-back,
.intro-cutin[data-phase="turn"] .intro-cutin-character-turn,
.intro-cutin[data-phase="smile"] .intro-cutin-character-smile {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes introCutinSceneFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes introCutinSceneFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes introCutinBackgroundDrift {
  0% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1.045);
  }
}

.overlay.dialogue-cutscene-panel {
  padding: 0;
  background: rgba(5, 6, 5, 0.84);
  backdrop-filter: blur(4px);
}

.overlay.dialogue-cutscene-panel .overlay-card {
  width: min(96vw, calc(96vh * 1.777), 1672px);
  max-height: 96vh;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.overlay.dialogue-cutscene-panel #overlayLabel,
.overlay.dialogue-cutscene-panel #overlayTitle,
.overlay.dialogue-cutscene-panel #overlayText,
.overlay.dialogue-cutscene-panel .overlay-actions {
  display: none;
}

.overlay.dialogue-cutscene-panel .overlay-custom-panel {
  margin: 0;
}

.overlay.dialogue-cutscene-panel .overlay-close-button {
  top: -8px;
  right: -8px;
  z-index: 8;
  width: auto;
  min-width: 124px;
  height: auto;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
}

.overlay.dialogue-cutscene-panel.tutorial-restart-fade {
  animation: tutorial-restart-overlay-fade 3s ease forwards;
  pointer-events: none;
}

.overlay.dialogue-cutscene-panel.tutorial-restart-fade .overlay-card {
  animation: tutorial-restart-card-fade 3s ease forwards;
}

@keyframes tutorial-restart-overlay-fade {
  0% {
    background: rgba(5, 6, 5, 0.84);
    backdrop-filter: blur(4px);
  }
  100% {
    background: #020302;
    backdrop-filter: blur(10px);
  }
}

@keyframes tutorial-restart-card-fade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.985);
  }
}

.dialogue-channel {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  color: #17150d;
  font-family: "Bahnschrift", "Malgun Gothic", sans-serif;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.44));
}

.dialogue-channel.compact {
  width: min(78vw, 1120px);
  margin: 0 auto;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.4));
}

.dialogue-channel.compact .dialogue-channel-text {
  font-size: clamp(0.92rem, 1.55vw, 1.45rem);
  line-height: 1.62;
}

.dialogue-channel.compact .dialogue-channel-name {
  font-size: clamp(0.84rem, 1.35vw, 1.28rem);
}

.dialogue-channel.compact .dialogue-channel-choice {
  font-size: clamp(0.9rem, 1.35vw, 1.25rem);
}

.dialogue-channel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.dialogue-channel-text,
.dialogue-channel-name,
.dialogue-channel-choice {
  position: absolute;
  z-index: 4;
}

.dialogue-channel-portrait {
  position: absolute;
  z-index: 3;
}

.dialogue-channel-text {
  left: 6.9%;
  top: 17.5%;
  width: 61.4%;
  height: 49.8%;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.5vw, 38px);
  overflow-y: auto;
  color: rgba(20, 19, 14, 0.92);
  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1.7;
  white-space: pre-wrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  scrollbar-width: thin;
}

.dialogue-channel-line {
  min-height: 0;
  white-space: pre-wrap;
}

.dialogue-channel-line-wrap {
  display: flex;
  gap: clamp(10px, 1.6vw, 24px);
  align-items: center;
  min-height: 0;
}

.dialogue-channel-line-wrap.has-visual .dialogue-channel-line {
  flex: 1 1 auto;
}

.dialogue-channel-line-visual {
  flex: 0 0 clamp(92px, 14vw, 190px);
  max-width: clamp(92px, 14vw, 190px);
  max-height: clamp(92px, 20vw, 230px);
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(92, 11, 11, 0.28));
  opacity: 0.94;
}

.dialogue-channel-next {
  appearance: none;
  -webkit-appearance: none;
  align-self: flex-end;
  margin-top: auto;
  padding: 4px 0 0;
  border: 0;
  outline: 0;
  color: rgba(37, 33, 20, 0.72);
  background: transparent;
  box-shadow: none;
  font-family: "Bahnschrift", "Malgun Gothic", sans-serif;
  font-size: clamp(0.78rem, 1.1vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dialogue-channel-next:hover {
  color: rgba(37, 31, 16, 0.98);
}

.dialogue-channel-next.hidden {
  display: none;
}

.dialogue-channel-portrait {
  left: 73.0%;
  top: 17.5%;
  width: 18.6%;
  height: 33.5%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dialogue-channel-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28));
}

.dialogue-channel-portrait-placeholder {
  width: 50%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(25, 26, 21, 0.32);
  box-shadow: 0 40px 0 28px rgba(25, 26, 21, 0.24);
}

.dialogue-channel-name {
  left: 72.0%;
  top: 57.8%;
  width: 21.1%;
  height: 9.5%;
  display: grid;
  place-items: center;
  padding: 0 2%;
  overflow: hidden;
  color: rgba(20, 18, 13, 0.94);
  font-size: clamp(0.9rem, 1.75vw, 1.72rem);
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogue-channel-choice {
  top: 74.7%;
  width: 35.7%;
  height: 12.4%;
  border: 0;
  border-radius: 3px;
  color: #f5ecd4;
  background: rgba(88, 69, 42, 0.36);
  font-family: "Bahnschrift", "Malgun Gothic", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    background 0.16s ease;
}

.dialogue-channel-choice[data-dialogue-choice="accept"] {
  left: 12.8%;
}

.dialogue-channel-choice[data-dialogue-choice="reject"] {
  left: 51.5%;
}

.dialogue-channel-choice:not(.inactive):hover {
  transform: translateY(-2px);
  filter: brightness(1.16);
  background: rgba(116, 88, 48, 0.52);
}

.dialogue-channel-choice.inactive {
  color: transparent;
  cursor: default;
  opacity: 0.22;
}

.dialogue-channel-never-again {
  position: absolute;
  right: 4.2%;
  bottom: -5.6%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(224, 212, 170, 0.28);
  border-radius: 999px;
  color: rgba(247, 240, 214, 0.9);
  background: rgba(12, 13, 10, 0.68);
  font-size: clamp(0.78rem, 1.1vw, 0.98rem);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.dialogue-channel-never-again input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.overlay.pause-panel .overlay-card {
  width: min(100%, 700px);
}

.overlay.confirm-panel .overlay-card {
  width: min(100%, 700px);
}

.overlay-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(215, 199, 156, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-family: "Courier New", monospace;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.overlay-close-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  background: rgba(208, 163, 93, 0.18);
}

.overlay-close-button.hidden,
.overlay-button.hidden,
.overlay-secondary-button.hidden {
  display: none;
}

.overlay-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 2px;
}

.overlay-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.overlay-card p {
  color: var(--text-main);
  line-height: 1.65;
  white-space: pre-line;
}

#overlayText {
  max-height: min(46vh, 390px);
  margin-right: -8px;
  padding-right: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(208, 163, 93, 0.78) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.overlay.expanded-panel #overlayText {
  max-height: min(52vh, 500px);
}

.overlay.shop-panel #overlayText {
  max-height: none;
  margin-right: 0;
  padding-right: 0;
  overflow: visible;
}

#overlayText::-webkit-scrollbar {
  width: 9px;
}

#overlayText::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

#overlayText::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(218, 176, 105, 0.95), rgba(135, 96, 50, 0.95));
}

.overlay-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 20px;
}

.overlay-choice-grid.hidden {
  display: none;
}

.overlay-choice-grid.shop-grid {
  grid-template-columns: 1fr;
}

.overlay.shop-panel .overlay-choice-grid.shop-grid {
  margin-top: 10px;
  padding-right: 0;
  overflow: visible;
}

.overlay.expanded-panel.shop-panel .overlay-choice-grid.shop-grid {
  max-height: none;
}

.overlay-choice-grid.day-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: min(38vh, 340px);
  padding-right: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(208, 163, 93, 0.78) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.overlay.expanded-panel .overlay-choice-grid.day-grid {
  max-height: min(48vh, 500px);
}

.overlay-choice-grid.pause-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overlay-choice-grid.pause-grid .overlay-choice {
  min-height: 104px;
}

.overlay-choice-grid.day-grid::-webkit-scrollbar {
  width: 9px;
}

.overlay-choice-grid.day-grid::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.overlay-choice-grid.day-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(218, 176, 105, 0.95), rgba(135, 96, 50, 0.95));
}

.overlay-choice {
  min-height: 116px;
  text-align: left;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.overlay-choice strong {
  display: block;
  margin-bottom: 4px;
}

.overlay-choice span {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.overlay-choice small {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay-choice.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.overlay-choice.selected {
  background: rgba(208, 163, 93, 0.18);
  border-color: rgba(208, 163, 93, 0.35);
}

.overlay-card.lulu-panel-reacting {
  animation: lulu-panel-react 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay-choice.lulu-hit-reacting {
  animation: lulu-hit-react 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
  border-color: rgba(255, 215, 132, 0.72);
  background: rgba(208, 163, 93, 0.28);
}

@keyframes lulu-panel-react {
  0% {
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }

  22% {
    transform: translateX(-6px) scale(1.006);
    filter: brightness(1.03);
  }

  44% {
    transform: translateX(6px) scale(1.01);
    filter: brightness(1.06);
  }

  66% {
    transform: translateX(-3px) scale(1.004);
    filter: brightness(1.03);
  }

  100% {
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes lulu-hit-react {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 211, 120, 0);
  }

  30% {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 18px rgba(255, 211, 120, 0.26);
  }

  58% {
    transform: translateY(2px) scale(0.985);
    box-shadow: 0 0 12px rgba(255, 211, 120, 0.18);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 211, 120, 0);
  }
}

.overlay-secondary-button {
  flex: 1 1 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(215, 199, 156, 0.24);
}

.overlay-actions .overlay-button {
  flex: 1.15 1 0;
}

.shop-choice-art {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  float: right;
  margin-left: 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
}

.shop-choice-art img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

@media (max-width: 1120px) {
  .topbar,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    top: 22px;
    right: 22px;
  }

  .status-strip {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .identity-terminal {
    left: 15.8%;
    top: 59.2%;
    bottom: auto;
    width: 29.5%;
    min-height: 16.8%;
    padding: 8px 9px 7px;
  }

  .mistake-display {
    left: 22.3%;
    top: 78.7%;
    bottom: auto;
    width: 22.5%;
    height: 5.6%;
    padding: 0 10px 6px 9px;
  }

  .mistake-display-label {
    font-size: 0.33rem;
    letter-spacing: 0.09em;
  }

  .mistake-display-count {
    font-size: 0.98rem;
    letter-spacing: 0.03em;
  }

  .checkpoint-interrogate-button {
    left: 60.3%;
    top: 58.6%;
    bottom: auto;
    width: 8%;
    min-width: 50px;
    height: 8.4%;
    min-height: 50px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 12px, 100%);
    padding: 14px 0 24px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 24px;
  }

  .title-group {
    gap: 6px;
  }

  .site-logo {
    width: min(78%, 280px);
  }

  .title-group h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .subtitle {
    max-width: none;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .utility-row {
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .topbar-actions {
    position: static;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .status-card {
    padding: 12px;
  }

  .status-card strong {
    margin-top: 4px;
    font-size: 1.18rem;
  }

  .controls,
  .overlay-choice-grid {
    grid-template-columns: 1fr;
  }

  .game-grid,
  .booth-panel,
  .documents-panel,
  .document-stack,
  .notes-utility-stack {
    gap: 14px;
  }

  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .checkpoint-card {
    padding: 0;
  }

  .window-card {
    display: none;
  }

  .rulebook-dock-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .window-header,
  .document-header,
  .document-row {
    flex-direction: column;
    align-items: start;
  }

  .overlay-card {
    max-height: calc(100vh - 28px);
    padding: 22px;
  }

  .overlay.cutscene-panel .overlay-card {
    width: 100vw;
    height: 100vh;
    max-height: none;
    padding: 0;
  }

  .overlay.dialogue-cutscene-panel .overlay-card {
    width: min(98vw, calc(92vh * 1.777), 1672px);
  }

  .overlay.dialogue-cutscene-panel .overlay-close-button {
    min-width: 92px;
    padding: 7px 11px;
    font-size: 0.68rem;
  }

  .dialogue-channel-text {
    padding: clamp(7px, 1.7vw, 14px);
    font-size: clamp(0.58rem, 2.2vw, 0.94rem);
    line-height: 1.48;
  }

  .dialogue-channel.compact .dialogue-channel-text {
    font-size: clamp(0.54rem, 2vw, 0.82rem);
    line-height: 1.44;
  }

  .dialogue-channel-line-wrap {
    gap: clamp(5px, 1vw, 10px);
  }

  .dialogue-channel-line-visual {
    flex-basis: clamp(44px, 10vw, 82px);
    max-width: clamp(44px, 10vw, 82px);
    max-height: clamp(48px, 15vw, 96px);
  }

  .dialogue-channel-next {
    font-size: clamp(0.5rem, 1.8vw, 0.72rem);
  }

  .dialogue-channel-portrait-image {
    width: 92%;
    height: 92%;
  }

  .dialogue-channel-name,
  .dialogue-channel.compact .dialogue-channel-name {
    font-size: clamp(0.54rem, 2vw, 0.82rem);
  }

  .dialogue-channel-choice,
  .dialogue-channel.compact .dialogue-channel-choice {
    font-size: clamp(0.56rem, 2.1vw, 0.86rem);
  }

  .dialogue-channel-never-again {
    gap: 5px;
    padding: 5px 8px;
    font-size: clamp(0.5rem, 1.8vw, 0.68rem);
  }

  .dialogue-channel-never-again input {
    width: 12px;
    height: 12px;
  }

  .overlay-actions {
    flex-direction: column;
  }

  .overlay-actions .overlay-button,
  .overlay-actions .overlay-secondary-button {
    width: 100%;
  }

  #overlayText {
    max-height: 48vh;
    font-size: 0.94rem;
  }

  .overlay.cutscene-panel #overlayText {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .cutscene-visual,
  .cutscene-frame {
    min-height: 210px;
  }

  .cutscene-frame {
    padding: 22px 20px;
    gap: 10px;
  }

  .cutscene-frame h3 {
    font-size: clamp(1.45rem, 7vw, 2.1rem);
  }

  .cutscene-quote {
    font-size: 0.86rem;
  }

  .cutscene-card {
    padding: 14px 15px;
  }

  .cutscene-bullets {
    padding-left: 16px;
    font-size: 0.88rem;
  }

  .checkpoint-scene {
    min-height: clamp(430px, 72vh, 500px);
    border-radius: 20px;
  }

  .entrant-stage {
    top: 6.4%;
    left: 4.8%;
    right: 4.8%;
    height: 34.5%;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.88fr) minmax(0, 1fr);
    gap: 6px;
  }

  .entrant-portrait {
    width: min(82%, 162px);
    min-width: 96px;
  }

  .stage-dialogue {
    top: 4.2%;
    width: min(156px, calc(50% - 8px));
    max-width: min(156px, calc(50% - 8px));
    height: auto;
    max-height: 54%;
    padding: 0;
    border-radius: 0;
  }

  .entrant-stage.special-entrant-active {
    --special-entrant-left: 7.5%;
    --special-entrant-right: 7.5%;
    --special-entrant-top: 8.5%;
    --special-entrant-height: 51%;
    left: var(--special-entrant-left);
    right: var(--special-entrant-right);
    top: var(--special-entrant-top);
    height: var(--special-entrant-height);
  }

  .entrant-stage.special-entrant-active .entrant-portrait.custom-photo {
    top: 0;
    bottom: 0;
  }

  .entrant-stage.special-entrant-active .stage-dialogue {
    top: 1.5%;
    max-height: 21%;
  }

  .stage-dialogue.traveler,
  .stage-dialogue.inspector {
    margin-top: 0;
  }

  .stage-dialogue .terminal-label {
    display: none;
  }

  .dialogue-stack {
    font-size: 0.52rem;
    line-height: 1.35;
    gap: 2px;
  }

  .dialogue-bubble {
    padding: 3px 4px;
    border-radius: 8px;
  }

  .identity-terminal {
    left: 16.4%;
    right: auto;
    top: 60.1%;
    bottom: auto;
    width: 27.4%;
    height: 16.4%;
    min-height: 0;
    padding: 5px 6px 4px;
  }

  .mistake-display {
    left: 22.1%;
    right: auto;
    top: 79.2%;
    bottom: auto;
    width: 22.6%;
    height: 5.7%;
    padding: 0 8px 5px 7px;
  }

  .mistake-display-label {
    font-size: 0.28rem;
    letter-spacing: 0.06em;
  }

  .mistake-display-count {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
  }

  .identity-terminal .terminal-label {
    margin-bottom: 2px;
    font-size: 0.44rem;
  }

  .identity-terminal .scan-grid {
    gap: 2px;
    font-size: 0.39rem;
  }

  .identity-terminal .scan-grid div {
    grid-template-columns: 34px 1fr;
    gap: 3px;
  }

  .checkpoint-interrogate-button {
    left: 60.7%;
    right: auto;
    top: 59.2%;
    bottom: auto;
    width: 7.2%;
    min-width: 42px;
    height: 7.6%;
    min-height: 42px;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }

  .checkpoint-monitor {
    left: 48.1%;
    right: 8.8%;
    bottom: 16%;
    height: 13.2%;
    gap: 4px;
    padding: 5px;
  }

  .monitor-action {
    padding: 6px 4px;
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }

  .stamp-mark {
    top: -10px;
    right: 2px;
    width: 118px;
  }

  .passport-verdict-stamp {
    top: 36%;
    right: 4%;
    width: 104px;
  }

  .passport-page {
    grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1.3fr);
    gap: 12px;
    padding: 14px 14px 32px;
  }

  .passport-photo {
    min-height: 124px;
  }

  .passport-field span {
    font-size: 0.58rem;
  }

  .passport-field strong {
    font-size: 0.74rem;
  }

  .passport-machine-line {
    left: 14px;
    right: 14px;
    font-size: 0.68rem;
  }

  .document.permit {
    min-height: 400px;
  }

  .document.passport {
    min-height: 270px;
  }

  .document.support {
    min-height: 230px;
  }

  .permit-fields {
    top: 17%;
    left: 15%;
    right: 13%;
    bottom: 22%;
    gap: 6px;
  }

  .permit-line {
    padding: 0 4px 4px;
  }

  .permit-line span {
    font-size: 0.5rem;
  }

  .permit-line strong {
    font-size: 0.66rem;
  }

  .permit-stamp.official,
  .permit-stamp.forged {
    width: 26%;
  }

  .citizen-line span {
    font-size: 0.52rem;
  }

  .citizen-line strong {
    font-size: 0.68rem;
  }

  .citizen-stamp.official,
  .citizen-stamp.forged {
    width: 16%;
  }

.queue-pill,
.document-status {
  text-align: left;
}
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 8px, 100%);
    padding: 10px 0 18px;
  }

  .topbar {
    padding: 16px 14px;
    border-radius: 20px;
  }

  .overlay.cutscene-panel .overlay-card {
    padding: 0;
  }

  .overlay.dialogue-cutscene-panel .overlay-card {
    width: min(99vw, calc(90vh * 1.777), 1672px);
  }

  .overlay.dialogue-cutscene-panel .overlay-close-button {
    min-width: 78px;
    padding: 6px 9px;
    font-size: 0.58rem;
  }

  .dialogue-channel-text {
    padding: clamp(5px, 1.4vw, 9px);
    font-size: clamp(0.44rem, 2.05vw, 0.66rem);
    line-height: 1.34;
  }

  .dialogue-channel.compact {
    width: min(88vw, 1120px);
  }

  .dialogue-channel.compact .dialogue-channel-text {
    font-size: clamp(0.42rem, 1.95vw, 0.6rem);
    line-height: 1.32;
  }

  .dialogue-channel-line-wrap {
    gap: 4px;
  }

  .dialogue-channel-line-visual {
    flex-basis: clamp(32px, 9vw, 54px);
    max-width: clamp(32px, 9vw, 54px);
    max-height: clamp(34px, 12vw, 60px);
  }

  .dialogue-channel-next {
    padding-top: 1px;
    font-size: clamp(0.4rem, 1.65vw, 0.52rem);
  }

  .dialogue-channel-portrait-image {
    width: 88%;
    height: 88%;
  }

  .dialogue-channel-name,
  .dialogue-channel.compact .dialogue-channel-name {
    font-size: clamp(0.42rem, 1.8vw, 0.58rem);
  }

  .dialogue-channel-choice,
  .dialogue-channel.compact .dialogue-channel-choice {
    font-size: clamp(0.44rem, 1.9vw, 0.62rem);
  }

  .dialogue-channel-never-again {
    right: 3%;
    bottom: -7.5%;
    gap: 4px;
    padding: 4px 6px;
    font-size: clamp(0.4rem, 1.6vw, 0.52rem);
  }

  .dialogue-channel-never-again input {
    width: 10px;
    height: 10px;
  }

  .cutscene-visual,
  .cutscene-frame {
    min-height: 184px;
  }

  .cutscene-frame {
    padding: 18px 16px;
  }

  .cutscene-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .cutscene-frame h3 {
    font-size: clamp(1.28rem, 6.6vw, 1.78rem);
  }

  .cutscene-quote {
    font-size: 0.78rem;
    line-height: 1.6;
  }

  .cutscene-bullets {
    font-size: 0.82rem;
  }

  .title-group h1 {
    font-size: clamp(1.55rem, 7.4vw, 2.05rem);
  }

  .eyebrow,
  .section-label,
  .document-type,
  .status-card span,
  .queue-pill span {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }

  .subtitle {
    font-size: 0.82rem;
  }

  .status-card {
    padding: 10px 11px;
  }

  .status-card strong {
    font-size: 1.02rem;
  }

  .card {
    padding: 14px;
  }

  .checkpoint-card {
    padding: 0;
  }

  .checkpoint-scene {
    min-height: clamp(400px, 70vh, 454px);
  }

  .entrant-stage {
    top: 6%;
    left: 4%;
    right: 4%;
    height: 33.5%;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 0.84fr) minmax(0, 1fr);
    gap: 4px;
  }

  .stage-dialogue {
    top: 3.8%;
    width: min(142px, calc(50% - 5px));
    max-width: min(142px, calc(50% - 5px));
    max-height: 48%;
  }

  .entrant-stage.special-entrant-active .stage-dialogue {
    max-height: 18%;
  }

  .dialogue-stack {
    font-size: 0.46rem;
    line-height: 1.3;
  }

  .dialogue-bubble {
    padding: 3px 4px;
    border-radius: 7px;
  }

  .identity-terminal {
    left: 16.2%;
    top: 60.4%;
    width: 27.2%;
    height: 16.2%;
    padding: 4px 5px 3px;
  }

  .identity-terminal .scan-grid {
    font-size: 0.35rem;
  }

  .identity-terminal .scan-grid div {
    grid-template-columns: 31px 1fr;
    gap: 2px;
  }

  .mistake-display {
    top: 79.3%;
    width: 22.4%;
    height: 5.4%;
    padding: 0 6px 4px 6px;
  }

  .mistake-display-label {
    font-size: 0.24rem;
  }

  .mistake-display-count {
    font-size: 0.72rem;
  }

  .checkpoint-interrogate-button {
    min-width: 39px;
    min-height: 39px;
    font-size: 0.54rem;
  }

  .checkpoint-monitor {
    left: 47.8%;
    right: 8.5%;
    bottom: 15.8%;
    height: 12.7%;
    padding: 4px;
  }

  .monitor-action {
    font-size: 0.52rem;
    padding: 5px 3px;
  }

  .rulebook-dock-panel {
    grid-template-columns: 1fr;
  }

  .document {
    padding: 16px;
  }

  .document.passport {
    min-height: 248px;
  }

  .document.permit {
    min-height: 368px;
  }

  .document.support {
    min-height: 214px;
  }
}

.entrant-portrait.custom-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  filter: none;
  border-radius: 0;
  background: none;
}

.entrant-portrait-custom-image,
.passport-photo-image,
.citizen-photo-image,
.wanted-portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center top;
}

.entrant-portrait-custom-image {
  position: absolute;
  inset: 0;
  object-fit: contain;
  transform-origin: center bottom;
  filter: saturate(0.92) contrast(1.04) brightness(0.95) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.28));
}

.passport-photo.custom-photo,
.citizen-photo.custom-photo,
.wanted-portrait.custom-photo {
  overflow: hidden;
}

.passport-photo-image,
.citizen-photo-image {
  filter: saturate(0.92) contrast(1.02) brightness(0.98);
}

.wanted-portrait-image {
  filter: sepia(0.22) saturate(0.78) contrast(1.04) brightness(0.94);
}

.character-editor-button {
  border-color: rgba(88, 123, 171, 0.42);
}

.character-editor-button:hover,
.character-editor-button[aria-expanded="true"] {
  border-color: rgba(114, 161, 226, 0.72);
  background: rgba(48, 85, 144, 0.16);
}

.character-editor-icon {
  background:
    linear-gradient(135deg, rgba(198, 225, 255, 0.96), rgba(66, 111, 173, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(16, 31, 56, 0.14) 6px 7px);
  color: #10213a;
}

.decoration-editor-button {
  border-color: rgba(118, 142, 131, 0.42);
}

.decoration-editor-button:hover,
.decoration-editor-button[aria-expanded="true"] {
  border-color: rgba(164, 204, 184, 0.72);
  background: rgba(53, 90, 74, 0.16);
}

.decoration-editor-icon {
  background:
    linear-gradient(135deg, rgba(212, 247, 223, 0.96), rgba(77, 133, 103, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(17, 46, 31, 0.14) 6px 7px);
  color: #173222;
}

.rulebook-dock-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overlay-custom-panel {
  margin: 16px 0 18px;
  min-height: 0;
}

.overlay.shop-panel .overlay-custom-panel {
  margin: 16px 0 10px;
}

.overlay-custom-panel.hidden {
  display: none;
}

.shop-filter-panel {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 199, 156, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.1));
}

.shop-filter-header h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.shop-filter-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-color: rgba(208, 163, 93, 0.62) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.shop-filter-row::-webkit-scrollbar {
  height: 8px;
}

.shop-filter-row::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.shop-filter-row::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(218, 176, 105, 0.92), rgba(135, 96, 50, 0.92));
}

.shop-filter-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(215, 199, 156, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.shop-filter-chip:hover {
  transform: translateY(-1px);
  background: rgba(208, 163, 93, 0.12);
}

.shop-filter-chip.active {
  background: rgba(208, 163, 93, 0.2);
  border-color: rgba(208, 163, 93, 0.34);
}

.shop-filter-chip span {
  font-size: 0.9rem;
}

.shop-filter-chip small {
  color: var(--gold);
  letter-spacing: 0.06em;
}

.overlay.character-editor-panel .overlay-card {
  width: min(100%, 1120px);
  max-height: min(94vh, 980px);
  padding: 28px 30px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(208, 163, 93, 0.78) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.overlay.decoration-editor-panel .overlay-card {
  overflow-x: auto;
}

.overlay.character-editor-panel .overlay-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.overlay.character-editor-panel #overlayText {
  max-height: none;
  margin-right: 0;
  padding-right: 0;
  overflow: visible;
  color: rgba(247, 240, 214, 0.88);
}

.overlay.character-editor-panel .overlay-actions {
  display: none;
}

.overlay.special-collection-window-panel .overlay-card {
  width: min(100%, 1080px);
  max-height: min(92vh, 940px);
  padding: 28px 30px 30px;
  overflow: hidden;
}

.overlay.special-collection-window-panel #overlayText {
  max-height: none;
  margin-right: 0;
  padding-right: 0;
  overflow: visible;
  color: rgba(247, 240, 214, 0.88);
}

.overlay.special-collection-window-panel .overlay-actions {
  display: none;
}

.overlay.special-collection-window-panel .overlay-custom-panel {
  margin-top: 20px;
  margin-bottom: 0;
  padding-right: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(128, 171, 139, 0.62) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.overlay.special-collection-window-panel .overlay-custom-panel::-webkit-scrollbar {
  width: 9px;
}

.overlay.special-collection-window-panel .overlay-custom-panel::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.overlay.special-collection-window-panel .overlay-custom-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(136, 181, 145, 0.94), rgba(75, 112, 85, 0.94));
}

.character-delete-confirm-shell {
  display: grid;
  gap: 14px;
}

.character-delete-confirm-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(172, 81, 81, 0.28);
  background:
    linear-gradient(180deg, rgba(63, 23, 23, 0.4), rgba(19, 10, 10, 0.6)),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.character-delete-confirm-card h3 {
  margin: 6px 0 14px;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
}

.character-delete-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.character-delete-confirm-grid div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(215, 199, 156, 0.1);
}

.character-delete-confirm-grid dt {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.character-delete-confirm-grid dd {
  margin: 0;
  color: var(--text-main);
  font-weight: 700;
}

.character-delete-confirm-warning {
  margin: 16px 0 0;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(215, 162, 92, 0.18);
  background: rgba(215, 162, 92, 0.08);
  color: rgba(249, 240, 215, 0.94);
}

.character-editor-shell {
  display: grid;
  gap: 16px;
}

.character-editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.character-editor-toolbar h3 {
  margin: 6px 0 0;
  font-size: 1.18rem;
}

.character-editor-help {
  margin: 6px 0 0;
  color: rgba(247, 240, 214, 0.82);
}

.character-editor-message {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(208, 163, 93, 0.28);
  background: rgba(208, 163, 93, 0.1);
  color: var(--text-main);
}

.character-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: 16px;
  min-height: 0;
}

.decoration-editor-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
  min-height: 0;
}

.overlay.decoration-editor-panel .character-editor-shell.decoration-editor-shell {
  min-width: 1180px;
}

.character-editor-column {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.character-editor-section {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(215, 199, 156, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08));
}

.character-editor-section h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.character-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.character-editor-field {
  display: grid;
  gap: 6px;
}

.character-editor-field.span-2 {
  grid-column: 1 / -1;
}

.character-editor-field label,
.character-editor-output label,
.character-editor-slider label {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.character-editor-field input,
.character-editor-field select,
.character-editor-field textarea,
.character-editor-output textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(215, 199, 156, 0.18);
  border-radius: 14px;
  background: rgba(13, 14, 12, 0.72);
  color: var(--text-main);
  resize: vertical;
}

.character-editor-field textarea,
.character-editor-output textarea {
  min-height: 88px;
}

.character-editor-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.character-editor-file-row input[type="file"] {
  flex: 1 1 220px;
}

.character-editor-chip-button,
.character-editor-action,
.character-editor-load,
.character-editor-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(215, 199, 156, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

.character-editor-chip-button:hover,
.character-editor-action:hover,
.character-editor-load:hover,
.character-editor-delete:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.character-editor-chip-button:disabled,
.character-editor-action:disabled,
.character-editor-load:disabled,
.character-editor-delete:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
  filter: none;
}

.character-editor-action.primary {
  border-color: rgba(208, 163, 93, 0.46);
  background: linear-gradient(180deg, rgba(208, 163, 93, 0.28), rgba(117, 83, 38, 0.2));
  color: #f9f0d7;
}

.character-editor-action.danger,
.character-editor-delete {
  border-color: rgba(172, 81, 81, 0.36);
  background: rgba(132, 34, 34, 0.16);
}

.character-editor-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.character-editor-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.character-editor-surface-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.character-editor-surface-tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(215, 199, 156, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
}

.character-editor-surface-tab.active {
  border-color: rgba(208, 163, 93, 0.46);
  background: rgba(208, 163, 93, 0.16);
  color: var(--text-main);
}

.character-editor-preview {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border-radius: 20px;
  border: 1px solid rgba(215, 199, 156, 0.16);
  background: linear-gradient(180deg, rgba(25, 27, 23, 0.96), rgba(12, 13, 11, 0.96));
}

.decoration-editor-preview {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-radius: 22px;
  border: 1px solid rgba(215, 199, 156, 0.16);
  background: linear-gradient(180deg, rgba(25, 27, 23, 0.96), rgba(12, 13, 11, 0.96));
}

.decoration-editor-preview-viewport {
  overflow: auto;
  max-height: min(76vh, 780px);
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 194, 140, 0.42) rgba(255, 255, 255, 0.05);
}

.decoration-editor-preview-viewport::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.decoration-editor-preview-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.decoration-editor-preview-viewport::-webkit-scrollbar-thumb {
  background: rgba(214, 194, 140, 0.34);
  border-radius: 999px;
  border: 2px solid rgba(13, 14, 12, 0.48);
}

.decoration-editor-preview-stage {
  position: relative;
  width: 1024px;
  min-height: 1536px;
  max-width: none;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(16, 17, 15, 0.16), rgba(10, 10, 9, 0.24)),
    url("./assets/checkpoint-interior.png") center / 100% 100% no-repeat;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(247, 240, 214, 0.06);
}

.decoration-editor-preview-hud {
  position: sticky;
  left: 16px;
  top: 16px;
  z-index: 4;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0 16px;
  pointer-events: none;
}

.decoration-editor-preview-hud span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(215, 199, 156, 0.16);
  background: rgba(12, 13, 11, 0.74);
  color: rgba(247, 240, 214, 0.92);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.decoration-editor-shop-preview {
  min-height: 140px;
  cursor: default;
  user-select: none;
}

.decoration-editor-shop-preview .shop-choice-art {
  margin-top: 2px;
}

.decoration-editor-shop-placeholder {
  color: rgba(247, 240, 214, 0.52);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.decoration-editor-shop-preview strong {
  padding-right: 84px;
}

.decoration-editor-preview-item {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.28));
}

.decoration-editor-preview-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.character-editor-preview-surface {
  position: relative;
  height: 100%;
  min-height: 240px;
  isolation: isolate;
}

.character-editor-preview-surface[data-surface="checkpoint"] {
  --special-entrant-left: 8.5%;
  --special-entrant-right: 8.5%;
  --special-entrant-top: 9%;
  --special-entrant-height: 53.5%;
  background:
    linear-gradient(180deg, rgba(16, 17, 15, 0.18), rgba(10, 10, 9, 0.28)),
    url("./assets/checkpoint-interior.png") center / cover no-repeat;
}

.character-editor-preview-surface[data-surface="passport"] {
  background:
    linear-gradient(180deg, rgba(255, 248, 224, 0.9), rgba(222, 208, 169, 0.78)),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(45, 37, 24, 0.04) 9px 10px);
}

.character-editor-preview-surface[data-surface="permit"] {
  background:
    linear-gradient(180deg, rgba(247, 226, 182, 0.1), rgba(152, 102, 55, 0.08)),
    url("./assets/entry-permit-template.png") center / cover no-repeat;
}

.character-editor-preview-surface[data-surface="citizen"] {
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(22, 44, 96, 0.96), rgba(15, 27, 73, 0.98));
}

.character-editor-preview-surface[data-surface="wanted"] {
  background: url("./assets/wanted-poster-template.png") center / cover no-repeat;
}

.character-editor-preview-title {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(9, 10, 10, 0.48);
  color: rgba(247, 240, 214, 0.9);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.character-editor-preview-slot {
  position: absolute;
  overflow: hidden;
  z-index: 2;
  border: 1px solid rgba(247, 240, 214, 0.2);
  background: rgba(8, 9, 9, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.character-editor-preview-checkpoint-guide {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.character-editor-preview-checkpoint-guide-frame {
  position: absolute;
  left: var(--special-entrant-left);
  top: var(--special-entrant-top);
  width: calc(100% - var(--special-entrant-left) - var(--special-entrant-right));
  height: var(--special-entrant-height);
  border-radius: 14px;
  border: 1px solid rgba(244, 235, 194, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(17, 17, 15, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.character-editor-preview-surface[data-surface="checkpoint"] .character-editor-preview-slot {
  left: var(--special-entrant-left);
  top: var(--special-entrant-top);
  width: calc(100% - var(--special-entrant-left) - var(--special-entrant-right));
  height: var(--special-entrant-height);
  border-radius: 18px;
}

.character-editor-preview-surface[data-surface="passport"] .character-editor-preview-slot {
  left: 6.6%;
  top: 18%;
  width: 25.8%;
  height: 56%;
  border-width: 3px;
}

.character-editor-preview-surface[data-surface="permit"] .character-editor-preview-slot {
  right: 11%;
  top: 18%;
  width: 23%;
  height: 20%;
  border-radius: 14px;
}

.character-editor-preview-surface[data-surface="citizen"] .character-editor-preview-slot {
  left: 9.1%;
  top: 32.4%;
  width: 20.9%;
  height: 42.6%;
  border-radius: 16px;
}

.character-editor-preview-surface[data-surface="wanted"] .character-editor-preview-slot {
  left: 46.8%;
  top: 25.7%;
  width: 42.9%;
  height: 37.6%;
}

.character-editor-preview-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center top;
}

.character-editor-preview-surface[data-surface="checkpoint"] .character-editor-preview-slot img {
  object-fit: contain;
  transform-origin: center bottom;
}

.character-editor-preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(247, 240, 214, 0.66);
  font-size: 0.9rem;
  line-height: 1.5;
}

.character-editor-slider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.character-editor-slider {
  display: grid;
  gap: 6px;
}

.character-editor-slider input[type="range"] {
  width: 100%;
}

.character-editor-slider-value {
  color: var(--gold);
  font-size: 0.84rem;
}

.character-editor-roster {
  display: grid;
  gap: 10px;
}

.character-editor-roster-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.character-editor-roster-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(215, 199, 156, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.character-editor-roster-item.active {
  border-color: rgba(208, 163, 93, 0.4);
  background: rgba(208, 163, 93, 0.12);
}

.character-editor-roster-item span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.character-editor-output {
  display: grid;
  gap: 10px;
}

.character-editor-dialogue-grid {
  display: grid;
  gap: 10px;
}

.character-editor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.permit-sheet.has-photo .permit-fields {
  right: 35%;
}

.permit-photo {
  position: absolute;
  right: 11%;
  top: 18%;
  width: 23%;
  height: 20%;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid rgba(71, 46, 22, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 248, 226, 0.82), rgba(193, 174, 138, 0.52)),
    repeating-linear-gradient(90deg, rgba(71, 46, 22, 0.05) 0 2px, transparent 2px 8px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 4px 10px rgba(0, 0, 0, 0.14);
  z-index: 1;
}

.permit-photo.custom-photo {
  overflow: hidden;
}

.permit-photo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center top;
  filter: saturate(0.92) contrast(1.02) brightness(0.98);
}

@media (max-width: 980px) {
  .overlay.character-editor-panel .overlay-card {
    width: min(100%, 920px);
    padding: 22px;
  }

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

  .character-editor-grid,
  .character-editor-slider-grid {
    grid-template-columns: 1fr;
  }

  .rulebook-dock-panel {
    grid-template-columns: 1fr;
  }

  .special-collection-dock-head {
    flex-direction: column;
  }

  .special-collection-count {
    align-self: flex-start;
  }

  .special-collection-window-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .special-collection-window-actions,
  .special-collection-country-group-header {
    width: 100%;
    justify-content: flex-start;
  }

  .special-collection-window-layout,
  .special-collection-detail-header,
  .special-collection-detail-stats {
    grid-template-columns: 1fr;
  }

  .character-editor-toolbar,
  .character-editor-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
