/* Exit Code Zero v4: shared tokens, base, buttons, pills, tags and the full-page screens
   (title, How to play, chapter cards, end card), toast, credit, sound button and error line.
   Owner: shell. Layout line: wide is 760 px and up, narrow is below 760 px. */

:root{
  --ground:#f4f7f5; --ink:#0f0f0f; --grey:#636363; --grey-2:#4a4a4a; --line:rgba(15,15,15,.07);
  --line-2:#e3e9e6; --faint:#7b8580;
  --mint:#12e29d; --mint-hi:#6bffc1; --mint-pale:#e9fbf2; --mint-tag:#d7f8e9; --green-text:#0a7a52;
  --deep:#113227; --deep-2:#1f5c4a;
  --red:#e5484d; --red-pale:#ffe9ea; --red-text:#c7262c;
  --amber:#f0a400; --amber-pale:#fff1d6; --amber-text:#8a5a00;
  --violet:#6d4aff; --violet-2:#5b3fd9; --lavender:#f1edff;
  --find:#c98a00; --understand:#6d4aff; --fix:#0fae73;
  --code-bg:#1b1d1c; --code-ink:#e8efe9;
  --sans:'Inter',system-ui,-apple-system,sans-serif;
  --tight:'Inter Tight','Inter',system-ui,sans-serif;
  --display:'Mona Sans','Inter Tight','Inter',sans-serif;
  --mono:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  --r-card:24px; --r-pill:999px;
  --shadow-card:0 1px 2px rgba(15,15,15,.04),0 18px 50px rgba(15,61,44,.14);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%}
/* no grey-blue flash on a tap: every control has its own pressed and focus states (inherited by every element) */
html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
body{
  font-family:var(--sans);color:var(--ink);-webkit-font-smoothing:antialiased;font-feature-settings:"cv11","ss01";
  overflow:hidden;position:relative;
  background-color:var(--ground);
  background-image:
    radial-gradient(circle at 1px 1px,rgba(16,110,74,.13) 1px,transparent 1.4px),
    radial-gradient(1200px 520px at 18% -8%,rgba(150,245,205,.85),rgba(150,245,205,0) 70%),
    radial-gradient(900px 480px at 92% 0%,rgba(214,205,255,.55),rgba(214,205,255,0) 70%),
    linear-gradient(180deg,#dcfbee 0%,#eefcf6 38%,#f7fbf9 70%,#ffffff 100%);
  background-size:22px 22px,auto,auto,auto;
}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
button:focus-visible,a:focus-visible{outline:2px solid var(--violet);outline-offset:3px}
svg{flex:none}

/* ---------- layers ---------- */
#world{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0;opacity:0;transition:opacity .6s ease;touch-action:manipulation}
body.world-ready #world{opacity:1}
#hud{position:fixed;inset:0;z-index:3;pointer-events:none}
#hud > *{pointer-events:auto}
#hud > #coach,#hud > #ptag{pointer-events:none}
#screen{position:fixed;inset:0;z-index:2;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}
body[data-screen="howto"] #screen,
body[data-screen="chapter"] #screen,
body[data-screen="end"] #screen{z-index:4}
#toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:8}
#credit{position:fixed;z-index:3}
#err{position:fixed;z-index:20}

/* ---------- shared atoms ---------- */
.mono{font-family:var(--mono)}
.src{display:inline-block;font:500 10.5px/1 var(--mono);color:var(--faint);border:1px solid var(--line-2);border-radius:6px;padding:3px 6px;background:#fff;vertical-align:2px;letter-spacing:0;white-space:nowrap}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 22px;border-radius:var(--r-pill);
  font:600 15px/1 var(--sans);letter-spacing:-.01em;white-space:nowrap;border:1px solid transparent;cursor:pointer;
  transition:transform .12s ease,box-shadow .2s ease,background-color .2s ease,opacity .2s ease;user-select:none;-webkit-user-select:none}
.btn:active:not([disabled]){transform:scale(.97)}
.btn svg{width:13px;height:13px}
.btn-mint{background:var(--mint);color:#04281b;box-shadow:0 6px 18px rgba(18,226,157,.35),inset 0 1px 0 rgba(255,255,255,.4)}
.btn-mint:hover:not([disabled]){background:#22eaa8}
.btn-white{background:#fff;color:var(--ink);border-color:#dfe4e1;box-shadow:0 1px 2px rgba(15,15,15,.05)}
.btn-white:hover:not([disabled]){border-color:#c9d3ce}
.btn-reject{background:#fff;color:var(--red-text);border-color:#f1d4d4}
.btn[disabled]{background:#edf1ef;color:#9aa5a0;border-color:#e2e8e5;box-shadow:none;cursor:default}
.btn-lg{min-height:48px;padding:0 26px;font-size:16px}
/* the static halo the frames draw around the one primary button of a full-page screen (never animated) */
.halo{box-shadow:0 0 0 6px rgba(18,226,157,.22),0 0 0 13px rgba(18,226,157,.10),0 6px 18px rgba(18,226,157,.35)}

.chip-ch{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px 0 10px;border-radius:var(--r-pill);background:#fff;border:1px solid var(--line-2);font:500 14px/1 var(--sans);color:var(--ink);white-space:nowrap}
.chip-ch svg{width:15px;height:15px;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.chip-ch.find svg{stroke:var(--find)}
.chip-ch.understand svg{stroke:var(--understand)}
.chip-ch.fix svg{stroke:var(--fix)}
.chip-ch .w{color:var(--grey);font-weight:400}
.tag-product{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:var(--r-pill);background:var(--mint-tag);border:1px solid #bdf0d9;color:var(--green-text);font:500 12.5px/1 var(--sans);white-space:nowrap}
.tag-ai{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:var(--r-pill);background:var(--lavender);border:1px solid #e4dcff;color:var(--violet-2);font:500 12.5px/1 var(--sans);white-space:nowrap}
.pill-rec{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:var(--r-pill);font:500 12px/1 var(--mono);white-space:nowrap;letter-spacing:.01em}
.pill-rec.bad{background:#ff8f8f;color:#4a0d0d;border:1px solid #f57b7b}
.pill-rec.warn{background:#fde68a;color:#7a4a05;border:1px solid #f5cf55}
.pill-rec.good{background:#2fe3a5;color:#04412b;border:1px solid #1fcf92}
.pill-code{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:4px 10px;border-radius:var(--r-pill);font:500 12px/1.25 var(--mono)}
.pill-code.zero{background:var(--mint-tag);color:#0b7a53;border:1px solid #bdf0d9}
.pill-code.one{background:#ffe1e1;color:#8a1d1d;border:1px solid #f8bcbc}
.disc{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font:600 14px/1 var(--tight);letter-spacing:.02em;background:#e6e9e8;color:var(--ink)}
.disc.mint{background:var(--mint);color:#04281b}
.credit-text{font:400 11px/1.45 var(--mono);color:var(--grey-2);letter-spacing:0}

/* tracker: the same segmented bar as the goal line (chapter cards show it as "Your progress") */
.trk{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
.trk .g{display:flex;align-items:center;gap:4px}
.trk .gi{width:15px;height:15px;margin-right:2px;fill:none;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.trk .seg{width:18px;height:6px;border-radius:999px;background:#e3e8e5}
.trk .seg.done{background:var(--mint)}
.trk .seg.now{width:30px;background:var(--c);box-shadow:0 0 0 3px color-mix(in srgb,var(--c) 22%,transparent)}

/* ---------- sound button, credit during rounds, toast, error line ---------- */
.icon-btn{position:absolute;top:18px;right:18px;width:36px;height:36px;border-radius:50%;background:#fff;border:1px solid var(--line-2);display:grid;place-items:center;box-shadow:0 4px 14px rgba(15,61,44,.08);z-index:6;color:var(--ink)}
.icon-btn svg{width:16px;height:16px}
.icon-btn::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%)}

/* Start over: a 44 px tall hit box around a 36 px pill (32 px narrow). It sits beside the sound button
   (body[data-restart] unset or "beside") or in the corner when the sound button is hidden ("corner"). When the
   goal line or the page's top line needs the room it becomes an icon circle: beside the sound button
   ("compact"), top left ("left", mid widths), under the sound button ("stack", narrow) or in the corner
   ("cornericon", the narrow end card). main.js placeRestart picks the spot. Above #screen (z 4) so it shows on
   the chapter and end pages too; below the toast and the error line. */
#restart{position:fixed;top:14px;right:62px;z-index:7;height:44px;min-width:44px;margin:0;padding:4px 0;border:0;background:none;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--ink);font:500 13px/1 var(--sans);-webkit-tap-highlight-color:transparent;touch-action:manipulation}
#restart .pill{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;padding:0 14px 0 11px;border-radius:var(--r-pill);background:#fff;border:1px solid var(--line-2);box-shadow:0 4px 14px rgba(15,61,44,.08);white-space:nowrap;transition:border-color .15s ease,transform .12s ease}
#restart svg{width:15px;height:15px;flex:none}
#restart:hover .pill{border-color:#c9d3ce}
#restart:active .pill{transform:scale(.96)}
#restart:focus{outline:none}
#restart:focus-visible .pill{box-shadow:0 0 0 3px rgba(18,226,157,.5),0 4px 14px rgba(15,61,44,.08)}
#restart[aria-expanded="true"] .pill{border-color:#c9d3ce;background:var(--mint-pale)}
body[data-restart="corner"] #restart{right:18px}
body[data-restart="compact"] #restart{right:58px;width:44px;padding:4px}
body[data-restart="left"] #restart{right:auto;left:14px;width:44px;padding:4px}
body[data-restart="stack"] #restart{top:58px;right:14px;width:44px;padding:4px}
body[data-restart="cornericon"] #restart{right:14px;width:44px;padding:4px}
body[data-restart="stack"] #restart .pill,body[data-restart="compact"] #restart .pill,body[data-restart="left"] #restart .pill,body[data-restart="cornericon"] #restart .pill{width:36px;padding:0}
body[data-restart="stack"] #restart .lbl,body[data-restart="compact"] #restart .lbl,body[data-restart="left"] #restart .lbl,body[data-restart="cornericon"] #restart .lbl{display:none}

#restart-ask{position:fixed;inset:0;z-index:9}
#restart-ask .scrim{position:absolute;inset:0;background:rgba(15,40,30,.18);opacity:0;transition:opacity .16s ease}
#restart-ask .box{position:absolute;top:var(--ask-top,66px);right:var(--ask-right,18px);width:min(340px,calc(100vw - 32px));box-sizing:border-box;padding:18px 18px 16px;border-radius:20px;background:#fff;border:1px solid var(--line);box-shadow:0 22px 50px -14px rgba(15,61,44,.38);opacity:0;transform:translateY(-6px);transition:opacity .16s ease,transform .16s ease}
#restart-ask.on .scrim{opacity:1}
#restart-ask.on .box{opacity:1;transform:none}
#restart-ask .q{margin:0;font:600 17px/1.3 var(--sans);color:var(--ink);letter-spacing:-.1px}
#restart-ask .n{margin:6px 0 0;font:400 14px/1.4 var(--sans);color:var(--grey)}
#restart-ask .row{display:flex;gap:10px;margin-top:16px}
#restart-ask .row .btn{flex:1 1 0;padding:0 12px;font-size:14px}
@media (prefers-reduced-motion:reduce){
  #restart .pill,#restart-ask .scrim,#restart-ask .box{transition:none}
}
@media (max-width:759.98px){
  #restart{top:6px;right:50px;padding:6px 0}
  #restart .pill{height:32px;padding:0 12px 0 10px;font-size:13px}
  body[data-restart="corner"] #restart{right:12px}
  body[data-restart="cornericon"] #restart{right:6px;width:44px;padding:6px}
  body[data-restart="stack"] #restart{top:calc(50px + env(safe-area-inset-top,0px));right:6px;width:44px;padding:6px}
  body[data-restart="stack"] #restart .pill,body[data-restart="cornericon"] #restart .pill{width:32px;padding:0}
  #restart-ask .box{left:16px;right:16px;width:auto}
}
.credit{right:22px;bottom:16px;white-space:nowrap;text-align:right;font:400 11px/1.4 var(--mono);color:var(--grey-2);pointer-events:none}
#toast{max-width:min(560px,calc(100vw - 32px));padding:11px 16px;border-radius:14px;background:var(--ink);color:#fff;font:500 14px/1.4 var(--sans);box-shadow:0 18px 40px -12px rgba(15,15,15,.45);opacity:0;transition:opacity .18s ease,transform .18s ease}
#toast.on{opacity:1}
#toast textarea{display:block;width:min(520px,calc(100vw - 64px));height:110px;margin-top:8px;border-radius:10px;border:0;padding:8px 10px;font:400 12px/1.45 var(--mono);color:var(--ink);resize:none}
#err{left:16px;right:16px;top:16px;margin:0 auto;max-width:640px;padding:12px 16px;border-radius:14px;background:#fff;border:1px solid #f8bcbc;color:var(--red-text);font:500 14px/1.45 var(--sans);box-shadow:0 12px 30px -12px rgba(199,38,44,.35)}

/* ======================================================================================
   TITLE (onboard-1)
   ====================================================================================== */
.scr-title{position:absolute;inset:0;pointer-events:none}
.scr-title::before{content:"";position:absolute;left:8px;right:8px;top:8px;height:58%;border-radius:24px 24px 0 0;
  background:linear-gradient(180deg,rgba(169,243,211,.9) 0%,rgba(205,248,229,.75) 40%,rgba(233,251,242,0) 100%);pointer-events:none}
.scr-title .mark{position:absolute;top:26px;left:30px;display:flex;align-items:center;gap:10px;font:600 15px/1 var(--sans);letter-spacing:-.01em;pointer-events:auto}
.tile-check{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:28%;background:linear-gradient(160deg,#3cf0b2,#10c98a);box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 6px 16px rgba(16,160,110,.28)}
.tile-check svg{width:15px;height:15px}
.scr-title .head{position:relative;text-align:center;padding:58px 24px 0;pointer-events:none}
.scr-title .lead{display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:0 4px;border-radius:999px;background:rgba(255,255,255,.7);border:1px solid #b9ecd6;box-shadow:0 0 0 3px rgba(255,255,255,.5)}
.scr-title .lead .t{height:22px;padding:0 10px;border-radius:999px;background:var(--mint-tag);color:#0b7a53;font:500 12px/22px var(--mono)}
.scr-title .lead .e{display:inline-flex;align-items:center;gap:6px;padding-right:10px;font:400 12px/1 var(--mono);color:#3d4643}
.scr-title h1{font:600 92px/1 var(--sans);letter-spacing:-3.2px;color:var(--ink);margin-top:20px}
.scr-title h1 em{font-style:normal;background:linear-gradient(180deg,#14d495,#0a9e6c);-webkit-background-clip:text;background-clip:text;color:transparent}
.scr-title .sub{font:400 20px/1.45 var(--sans);color:var(--grey);margin:16px auto 0;max-width:860px;letter-spacing:-.01em}
.scr-title .tools{display:inline-block;margin-top:4px;font-weight:500;color:#2f3532}
.scr-title .ctas{display:flex;gap:12px;justify-content:center;margin-top:26px;pointer-events:auto}
.scr-title .foot{position:absolute;left:50%;transform:translateX(-50%);bottom:16px;text-align:center;padding:6px 14px;border-radius:999px;background:rgba(255,255,255,.82);border:1px solid #e2ebe7;white-space:nowrap}

/* ======================================================================================
   HOW TO PLAY (onboard-2)
   ====================================================================================== */
.scr-howto{position:absolute;inset:0;display:grid;place-items:center;padding:24px 16px;background:rgba(244,247,245,.55);-webkit-backdrop-filter:blur(7px) saturate(.9);backdrop-filter:blur(7px) saturate(.9);overflow-y:auto}
.htp{position:relative;width:min(620px,100%);border-radius:var(--r-card);background:linear-gradient(180deg,#ffffff 0%,#f7fdfa 70%,#eefcf5 100%);border:1px solid #dfeae5;box-shadow:0 24px 70px rgba(15,61,44,.18);padding:34px 36px 26px}
.htp .hd{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.htp h2{font:600 34px/1.1 var(--sans);letter-spacing:-1.1px}
.htp .k{font:400 12px/1 var(--mono);color:#8a938f}
.htp .rows{margin-top:22px;display:flex;flex-direction:column;gap:14px}
.htp .row{display:grid;grid-template-columns:132px 1fr;gap:16px;align-items:center}
.htp .row p{font:400 16px/1.45 var(--sans);color:#2f3532;letter-spacing:-.005em}
.htp .chip{justify-self:start;display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 11px;border-radius:999px;font:500 12px/1 var(--mono);white-space:nowrap}
.htp .c-dup{background:#fde68a;color:#7a4a05;border:1px solid #f5cf55}
.htp .c-ok{background:#2fe3a5;color:#04412b;border:1px solid #1fcf92}
.htp .c-pr{background:#fff;color:var(--ink);border:1px solid var(--line-2)}
.htp .c-pr i{width:16px;height:16px;border-radius:50%;background:var(--mint);font:600 8px/16px var(--sans);text-align:center;font-style:normal;color:#04281b}
.htp .c-ap{background:linear-gradient(90deg,#efe9ff,#e2d6ff);color:#4c1d95;border:1px solid #d4c4fb}
.htp .goalbox{margin-top:22px;border:1px solid var(--line-2);border-radius:16px;background:#fff;padding:16px 18px}
.htp .goalbox p{font:400 15px/1.45 var(--sans)}
.htp .goalbox .codes{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.htp .goalbox .note{margin-top:10px;color:var(--grey);font-size:14px}
.htp .bot{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:22px}
.htp .bot .credit-text{max-width:330px}

/* ======================================================================================
   CHAPTER CARDS (onboard-3, finale-1, finale-2)
   ====================================================================================== */
.scr-chapter{position:relative;min-height:100%;background:var(--ground);padding-bottom:28px}
.scr-chapter .band{position:absolute;left:0;right:0;top:0;height:132px;overflow:hidden;border-bottom:1px solid var(--line-2)}
.scr-chapter .band::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#c9f5e0 0%,#e6f6ee 45%,#ece8fb 100%)}
.scr-chapter .band::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(244,247,245,0) 30%,var(--ground) 100%)}
.scr-chapter .band .grid{position:absolute;z-index:1;left:50%;top:-14px;transform:translateX(-50%);display:grid;grid-template-columns:repeat(32,40px);gap:6px}
.scr-chapter .band .grid i{width:40px;height:40px;border-radius:9px;background:rgba(255,255,255,.55);border:1px solid rgba(15,92,63,.06)}
.scr-chapter .vl{position:absolute;top:132px;bottom:0;width:1px;background:var(--line-2)}
.scr-chapter .plus{position:absolute;top:132px;width:13px;height:13px;transform:translate(-6px,-6px)}
.scr-chapter .plus::before,.scr-chapter .plus::after{content:"";position:absolute;background:#b8c3be}
.scr-chapter .plus::before{left:6px;top:0;width:1px;height:13px}
.scr-chapter .plus::after{top:6px;left:0;height:1px;width:13px}
.scr-chapter .wrap{position:relative;max-width:1280px;margin:0 auto;padding:156px 0 0}
.scr-chapter .top{display:flex;justify-content:space-between;align-items:center}
.scr-chapter .cnum{font:400 13px/1 var(--mono);color:#6b7570}
.scr-chapter .eyebrow{display:flex;align-items:center;gap:8px;font:400 13px/1 var(--mono);color:#4b5550;margin-top:20px}
.scr-chapter .eyebrow svg{width:12px;height:12px}
.scr-chapter .hero{display:grid;grid-template-columns:1fr 340px;align-items:end;gap:40px}
.scr-chapter h1{font-family:var(--display);font-weight:800;font-stretch:75%;font-size:88px;line-height:.92;letter-spacing:-2.3px;margin-top:12px;padding-bottom:6px;
  background:linear-gradient(180deg,#0f0f0f 0%,#0f0f0f 48%,#5d6862 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
.scr-chapter h1 span{display:block}
.scr-chapter .sub{font-size:18px;color:var(--grey);margin-top:12px;max-width:780px;line-height:1.45}
.scr-chapter .side{display:flex;flex-direction:column;gap:14px;align-items:flex-end;padding-bottom:8px}
.scr-chapter .prog{background:#fff;border:1px solid var(--line-2);border-radius:16px;padding:12px 14px;width:100%}
.scr-chapter .prog .h{font:400 12px/1 var(--mono);color:#7b8580;margin-bottom:10px;display:flex;justify-content:space-between}
.scr-chapter .cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:28px}
.scr-chapter .card{position:relative;background:#fff;border:1px solid var(--line-2);border-radius:22px;padding:16px 18px 14px;overflow:hidden;box-shadow:0 1px 2px rgba(15,61,44,.04);display:flex;flex-direction:column}
.scr-chapter .card.next{border-color:#f3dfb4;background:linear-gradient(180deg,#fffaf0 0%,#ffffff 60%);box-shadow:0 18px 40px -22px rgba(201,138,0,.45)}
.scr-chapter .card .glow{position:absolute;left:0;right:0;top:0;height:200px;pointer-events:none}
.scr-chapter .card .row{position:relative;display:flex;justify-content:space-between;align-items:center}
.scr-chapter .card .chip-ch{font-size:13px;height:28px;padding:0 11px 0 9px}
.scr-chapter .card .rn{font:400 12px/1 var(--mono);color:#6b7570}
.scr-chapter .ill{position:relative;height:136px;margin:10px 0;display:flex;align-items:center;justify-content:center}
.scr-chapter .card h3{position:relative;font:600 23px/1.1 var(--tight);letter-spacing:-.6px}
.scr-chapter .card p{position:relative;font-size:14px;color:var(--grey);margin-top:7px;line-height:1.4;min-height:39px;flex:1}
.scr-chapter .card .ft{position:relative;display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--line-2);margin-top:14px;padding-top:11px;font:400 12px/1 var(--mono);color:#4b5550}
.scr-chapter .card .ft > span:first-child{display:inline-flex;gap:7px;align-items:center}
.scr-chapter .card .ft svg{width:11px;height:11px}
.scr-chapter .card .ft .up{color:#b45309}
.scr-chapter .cta{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:22px}
.scr-chapter .foot{text-align:center;margin-top:44px}
/* tile illustrations */
.ill .mini{background:#fff;border:1px solid #e6ece9;border-radius:12px;box-shadow:0 10px 24px -14px rgba(15,61,44,.35);font:400 10.5px/1.25 var(--mono);color:#3d4542}
.ill .mp{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:3px 8px;font:500 10px/1.2 var(--mono);white-space:nowrap}
.ill .p-ok{background:var(--mint);color:#063d2a}
.ill .p-dup{background:#ffd66b;color:#4a3500}
.ill .p-bad{background:#ff8a8f;color:#5c0b10}
.ill .p-grey{background:#f0f3f1;color:#4b5550}
.ill .mdisc{width:20px;height:20px;border-radius:50%;display:inline-grid;place-items:center;font:600 8.5px/1 var(--sans);color:#fff;background:#6f7a75}
.ill .kv{width:300px;padding:10px 12px}
.ill .kv .r{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;border-bottom:1px solid #eef2f0}
.ill .kv .r:last-child{border-bottom:0}
.ill .tbl{width:100%;border-collapse:collapse}
.ill .tbl td,.ill .tbl th{padding:5px 8px;text-align:left;white-space:nowrap}
.ill .tbl th{font-weight:500;color:#8a948f;border-bottom:1px solid #eef2f0}
.ill .tbl tr.hl td{background:#fff8e1}
.ill .code{background:#14201b;border-radius:12px;padding:12px 14px;font:400 10.5px/1.55 var(--mono);color:#cfe0d8;box-shadow:0 12px 26px -14px rgba(0,0,0,.5)}
.ill .code .k{color:#6bffc1}.ill .code .s{color:#ffd66b}.ill .code .c{color:#7d9389}
.ill .bm{display:inline-block;border-radius:999px;padding:3px 8px;font:500 9.5px/1.2 var(--sans);border:1px solid #e3e9e6;background:#fff;color:#3d4542}
.ill .bm.on{background:var(--mint);border-color:var(--mint);color:#063d2a}
.ill .ai{width:330px;max-width:100%;border-radius:12px;padding:12px 14px;background:linear-gradient(90deg,#f1edff,#e9e2ff);color:#5b3fd9;font:400 12px/1.5 var(--sans)}
.ill .ai b{font-weight:600}
.ill svg.band2{width:260px;max-width:100%;height:auto}

/* ======================================================================================
   END CARD (finale-3)
   ====================================================================================== */
.scr-end{position:relative;min-height:100%}
.scr-end .page{position:relative;width:100%;max-width:1440px;margin:0 auto;padding:24px 40px 0}
.scr-end header{text-align:center}
.scr-end .etag{display:inline-flex;align-items:center;gap:8px;font:500 12px/1 var(--mono);color:var(--green-text);background:var(--mint-pale);border:1px solid #c4f0db;border-radius:999px;padding:7px 12px}
.scr-end .etag .dot{width:6px;height:6px;border-radius:50%;background:var(--mint);box-shadow:0 0 0 3px rgba(18,226,157,.18)}
.scr-end h1{font-family:var(--display);font-weight:800;font-stretch:75%;font-size:64px;line-height:1;letter-spacing:-1.5px;margin:12px 0 8px;
  background:linear-gradient(180deg,#0f0f0f 40%,#3a4a43 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
.scr-end .sub{font-size:17px;color:var(--grey);letter-spacing:-.1px}
.scr-end .sub .src{margin-left:8px}
.scr-end .main{display:grid;grid-template-columns:1fr 470px;gap:28px;margin-top:12px;align-items:start}
.scr-end .world{position:relative;height:640px;pointer-events:none}
.scr-end .isle{position:absolute;left:0;right:0;top:0;bottom:150px}
.scr-end .shelf{position:absolute;left:20px;right:20px;bottom:0;background:rgba(255,255,255,.88);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--line-2);border-radius:22px;
  box-shadow:0 12px 32px -14px rgba(15,61,44,.25);padding:12px 16px 14px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;pointer-events:auto}
.scr-end .grp{display:flex;flex-direction:column;gap:9px}
.scr-end .grp + .grp{border-left:1px dashed #dbe3df;padding-left:12px}
.scr-end .grp .chip-ch{align-self:flex-start;height:26px;font-size:12px;padding:0 10px 0 8px}
.scr-end .grp .chip-ch svg{width:13px;height:13px}
.scr-end .tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.scr-end .tile{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px}
.scr-end .ico{position:relative;width:42px;height:42px;border-radius:11px;background:linear-gradient(160deg,var(--deep-2),var(--deep));display:grid;place-items:center;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 4px 10px -4px rgba(17,50,39,.5)}
.scr-end .ico > svg{width:20px;height:20px;stroke:var(--mint-hi);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.scr-end .ico .ok{position:absolute;right:-5px;top:-5px;width:16px;height:16px;border-radius:50%;background:var(--mint);border:2px solid #fff;display:grid;place-items:center}
.scr-end .ico .ok svg{width:9px;height:9px;stroke:#063d2a;stroke-width:3.4;fill:none;stroke-linecap:round;stroke-linejoin:round}
.scr-end .tile b{font:600 11px/1.2 var(--sans);letter-spacing:-.1px;color:var(--ink)}
.scr-end .tile i{font:400 9.5px/1 var(--mono);font-style:normal;color:#7b8580}
.scr-end .run{background:linear-gradient(180deg,#ffffff 0%,#ffffff 55%,#effcf5 100%);border:1px solid var(--line-2);border-radius:24px;box-shadow:0 30px 60px -30px rgba(15,61,44,.35),0 2px 6px rgba(15,61,44,.05);padding:22px 24px 20px;margin-top:20px}
.scr-end .crow{display:flex;align-items:center;justify-content:space-between}
.scr-end .crow .eb{font:500 12px/1 var(--mono);color:#7b8580}
.scr-end .crow .time{font:500 11.5px/1 var(--mono);color:#4b5550;background:#f2f5f3;border-radius:999px;padding:6px 10px}
.scr-end .run h2{font:600 34px/1.05 var(--tight);letter-spacing:-1.1px;margin:10px 0 6px}
.scr-end .run .lead{font-size:14.5px;color:var(--grey)}
.scr-end .three{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:16px}
.scr-end .big{border:1px solid var(--line-2);border-radius:16px;padding:14px 14px 13px;background:#fff}
.scr-end .big.zb{background:linear-gradient(180deg,#fff,#effcf5)}
.scr-end .big .n{font:600 38px/1 var(--tight);letter-spacing:-1.2px;height:40px;display:flex;align-items:center}
.scr-end .big .z{display:inline-grid;place-items:center;min-width:52px;height:40px;border-radius:999px;background:var(--mint);color:#063d2a;font:600 26px/1 var(--mono);box-shadow:0 8px 18px -8px rgba(18,226,157,.9)}
.scr-end .big .t{font-size:13px;color:#3d4542;margin-top:8px;line-height:1.3}
.scr-end .runs{margin-top:10px;border:1px solid var(--line-2);border-radius:16px;padding:10px 12px;background:#fff}
.scr-end .runs .lbl{font:500 11px/1 var(--mono);color:#7b8580;margin-bottom:8px}
.scr-end .codes{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.scr-end .code{display:flex;flex-direction:column;align-items:center;gap:6px}
.scr-end .code .c{width:100%;height:30px;border-radius:10px;display:grid;place-items:center;font:600 16px/1 var(--mono)}
.scr-end .code .c.f{background:#fff0f0;color:#c7353b;border:1px solid #ffd2d4}
.scr-end .code .c.p{background:var(--mint);color:#063d2a;box-shadow:0 6px 16px -6px rgba(18,226,157,.8)}
.scr-end .code span{font:400 10.5px/1 var(--mono);color:#7b8580}
.scr-end .verdict{margin-top:12px;display:flex;gap:12px;align-items:flex-start;background:#f6f8f7;border-radius:16px;padding:10px 12px}
.scr-end .verdict .disc{width:34px;height:34px;font-size:12px}
.scr-end .verdict .disc.grey{background:#6f7a75;color:#fff}
.scr-end .verdict .who{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;margin-bottom:5px}
.scr-end .verdict .who b{font:600 14px/1 var(--sans);color:var(--ink)}
.scr-end .verdict .who span{font:400 11px/1 var(--mono);color:var(--grey)}
.scr-end .verdict q{font-size:14px;line-height:1.36;color:var(--ink);quotes:none}
.scr-end .btns{display:flex;align-items:center;gap:10px;margin-top:16px}
.scr-end .btns .hint{font-size:11.5px;color:#7b8580;margin-left:auto;text-align:right;line-height:1.3}
.scr-end .foot{text-align:center;padding:12px 0 14px}

/* ======================================================================================
   NARROW (below 760 px)
   ====================================================================================== */
@media (max-width:759.98px){
  .icon-btn{top:calc(12px + env(safe-area-inset-top,0px));right:12px;width:32px;height:32px}
  .credit{display:none}

  .scr-title::before{left:6px;right:6px;top:6px;border-radius:20px 20px 0 0;height:62%}
  .scr-title .mark{top:18px;left:18px;font-size:14px}
  .scr-title .head{padding:60px 16px 0}
  .scr-title .lead{flex-direction:column;gap:8px;background:none;border:0;box-shadow:none}
  .scr-title .lead .e{font-size:11.5px;padding:0}
  .scr-title h1{font-size:52px;letter-spacing:-1.8px;margin-top:14px;line-height:1}
  .scr-title h1 em{display:block}
  .scr-title .sub{font-size:16px;margin-top:12px}
  .scr-title .tools{font-size:13.5px}
  .scr-title .ctas{gap:10px;margin-top:18px}
  .scr-title .ctas .btn{min-height:46px;padding:0 20px;font-size:15px}
  .scr-title .foot{white-space:normal;left:12px;right:12px;transform:none;border-radius:14px;bottom:12px;padding:6px 10px}

  .scr-howto{place-items:start center;padding:16px}
  .htp{padding:24px 20px 20px}
  .htp h2{font-size:28px}
  .htp .rows{gap:12px;margin-top:16px}
  .htp .row{grid-template-columns:1fr;gap:6px}
  .htp .row p{font-size:15px}
  .htp .goalbox{padding:14px}
  .htp .bot{flex-direction:column-reverse;align-items:stretch;gap:14px}
  .htp .bot .btn{width:100%}
  .htp .bot .credit-text{max-width:none;text-align:center}
  /* Priya's initials in her chip at 12 px on a phone: a larger disc in the same 26 px chip */
  .htp .c-pr{padding-left:2px}
  .htp .c-pr i{width:22px;height:22px;font:600 12px/22px var(--sans);letter-spacing:-.3px}
  /* the button row is pinned to the card's bottom edge: on a phone How to play is taller than the screen, and
     "Got it" stays in view with the rules scrolling under it (the cut-off text above the bar shows they scroll) */
  /* bottom matches the screen's padding, so the pinned bar meets the screen's bottom edge with nothing under it;
     the card clips (without becoming a scroller) so the bar takes its rounded corners at the end */
  .htp{overflow:clip}
  .htp .bot{position:sticky;bottom:-16px;z-index:1;margin:22px -20px -20px;padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));
    background:#f2fcf7;border-top:1px solid #dfeae5}
  .htp .bot::before{content:"";position:absolute;left:0;right:0;bottom:calc(100% + 1px);height:18px;pointer-events:none;
    background:linear-gradient(180deg,rgba(247,253,250,0),rgba(247,253,250,.92))}

  .scr-chapter .band{height:96px}
  .scr-chapter .vl,.scr-chapter .plus{display:none}
  .scr-chapter .wrap{padding:112px 16px 0}
  .scr-chapter .hero{grid-template-columns:1fr;gap:18px}
  .scr-chapter h1{font-size:56px;letter-spacing:-1.4px}
  .scr-chapter .sub{font-size:16px}
  .scr-chapter .side{align-items:stretch}
  .scr-chapter .side .btn{width:100%}
  .scr-chapter .prog .trk{gap:7px}
  .scr-chapter .prog .trk .seg{width:16px}
  .scr-chapter .prog .trk .seg.now{width:24px}
  .scr-chapter .cards{grid-template-columns:1fr;gap:12px;margin-top:20px}
  .scr-chapter .ill{height:auto;min-height:100px;transform:scale(.92)}
  .scr-chapter .card p{min-height:0}
  .scr-chapter .cta{flex-direction:column-reverse;align-items:stretch;gap:14px}
  .scr-chapter .cta .btn{width:100%}
  .scr-chapter .cta .credit-text{text-align:center}
  .scr-chapter .foot{margin-top:24px;padding:0 16px}

  .scr-end .page{padding:22px 16px 0}
  .scr-end h1{font-size:44px;letter-spacing:-1px;margin:14px 0 10px}
  .scr-end .sub{font-size:15px}
  .scr-end .main{display:block}
  .scr-end .world{height:auto}
  .scr-end .isle{position:relative;left:auto;right:auto;top:auto;bottom:auto;height:270px;margin:0 -16px}
  .scr-end .shelf{position:relative;left:auto;right:auto;grid-template-columns:1fr;gap:12px;margin:-4px 0 16px}
  .scr-end .grp + .grp{border-left:0;padding-left:0;border-top:1px dashed #dbe3df;padding-top:12px}
  .scr-end .run{padding:20px 18px 18px;border-radius:22px;margin-top:0}
  .scr-end .run h2{font-size:30px}
  .scr-end .three{gap:6px}
  .scr-end .big{padding:12px 10px}
  .scr-end .big .n{font-size:30px;height:34px}
  .scr-end .big .z{min-width:44px;height:34px;font-size:22px}
  .scr-end .big .t{font-size:12px}
  .scr-end .btns{flex-wrap:wrap}
  .scr-end .btns .hint{margin-left:0;text-align:left;width:100%}
  .scr-end .foot{padding:16px 8px 22px}
}
@media (max-width:1180px) and (min-width:760px){
  .credit{display:none} /* one line beside the bubble needs room; D13 asks for it at 1440 */
  .scr-chapter .wrap{padding-left:32px;padding-right:32px}
  .scr-chapter .vl,.scr-chapter .plus{display:none}
  .scr-end .main{grid-template-columns:1fr 420px}
  .scr-end .shelf{left:0;right:0}
}
@media (max-height:760px) and (min-width:760px){
  .scr-title .head{padding-top:44px}
}
@media (prefers-reduced-motion:reduce){
  *{transition-duration:.01ms!important;animation-duration:.01ms!important}
}

/* ======================================================================================
   Lesson face (js/consoles/index.js lesson). Owner: ui lane. Next round rides in a sticky
   bar at the card's bottom edge so it never needs scrolling to; cz-compact folds the
   secondary rows when the lesson would make the card scroll.
   ====================================================================================== */
#card .cz-nextbar{position:sticky;bottom:0;z-index:3;padding:14px 24px 20px;margin-top:-20px;
  background:#e9fbf2;border-top:1px solid #d3eee1}
#card .cz-nextbar .btn.cz-next{margin-top:0}
#card.cz-compact .cz-onboard,#card.cz-compact .cz-row-ok,#card.cz-compact .cz-legend2,
#card.cz-compact .cz-mon .cz-note,#card.cz-compact .cz-sub2,#card.cz-compact .cz-quotebox,
#card.cz-compact .cz-dslist .cz-ds:not(.cz-flag):not(.cz-more),#card.cz-compact .cz-tiny{display:none}
#card.cz-compact .cz-lesson-in{margin-top:12px}
#card.cz-compact[data-round="6"] .cz-apbar{display:none}
@media (max-width:759.98px){
  #card .cz-nextbar{padding:12px 16px calc(14px + env(safe-area-inset-bottom,0px));margin-top:-24px}
}
/* Narrow end card: the "Your run" pill that points at the scorecard below the shelf. */
.scr-end .endpill{position:fixed;left:0;right:0;bottom:0;z-index:5;display:block;width:100%;
  min-height:48px;padding:0 16px env(safe-area-inset-bottom,0px);border:0;border-top:1px solid #cdeedf;border-radius:0;
  background:rgba(247,253,250,.92);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  box-shadow:0 -10px 24px -16px rgba(16,80,50,.35);font:500 14px/48px var(--mono);color:#0b7a53;cursor:pointer;text-align:center}

/* ======================================================================================
   PHONES: height as well as width. Owner: shell (mobile pass, 15 Nov 2026).
   --sheet-cap is the height the narrow console sheet and the bubble docked on it may share: the screen height
   less the band the island needs to show the board pack whole with the round's gate under it, never more than
   56% (spec 8.3) and never less than a usable sheet. consoles.css reads it; guide.js docks the bubble.
   ====================================================================================== */
:root{--sheet-cap:44vh}
@media (max-width:759.98px){
  :root{--sheet-cap:clamp(230px,calc(100vh - 300px),56vh)}
  @supports (height:100dvh){ :root{--sheet-cap:clamp(230px,calc(100dvh - 300px),56dvh)} }
  /* rounds 7 and 8 need the payments gate in the band as well as the board pack and the orders gate */
  body[data-round="7"],body[data-round="8"]{--sheet-cap:clamp(230px,calc(100vh - 380px),56vh)}
  @supports (height:100dvh){ body[data-round="7"],body[data-round="8"]{--sheet-cap:clamp(230px,calc(100dvh - 380px),56dvh)} }
}
@media (max-width:759.98px) and (max-height:719.98px){
  :root{--sheet-cap:clamp(230px,calc(100vh - 286px),56vh)}
  @supports (height:100dvh){ :root{--sheet-cap:clamp(230px,calc(100dvh - 286px),56dvh)} }
  body[data-round="7"],body[data-round="8"]{--sheet-cap:clamp(220px,calc(100vh - 330px),56vh)}
  @supports (height:100dvh){ body[data-round="7"],body[data-round="8"]{--sheet-cap:clamp(220px,calc(100dvh - 330px),56dvh)} }
}

/* the owner's note under the title buttons: touch and narrow screens only, quiet, in the text flow */
.scr-title .desk-note{display:none;margin:14px auto 0;font:400 14px/1.4 var(--sans);color:var(--grey);letter-spacing:-.005em;pointer-events:none}
@media (max-width:759.98px),(pointer:coarse){
  .scr-title .desk-note{display:block}
}

@media (max-width:759.98px){
  /* readable small print on a phone */
  .credit-text{font-size:12px}
  .src{font-size:12px}
  .scr-title .lead .t{font-size:12.5px}
  .scr-title .lead .e{font-size:12.5px}
  .scr-title .foot{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .scr-title .desk-note{margin-top:12px}

  /* end card: tile names at 12 px with no round captions; the strip at the bottom never sits on the shelf */
  .scr-end .tile b{font-size:12px;line-height:1.25}
  .scr-end .tile i{display:none}
  .scr-end .shelf{margin-bottom:24px}
  .scr-end .page{padding-top:calc(22px + env(safe-area-inset-top,0px))}
  .scr-end .crow .time{font-size:12px}
  .scr-end .runs .lbl{font-size:12px}
  .scr-end .code span{font-size:12px}
  .scr-end .verdict .who span{font-size:12px}
  .scr-end .btns .hint{font-size:12.5px}
  .scr-end .foot{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}
}
/* the Start over circle on the end card leaves once the page scrolls, so it never sits on the scorecard */
#restart{transition:opacity .16s ease,visibility .16s}
body.end-scrolled[data-scene="end"] #restart{opacity:0;visibility:hidden;pointer-events:none}

/* short narrow screens: a compact title and How to play */
@media (max-width:759.98px) and (max-height:719.98px){
  .scr-title::before{height:66%}
  .scr-title .mark{top:14px}
  .scr-title .head{padding-top:46px}
  .scr-title .lead{gap:6px}
  .scr-title h1{font-size:42px;letter-spacing:-1.4px;margin-top:10px}
  .scr-title h1 em{display:inline}
  .scr-title .sub{font-size:15px;line-height:1.4;margin-top:10px}
  .scr-title .tools{font-size:13.5px}
  .scr-title .ctas{margin-top:14px}
  .scr-title .ctas .btn{min-height:44px}
  .scr-title .desk-note{margin-top:10px}
  .scr-title .foot{padding:5px 10px;bottom:calc(8px + env(safe-area-inset-bottom,0px))}

  .scr-howto{padding:12px}
  .htp{padding:20px 18px 18px}
  .htp h2{font-size:26px}
  .htp .rows{gap:10px;margin-top:12px}
  .htp .row p{font-size:14.5px;line-height:1.4}
  .htp .goalbox{margin-top:14px;padding:12px 14px}
  .htp .bot{bottom:-12px;margin:14px -18px -18px;padding:10px 18px calc(10px + env(safe-area-inset-bottom,0px));gap:8px}
}
@media (max-width:759.98px) and (max-height:599.98px){
  .scr-title .head{padding-top:40px}
  .scr-title .lead .e{display:none}
  .scr-title h1{font-size:38px;margin-top:8px}
  .scr-title .sub{font-size:14.5px}
}

/* a phone held sideways: too short for the island, the console and the bubble together, so a card asks to turn
   it upright (and says the game is best on a computer). It covers the game and takes every tap until then. */
#rotate{display:none}
@media (orientation:landscape) and (max-height:500px) and (pointer:coarse){
  #rotate{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:16px calc(16px + env(safe-area-inset-right,0px)) 16px calc(16px + env(safe-area-inset-left,0px));
    background:rgba(240,250,245,.86);-webkit-backdrop-filter:blur(14px) saturate(.9);backdrop-filter:blur(14px) saturate(.9);touch-action:none}
  #rotate .box{width:min(420px,100%);padding:26px 28px 24px;border-radius:24px;background:#fff;border:1px solid #dfeae5;box-shadow:0 24px 60px -20px rgba(15,61,44,.35);text-align:center}
  #rotate .ph{width:44px;height:44px;color:var(--green-text);animation:ecz-turn 2.4s ease-in-out infinite;transform-origin:50% 50%}
  #rotate .q{margin:12px 0 0;font:600 22px/1.2 var(--sans);letter-spacing:-.4px;color:var(--ink)}
  #rotate .n{margin:8px 0 0;font:400 15px/1.45 var(--sans);color:var(--grey)}
  #hud,#screen,#restart,#restart-ask,#toast{visibility:hidden}
}
@keyframes ecz-turn{0%,30%{transform:rotate(-90deg)}55%,100%{transform:rotate(0)}}
@media (prefers-reduced-motion:reduce){ #rotate .ph{animation:none} }
