:root {
  --bg-desk: #232b36;
  --desk-pad: #37474f;
  --paper-bg: #fdf8e9;
  --paper-border: #d4c5a9;
  --ink: #1a1a1a;
  --cites-stamp-red: #d32f2f;
  --cites-stamp-green: #2e7d32;
  --accent-gold: #fbc02d;
  --accent-blue: #0288d1;
  --accent-cyan: #00e5ff;
  --danger: #e53935;
  --success: #43a047;
  --lcd-green: #00e676;
  --lcd-bg: #00240e;
  --font-mono: "Courier New", Courier, monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-desk);
  font-family: var(--font-sans);
  color: #eceff1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* TOP DASHBOARD / HEADER */
header {
  background: linear-gradient(180deg, #1b222c 0%, #11161d 100%);
  border-bottom: 3px solid #0d1217;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 10;
  flex-wrap: wrap;
}

.agency-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agency-badge {
  font-size: 1.8rem;
  background: #37474f;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.agency-text h1 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
}

.agency-text span {
  font-size: 0.65rem;
  color: #90a4ae;
  letter-spacing: 0.5px;
}

.hud-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-card {
  background: #19202a;
  border: 1px solid #37474f;
  border-radius: 6px;
  padding: 4px 10px;
  text-align: center;
  min-width: 75px;
}

.metric-card .label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #90a4ae;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 1px;
}

.metric-card .value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.metric-card.timer-card .value {
  color: var(--lcd-green);
}

.metric-card.timer-card.frozen .value {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px var(--accent-cyan);
}

.metric-card.timer-card.urgent .value {
  color: var(--danger);
  animation: pulse-urgent 0.8s infinite alternate;
}

@keyframes pulse-urgent {
  from { transform: scale(1); filter: drop-shadow(0 0 2px var(--danger)); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 8px var(--danger)); }
}

.mode-badge {
  background: #37474f;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.strikes-container {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.strike-box {
  width: 18px;
  height: 18px;
  background: #263238;
  border: 1px solid #455a64;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #546e7a;
  font-weight: bold;
}

.strike-box.active {
  background: #d32f2f;
  border-color: #ff5252;
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 23, 68, 0.7);
}

.header-btns {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: #263238;
  border: 1px solid #455a64;
  color: #eceff1;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #37474f;
  border-color: #78909c;
}

/* MAIN DESK PLAY AREA */
main {
  flex: 1;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  transition: box-shadow 0.3s ease;
}

/* PANIC MODE CONTAINER GLOW */
main.panic-glow {
  animation: panic-pulse 0.7s infinite alternate;
}

@keyframes panic-pulse {
  from {
    box-shadow: inset 0 0 15px rgba(229, 57, 53, 0.3), 0 0 20px rgba(229, 57, 53, 0.2);
  }
  to {
    box-shadow: inset 0 0 35px rgba(229, 57, 53, 0.7), 0 0 40px rgba(229, 57, 53, 0.5);
  }
}

/* LEFT PANEL: PASSENGER & ANIMAL INSPECTION */
.inspection-bay {
  background: #263238;
  border-radius: 10px;
  border: 2px solid #37474f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.passenger-booth {
  background: #1e272e;
  padding: 10px 14px;
  border-bottom: 2px solid #37474f;
  display: flex;
  align-items: center;
  gap: 12px;
}

.passenger-avatar {
  width: 52px;
  height: 52px;
  background: #34495e;
  border: 2px solid var(--accent-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  position: relative;
}

.passenger-details {
  flex: 1;
  min-width: 0;
}

.passenger-name-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #b0bec5;
}

.passenger-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speech-bubble {
  margin-top: 3px;
  background: #2c3e50;
  border-left: 3px solid var(--accent-gold);
  padding: 4px 8px;
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
  font-style: italic;
  color: #eceff1;
  line-height: 1.3;
}

/* ANIMAL DISPLAY & SCALE */
.animal-stage-container {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.scale-bar {
  background: #111;
  border: 2px solid #455a64;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scale-label {
  font-size: 0.72rem;
  font-weight: bold;
  color: #78909c;
  letter-spacing: 0.8px;
}

.scale-digital-readout {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--lcd-green);
  background: var(--lcd-bg);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #004d20;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

/* INTERACTIVE CANVAS CAGE */
.viewport-box {
  position: relative;
  background: radial-gradient(circle at center, #3b4d58 0%, #1f2a30 100%);
  border: 3px solid #455a64;
  border-radius: 8px;
  aspect-ratio: 2 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
  container-type: inline-size;
}

.viewport-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 35px
  );
  pointer-events: none;
}

.animal-underlayer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.animal-illustration {
  font-size: min(6.5rem, 22cqw);
  filter: drop-shadow(0 12px 15px rgba(0,0,0,0.5));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animal-revealed-tag {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.animal-scratch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 5;
  touch-action: none;
}

/* GADGET TRAY */
.gadget-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #18222a;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #37474f;
  flex-wrap: wrap;
}

.gadget-btn {
  background: #263238;
  border: 1px solid #455a64;
  color: #eceff1;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.gadget-btn:active {
  transform: scale(0.96);
}

.gadget-btn.coffee {
  border-color: #8d6e63;
  background: #3e2723;
  color: #ffccbc;
}

.gadget-btn.coffee.used {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}

/* TOOL CONTROLS */
.toolbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #1e272e;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #37474f;
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  gap: 6px;
}

.tool-btn {
  background: #2c3e50;
  border: 2px solid #455a64;
  color: #cfd8dc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.tool-btn.active {
  background: var(--accent-gold);
  color: #111;
  border-color: #ffd54f;
  box-shadow: 0 0 10px rgba(251, 192, 45, 0.5);
}

.wipe-progress-text {
  font-size: 0.72rem;
  color: #90a4ae;
  font-weight: 600;
}

/* RIGHT PANEL: CITES PERMIT & VERDICT */
.permit-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cites-permit {
  background-color: var(--paper-bg);
  background-image: radial-gradient(#e0d7be 1px, transparent 1px);
  background-size: 16px 16px;
  border: 3px double var(--paper-border);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: clip;
}

.cites-permit::before {
  content: "W.C.A. VERIFIED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 2.8rem;
  font-weight: 900;
  color: rgba(180, 160, 130, 0.12);
  pointer-events: none;
  letter-spacing: 4px;
  white-space: nowrap;
}

.permit-header {
  border-bottom: 2px solid #5d4037;
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.permit-title-wrap h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #3e2723;
}

.permit-title-wrap span {
  font-size: 0.65rem;
  color: #795548;
  font-weight: bold;
  letter-spacing: 1px;
}

.permit-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: bold;
  color: #5d4037;
  border: 1px dashed #8d6e63;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.6);
}

.permit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 12px 0;
}

.permit-field {
  border-bottom: 1px solid #d7ccc8;
  padding-bottom: 3px;
}

.permit-field.full-width {
  grid-column: span 2;
}

.permit-field .p-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: #8d6e63;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.permit-field .p-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #212121;
}

.permit-field .p-subtext {
  font-size: 0.68rem;
  color: #616161;
  font-style: italic;
}

.official-seal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed #bcaaa4;
  padding-top: 10px;
  margin-top: auto;
}

.security-hologram {
  width: 70px;
  height: 44px;
  border: 2px solid #8d6e63;
  background: linear-gradient(135deg, #e0f7fa 0%, #ffe082 50%, #f8bbd0 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #37474f;
  text-shadow: 0 1px 1px #fff;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.security-hologram.missing {
  background: #efebe9;
  border-style: dashed;
  color: #b0bec5;
}

.security-hologram.missing::after {
  content: "NO SEAL";
  color: #d32f2f;
  font-weight: bold;
  font-size: 0.62rem;
}

.customs-date-badge {
  text-align: right;
}

.customs-date-badge .c-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #8d6e63;
}

.customs-date-badge .c-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: #1b222c;
}

/* VERDICT STAMP CONTROLS */
.verdict-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stamp-btn {
  padding: 16px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.1s ease;
  box-shadow: 0 5px 0 rgba(0,0,0,0.35), 0 8px 18px rgba(0,0,0,0.3);
  position: relative;
}

.stamp-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35), 0 3px 8px rgba(0,0,0,0.2);
}

.stamp-btn.deny {
  background: linear-gradient(180deg, #e53935 0%, #b71c1c 100%);
  color: #fff;
  border: 2px solid #ff8a80;
}

.stamp-btn.approve {
  background: linear-gradient(180deg, #43a047 0%, #1b5e20 100%);
  color: #fff;
  border: 2px solid #a5d6a7;
}

.stamp-btn .shortcut-tag {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

/* PHYSICAL STAMP OVERLAY EFFECT ON VERDICT */
.rubber-stamp-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg) scale(2);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 6px 20px;
  border: 6px solid;
  border-radius: 12px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.15s ease;
}

.rubber-stamp-overlay.active-stamp {
  opacity: 0.92;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1);
}

.rubber-stamp-overlay.approved {
  color: var(--cites-stamp-green);
  border-color: var(--cites-stamp-green);
  background: rgba(46, 125, 50, 0.15);
  box-shadow: 0 0 15px rgba(46, 125, 50, 0.4);
}

.rubber-stamp-overlay.denied {
  color: var(--cites-stamp-red);
  border-color: var(--cites-stamp-red);
  background: rgba(211, 47, 47, 0.15);
  box-shadow: 0 0 15px rgba(211, 47, 47, 0.4);
}

/* SCREEN SHAKE ANIMATION */
.screen-shake {
  animation: shake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-3px, 1px, 0); }
  20%, 80% { transform: translate3d(4px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 3px, 0); }
  40%, 60% { transform: translate3d(6px, -3px, 0); }
}

/* TOAST / FEEDBACK POPUP */
.verdict-feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #1e272e;
  border: 2px solid var(--accent-gold);
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  max-width: 90%;
}

.verdict-feedback.show {
  transform: translateX(-50%) translateY(0);
}

.verdict-feedback.correct {
  border-color: var(--success);
  background: #1b3820;
}

.verdict-feedback.wrong {
  border-color: var(--danger);
  background: #3b1818;
}

/* MODAL OVERLAYS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 18, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  overflow-y: auto;
}

.modal-card {
  background: #1e272e;
  border: 3px solid var(--accent-gold);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  text-align: center;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
}

.modal-card h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.modal-card .subtitle {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* DAILY BULLETIN MEMO STYLING */
.bulletin-paper {
  background-color: var(--paper-bg);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 28px,
    #e8dec7 29px
  );
  border: 2px solid #bcaaa4;
  border-radius: 6px;
  padding: 20px;
  color: #2e1d10;
  text-align: left;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  position: relative;
  font-family: var(--font-mono);
}

.bulletin-header-stamp {
  border-bottom: 2px solid #5d4037;
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulletin-header-stamp .b-agency {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #3e2723;
}

.bulletin-header-stamp .b-confidential {
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 900;
  border: 1px solid var(--danger);
  padding: 1px 6px;
  border-radius: 3px;
}

.bulletin-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #211510;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.bulletin-story {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #372314;
  margin-bottom: 14px;
}

.bulletin-rules-box {
  background: rgba(0, 0, 0, 0.05);
  border-left: 3px solid #8d6e63;
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
}

.bulletin-rules-title {
  font-size: 0.75rem;
  font-weight: 900;
  color: #5d4037;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.bulletin-rules-list {
  list-style-type: none;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #212121;
}

.bulletin-rules-list li {
  margin-bottom: 4px;
}

/* MAIN MENU BUTTONS */
.menu-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.menu-big-btn {
  background: #263238;
  border: 2px solid #455a64;
  padding: 16px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  color: #eceff1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-big-btn:hover {
  border-color: var(--accent-gold);
  background: #37474f;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

.menu-btn-content .btn-heading {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-btn-content .btn-sub {
  font-size: 0.75rem;
  color: #90a4ae;
  margin-top: 3px;
}

.menu-btn-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(251, 192, 45, 0.15);
  border: 1px solid var(--accent-gold);
  padding: 4px 10px;
  border-radius: 6px;
}

.high-score-banner {
  background: #18222a;
  border: 1px dashed #546e7a;
  padding: 8px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.high-score-banner .hs-val {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-gold);
  font-size: 1rem;
}

.guide-box {
  background: #263238;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  margin-bottom: 18px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cfd8dc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-btn {
  background: linear-gradient(180deg, #ffb300 0%, #f57f17 100%);
  border: 2px solid #ffe082;
  color: #111;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.4);
  transition: all 0.15s ease;
  width: 100%;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.6);
}

.secondary-btn {
  background: #37474f;
  border: 1px solid #78909c;
  color: #eceff1;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: all 0.15s;
}

.secondary-btn:hover {
  background: #455a64;
  border-color: #b0bec5;
}

/* SUMMARY STATS TABLE */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-tile {
  background: #263238;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #37474f;
}

.summary-tile .s-label {
  font-size: 0.68rem;
  color: #90a4ae;
  text-transform: uppercase;
  font-weight: bold;
}

.summary-tile .s-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.rank-badge {
  font-size: 2.6rem;
  font-weight: 900;
  margin: 8px 0;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}

/* PET-DEX DOSSIER GRID */
.petdex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px;
  margin-bottom: 14px;
}

.dex-card {
  background: #263238;
  border: 2px solid #37474f;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
}

.dex-card.discovered {
  border-color: var(--accent-gold);
  background: #2c3846;
}

.dex-card .dex-icon {
  font-size: 2.5rem;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.dex-card.locked .dex-icon {
  filter: grayscale(1) opacity(0.3);
}

.dex-card .dex-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.dex-card.locked .dex-name {
  color: #78909c;
}

.dex-card .dex-species {
  font-size: 0.65rem;
  color: #90a4ae;
  font-style: italic;
  margin-top: 2px;
}

.dex-card .dex-busted-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
}

/* CUSTOM SUSPECTS LIST */
.suspect-form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.versus-input {
  flex: 1;
  background: #263238;
  border: 1px solid #455a64;
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.suspect-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #263238;
  border: 1px solid #37474f;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  text-align: left;
}

.suspect-item .s-info {
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   BLACKLIGHT UV MODE — genuine seals glow, forgeries stay dark
   ========================================================================== */
.security-hologram .uv-mark {
  display: none;
}

.cites-permit.uv-on {
  background: #1b0f33 !important;
  box-shadow: inset 0 0 50px rgba(170, 0, 255, 0.45), 0 10px 30px rgba(0,0,0,0.45);
  transition: background 0.2s;
}

.cites-permit.uv-on * {
  color: #9f8bc9 !important;
  border-color: #4a2d7a !important;
}

.cites-permit.uv-on .security-hologram {
  background: #120a24;
}

.cites-permit.uv-on .security-hologram .seal-text {
  display: none;
}

.cites-permit.uv-on .security-hologram .uv-mark {
  display: flex;
  font-size: 0.62rem;
  font-weight: 900;
}

.cites-permit.uv-on .uv-mark.genuine {
  color: #76ff03 !important;
  text-shadow: 0 0 6px #76ff03, 0 0 14px #76ff03;
}

.cites-permit.uv-on .uv-mark.fake {
  color: #4a3b66 !important;
  font-style: italic;
  font-weight: 600;
}

.viewport-box.uv-cursor canvas {
  cursor: not-allowed;
}

/* MISTAKE / BUST HIGHLIGHT — points at the field that proves the violation */
.flagged {
  outline: 3px solid #ff1744 !important;
  outline-offset: 2px;
  border-radius: 4px;
  animation: flagPulse 0.45s ease-in-out 4;
}

@keyframes flagPulse {
  50% { outline-color: transparent; }
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   Two columns wherever there's room (tablets, laptops, phones held sideways).
   A compact single column for phones held upright and for short screens.
   ========================================================================== */
.menu-toggle {
  display: none;
}

.hotkey-hint {
  font-size: 0.7rem;
  color: #78909c;
}

/* Keyboard hints only make sense with a keyboard and mouse. */
@media not all and (hover: hover) and (pointer: fine) {
  .hotkey-hint,
  .stamp-btn .shortcut-tag {
    display: none;
  }
}

/* Finger-sized targets on touch screens. */
@media (pointer: coarse) {
  .btn-icon,
  .gadget-btn,
  .tool-btn,
  .primary-btn,
  .secondary-btn {
    min-height: 44px;
  }
}

/* Medium widths: keep two columns, tighten spacing. */
@media (max-width: 1100px) {
  main {
    gap: 12px;
    padding: 10px 12px;
  }
  .agency-text span {
    display: none;
  }
}

/* Header buttons fold into a menu once they'd start wrapping. */
@media (max-width: 1000px) {
  header {
    flex-wrap: nowrap;
    position: relative;
  }
  .menu-toggle {
    display: flex;
    font-size: 1.1rem;
    min-width: 40px;
    justify-content: center;
  }
  .header-btns {
    display: none;
    position: absolute;
    top: 100%;
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #11161d;
    border: 1px solid #37474f;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 150;
    min-width: 180px;
  }
  .header-btns.open {
    display: flex;
  }
  .header-btns .btn-icon {
    justify-content: flex-start;
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  .hud-metrics {
    flex-wrap: nowrap;
  }
}

/* Compact mode: phones held upright (narrow) or any short screen (phones sideways). */
@media (max-width: 699px), (max-height: 520px) {
  header {
    padding: 6px 10px;
    padding-top: max(6px, env(safe-area-inset-top));
    gap: 8px;
  }
  .agency-branding,
  .mode-badge {
    display: none;
  }
  .hud-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .metric-card {
    min-width: 0;
    flex: 1;
    padding: 2px 4px;
  }
  .metric-card .label {
    font-size: 0.55rem;
    letter-spacing: 0.3px;
  }
  .metric-card .value {
    font-size: 1rem;
  }
  .strike-box {
    width: 14px;
    height: 14px;
    font-size: 0.6rem;
  }

  main {
    padding: 8px;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    gap: 8px;
  }

  .passenger-booth {
    padding: 6px 10px;
    gap: 8px;
  }
  .passenger-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .passenger-name-tag {
    display: none;
  }
  .passenger-name {
    font-size: 0.9rem;
  }
  .speech-bubble {
    font-size: 0.74rem;
    padding: 3px 6px;
  }

  .animal-stage-container {
    padding: 8px;
    gap: 6px;
  }
  .scale-bar {
    padding: 3px 8px;
  }
  .wide-only {
    display: none;
  }

  /* Gadgets and tools share one row under the crate. */
  .animal-stage-container {
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .scale-bar,
  .viewport-box {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  /* The scale reading sits on the crate's corner instead of taking its own row. */
  .scale-bar {
    z-index: 6;
    align-self: start;
    justify-self: end;
    margin: 6px;
    padding: 2px 6px;
    gap: 6px;
    pointer-events: none;
    background: rgba(17, 17, 17, 0.85);
  }
  .scale-label {
    font-size: 0.6rem;
  }
  .permit-header {
    display: none;
  }
  .viewport-box {
    /* Never let the crate push the stamp buttons off a short screen. */
    width: min(100%, calc((100dvh - 170px) * 2));
    justify-self: center;
  }
  .gadget-tray,
  .toolbox {
    flex-wrap: nowrap;
  }
  .wipe-progress-text {
    display: none;
  }
  .hotkey-hint {
    display: none;
  }
  .scale-digital-readout {
    font-size: 1.05rem;
  }
  .gadget-tray,
  .toolbox {
    padding: 4px 6px;
    gap: 6px;
  }
  .gadget-btn,
  .tool-btn {
    font-size: 0.72rem;
    padding: 6px 8px;
  }
  .wipe-progress-text {
    font-size: 0.68rem;
  }

  .permit-panel {
    gap: 8px;
  }
  .cites-permit {
    padding: 10px 12px;
  }
  .permit-title-wrap h2 {
    font-size: 0.9rem;
  }
  .permit-title-wrap span,
  .chip-field {
    display: none;
  }
  .permit-fields {
    gap: 6px 10px;
    margin: 8px 0;
  }
  .permit-field .p-value {
    font-size: 0.82rem;
  }
  .official-seal-row {
    padding-top: 6px;
  }
  .rubber-stamp-overlay {
    font-size: 2rem;
  }

  .stamp-btn {
    padding: 12px 10px;
    font-size: 1.05rem;
  }

  /* Feedback appears at the top so it never covers the stamp buttons. */
  .verdict-feedback {
    top: 8px;
    bottom: auto;
    transform: translateX(-50%) translateY(-160px);
    width: calc(100% - 16px);
    max-width: 520px;
    font-size: 0.82rem;
    z-index: 300;
  }
  .verdict-feedback.show {
    transform: translateX(-50%) translateY(0);
  }

  .modal-backdrop {
    padding: 8px;
  }
  .modal-card {
    padding: 16px 14px;
  }
  .modal-card h2 {
    font-size: 1.25rem;
  }
}

/* Phones held upright: one column, APPROVE/DENY pinned at thumb reach. */
@media (max-width: 699px) {
  main {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }
  .verdict-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -8px;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(35, 43, 54, 0) 0%, var(--bg-desk) 30%);
  }
}

/* Phones held sideways: two tight columns, stamps pinned to the bottom of the permit column. */
@media (min-width: 700px) and (max-height: 520px) {
  main {
    grid-template-columns: 1.1fr 1fr;
  }
  .passenger-avatar {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }
  .permit-header {
    padding-bottom: 4px;
  }
  .permit-fields {
    margin: 4px 0;
  }
  .security-hologram {
    height: 36px;
  }
  .verdict-actions {
    position: sticky;
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .stamp-btn {
    padding: 8px;
  }
}

/* ==========================================================================
   DIALOGUE + SPOTLIGHT
   ========================================================================== */
.dialogue-layer {
  position: fixed;
  inset: 0;
  z-index: 190;
}

.dialogue-layer.passthrough,
.dialogue-layer.passthrough .dialogue-box {
  pointer-events: none;
}

.spotlight-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.spotlight-dim {
  fill: rgba(8, 10, 14, 0.62);
}

.spotlight-outline {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 3;
  animation: spotPulse 1.1s ease-in-out infinite;
}

@keyframes spotPulse {
  50% { stroke-opacity: 0.35; }
}

.dialogue-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(580px, calc(100% - 16px));
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--paper-bg);
  color: var(--ink);
  border: 3px solid #5d4037;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: dialogueIn 0.18s ease-out;
}

@keyframes dialogueIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

.dialogue-box.pos-bottom {
  bottom: max(12px, env(safe-area-inset-bottom));
}

.dialogue-box.pos-top {
  top: max(12px, env(safe-area-inset-top));
}

.dialogue-portrait {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: #e0a23a;
  border: 3px solid #5d4037;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
}

.dialogue-body {
  flex: 1;
  min-width: 0;
}

.dialogue-name {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #b0482a;
  margin-bottom: 3px;
}

.dialogue-text {
  font-size: 0.98rem;
  line-height: 1.4;
  font-weight: 600;
}

.dialogue-next {
  margin-top: 6px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8d6e63;
  animation: nextBlink 1s steps(2, start) infinite;
}

@keyframes nextBlink {
  to { visibility: hidden; }
}

@media (max-width: 699px), (max-height: 520px) {
  .dialogue-box {
    gap: 8px;
    padding: 8px 10px;
  }
  .dialogue-portrait {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }
  .dialogue-text {
    font-size: 0.86rem;
  }
}

/* ==========================================================================
   W.C.A. "NAIROBI SIGNWRITER" SKIN (Batch 0 style guide, Claude Design)
   Flat fills, one 3px ink outline, one hard shadow tone, paper and halftone
   texture. Layered over the layout rules above so responsiveness is unchanged.
   ========================================================================== */
:root {
  --ink: #1E2240;
  --ink-soft: #2F3670;
  --charcoal: #2A2623;
  --paper: #F3E6C8;
  --paper-shade: #DCC89E;
  --bone: #FBF6EA;
  --bone-shade: #E4D6B6;
  --ochre: #E0A23A;
  --ochre-shade: #B87F24;
  --terracotta: #C4552D;
  --terracotta-shade: #9A3F1F;
  --teal: #1F8A8A;
  --teal-shade: #166868;
  --kanga-red: #B8202E;
  --kanga-red-shade: #8E1622;
  --stamp-green: #2E7D4F;
  --stamp-green-shade: #215C3A;
  --uv-violet: #6B2FD6;
  --uv-glow: #7CFF3A;
  --font-display: 'Lilita One', 'Arial Black', sans-serif;
  --font-type: 'Special Elite', 'Courier New', monospace;
  --font-body: 'Baloo 2', system-ui, sans-serif;
  --hard-shadow: 0 5px 0 var(--ink);
  --paper-texture: url(art/fx/paper-grain.svg);

  /* Re-point the old tokens so untouched rules pick up the palette. */
  --bg-desk: var(--terracotta);
  --paper-bg: var(--paper);
  --paper-border: var(--ink);
  --accent-gold: var(--ochre);
  --danger: var(--kanga-red);
  --success: var(--stamp-green);
  --cites-stamp-red: var(--kanga-red);
  --cites-stamp-green: var(--stamp-green);
  --font-mono: var(--font-type);
  --font-sans: var(--font-body);
}

body {
  background: var(--terracotta) url(art/scene/desk-bg.svg) center / cover fixed;
  color: var(--ink);
  font-family: var(--font-body);
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* --- HUD --- */
header {
  background-color: var(--ochre);
  background-image: radial-gradient(circle, #CF9230 1.6px, transparent 2.1px);
  background-size: 7px 7px;
  border-bottom: 3px solid var(--ink);
  box-shadow: none;
}

.agency-badge {
  background: none;
  border: none;
  box-shadow: none;
  width: 46px;
  height: 46px;
}

.agency-badge img {
  width: 100%;
  height: 100%;
}

.agency-text h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 1px;
}

.agency-text span,
.metric-card .label {
  color: var(--ink);
  font-weight: 800;
}

.metric-card {
  background: transparent;
  border: none;
}

.metric-card .value,
.metric-card.timer-card .value {
  font-family: var(--font-type);
  font-weight: 400;
  color: var(--ink);
}

.metric-card.timer-card.frozen .value {
  color: var(--teal-shade);
  text-shadow: none;
}

.metric-card.timer-card.urgent .value {
  color: var(--kanga-red);
}

.mode-badge {
  background: var(--ink);
  border: 3px solid var(--ink);
  color: var(--ochre);
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 1px;
}

.strike-box {
  background: transparent;
  border: 3px solid rgba(30, 34, 64, 0.3);
  border-radius: 0;
  color: transparent;
}

.strike-box.active {
  background: url(art/ui/icon-strike.svg) center / 90% no-repeat;
  border-color: transparent;
  box-shadow: none;
}

.btn-icon,
.gadget-btn,
.tool-btn,
.secondary-btn {
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, background 0.1s;
}

.btn-icon:hover,
.gadget-btn:hover,
.tool-btn:hover,
.secondary-btn:hover {
  background: #FFFDF6;
  border-color: var(--ink);
}

.btn-icon:active,
.gadget-btn:active,
.tool-btn:active,
.secondary-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.header-btns {
  background: transparent;
}

@media (max-width: 1000px) {
  .header-btns {
    background: var(--paper) var(--paper-texture);
    border: 3px solid var(--ink);
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(30, 34, 64, 0.35);
  }
}

/* --- DESK --- */
.inspection-bay {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  gap: 10px;
}

.passenger-booth {
  background: var(--paper) var(--paper-texture);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(30, 34, 64, 0.35);
}

.booth-window {
  flex-shrink: 0;
  position: relative;
  width: 132px;
  aspect-ratio: 20 / 13;
  border: 3px solid var(--ink);
  background: var(--teal) url(art/scene/airport-bg.svg) center / cover;
  overflow: hidden;
}

.passenger-avatar {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 2.6rem;
  align-items: flex-end;
}

.passenger-avatar img {
  height: 108%;
  width: auto;
  display: block;
  margin-bottom: -4%;
}

.passenger-name-tag {
  color: var(--terracotta);
  font-weight: 800;
}

.passenger-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
}

.speech-bubble {
  background: var(--bone);
  border: 2px solid var(--ink);
  border-left: 6px solid var(--ochre);
  border-radius: 0;
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

.animal-stage-container {
  padding: 0;
}

.scale-bar {
  background: var(--charcoal);
  border: 3px solid var(--ink);
  border-radius: 0;
}

.scale-label {
  color: var(--paper-shade);
  font-family: var(--font-body);
  font-weight: 800;
}

.scale-digital-readout {
  font-family: var(--font-type);
  font-weight: 400;
  border-radius: 0;
}

.viewport-box {
  background: #7a5a36 url(art/scene/crate-inside.svg) center / cover;
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 6px 6px 0 rgba(30, 34, 64, 0.35);
}

.viewport-box::before {
  display: none;
}

.animal-underlayer {
  justify-content: flex-end;
}

.animal-illustration.has-art {
  height: 92%;
  display: flex;
  align-items: flex-end;
  filter: none;
}

.animal-illustration.has-art img {
  height: 100%;
  width: auto;
}

.animal-revealed-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  background: var(--bone);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  box-shadow: 3px 3px 0 rgba(30, 34, 64, 0.35);
}

.gadget-tray,
.toolbox {
  background: transparent;
  border: none;
  padding: 0;
}

.gadget-btn.coffee {
  background: var(--bone);
  border-color: var(--ink);
  color: var(--ink);
}

.tool-btn.active {
  background: var(--ochre);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 1px 0 var(--ink);
  transform: translateY(3px);
}

.wipe-progress-text,
.hotkey-hint {
  color: var(--bone);
  font-weight: 700;
  text-shadow: 0 1px 0 var(--ink);
}

/* --- PERMIT --- */
.cites-permit {
  background: var(--paper) var(--paper-texture);
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  box-shadow: 6px 6px 0 rgba(30, 34, 64, 0.35);
  transform: rotate(-0.8deg);
}

.cites-permit::before {
  color: rgba(30, 34, 64, 0.06);
  font-family: var(--font-display);
}

.permit-header {
  border-bottom: 3px solid var(--ink);
}

.permit-title-wrap h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.permit-title-wrap span {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 2px;
}

.permit-code {
  font-family: var(--font-type);
  color: var(--kanga-red);
  border: none;
  background: none;
  font-size: 1rem;
}

.permit-field {
  border-bottom: none;
}

.permit-field .p-label {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 1.5px;
}

.permit-field .p-value {
  font-family: var(--font-type);
  font-weight: 400;
  color: var(--ink-soft);
  border: 2px solid var(--ink);
  padding: 3px 8px;
  background: rgba(251, 246, 234, 0.55);
}

.official-seal-row {
  border-top: 2px dashed var(--ink);
}

.security-hologram {
  width: 84px;
  height: 84px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  transform: rotate(-6deg);
  overflow: visible;
}

.security-hologram img {
  width: 100%;
  height: 100%;
}

.customs-date-badge .c-label {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 1px;
}

.customs-date-badge .c-date {
  font-family: var(--font-type);
  font-weight: 400;
  color: var(--kanga-red);
  font-size: 1rem;
}

/* Blacklight: the paper goes violet, text dims, and only the seal art changes. */
.cites-permit.uv-on {
  background: #241046 !important;
  box-shadow: inset 0 0 50px rgba(107, 47, 214, 0.55), 6px 6px 0 rgba(30, 34, 64, 0.35);
}

.cites-permit.uv-on * {
  color: #8E7BC8 !important;
  border-color: #4E1FA3 !important;
}

.cites-permit.uv-on .permit-field .p-value {
  background: transparent;
}

.cites-permit.uv-on .security-hologram {
  background: none;
}

/* --- STAMPS --- */
.stamp-btn {
  border: 3px solid var(--ink) !important;
  border-radius: 0;
  box-shadow: 0 7px 0 var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 1px;
  flex-direction: row;
  gap: 10px;
  color: var(--bone);
}

.stamp-btn:active {
  transform: translateY(6px);
  box-shadow: 0 1px 0 var(--ink);
}

.stamp-btn.approve {
  background: var(--stamp-green);
}

.stamp-btn.approve:hover {
  background: #358C5A;
}

.stamp-btn.approve:active {
  background: var(--stamp-green-shade);
}

.stamp-btn.deny {
  background: var(--kanga-red);
}

.stamp-btn.deny:hover {
  background: #C62A38;
}

.stamp-btn.deny:active {
  background: var(--kanga-red-shade);
}

.stamp-btn .stamp-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.stamp-btn .stamp-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 1.6rem;
  line-height: 1;
}

.stamp-btn .shortcut-tag {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 1px;
  opacity: 0.85;
}

.rubber-stamp-overlay {
  border: none;
  background: none !important;
  box-shadow: none !important;
  padding: 0;
  width: 78%;
  max-width: 360px;
}

.rubber-stamp-overlay img {
  width: 100%;
  height: auto;
  display: block;
}

.flagged {
  outline-color: var(--kanga-red) !important;
}

/* --- FEEDBACK TOAST --- */
.verdict-feedback {
  background: var(--paper) var(--paper-texture);
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  box-shadow: 6px 6px 0 rgba(30, 34, 64, 0.45);
}

.verdict-feedback.correct {
  background: var(--paper) var(--paper-texture);
  border-color: var(--ink);
  border-left: 10px solid var(--stamp-green);
}

.verdict-feedback.wrong {
  background: var(--paper) var(--paper-texture);
  border-color: var(--ink);
  border-left: 10px solid var(--kanga-red);
}

#toastIcon img {
  width: 26px;
  height: 26px;
  display: block;
}

/* --- MODALS & MENUS --- */
.modal-backdrop {
  background: rgba(42, 38, 35, 0.82);
  backdrop-filter: none;
}

.modal-card {
  background: var(--paper) var(--paper-texture);
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  box-shadow: 10px 10px 0 rgba(30, 34, 64, 0.5);
}

.modal-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  text-transform: none;
  font-size: 2rem;
}

.modal-card .subtitle {
  color: var(--terracotta);
  font-weight: 800;
}

.menu-logo {
  margin: -6px auto 6px;
  max-width: 420px;
}

.menu-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.high-score-banner,
.guide-box,
.summary-tile,
.suspect-item,
.dex-card {
  background: var(--bone);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
}

.high-score-banner .hs-val,
.summary-tile .s-value {
  font-family: var(--font-type);
  font-weight: 400;
  color: var(--ink);
}

.summary-tile .s-label,
.dex-card .dex-species,
.menu-btn-content .btn-sub {
  color: var(--ink-soft);
}

.menu-big-btn {
  background: var(--bone);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--hard-shadow);
  color: var(--ink);
}

.menu-big-btn:hover {
  background: #FFFDF6;
  border-color: var(--ink);
  transform: none;
  box-shadow: var(--hard-shadow);
}

.menu-big-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.menu-btn-content .btn-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink);
}

.menu-btn-badge {
  font-family: var(--font-type);
  color: var(--ink);
  background: var(--ochre);
  border: 2px solid var(--ink);
  border-radius: 0;
}

.primary-btn {
  background: var(--ochre);
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  box-shadow: 0 6px 0 var(--ink);
}

.primary-btn:hover {
  background: #EBB453;
  transform: none;
  box-shadow: 0 6px 0 var(--ink);
}

.primary-btn:active {
  background: var(--ochre-shade);
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.rank-badge {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ochre);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
}

.bulletin-paper {
  background-color: var(--bone);
  border: 3px solid var(--ink);
  border-radius: 0;
  font-family: var(--font-type);
  color: var(--ink);
}

.bulletin-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: none;
  font-size: 1.5rem;
  color: var(--ink);
}

.bulletin-story,
.bulletin-rules-list {
  color: var(--ink);
}

.bulletin-header-stamp .b-confidential {
  border-width: 2px;
  border-radius: 0;
}

.dex-card.discovered {
  background: var(--bone);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ochre);
}

.dex-card .dex-name,
.dex-card.locked .dex-name {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
}

.dex-card .dex-icon img {
  width: 40px;
  height: 40px;
}

.dex-card .dex-busted-tag {
  background: var(--kanga-red);
  border-radius: 0;
}

.versus-input,
#selectAvatar {
  background: var(--bone) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 0 !important;
  color: var(--ink) !important;
}

/* --- DIALOGUE --- */
.dialogue-box {
  background: var(--paper) var(--paper-texture);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(30, 34, 64, 0.45);
}

.dialogue-portrait {
  background: var(--ochre);
  border: 3px solid var(--ink);
  border-radius: 0;
}

.dialogue-name {
  color: var(--terracotta);
}

.dialogue-next {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 1px;
}

.spotlight-outline {
  stroke: var(--ochre);
  stroke-width: 4;
}

/* --- COMPACT SCREENS --- */
@media (max-width: 699px), (max-height: 520px) {
  .booth-window {
    width: 78px;
  }
  .passenger-avatar {
    font-size: 1.8rem;
  }
  .passenger-name {
    font-size: 1rem;
  }
  .security-hologram {
    width: 58px;
    height: 58px;
  }
  .stamp-btn .stamp-icon {
    width: 38px;
    height: 38px;
  }
  .stamp-btn .stamp-label {
    font-size: 1.3rem;
  }
  .scale-bar {
    background: rgba(42, 38, 35, 0.9);
  }
  .modal-card h2 {
    font-size: 1.5rem;
  }
  /* The boxed permit fields are taller than plain text; tighten so the desk still fits one screen. */
  .permit-fields {
    gap: 3px 8px;
    margin: 4px 0;
  }
  .permit-field .p-label {
    font-size: 0.55rem;
    margin-bottom: 0;
  }
  .permit-field .p-value {
    padding: 0 6px;
    font-size: 0.8rem;
  }
  .official-seal-row {
    padding-top: 3px;
  }
  .security-hologram {
    width: 46px;
    height: 46px;
  }
  .cites-permit {
    padding: 6px 10px;
  }
  .passenger-booth {
    padding: 4px 8px;
  }
  .booth-window {
    width: 66px;
  }
  .stamp-btn {
    padding: 8px 10px;
  }
  .stamp-btn .stamp-icon {
    width: 32px;
    height: 32px;
  }
}

.guide-box .rule-deny {
  color: var(--kanga-red);
}

.guide-box .rule-approve {
  color: var(--stamp-green);
}

/* Rescue Log badges */
.dex-card .dex-icon {
  display: flex;
  justify-content: center;
}

.dex-card .dex-icon.has-art img {
  width: 84px;
  height: 84px;
}

.dex-card.locked .dex-icon.has-art img {
  filter: none;
  opacity: 0.55;
}

.dex-card .dex-lore {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--ink);
  margin-top: 4px;
}

.dex-card.kind-trafficked .dex-busted-tag {
  background: var(--stamp-green);
}

.dex-card.kind-legal .dex-busted-tag {
  background: var(--teal);
}

.petdex-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* On small screens the scale reading sits on the crate's top edge, so the reveal tag moves to the bottom. */
@media (max-width: 699px), (max-height: 520px) {
  .animal-revealed-tag {
    top: auto;
    bottom: 6px;
    max-width: calc(100% - 16px);
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   BATCH 6 SCREENS: menu, bulletin, shift report, Rescue Log, dialogue
   ========================================================================== */
.screen-backdrop {
  background: var(--terracotta) url(art/scene/desk-bg.svg) center / cover;
  padding: 16px;
}

.big-btn {
  min-height: 72px;
  padding: 0 28px;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.08s, box-shadow 0.08s;
}

.big-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.big-btn-ochre { background: var(--ochre); }
.big-btn-ochre:hover { background: #EBB453; }
.big-btn-teal { background: var(--teal); color: var(--bone); }
.big-btn-teal:hover { background: #26999A; }
.big-btn-paper { background: var(--paper); }

.big-btn-sub {
  font-family: var(--font-type);
  font-size: 0.8rem;
  margin-top: 4px;
  opacity: 0.85;
}

.icon-square {
  width: 48px;
  height: 48px;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-square .icon {
  width: 26px;
  height: 26px;
}

.icon-square:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

/* --- 6a Main menu --- */
.screen-corner-btns {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  display: flex;
  gap: 12px;
  z-index: 2;
}

.menu-biscuit {
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: min(300px, 32vw);
  pointer-events: none;
}

.menu-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 720px;
}

.menu-screen .menu-logo {
  width: min(700px, 100%);
  max-width: none;
  margin: 0;
}

.menu-main-btns {
  display: flex;
  gap: 24px;
}

.menu-main-btns .big-btn {
  width: 280px;
  min-height: 80px;
  font-size: 2.25rem;
}

.menu-highscore {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 6px 18px;
  transform: rotate(-1.5deg);
}

.menu-highscore .hs-label {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.menu-highscore .hs-val {
  font-family: var(--font-type);
  font-size: 1.75rem;
}

.menu-links {
  display: flex;
  gap: 18px;
}

.text-link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--bone);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-shadow: 0 1px 0 var(--ink);
}

.menu-footer {
  position: absolute;
  left: 16px;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bone);
  text-shadow: 0 1px 0 var(--ink);
}

.menu-footer img {
  width: 44px;
  height: 44px;
}

/* --- 6b Daily bulletin --- */
.bulletin-screen {
  display: flex;
  align-items: center;
  gap: 32px;
  max-height: 100%;
}

.bulletin-sheet {
  position: relative;
  width: min(460px, 100%);
  aspect-ratio: 620 / 800;
  background: url(art/scene/bulletin-paper.svg) center / 100% 100% no-repeat;
  box-shadow: 8px 8px 0 rgba(30, 34, 64, 0.35);
  transform: rotate(-1deg);
  flex-shrink: 0;
}

.bulletin-body {
  position: absolute;
  inset: 17% 9% 9% 9%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  color: var(--ink);
}

.bulletin-kicker {
  font-family: var(--font-type);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.bulletin-screen .bulletin-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.05;
  margin: 0;
}

.bulletin-screen .bulletin-story {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
}

.bulletin-rules {
  border-top: 2px dashed var(--ink);
  padding-top: 8px;
}

.bulletin-screen .bulletin-rules-title {
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  color: var(--kanga-red);
}

.bulletin-screen .bulletin-rules-list {
  list-style: decimal;
  padding-left: 20px;
  font-family: var(--font-type);
  font-size: 0.88rem;
  line-height: 1.4;
}

.bulletin-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.bulletin-nudge {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--bone);
  text-shadow: 2px 2px 0 var(--ink);
}

/* --- Paper panel (9-slice) used by the report and Rescue Log --- */
.paper-panel {
  border: 40px solid transparent;
  border-image: url(art/ui/panel-paper.svg) 40 fill round;
  color: var(--ink);
}

/* --- 6d Shift report --- */
.report-panel {
  width: min(820px, 100%);
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.report-kicker {
  font-family: var(--font-type);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.report-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.75rem;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

.report-rank {
  transform: rotate(-7deg);
  border: 6px double var(--kanga-red);
  padding: 6px 16px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--kanga-red);
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.report-stat {
  border: 2px solid var(--ink);
  background: var(--bone);
  padding: 10px 16px;
}

.report-stat .s-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.report-stat .s-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-type);
  font-size: 2.25rem;
  line-height: 1.1;
}

.report-strike-marks {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

.strike-mark {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(30, 34, 64, 0.3);
}

.strike-mark.used {
  border-color: transparent;
  background: url(art/ui/icon-strike.svg) center / 100% no-repeat;
}

.report-rescued {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-rescued-badges {
  display: flex;
  gap: 6px;
}

.report-rescued-badges span img {
  width: 64px;
  height: 64px;
  display: block;
}

.report-rescued-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.report-score {
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
}

.report-score span {
  font-family: var(--font-type);
  font-size: 1.2rem;
  letter-spacing: 0;
}

.report-actions {
  display: flex;
  gap: 16px;
}

.report-actions #btnEndAction {
  flex: 1;
}

.report-actions #btnEndReturnMenu {
  width: 180px;
}

/* --- 6e Rescue Log header --- */
.log-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
}

.log-count {
  font-family: var(--font-type);
  font-size: 1.3rem;
}

/* --- 6c Dialogue: big portrait standing beside a paper speech panel --- */
.dialogue-box {
  width: min(900px, calc(100% - 16px));
  padding: 26px 22px 16px calc(clamp(150px, 22vw, 260px) + 12px);
  overflow: visible;
  min-height: 150px;
}

.dialogue-portrait {
  position: absolute;
  left: -8px;
  bottom: -6px;
  width: clamp(150px, 22vw, 260px);
  height: clamp(150px, 22vw, 260px);
  background: none;
  border: none;
  pointer-events: none;
}

.dialogue-portrait.has-art img {
  width: 100%;
  height: 100%;
  display: block;
}

.dialogue-name {
  position: absolute;
  top: -20px;
  left: calc(clamp(150px, 22vw, 260px) + 4px);
  background: var(--teal);
  border: 3px solid var(--ink);
  padding: 2px 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--bone);
  transform: rotate(-2deg);
}

.dialogue-text {
  font-size: 1.15rem;
  line-height: 1.45;
  font-weight: 600;
}

.dialogue-next {
  color: var(--terracotta);
  letter-spacing: 1.5px;
}

/* --- Small screens --- */
@media (max-width: 699px), (max-height: 520px) {
  .menu-biscuit {
    display: none;
  }
  .menu-main-btns {
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 320px;
  }
  .menu-main-btns .big-btn {
    width: 100%;
    min-height: 68px;
    font-size: 1.9rem;
  }
  .menu-screen {
    gap: 16px;
  }
  .menu-footer span {
    font-size: 0.75rem;
  }
  .menu-footer img {
    width: 32px;
    height: 32px;
  }
  .bulletin-screen {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .bulletin-sheet {
    width: min(360px, 100%);
    max-height: calc(100dvh - 120px);
  }
  .bulletin-nudge {
    display: none;
  }
  .bulletin-actions {
    align-items: center;
    width: 100%;
  }
  .bulletin-actions .big-btn {
    width: min(360px, 100%);
  }
  .bulletin-screen .bulletin-title {
    font-size: 1.4rem;
  }
  .bulletin-screen .bulletin-story,
  .bulletin-screen .bulletin-rules-list {
    font-size: 0.8rem;
  }
  .paper-panel {
    border-width: 26px;
  }
  .report-head {
    flex-direction: column;
  }
  .report-title {
    font-size: 2rem;
  }
  .report-rank {
    font-size: 1.2rem;
    transform: rotate(-4deg);
  }
  .report-stat .s-value {
    font-size: 1.6rem;
  }
  .report-stat .s-label {
    font-size: 0.65rem;
  }
  .report-actions #btnEndReturnMenu {
    width: 110px;
  }
  .report-rescued-badges span img {
    width: 44px;
    height: 44px;
  }
  .dialogue-box {
    padding: 24px 12px 10px 104px;
    min-height: 110px;
  }
  .dialogue-portrait {
    width: 104px;
    height: 104px;
    left: -6px;
  }
  .dialogue-name {
    left: 96px;
    font-size: 1rem;
    top: -16px;
  }
  .dialogue-text {
    font-size: 0.9rem;
  }
}

@media (max-height: 520px) {
  .menu-screen .menu-logo {
    width: min(360px, 60vw);
  }
  .menu-main-btns {
    flex-direction: row;
    max-width: none;
    width: auto;
  }
  .menu-main-btns .big-btn {
    width: 200px;
    min-height: 60px;
  }
}

/* Keep the date line clear of the bulletin art's RESTRICTED stamp. */
.bulletin-kicker {
  padding-right: 30%;
}

@media (max-width: 699px), (max-height: 520px) {
  .report-actions .big-btn {
    font-size: 1.5rem;
    min-height: 60px;
    padding: 0 12px;
  }
}

/* A hidden toast must stay hidden even while its position animates (e.g. rotating a phone). */
.verdict-feedback:not(.show) {
  visibility: hidden;
}

/* ==========================================================================
   PHASE 4: story scenes and team activities
   ========================================================================== */
.dialogue-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--terracotta) center / cover no-repeat;
}

/* The desk band along the bottom, like the Batch 6 dialogue screen. */
.dialogue-backdrop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: var(--terracotta) url(art/scene/desk-bg.svg) center / cover;
  border-top: 3px solid var(--ink);
}

.dialogue-layer.scene-mode .dialogue-backdrop {
  display: block;
}

.dialogue-layer.scene-mode .spotlight-svg {
  display: none;
}

.dialogue-layer.scene-mode .dialogue-box {
  bottom: max(28px, env(safe-area-inset-bottom));
  top: auto;
}

/* --- Activity screen --- */
.activity-panel {
  width: min(760px, 100%);
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.activity-progress {
  font-family: var(--font-type);
  font-size: 1.4rem;
  border: 2px solid var(--ink);
  background: var(--bone);
  padding: 2px 10px;
  white-space: nowrap;
}

.activity-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.activity-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  min-height: 1.5em;
}

.activity-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.activity-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
}

.activity-option:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.activity-option:disabled {
  opacity: 0.6;
  cursor: default;
}

.activity-option-art img {
  width: 72px;
  height: 72px;
  display: block;
}

.activity-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  width: 100%;
}

.activity-result-line {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
}

.activity-perk {
  border: 3px solid var(--ink);
  background: var(--ochre);
  padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1deg);
}

.activity-perk-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.activity-perk-text {
  font-weight: 600;
}

/* K9 training */
.k9-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.k9-biscuit img {
  width: 150px;
  height: 150px;
  display: block;
}

.k9-crate {
  width: 150px;
  height: 110px;
  border: 3px solid var(--ink);
  background: url(art/scene/crate-cover.svg) center / cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.k9-crate.open {
  background: url(art/scene/crate-inside.svg) center / cover;
}

.k9-crate img {
  width: 90px;
  height: 90px;
}

/* Warehouse raid */
.raid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.raid-crate {
  position: relative;
  aspect-ratio: 2 / 1;
  border: 3px solid var(--ink);
  background: url(art/scene/crate-inside.svg) center / cover;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.raid-crate.rescued {
  box-shadow: 0 0 0 4px var(--stamp-green);
}

.raid-inside img {
  height: 80%;
  max-height: 80px;
  display: block;
}

.raid-empty {
  font-family: var(--font-type);
  color: var(--bone);
  text-shadow: 0 1px 0 var(--ink);
}

.raid-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  transition: opacity 0.3s;
}

/* Quiz night */
.quiz-board {
  display: flex;
  gap: 16px;
}

.quiz-score {
  font-family: var(--font-display);
  font-size: 1.6rem;
  background: var(--ochre);
  border: 3px solid var(--ink);
  padding: 4px 18px;
}

.quiz-score.tony {
  background: var(--teal);
  color: var(--bone);
}

.quiz-question {
  font-family: var(--font-type);
  font-size: 1.3rem;
  line-height: 1.4;
  text-align: center;
  background: var(--bone);
  border: 2px solid var(--ink);
  padding: 14px 18px;
  width: 100%;
}

.quiz-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.quiz-buttons .stamp-btn {
  min-height: 64px;
  font-size: 1.5rem;
}

.quiz-buttons .stamp-btn:disabled {
  opacity: 0.55;
}

@media (max-width: 699px), (max-height: 520px) {
  .activity-options {
    gap: 8px;
  }
  .activity-option {
    font-size: 0.9rem;
  }
  .activity-option-art img {
    width: 52px;
    height: 52px;
  }
  .k9-biscuit img {
    width: 110px;
    height: 110px;
  }
  .k9-crate {
    width: 120px;
    height: 88px;
  }
  .raid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .quiz-question {
    font-size: 1rem;
  }
  .activity-result-line {
    font-size: 1.25rem;
  }
}

/* ==========================================================================
   PHASE 5: grades, personal bests, sharing, bribes
   ========================================================================== */
.report-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.report-rank .rank-grade {
  font-size: 3.2rem;
}

.report-rank .rank-title {
  font-size: 1rem;
  letter-spacing: 2px;
  margin-top: 2px;
}

.report-stat .s-unit {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 4px;
}

.report-best {
  font-weight: 800;
  color: var(--terracotta);
  min-height: 1.2em;
}

.report-actions #btnShareResult {
  width: 160px;
}

/* The envelope: brown paper, scribbled note, two choices. */
.bribe-offer {
  margin-top: 6px;
  padding: 8px 10px;
  background: #B8865A;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(30, 34, 64, 0.35);
  transform: rotate(-1deg);
  animation: bribeIn 0.25s ease-out;
}

@keyframes bribeIn {
  from { transform: translateY(-8px) rotate(-4deg); opacity: 0; }
}

.bribe-note {
  font-family: var(--font-type);
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.bribe-actions {
  display: flex;
  gap: 8px;
}

.bribe-btn {
  flex: 1;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 6px;
  cursor: pointer;
}

.bribe-btn.take {
  background: var(--ochre);
  color: var(--ink);
}

.bribe-btn.refuse {
  background: var(--bone);
  color: var(--ink);
}

.bribe-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

@media (max-width: 699px), (max-height: 520px) {
  .report-rank .rank-grade {
    font-size: 2.2rem;
  }
  .report-rank .rank-title {
    font-size: 0.75rem;
  }
  .report-actions #btnShareResult {
    width: auto;
    flex: 0 0 auto;
  }
  .report-actions {
    gap: 8px;
  }
  .bribe-note {
    font-size: 0.72rem;
  }
}

@media (max-width: 699px), (max-height: 520px) {
  .passenger-booth {
    position: relative;
    z-index: 8;
  }
  .bribe-offer {
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(100% - 4px);
  }
}

@media (max-width: 699px), (max-height: 520px) {
  .report-actions .big-btn {
    font-size: 1.15rem;
    white-space: nowrap;
    padding: 0 10px;
  }
}

/* ==========================================================================
   ROUND 2: story map, shift title cards, activity backgrounds
   ========================================================================== */
#activityModal {
  background-size: cover;
  background-position: center;
}

.shift-card-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 38, 35, 0.75);
  cursor: pointer;
}

.shift-card {
  width: min(640px, 88vw);
  height: auto;
  filter: drop-shadow(10px 10px 0 rgba(30, 34, 64, 0.5));
  animation: cardIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes cardIn {
  from { transform: scale(0.6) rotate(-6deg); opacity: 0; }
}

/* --- Story map --- */
.map-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(1100px, 100%);
  max-height: 100%;
}

.map-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.map-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--bone);
  text-shadow: 2px 2px 0 var(--ink);
}

.map-endings {
  font-family: var(--font-type);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 2px 10px;
}

.map-endings:empty {
  display: none;
}

.map-board {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 190px);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(30, 34, 64, 0.4);
}

.map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-nodes {
  position: absolute;
  inset: 0;
}

.map-node {
  position: absolute;
  transform: translate(-22px, -22px);
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.map-node:disabled {
  cursor: default;
}

.map-dot {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--teal);
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 var(--ink);
}

.map-node.current .map-dot {
  background: var(--ochre);
  color: var(--ink);
  animation: spotPulse 1.1s ease-in-out infinite;
}

.map-node.locked .map-dot {
  background: var(--paper);
  opacity: 0.85;
}

.map-text {
  display: flex;
  flex-direction: column;
  background: var(--bone);
  border: 2px solid var(--ink);
  padding: 1px 8px;
  line-height: 1.15;
  position: relative;
}

.map-node.locked .map-text {
  opacity: 0.7;
}

.map-shift {
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--ink-soft);
}

.map-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
}

.map-grade {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--kanga-red);
  color: var(--kanga-red);
  background: var(--bone);
  font-family: var(--font-display);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
}

/* Phones: the stops become a list instead of a map. */
@media (max-width: 699px) {
  .map-title {
    font-size: 1.2rem;
  }
  .map-board {
    aspect-ratio: auto;
    max-height: none;
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--paper) var(--paper-texture);
    padding: 8px;
  }
  .map-bg {
    display: none;
  }
  .map-nodes {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .map-node {
    position: static;
    transform: none;
  }
  .map-dot {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }
  .map-screen {
    height: 100%;
  }
  #btnMapStart {
    width: 100%;
  }
}

/* Stops near the right edge put their label on the left so it stays on the map. */
.map-node.flip {
  flex-direction: row-reverse;
  transform: translate(calc(-100% + 22px), -22px);
}

@media (max-width: 699px) {
  .map-node.flip {
    flex-direction: row;
    transform: none;
  }
}

.dialogue-backdrop.full-scene::after {
  display: none;
}

/* ==========================================================================
   BATCH 8: branching map stops, ending portraits, envelope art
   ========================================================================== */
.map-dot.has-art {
  position: relative;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.map-dot.has-art img {
  width: 100%;
  height: 100%;
  display: block;
}

.map-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
}

.map-node.current .map-dot.has-art {
  background: none;
}

.map-node {
  transform: translate(-26px, -26px);
}

.map-node.flip {
  transform: translate(calc(-100% + 26px), -26px);
}

.map-node.ending .map-label {
  color: var(--stamp-green);
}

.ending-portrait img {
  width: 150px;
  height: 150px;
  display: block;
}

.bribe-offer {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
}

.bribe-envelope {
  grid-row: span 2;
  width: 64px;
  height: auto;
}

@media (max-width: 699px) {
  .map-node,
  .map-node.flip {
    transform: none;
  }
  .map-dot.has-art {
    width: 40px;
    height: 40px;
  }
  .bribe-envelope {
    width: 44px;
  }
}

/* Desktop map: locked stops are just sockets on the path; their labels appear once reached. */
@media (min-width: 700px) {
  .map-node.locked .map-text {
    display: none;
  }
}

.activity-progress:empty {
  display: none;
}

/* ==========================================================================
   SOUND SETTINGS
   ========================================================================== */
.audio-card {
  max-width: 420px;
}

.audio-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 10px 0 20px;
  text-align: left;
}

.audio-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.audio-row input[type="range"] {
  width: 100%;
  accent-color: var(--ochre);
  height: 28px;
}

.audio-mute {
  grid-template-columns: auto 1fr;
  font-weight: 700;
}

.audio-mute input {
  width: 22px;
  height: 22px;
  accent-color: var(--kanga-red);
}

/* ==========================================================================
   BATCH 9: loading screen, K9 training crate, raid torch, quiz scoreboard
   ========================================================================== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--terracotta) url(art/ui/splash.svg) center / contain no-repeat;
  transition: opacity 0.5s ease;
}

.splash.gone {
  opacity: 0;
  pointer-events: none;
}

/* K9: the training crate opens and the animal pops up out of it */
.k9-crate {
  position: relative;
}

.k9-crate.has-art {
  width: 170px;
  height: 142px;
  border: none;
  background: url(art/activity/sniff-crate-closed.svg) center / contain no-repeat;
}

.k9-crate.has-art.open {
  background-image: url(art/activity/sniff-crate-open.svg);
}

.k9-crate.has-art .k9-crate-no {
  display: none;
}

.k9-crate-no {
  font-family: var(--font-type);
  font-size: 1.4rem;
  color: var(--bone);
  text-shadow: 0 1px 0 var(--ink);
}

.k9-peek {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  animation: peekUp 0.3s ease-out;
}

.k9-peek img {
  width: 80px;
  height: 80px;
  display: block;
}

@keyframes peekUp {
  from { transform: translate(-50%, 30px); opacity: 0; }
}

.k9-treats {
  display: flex;
  gap: 6px;
  min-height: 34px;
}

.k9-treat img {
  width: 34px;
  height: 34px;
  display: block;
}

/* Raid: a torch beam follows the finger across the crates */
.raid-grid {
  position: relative;
  overflow: hidden;
}

.raid-torch {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
  mix-blend-mode: screen;
}

/* Quiz: chalk scoreboard art with the scores written in the two boxes */
.quiz-board.chalk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(420px, 100%);
  aspect-ratio: 600 / 220;
  background: url(art/activity/scoreboard.svg) center / 100% 100% no-repeat;
  padding: 11% 7% 9%;
  gap: 12%;
}

.quiz-board.chalk .quiz-score,
.quiz-board.chalk .quiz-score.tony {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-type);
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  color: var(--bone);
}

.quiz-buzzers {
  display: flex;
  align-items: center;
  gap: 18px;
}

.quiz-buzzer img {
  width: 78px;
  height: 78px;
  display: block;
}

.quiz-vs {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

@media (max-width: 699px), (max-height: 520px) {
  .quiz-buzzer img {
    width: 56px;
    height: 56px;
  }
  .k9-crate.has-art {
    width: 130px;
    height: 108px;
  }
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.badges-card {
  max-width: 760px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}

.badge-grid.earned-now {
  max-height: none;
  width: 100%;
}

.badge-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  background: var(--bone);
  border: 2px solid var(--ink);
  padding: 10px 8px;
}

.badge-disc {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--ochre);
  box-shadow: 0 0 0 5px var(--terracotta), 0 0 0 8px var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 6px;
  overflow: hidden;
}

.badge-disc img {
  width: 70%;
  height: 70%;
}

.badge-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.1;
}

.badge-desc {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.badge-medal.locked .badge-disc {
  background: var(--paper-shade);
  box-shadow: 0 0 0 5px var(--bone-shade), 0 0 0 8px rgba(30, 34, 64, 0.35);
}

.badge-medal.locked .badge-disc img {
  filter: grayscale(1);
  opacity: 0.35;
}

.badge-medal.locked .badge-name {
  opacity: 0.6;
}

.earned-now .badge-medal {
  animation: badgeIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.earned-now .badge-medal:nth-child(2) { animation-delay: 0.12s; }
.earned-now .badge-medal:nth-child(3) { animation-delay: 0.24s; }
.earned-now .badge-medal:nth-child(4) { animation-delay: 0.36s; }
.earned-now .badge-medal:nth-child(5) { animation-delay: 0.48s; }

@keyframes badgeIn {
  from { transform: scale(0.4) rotate(-12deg); opacity: 0; }
}

.map-badges-btn {
  font-family: var(--font-type);
  background: var(--ochre);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  padding: 2px 10px;
  cursor: pointer;
}

@media (max-width: 699px) {
  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-badges-btn {
    font-size: 0.8rem;
  }
}
