/* ============================================================
   The Verification Desk — stylesheet
   Desk palette: cream / teal / brass  (GDD §16)
   Min viewport 1024×600 landscape; ≥44px targets; ≥16px text (AR-X04)
   ============================================================ */

:root {
  --cream: #f6efe2;
  --cream-2: #efe5d0;
  --paper: #fbf7ee;
  --teal: #1d6a6a;
  --teal-dark: #124b4b;
  --teal-light: #7fb5b0;
  --brass: #a06a2c;
  --brass-light: #d9a755;
  --ink: #2b2620;
  --ink-soft: #5b5348;
  --red-stamp: #b03a2e;
  --good: #2e7d4f;
  --bad: #b03a2e;
  --depends: #b07d2e;
  --shadow: 0 3px 10px rgba(43, 38, 32, 0.25);
  --radius: 12px;
  --font: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--teal-dark);
}

body { overflow: hidden; }

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 1000px;
  min-height: 560px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,244,214,0.16), transparent 60%),
    linear-gradient(180deg, #17595c 0%, #124b4b 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.boot-msg { color: var(--cream); margin: auto; font-size: 22px; }

button { font-family: inherit; font-size: 16px; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }

/* ---------- generic screen scaffold ---------- */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: screenIn 0.35s ease;
}
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.desk-scene {
  background:
    linear-gradient(180deg, rgba(255,241,205,0.10), transparent 45%),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, transparent 2px 90px),
    linear-gradient(180deg, #77503032 60%, #5d3d2440 100%),
    linear-gradient(180deg, #185a5d 0%, #114949 100%);
}

/* ---------- top & bottom rails (HUD) ---------- */

.rail-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #0f4040, #0d3a3a);
  border-bottom: 3px solid var(--brass);
  color: var(--cream);
  min-height: 54px;
  z-index: 30;
}
.rail-top .title-mini {
  font-weight: bold;
  letter-spacing: 0.06em;
  color: var(--brass-light);
  white-space: nowrap;
}
.rail-top .progress-strip { flex: 1; font-size: 15px; opacity: 0.95; text-align: center; }
.rail-top .hud-btn {
  min-width: 44px; min-height: 44px;
  background: var(--teal);
  color: var(--cream);
  border: 2px solid var(--teal-light);
  border-radius: 10px;
  padding: 4px 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.rail-top .hud-btn:hover { background: #257a7a; }
.ip-chip {
  background: var(--brass);
  border: 2px solid var(--brass-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: bold;
  white-space: nowrap;
}
.ip-chip.bump { animation: bump 0.5s ease; }
@keyframes bump { 30% { transform: scale(1.25); } }

.rail-method {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  background: #0d3a3a;
  border-top: 3px solid var(--brass);
  z-index: 30;
}
.method-step {
  color: var(--cream);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  opacity: 0.55;
  white-space: nowrap;
}
.method-step.active { opacity: 1; background: var(--teal); border-color: var(--teal-light); font-weight: bold; }
.method-step.done { opacity: 0.85; border-color: var(--good); }

/* ---------- dialogue ---------- */

.dialogue-dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 20px 14px;
  z-index: 40;
  pointer-events: none;
}
.dialogue-dock > * { pointer-events: auto; }
.portrait {
  width: 110px; height: 110px;
  flex: none;
  border-radius: 14px;
  background: var(--cream);
  border: 3px solid var(--brass);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.portrait svg { width: 100%; height: 100%; display: block; }
.bubble {
  background: var(--paper);
  border: 2px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  max-width: 720px;
  font-size: 17px;
  line-height: 1.45;
  position: relative;
}
.bubble .speaker { font-weight: bold; color: var(--teal); font-size: 14px; letter-spacing: 0.04em; margin-bottom: 4px; }
.bubble .next-btn {
  margin-top: 10px;
  background: var(--teal);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  min-height: 44px;
  font-weight: bold;
}
.bubble .next-btn:hover { background: #257a7a; }

/* ---------- panels, cards, buttons ---------- */

.panel {
  background: var(--paper);
  border: 2px solid var(--brass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  max-width: 860px;
  width: 100%;
}
.panel h2 { color: var(--teal-dark); margin-bottom: 8px; font-size: 22px; }
.panel h3 { color: var(--teal-dark); margin-bottom: 6px; font-size: 18px; }
.panel p { line-height: 1.45; margin-bottom: 8px; }
.panel .small { font-size: 14px; color: var(--ink-soft); }

.btn {
  background: var(--teal);
  color: var(--cream);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 20px;
  min-height: 46px;
  min-width: 44px;
  font-weight: bold;
  font-size: 16px;
}
.btn:hover:not(:disabled) { background: #257a7a; }
.btn.brass { background: var(--brass); }
.btn.brass:hover:not(:disabled) { background: #b97f3d; }
.btn.ghost { background: transparent; color: var(--teal-dark); border-color: var(--teal); }
.btn.ghost:hover:not(:disabled) { background: #1d6a6a18; }
.btn.big { font-size: 20px; padding: 14px 30px; }
.btn.danger { background: var(--red-stamp); }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

.choice-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; width: 100%; }
.choice {
  text-align: left;
  background: var(--cream);
  border: 2px solid var(--teal-light);
  border-radius: 10px;
  padding: 12px 16px;
  min-height: 48px;
  font-size: 16px;
  line-height: 1.35;
  width: 100%;
}
.choice:hover:not(:disabled) { border-color: var(--teal); background: #fff; }
.choice.selected { border-color: var(--teal); background: #d5e8e5; box-shadow: inset 0 0 0 2px var(--teal); }
.choice.idk { border-style: dashed; color: var(--ink-soft); }
.choice.correct-reveal { border-color: var(--good); background: #ddefe2; }
.choice.wrong-reveal { border-color: var(--bad); background: #f6e0dc; }

.toast {
  position: absolute;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 16px;
  box-shadow: var(--shadow);
  z-index: 90;
  animation: toastIn 0.3s ease;
  max-width: 70%;
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }

/* stamps */
.stamp {
  display: inline-block;
  border: 4px solid var(--red-stamp);
  color: var(--red-stamp);
  font-weight: bold;
  font-size: 26px;
  letter-spacing: 0.12em;
  padding: 6px 18px;
  border-radius: 8px;
  transform: rotate(-8deg);
  text-transform: uppercase;
  animation: stampIn 0.4s cubic-bezier(0.2, 2.2, 0.4, 1);
  background: rgba(255,255,255,0.75);
}
.stamp.teal { border-color: var(--teal); color: var(--teal); }
@keyframes stampIn { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } }

/* ---------- evidence frame & magnifier ---------- */

.evidence-wrap { display: flex; gap: 18px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }

.evidence-frame {
  background: #3d3a35;
  border: 3px solid var(--brass);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow);
  position: relative;
  user-select: none;
}
.evidence-frame .serial {
  color: var(--brass-light);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-align: center;
  padding-bottom: 6px;
  font-family: "Courier New", monospace;
}
.evidence-frame .img-holder {
  position: relative;
  width: 380px; height: 380px;
  overflow: hidden;
  background: #222;
  touch-action: none;
}
.evidence-frame.small .img-holder { width: 300px; height: 300px; }
.evidence-frame img.evidence { width: 100%; height: 100%; display: block; pointer-events: none; }

/* photo still downloading (preload revision 2026-09-07): the square frame is
   already reserved by .img-holder; show a light "fetching" shimmer instead of
   a black square — removed by viewer.js the moment the photo arrives */
.img-holder.img-loading::after {
  content: 'fetching from the archive…';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(110deg, #2c3a3a 40%, #3d5050 50%, #2c3a3a 60%);
  background-size: 220% 100%;
  animation: imgFetch 1.4s linear infinite;
  color: #cfe0dd; font-size: 13px; font-weight: bold;
  letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
}
@keyframes imgFetch { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* the Part-B archive gate line (assessment.js) */
.preload-wait { animation: preloadPulse 1.4s ease-in-out infinite; }
@keyframes preloadPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .img-holder.img-loading::after, .preload-wait { animation: none; }
}

.scan-overlay {
  position: absolute; inset: 0;
  background: rgba(10, 40, 40, 0.28);
  cursor: crosshair;
  z-index: 5;
}
.scan-overlay .reticle {
  position: absolute;
  width: 110px; height: 110px;
  border: 2px solid #ffe9b0;
  border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(10, 40, 40, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.scan-overlay .scan-label {
  position: absolute; bottom: 8px; left: 0; right: 0;
  text-align: center; color: #ffe9b0; font-size: 14px; font-weight: bold;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}

.lens {
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 4px solid var(--brass-light);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 0 8px rgba(0,0,0,0.4);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 8;
  display: none;
}

.mark-pin {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid #ffd764;
  border-radius: 50%;
  background: rgba(255, 215, 100, 0.22);
  z-index: 7;
  pointer-events: none;
  animation: pinIn 0.3s ease;
}
@keyframes pinIn { from { transform: scale(2); opacity: 0; } }

.region-glow {
  position: absolute;
  border: 3px dashed #ffd764;
  border-radius: 10px;
  background: rgba(255, 215, 100, 0.15);
  z-index: 6;
  pointer-events: none;
  animation: glowPulse 1.2s ease infinite;
}
@keyframes glowPulse { 50% { background: rgba(255,215,100,0.3); } }

.frame-toolbar { display: flex; gap: 8px; justify-content: center; padding-top: 8px; flex-wrap: wrap; }
.frame-toolbar .tool-btn {
  background: #57524a;
  color: var(--cream);
  border: 1px solid #7d766b;
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 44px;
  font-size: 14px;
}
.frame-toolbar .tool-btn.on { background: var(--teal); border-color: var(--teal-light); font-weight: bold; }

/* evidence tray */
.tray {
  background: var(--cream-2);
  border: 2px solid var(--brass);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 240px;
  max-width: 320px;
}
.tray h4 { color: var(--teal-dark); font-size: 15px; margin-bottom: 6px; letter-spacing: 0.04em; }
.tray .tray-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper);
  border: 1px solid var(--teal-light);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 14px;
  animation: pinIn 0.25s ease;
}
.tray .tray-chip .chip-ico { width: 26px; height: 26px; flex: none; }
.tray .tray-chip .chip-ico svg { width: 100%; height: 100%; }
.tray .empty { color: var(--ink-soft); font-size: 14px; font-style: italic; }

/* verdict panel */
.verdict-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.verdict-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.verdict-btn {
  min-width: 130px; min-height: 54px;
  font-size: 19px; font-weight: bold;
  border-radius: 12px;
  border: 3px solid transparent;
  color: #fff;
}
.verdict-btn.real { background: var(--good); }
.verdict-btn.fake { background: var(--red-stamp); }
.verdict-btn.investigate { background: var(--brass); font-size: 16px; }
.verdict-btn:hover:not(:disabled) { filter: brightness(1.12); }
.verdict-btn:disabled { opacity: 0.4; }

.confidence-dial { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.conf-btn {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--teal-light);
  background: var(--cream);
  font-size: 15px;
}
.conf-btn:hover { border-color: var(--teal); background: #fff; }

/* clue class picker */
.class-picker {
  position: absolute;
  background: var(--paper);
  border: 2px solid var(--brass);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 340px;
}
.class-picker .pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px solid var(--teal-light);
  background: var(--cream);
  border-radius: 10px;
  padding: 6px;
  font-size: 12px;
  min-height: 44px;
  width: 100px;
}
.class-picker .pick svg { width: 42px; height: 42px; }
.class-picker .pick:hover { border-color: var(--teal); }

/* ---------- clue cards & album ---------- */

.clue-card {
  width: 150px;
  background: linear-gradient(160deg, #fffdf6, #f3ead6);
  border: 3px solid var(--brass);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  box-shadow: var(--shadow);
  flex: none;
}
.clue-card.rare { border-style: dashed; border-color: var(--teal); }
.clue-card .card-art { width: 100%; height: 100px; }
.clue-card .card-art svg { width: 100%; height: 100%; }
.clue-card .card-name { font-weight: bold; color: var(--teal-dark); font-size: 14px; margin-top: 4px; }
.clue-card .card-hint { font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; margin-top: 3px; }
.clue-card .card-caveat {
  margin-top: 4px; font-size: 10.5px; background: #fff3d1;
  border: 1px dashed var(--depends); border-radius: 6px; padding: 3px 4px; color: #7a5a10;
}
.clue-card.locked { filter: grayscale(1) opacity(0.45); }

.card-mint-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 42, 42, 0.82);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  z-index: 200;
}
.card-mint-overlay .clue-card { width: 230px; animation: mintIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
.card-mint-overlay .clue-card .card-art { height: 160px; }
.card-mint-overlay .mint-title { color: var(--brass-light); font-size: 24px; font-weight: bold; letter-spacing: 0.08em; }
.card-mint-overlay .mint-text { color: var(--cream); max-width: 540px; text-align: center; line-height: 1.4; font-size: 16px; }
@keyframes mintIn { from { transform: scale(0.3) rotate(-12deg); opacity: 0; } }

.album-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 42, 42, 0.88);
  z-index: 210;
  overflow-y: auto;
  padding: 30px;
}
.album-overlay h2 { color: var(--brass-light); text-align: center; margin-bottom: 6px; }
.album-overlay .album-sub { color: var(--cream); text-align: center; margin-bottom: 14px; font-size: 14px; }
.album-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 1100px; margin: 0 auto 18px; }
.album-shelf-label {
  color: var(--teal-light); text-align: center; letter-spacing: 0.1em;
  margin: 14px 0 8px; font-weight: bold;
}

/* ---------- platform (fictional app) chrome ---------- */

.platform-card {
  width: 480px;
  max-width: 94%;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid #d8d2c6;
}
.platform-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: #fff; font-weight: bold; letter-spacing: 0.03em;
}
.platform-head.buzzly { background: #7146c9; }
.platform-head.pingle { background: #2e8f4f; }
.platform-head.swapspot { background: #d97417; }
.platform-head.starstream { background: #c92756; }
.platform-body { padding: 12px 14px; }
.post-author { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--teal);
  color: #fff; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: none;
}
.post-author .a-name { font-weight: bold; font-size: 15px; }
.post-author .a-sub { font-size: 12.5px; color: #777; }
.post-text { font-size: 15.5px; line-height: 1.4; margin-bottom: 10px; }
.post-img { width: 100%; border-radius: 8px; display: block; }
.post-metrics { display: flex; gap: 16px; padding-top: 8px; color: #666; font-size: 13.5px; }
.chat-bubble-line { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-end; }
.chat-msg { background: #e8f4ea; border-radius: 12px 12px 12px 2px; padding: 8px 12px; font-size: 14.5px; max-width: 78%; }

/* ---------- source panel ---------- */

.source-panel {
  background: var(--cream-2);
  border: 2px solid var(--brass);
  border-radius: var(--radius);
  padding: 14px 18px;
  max-width: 460px;
  width: 100%;
  animation: screenIn 0.3s ease;
}
.source-panel h3 { display: flex; align-items: center; gap: 8px; }
.source-row {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--teal-light);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 14.5px;
}
.source-row .s-label { font-weight: bold; color: var(--teal-dark); min-width: 118px; flex: none; }
.source-row.finding { border-color: var(--brass); background: #fdf3dd; }

/* ---------- machines & switches (Act 1) ---------- */

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--cream); border: 2px solid var(--teal-light); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.switch-row .q { font-size: 15.5px; font-weight: bold; color: var(--teal-dark); }
.switch-pair { display: flex; gap: 6px; }
.switch-pair button {
  min-width: 64px; min-height: 44px;
  border-radius: 8px; border: 2px solid var(--teal-light);
  background: var(--paper); font-weight: bold;
}
.switch-pair button.on-yes { background: var(--good); color: #fff; border-color: var(--good); }
.switch-pair button.on-no { background: var(--red-stamp); color: #fff; border-color: var(--red-stamp); }

.verdict-lamp {
  font-size: 24px; font-weight: bold; letter-spacing: 0.1em;
  padding: 12px 30px; border-radius: 12px;
  border: 4px solid; text-align: center;
}
.verdict-lamp.good { color: var(--good); border-color: var(--good); background: #ddefe2; }
.verdict-lamp.bad { color: var(--bad); border-color: var(--bad); background: #f6e0dc; }
.verdict-lamp.depends { color: var(--depends); border-color: var(--depends); background: #f8eed3; }

.chute-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.chute {
  width: 190px; min-height: 120px;
  border: 3px solid var(--teal);
  border-radius: 12px 12px 40px 40px;
  background: linear-gradient(180deg, var(--paper), var(--cream-2));
  padding: 12px;
  text-align: center;
  font-weight: bold;
  color: var(--teal-dark);
}
.chute:hover { background: #fff; border-color: var(--brass); }
.chute .chute-sub { font-weight: normal; font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.3; }

.meter {
  width: 100%; height: 26px;
  background: #ddd4c0;
  border: 2px solid var(--brass);
  border-radius: 13px;
  overflow: hidden;
}
.meter .fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--teal-light)); transition: width 0.4s ease; }

/* nesting rings */
.ring-slots { position: relative; width: 340px; height: 340px; margin: 0 auto; }
.ring-slot { position: absolute; border: 3px dashed #9aa; border-radius: 50%; display: flex; align-items: flex-start; justify-content: center; }
.ring-slot.filled { border-style: solid; }
.ring-slot .ring-label { margin-top: 6px; font-weight: bold; font-size: 14px; background: var(--paper); padding: 2px 10px; border-radius: 8px; border: 1px solid var(--teal-light); }
.ring-pieces { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ring-piece {
  border: 3px solid var(--teal); border-radius: 18px;
  background: var(--cream); font-weight: bold;
  padding: 12px 20px; min-height: 48px; font-size: 15px;
  max-width: 260px;
}
.ring-piece.selected { background: var(--teal); color: #fff; }
.ring-piece:disabled { opacity: 0.35; }
/* Rev 3: one-line child-friendly description under each science name */
.ring-piece .piece-gloss {
  display: block; font-weight: normal; font-size: 12px; line-height: 1.3;
  margin-top: 3px; color: var(--ink-soft);
}
.ring-piece.selected .piece-gloss { color: #e8f4f2; }

/* propagation map */
.prop-canvas { background: #0d3a3a; border: 3px solid var(--brass); border-radius: 12px; }

/* ---------- assessment (clipboard) chrome ---------- */

.clipboard {
  background: #b98a4a;
  border-radius: 16px 16px 10px 10px;
  padding: 26px 18px 18px;
  box-shadow: var(--shadow);
  max-width: 900px;
  width: 96%;
  position: relative;
  margin: 8px auto;
}
.clipboard::before {
  content: "";
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  width: 130px; height: 26px;
  background: #8d8d94;
  border-radius: 8px;
  box-shadow: inset 0 -3px 4px rgba(0,0,0,0.35);
}
.clipboard .sheet {
  background: var(--paper);
  border-radius: 6px;
  padding: 20px 26px;
  min-height: 300px;
}
.sheet .form-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--teal);
  padding-bottom: 8px; margin-bottom: 14px;
  gap: 10px; flex-wrap: wrap;
}
.sheet .form-head .f-title { font-weight: bold; color: var(--teal-dark); font-size: 19px; letter-spacing: 0.03em; }
.sheet .form-head .f-meta { font-size: 13px; color: var(--ink-soft); font-family: "Courier New", monospace; }
.sheet .q-text { font-size: 18px; line-height: 1.45; margin-bottom: 14px; }
.sheet .q-note { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }

.seq-slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.seq-slot {
  border: 2px dashed var(--teal-light); border-radius: 10px;
  min-height: 50px; padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--cream);
  font-size: 15.5px;
}
.seq-slot .slot-num { font-weight: bold; color: var(--teal); width: 24px; flex: none; }
.seq-slot.filled { border-style: solid; background: #d5e8e5; }

.diagram-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.diagram-opt {
  border: 3px solid var(--teal-light); border-radius: 12px;
  background: var(--cream); padding: 10px;
  width: 200px;
}
.diagram-opt:hover { border-color: var(--teal); background: #fff; }
.diagram-opt.selected { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); background: #d5e8e5; }
.diagram-opt svg { width: 100%; height: 150px; }
.diagram-opt .d-label { font-weight: bold; margin-top: 6px; }

.match-board { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.match-cards { display: flex; flex-direction: column; gap: 10px; max-width: 400px; }
.match-scenario {
  border: 2px solid var(--teal-light); border-radius: 10px;
  background: var(--cream); padding: 10px 14px;
  font-size: 15px; line-height: 1.35; text-align: left;
}
.match-scenario.selected { border-color: var(--brass); background: #fdf3dd; box-shadow: 0 0 0 2px var(--brass); }
.match-scenario.placed { opacity: 0.55; }
.match-bins { display: flex; flex-direction: column; gap: 10px; }
.match-bin {
  border: 3px solid var(--teal); border-radius: 12px;
  min-width: 200px; min-height: 64px;
  background: var(--paper); padding: 8px 12px;
  font-weight: bold; color: var(--teal-dark);
  text-align: center;
}
.match-bin .bin-fill { font-weight: normal; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.match-bin.idk-bin { border-style: dashed; color: var(--ink-soft); }

.smiley-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.smiley-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 3px solid var(--teal-light); border-radius: 12px;
  background: var(--cream); padding: 10px;
  width: 132px; min-height: 120px;
  font-size: 13px; line-height: 1.25; text-align: center;
}
.smiley-opt svg { width: 56px; height: 56px; }
.smiley-opt:hover { border-color: var(--teal); background: #fff; }

/* ---------- misc scenes ---------- */

.screen-body.title-body { justify-content: center; }
.title-hero { text-align: center; color: var(--cream); margin-top: 20px; position: relative; }
.title-hero::before {
  /* desk-lamp glow behind the masthead (decorative) */
  content: ""; position: absolute; left: 50%; top: -70px;
  width: 620px; height: 380px; max-width: 90vw;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,235,180,0.26), transparent 62%);
  pointer-events: none;
  animation: lampGlow 5.5s ease-in-out infinite;
}
@keyframes lampGlow { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }
.title-crest {
  width: 96px; height: 96px; margin: 0 auto 8px auto; position: relative;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
  animation: crestSwing 6s ease-in-out infinite;
}
.title-crest svg { width: 100%; height: 100%; }
@keyframes crestSwing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.title-hero h1 {
  font-size: clamp(40px, 6vw, 56px); letter-spacing: 0.06em; color: var(--brass-light);
  text-shadow: 0 3px 0 #6b4318, 0 8px 22px rgba(0,0,0,0.5);
  position: relative;
}
.title-hero h1::after {
  content: ""; display: block; width: 190px; height: 4px;
  margin: 12px auto 0 auto; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-light), transparent);
}
.title-hero .subtitle { font-size: 20px; margin-top: 8px; opacity: 0.9; font-style: italic; }
.title-hero .file-chip {
  display: block; width: fit-content; margin-left: auto; margin-right: auto;
  margin-top: 26px; padding: 4px 16px;
  border: 2px dashed var(--brass-light); border-radius: 8px;
  color: var(--brass-light); font-size: 13px; letter-spacing: 0.1em;
  transform: rotate(-2deg); opacity: 0.9;
}
.title-hero .study-note { font-size: 13px; opacity: 0.65; margin-top: 14px; max-width: 640px; margin-left: auto; margin-right: auto; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .title-hero::before, .title-crest { animation: none; }
}

.codename-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 700px; }
.codename-grid .btn { min-width: 130px; }

.big-share-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.share-btn-big {
  background: linear-gradient(180deg, #ff7d4d, #e8541f);
  color: #fff; font-size: 26px; font-weight: bold;
  border: none; border-radius: 16px;
  padding: 18px 60px; min-height: 64px;
  box-shadow: 0 6px 0 #a83a12, var(--shadow);
  animation: shareWiggle 1.6s ease infinite;
}
@keyframes shareWiggle { 0%, 100% { transform: rotate(0); } 88% { transform: rotate(0); } 91% { transform: rotate(-2deg) scale(1.04); } 95% { transform: rotate(2deg) scale(1.04); } }
.hold-on-btn { background: none; border: none; color: var(--cream); text-decoration: underline; font-size: 14.5px; min-height: 44px; }
.screen .hold-on-btn.dark { color: var(--teal-dark); }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.badge-medal {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 108px; text-align: center; font-size: 12px; color: var(--ink);
}
.badge-medal .medal-disc {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-light), var(--brass));
  border: 3px solid #6b4318;
  display: flex; align-items: center; justify-content: center;
}
.badge-medal .medal-disc svg { width: 40px; height: 40px; }
.badge-medal.locked .medal-disc { filter: grayscale(1) opacity(0.4); }

.casebook-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.casebook-cell { background: var(--cream); border: 2px solid var(--teal-light); border-radius: 10px; padding: 12px 16px; min-width: 210px; max-width: 320px; }
.casebook-cell h4 { color: var(--teal-dark); font-size: 15px; margin-bottom: 8px; }
.casebook-cell ul { margin-left: 18px; font-size: 14px; line-height: 1.5; }

.cert-sheet {
  background: var(--paper);
  border: 6px double var(--brass);
  border-radius: 8px;
  padding: 30px 40px;
  text-align: center;
  max-width: 620px;
  box-shadow: var(--shadow);
}
.cert-sheet h2 { color: var(--brass); letter-spacing: 0.15em; font-size: 26px; }
.cert-sheet .cert-name { font-size: 34px; color: var(--teal-dark); margin: 12px 0; font-weight: bold; }

.takeaway-tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.takeaway-tile {
  background: var(--cream); border: 2px solid var(--teal); border-radius: 12px;
  width: 200px; padding: 14px; text-align: center;
}
.takeaway-tile .t-name { font-weight: bold; color: var(--teal-dark); margin-bottom: 6px; }
.takeaway-tile .btn { margin-top: 8px; font-size: 14px; padding: 8px 14px; }

/* researcher panel */
.res-panel {
  position: fixed; right: 12px; top: 60px;
  background: #fff; border: 2px solid var(--red-stamp); border-radius: 10px;
  padding: 14px; z-index: 500; width: 340px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  max-height: 80vh; overflow-y: auto;
}
.res-panel h3 { color: var(--red-stamp); margin-bottom: 8px; }
.res-panel .btn { font-size: 13px; min-height: 36px; padding: 6px 10px; margin: 3px 2px; }
.res-panel code { background: #f2ece0; padding: 1px 5px; border-radius: 4px; }

/* ---------- Rev 3 (playtest revision) additions ---------- */

/* hook ladder: realistic photo tiles (filtered / cropped / invented) */
.ladder-img {
  width: 100%; height: 150px; overflow: hidden; border-radius: 10px;
  background: #222;
}
.ladder-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ladder-img.filtered img { filter: saturate(1.6) brightness(1.15) contrast(1.06); }
.ladder-img.cropped { border: 3px dashed #c0392b; }
.ladder-img.cropped img { transform: scale(1.9); transform-origin: 50% 30%; }

/* the Patterner — a visible machine around the output screen */
.patterner { width: 300px; margin: 10px auto; }
.patterner .p-hopper {
  width: 190px; margin: 0 auto; padding: 8px 0 12px;
  background: linear-gradient(180deg, #6a7076, #51565c);
  clip-path: polygon(0 0, 100% 0, 74% 100%, 26% 100%);
  color: #ffe9b0; font-size: 12px; font-weight: bold; text-align: center;
}
.patterner .p-body {
  border: 4px solid #3c4046; border-radius: 14px; padding: 14px;
  background: linear-gradient(180deg, #6a7076, #4c5157);
  box-shadow: var(--shadow);
}
.patterner .p-dials { display: flex; justify-content: space-between; margin-bottom: 8px; }
.patterner .p-dial {
  width: 15px; height: 15px; border-radius: 50%;
  background: #20343a; border: 3px solid #8d949b; display: inline-block;
}
.patterner .p-dial.lit { background: #ffd764; box-shadow: 0 0 8px #ffd764; }
.patterner .p-screen {
  width: 190px; height: 190px; margin: 10px auto 4px;
  border: 4px solid var(--brass); border-radius: 8px;
  overflow: hidden; background: #111; position: relative;
}
.patterner .p-screen img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter 0.5s ease, opacity 0.5s ease; }
.patterner .p-noout {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #777; font-size: 13px;
}
.patterner .p-label { text-align: center; color: #ffe9b0; font-size: 11px; letter-spacing: 0.14em; }
.patterner .meter { margin: 0 auto; }

/* clue cards: realistic evidence crop as main art, drawn icon as corner badge */
.clue-card { position: relative; }
.clue-card .card-photo {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 8px;
  background-repeat: no-repeat; background-color: #222;
  border: 1px solid #c9b892;
}
.clue-card .card-art.mini {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; padding: 2px;
  background: rgba(255, 253, 246, 0.92); border-radius: 8px;
  border: 1px solid #c9b892;
}
.clue-card .card-art.mini svg { width: 100%; height: 100%; }

/* stuck rescue (idle deadlock breaker) */
.stuck-box {
  position: fixed; right: 14px; bottom: 14px; z-index: 600;
  background: var(--paper); border: 2px solid var(--brass);
  border-radius: 12px; padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; max-width: 270px;
}
.stuck-box .stuck-title { font-weight: bold; color: var(--teal-dark); }
.stuck-box .btn { font-size: 14px; min-height: 40px; padding: 8px 12px; }

/* assessment "you can change your tap" note — Rev 4 (round-2 bug 2): the old
   soft-ink italic was unreadable on the dark desk; it now carries its own
   high-contrast chip so it reads in EVERY context (dark scene or paper sheet). */
.tap-note {
  display: inline-block;
  color: var(--ink);
  background: #fff4d6;
  border: 1.5px solid var(--brass);
  border-radius: 8px;
  padding: 6px 12px;
  font-style: italic;
  font-size: 15px;
}

/* ---------- Rev 4 (AHS v2.0 re-harmonisation + round-2 bug fixes) ---------- */

/* round-2 bug 2: "How sure are you?" was created with no class and inherited dark
   ink on the dark-teal desk. It is now a ≥20px high-contrast chip that reads the
   same on the dark gameplay scene AND on paper/sheet contexts. */
.conf-q {
  font-size: 21px;
  color: var(--teal-dark);
  background: var(--cream);
  border: 2px solid var(--brass);
  border-radius: 10px;
  padding: 8px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
/* the confidence Smileyometer (AHS v2.0 §1.5) reuses the LX smiley buttons */
.smiley-opt.selected { border-color: var(--teal); background: #d5e8e5; box-shadow: inset 0 0 0 2px var(--teal); }
.conf-panel { gap: 12px; }

/* character screen (AHS v2.0 §3.1) */
.char-grid { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 6px; }
.char-row {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  background: var(--cream); border: 2px solid var(--teal-light);
  border-radius: 10px; padding: 10px 14px;
}
.char-row .char-name { font-weight: bold; color: var(--teal-dark); font-size: 18px; }
.char-row .char-desc { font-size: 16px; }

/* knowledge-sheet extras: the secondary ask line and the one neutral part-intro line */
.sheet .q-ask { font-weight: bold; color: var(--teal-dark); }
.sheet .part-intro {
  border-left: 4px solid var(--brass); padding-left: 10px;
  font-style: italic; color: var(--ink-soft);
}

/* LX-10 / LX-11 optional typed items (AHS v2.0 §7) */
.lx-text {
  width: 100%; min-height: 110px; resize: vertical;
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  border: 2px solid var(--teal-light); border-radius: 10px;
  padding: 10px 12px; background: #fff; color: var(--ink);
  margin-bottom: 10px;
}
.lx-text:focus { border-color: var(--teal); outline: none; }

/* round-2 bug 5: realistic clue thumbnails (class picker, tray chips, medals) */
.clue-thumb {
  display: block; border-radius: 8px; overflow: hidden;
  background-repeat: no-repeat; background-color: #222;
  border: 1px solid #c9b892;
}
.clue-thumb.drawn { background: none; border: none; }
.clue-thumb.drawn svg { width: 100%; height: 100%; display: block; }
.pick-ico { width: 52px; height: 52px; flex: none; }
span.pick-ico { display: block; }
.tray .tray-chip .clue-thumb.chip-ico { width: 26px; height: 26px; border-radius: 6px; }
.medal-thumb { width: 48px; height: 48px; border-radius: 50%; border: none; }

/* accessibility helpers */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; }

@media (max-width: 1100px) {
  .evidence-frame .img-holder { width: 320px; height: 320px; }
}
