:root{
  --ink:#e8e6dd; --bg:#0d0f0c; --panel:#161a15; --line:#2c332a;
  --glow:#7bd389; --amber:#e0b050; --bad:#d1495b;
  --pad:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);
  font:16px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  -webkit-text-size-adjust:100%;overscroll-behavior:none}
#app{min-height:100dvh;max-width:860px;margin:0 auto;padding:18px 16px calc(20px + var(--pad))}
.screen{display:flex;flex-direction:column;gap:15px}
.hidden{display:none!important}
h1{font-size:clamp(30px,8vw,48px);margin:6px 0 0;letter-spacing:.02em;font-weight:600}
h1 span{color:var(--glow)}
h2{font-size:clamp(24px,6vw,34px);margin:0}
.lede{margin:0;font-size:clamp(15px,3.6vw,18px);color:#bfc4b8;line-height:1.6}
.fine{font-size:12.5px;color:#7d8478;line-height:1.5}
.playlab{display:inline-flex;align-items:center;min-height:44px;color:var(--glow);text-decoration:underline;text-underline-offset:3px}

.bar{display:flex;justify-content:space-between;font-size:14px;color:#9aa295;
  letter-spacing:.06em;text-transform:uppercase}
#tally{color:var(--glow)}

.dossier{position:relative;background:var(--panel);border:1px solid var(--line);
  border-radius:4px;padding:16px 15px 15px;overflow:hidden}
.dossier::before{content:"";position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(0deg,#ffffff05 0 2px,transparent 2px 4px)}
.stamp{display:inline-block;border:2px solid #8a5a4a;color:#c8806a;
  padding:2px 8px;font-size:11px;letter-spacing:.18em;transform:rotate(-1.5deg);
  margin-bottom:10px}
.meta{font-size:12.5px;color:#8f978a;letter-spacing:.05em;margin-bottom:8px}

.transcript{margin:0;font-size:14.5px;line-height:1.7;color:#d6d3c8;
  max-height:7.5em;overflow:hidden}
.transcript.open{max-height:none}
.more{margin-top:8px;padding:8px 12px;min-height:44px;width:100%;cursor:pointer;
  background:transparent;color:var(--glow);border:1px solid var(--line);
  border-radius:3px;font:inherit;font-size:13px;letter-spacing:.06em}
/* display:flex beats the hidden attribute, so the scan stayed on screen when the
   round tried to hold it back. */
.pagebox[hidden]{display:none}
.pagebox{margin:0 0 12px;border-radius:3px;background:#e8e6dd;
  height:32dvh;display:flex;align-items:center;justify-content:center}
/* The scans are letterboxed with wide margins; contain wastes half the box on
   white. Cover from the top shows the form itself. */
.pagebox img{width:100%;height:100%;object-fit:cover;object-position:center top;display:block}


.ask{margin:4px 0 0;font-size:15px;color:#bfc4b8}
#options{display:flex;flex-direction:column;gap:10px}
.opt{width:100%;text-align:left;cursor:pointer;color:var(--ink);
  background:var(--panel);border:1px solid var(--line);border-radius:4px;
  padding:13px 14px;font:inherit;font-size:13.5px;line-height:1.6;min-height:56px;
  transition:border-color .15s,background .15s,transform .15s}
.opt:hover:not(:disabled){border-color:#4e5a4b}
.opt .lbl{display:block;color:#8f978a;font-size:11.5px;letter-spacing:.1em;margin-bottom:5px}
.opt:disabled{cursor:default}
.opt.right{border-color:var(--glow);background:#7bd3891a}
.opt.wrong{border-color:var(--bad);background:#d1495b1a}
.opt.dim{opacity:.4}

@keyframes reveal{0%{transform:scale(.97);opacity:.4}60%{transform:scale(1.015)}100%{transform:scale(1);opacity:1}}
@keyframes ping{0%{box-shadow:0 0 0 0 #7bd38966}100%{box-shadow:0 0 0 18px #7bd38900}}
@media (prefers-reduced-motion:no-preference){
  .opt.right{animation:reveal .45s ease-out,ping .8s ease-out .1s}
  .opt.wrong{animation:reveal .3s ease-out}
  .screen{animation:fadein .2s ease-out}
  @keyframes fadein{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
}

.why{font-size:12.5px;color:#9aa295;margin:8px 0 0;padding:10px 12px;
  background:#0f120e;border-left:2px solid var(--glow);border-radius:0 4px 4px 0}
.why b{color:var(--ink)}
.why a{color:var(--glow)}
button.big{width:100%;padding:16px;font:inherit;font-size:17px;border-radius:4px;
  border:0;cursor:pointer;background:var(--glow);color:#0d0f0c;font-weight:700;
  letter-spacing:.04em;min-height:54px}
button.ghost{width:100%;padding:13px;font:inherit;font-size:15px;border-radius:4px;
  cursor:pointer;background:transparent;color:#bfc4b8;border:1px solid var(--line);min-height:50px}
#verdict{font-size:clamp(36px,10vw,60px);color:var(--glow);line-height:1.1}
#verdict small{display:block;font-size:15px;color:#9aa295;letter-spacing:.05em;margin-top:6px}
.reading{background:var(--panel);border:1px solid var(--line);border-radius:4px;
  padding:14px;font-size:14px;color:#bfc4b8;margin:0;line-height:1.65}
.reading b{color:var(--ink)}

/* "How this works" diagram, shown on the start screen of every game in this
   family. Plain boxes and arrows in CSS rather than an image, so it scales and
   translates with the page. */
.howworks{display:flex;flex-direction:column;gap:0;margin:4px 0 2px}
.step{display:flex;gap:10px;align-items:flex-start;padding:9px 11px;
  background:var(--panel);border:1px solid var(--line);border-radius:3px}
.step .n{flex:0 0 26px;height:26px;border-radius:50%;background:var(--glow);
  color:#0d0f0c;display:flex;align-items:center;justify-content:center;
  font-size:13px;font-weight:700}
.step .s{font-size:13.5px;line-height:1.55;color:#bfc4b8}
.step .s b{color:var(--ink)}
.arrow{align-self:center;color:#4e5a4b;font-size:15px;line-height:1;padding:3px 0}
.chipline{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.chipline span{font-size:11.5px;letter-spacing:.06em;padding:3px 8px;border-radius:3px;
  border:1px solid var(--line);color:#9aa295}
.opt.wide{display:flex;align-items:center;gap:12px;min-height:64px}
.opt .bigopt{font-size:16px;line-height:1.4;color:var(--ink)}
.opt.wide .lbl{margin:0;flex:0 0 auto}
.howtitle{margin:2px 0 8px;font-size:13px;letter-spacing:.1em;
  text-transform:uppercase;color:#8f978a}
.why .quote{color:#8f978a;font-size:12.5px}

.modepick{display:flex;flex-direction:column;gap:9px}
.ghostbig{width:100%;padding:14px;font:inherit;font-size:16px;border-radius:3px;
  cursor:pointer;background:transparent;color:var(--glow);
  border:1px solid var(--line);min-height:52px;letter-spacing:.02em}
.ghostbig:hover{border-color:var(--glow)}
.erayears{display:block;color:#8f978a;font-size:12px;margin-top:3px;
  font-family:ui-sans-serif,system-ui,sans-serif}

.whyhow{background:var(--panel);border:1px solid var(--line);border-radius:3px;
  padding:8px 12px;font-size:13.5px;color:#bfc4b8;margin-bottom:4px}
.whyhow summary{cursor:pointer;list-style:none;min-height:30px;padding:3px 0;
  color:var(--ink);font-size:13.5px}
.whyhow summary::-webkit-details-marker{display:none}
.whyhow summary::before{content:"\25B8 ";color:var(--glow)}
.whyhow[open] summary::before{content:"\25BE "}
.whyhow p{margin:7px 0;line-height:1.6}
.whyhow b{color:var(--ink)}

/* Declassify: the document arrives blacked out and you uncover it a word at a
   time. The look is the material's own. */
.guessrow{display:flex;gap:8px;margin:2px 0 8px}
#rinput{flex:1;min-height:48px;padding:10px 12px;font:inherit;font-size:16px;
  background:#0f120e;border:1px solid var(--line);border-radius:3px;color:var(--ink)}
#rinput:focus{outline:none;border-color:var(--glow)}
.guessrow .playbtn{min-width:96px}
.rfeedback{margin:0 0 8px;min-height:22px;font-size:13.5px;color:#9aa295}
.rfeedback b{color:var(--glow)}
.rdoc{background:#14170f;border:1px solid var(--line);border-radius:3px;
  padding:14px 13px;line-height:2.1;font-size:14.5px;max-height:46dvh;
  overflow-y:auto;word-break:break-word}
.tok{border-radius:2px}
.tok.hid{background:#e8e6dd;color:transparent;user-select:none;
  box-shadow:0 0 0 1px #e8e6dd}
.tok.shown{color:#d6d3c8}
.tok.just{background:#7bd38933;color:#eafff0}
.tok.key{color:var(--glow);font-weight:600}
#rchoices{display:flex;flex-direction:column;gap:9px;margin-top:12px}
#rresult{margin-top:12px;font-size:14.5px;line-height:1.75;color:#bfc4b8}
#rresult b{color:var(--ink)}
