/* ============================================================
   MathsConnected — shared theme
   Extracted from the hub so every new page (landing, pricing,
   login, dashboards) is visually identical to the game hub.
   ============================================================ */
:root{
  --navy:#1f3a72; --navy-deep:#16294f; --teal:#17858a; --teal-deep:#0f5e62;
  --purple:#7b3fa9; --purple-deep:#5c2c80; --gold:#e0a422; --gold-soft:#f7d98b;
  --ink:#26314b; --paper:#faf6ea; --card:#fffdf5; --line:#2b3a55;
  --grey:#8b93a7; --green:#2e8b57; --red:#d95d4e;
  --shadow:4px 5px 0 rgba(31,58,114,.14);
}
/* The two fonts, served from the site (22 Oct 2026; they were Google Fonts, a stylesheet from two other
   servers that every page waited for). Latin and Latin Extended only, as Google split them; Nunito is
   one variable file for every weight. Pages preload the two files they use at once. */
@font-face{font-family:'Nunito'; font-style:italic; font-weight:400; font-display:swap;
  src:url(fonts/nunito-v32-italic-latin.woff2) format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Nunito'; font-style:italic; font-weight:400; font-display:swap;
  src:url(fonts/nunito-v32-italic-latin-ext.woff2) format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Nunito'; font-style:normal; font-weight:400 900; font-display:swap;
  src:url(fonts/nunito-v32-normal-latin.woff2) format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Nunito'; font-style:normal; font-weight:400 900; font-display:swap;
  src:url(fonts/nunito-v32-normal-latin-ext.woff2) format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Patrick Hand'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/patrick-hand-v25-normal-latin.woff2) format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Patrick Hand'; font-style:normal; font-weight:400; font-display:swap;
  src:url(fonts/patrick-hand-v25-normal-latin-ext.woff2) format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
*{box-sizing:border-box; margin:0; padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'Nunito',sans-serif; color:var(--ink); background:var(--paper);
  background-image:
    linear-gradient(rgba(31,58,114,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,58,114,.045) 1px, transparent 1px);
  background-size:26px 26px;
  min-height:100vh;
}
h1,h2,h3,.hand{font-family:'Patrick Hand',cursive; font-weight:400; letter-spacing:.3px}
button{font-family:inherit; cursor:pointer}
a{color:var(--teal-deep)}
.hidden{display:none !important}

/* ---------- top bar ---------- */
.top{
  position:sticky; top:0; z-index:40;
  background:rgba(250,246,234,.92); backdrop-filter:blur(6px);
  border-bottom:2.5px solid var(--line);
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:10px clamp(12px,3vw,28px);
}
.brandpill{
  background:#fff; border:2.5px solid var(--line); border-radius:14px;
  padding:3px 10px; display:flex; align-items:center; box-shadow:var(--shadow);
  transform:rotate(-.6deg); cursor:pointer; text-decoration:none;
}
.brandpill img{height:38px; width:auto; display:block}
nav.mainnav{display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; align-items:center}
/* Log in / Log out. Deliberately a sibling of the nav rather than inside it:
   on a phone the nav becomes one scrolling row, and the one thing that must
   never scroll out of sight is the way in. On a wide screen it sits exactly
   where it always sat, at the end of the row. */
.authbtn{flex:0 0 auto}
.navbtn{
  font-family:'Patrick Hand',cursive; font-size:1.06rem; color:var(--navy);
  background:transparent; border:2.5px solid transparent; border-radius:999px;
  padding:5px 14px; text-decoration:none; display:inline-block;
}
.navbtn:hover{border-color:var(--line); background:#fff}
.navbtn.active{background:var(--navy); color:#fff; border-color:var(--navy-deep); box-shadow:2px 3px 0 rgba(22,41,79,.25)}
.whochip{
  display:flex; align-items:center; gap:9px; background:#fff; border:2.5px solid var(--line);
  border-radius:999px; padding:4px 14px 4px 5px; box-shadow:var(--shadow); text-decoration:none;
}
.whochip .av{width:32px;height:32px;border-radius:50%;background:var(--gold-soft);border:2px solid var(--line);display:grid;place-items:center;font-size:17px}
.whochip .nm{font-weight:900; font-size:.9rem; color:var(--navy); line-height:1.05; text-align:left}
.whochip .rl{font-size:.66rem; font-weight:800; color:var(--teal); text-transform:uppercase; letter-spacing:.6px}

main{max-width:1180px; margin:0 auto; padding:clamp(16px,3.5vw,36px) clamp(12px,3vw,28px) 70px}
main.narrow{max-width:620px}

/* ---------- shared bits ---------- */
.chip{
  display:inline-flex; align-items:center; gap:5px;
  font-size:.7rem; font-weight:900; text-transform:uppercase; letter-spacing:.7px;
  border:2px solid var(--line); border-radius:999px; padding:2.5px 10px; background:#fff; color:var(--navy);
}
.chip.gold{background:var(--gold-soft); border-color:#b8860b; color:#7a5a08}
.chip.teal{background:#e2f4f4; border-color:var(--teal-deep); color:var(--teal-deep)}
.chip.purple{background:#f1e6fa; border-color:var(--purple-deep); color:var(--purple-deep)}
.chip.red{background:#fdecea; border-color:var(--red); color:#a8382c}
.chip.green{background:#e6f4ec; border-color:var(--green); color:#1d6b41}
.para{
  background:var(--card); border:2.5px solid var(--line); border-radius:16px; box-shadow:var(--shadow);
  padding:18px 22px; font-size:1.02rem; line-height:1.65;
}
.panel{background:var(--card); border:2.5px solid var(--line); border-radius:18px; box-shadow:var(--shadow); padding:20px}
.panel h3{font-size:1.45rem; color:var(--navy); margin-bottom:10px}
.pagehead{margin-bottom:22px; display:flex; flex-direction:column; gap:16px}
.pagehead h1,.pagehead h2{font-size:clamp(1.9rem,4.5vw,2.6rem); color:var(--navy); display:flex; align-items:center; gap:12px}
.backrow{margin-bottom:14px}
.backbtn{
  font-family:'Patrick Hand',cursive; font-size:1rem; background:#fff; color:var(--navy);
  border:2.5px solid var(--line); border-radius:999px; padding:5px 16px; box-shadow:var(--shadow);
  text-decoration:none; display:inline-block;
}
.backbtn:hover{transform:translate(-1px,-1px)}

/* ---------- buttons ---------- */
.btn{
  font-family:'Patrick Hand',cursive; font-size:1.08rem; color:#fff; background:var(--teal);
  border:2.5px solid var(--teal-deep); border-radius:999px; padding:7px 20px;
  box-shadow:2px 3px 0 rgba(15,94,98,.3); text-decoration:none; display:inline-block; text-align:center;
}
.btn:hover{transform:translate(-1px,-1px)}
.btn:active{transform:translate(1px,1px); box-shadow:none}
.btn:disabled{opacity:.55; cursor:not-allowed; transform:none}
.btn.navy{background:var(--navy); border-color:var(--navy-deep); box-shadow:2px 3px 0 rgba(22,41,79,.3)}
.btn.gold{background:var(--gold); border-color:#b8860b; color:#3d2c05; box-shadow:2px 3px 0 rgba(184,134,11,.3)}
.btn.purple{background:var(--purple); border-color:var(--purple-deep); box-shadow:2px 3px 0 rgba(92,44,128,.3)}
.btn.ghost{background:#fff; color:var(--navy); border-color:var(--line); box-shadow:2px 3px 0 rgba(31,58,114,.18)}
.btn.danger{background:#fff; color:var(--red); border-color:var(--red); box-shadow:2px 3px 0 rgba(217,93,78,.2)}
.btn.big{font-size:1.3rem; padding:10px 30px}
.btn.wide{width:100%}
.btn.mini{font-size:.85rem; padding:3px 12px; box-shadow:1px 2px 0 rgba(31,58,114,.2)}

/* ---------- forms ---------- */
.field{display:flex; flex-direction:column; gap:5px; margin-bottom:13px}
.field label{font-size:.78rem; font-weight:900; text-transform:uppercase; letter-spacing:.7px; color:var(--teal-deep)}
.field input, .field select, .field textarea{
  font-family:'Nunito',sans-serif; font-size:1rem; font-weight:700; padding:10px 13px;
  border:2.5px solid var(--line); border-radius:12px; background:#fff; outline:none; width:100%; color:var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--teal)}
.field textarea{resize:vertical; min-height:78px; line-height:1.42; font-family:inherit}
.field .hint{font-size:.75rem; font-weight:700; color:var(--grey)}
.checkrow{display:flex; gap:9px; align-items:flex-start; margin-bottom:13px; font-size:.85rem; line-height:1.45}
.checkrow input{width:19px; height:19px; flex:0 0 19px; margin-top:2px; accent-color:var(--teal)}

.msg{border:2.5px solid var(--line); border-radius:12px; padding:10px 14px; font-size:.88rem; font-weight:700; margin-bottom:13px}
.msg.error{background:#fdecea; border-color:var(--red); color:#a8382c}
.msg.ok{background:#e6f4ec; border-color:var(--green); color:#1d6b41}
.msg.info{background:#e2f4f4; border-color:var(--teal-deep); color:var(--teal-deep)}

/* ---------- tape ---------- */
.tape{position:absolute; width:92px; height:26px; opacity:.85; border:1.5px solid rgba(31,58,114,.25)}
.tape.tl{top:-13px; left:26px; background:rgba(23,133,138,.55); transform:rotate(-6deg)}
.tape.br{bottom:-13px; right:26px; background:rgba(123,63,169,.45); transform:rotate(5deg)}

/* ---------- tables ---------- */
.tbl{width:100%; border-collapse:collapse; font-size:.9rem}
.tbl th{
  text-align:left; font-size:.7rem; text-transform:uppercase; letter-spacing:.7px; color:var(--grey);
  font-weight:900; padding:7px 8px; border-bottom:2.5px solid var(--line);
}
.tbl td{padding:9px 8px; border-bottom:1.5px dashed rgba(31,58,114,.2); font-weight:700}
.tbl tr:hover td{background:rgba(255,255,255,.6)}
.tbl .num{text-align:right; font-variant-numeric:tabular-nums}
.empty{font-size:.85rem; color:var(--grey); font-weight:700; padding:14px 2px; text-align:center}

/* ---------- bars ---------- */
.bar{height:14px; border:2.5px solid var(--line); border-radius:999px; background:#fff; overflow:hidden; min-width:90px}
.bar i{display:block; height:100%; border-radius:999px; background:repeating-linear-gradient(-45deg,var(--teal),var(--teal) 9px,#2aa3a9 9px,#2aa3a9 18px); transition:width .6s cubic-bezier(.2,.8,.3,1)}
.bar.gold i{background:repeating-linear-gradient(-45deg,var(--gold),var(--gold) 9px,#f3c257 9px,#f3c257 18px)}

/* ---------- toast ---------- */
#toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(20px); z-index:120;
  background:var(--navy); color:#fff; font-family:'Patrick Hand',cursive; font-size:1.12rem;
  border:2.5px solid var(--navy-deep); border-radius:999px; padding:9px 24px; box-shadow:4px 5px 0 rgba(22,41,79,.35);
  opacity:0; pointer-events:none; transition:opacity .25s, transform .25s; max-width:92vw; text-align:center;
}
#toast.on{opacity:1; transform:translateX(-50%) translateY(0)}

/* ---------- footer ---------- */
footer{
  text-align:center; padding:26px 14px 34px; font-family:'Patrick Hand',cursive; color:var(--navy); font-size:1.05rem;
}
footer .dots span{display:inline-block; width:9px; height:9px; border-radius:50%; margin:0 3px}
footer .legal{font-family:'Nunito',sans-serif; font-size:.75rem; font-weight:700; color:var(--grey); margin-top:8px}
footer .legal a{color:var(--grey); margin:0 6px}

.reveal{animation:fadeUp .5s both}
@keyframes fadeUp{from{opacity:0; transform:translateY(14px)}to{opacity:1; transform:none}}
@media (prefers-reduced-motion:reduce){ *{animation:none !important; transition:none !important} }
/* ============================================================
   Phones and tablets.

   Everything below lives inside a media query, so the desktop
   layout is exactly what it was - the wide view was the one
   being designed for and it should not move.

   Two separate concerns, deliberately queried differently:
     * layout   -> by width. A narrow window needs a narrow layout
                   whether or not it is a touch screen.
     * tap size -> by pointer. A finger needs 44px whatever the
                   width; a mouse does not, and blowing the buttons
                   up on a laptop would wreck the look.
   ============================================================ */

/* ---------- the top bar, which was the worst of it ---------- */
/* It is sticky, and on a phone it wrapped to three rows: 178px of a
   812px screen, gone before a single word of content. One scrolling
   row instead - everything still reachable, a third of the height. */
@media (max-width:640px){
  /* One row, the same shape as the wide bar: logo on the left, the links in
     the middle, the way in on the right. The links are the only part that
     scrolls. An earlier version stacked the logo and Log in above the links
     on a second row, which worked but looked like two bars stuck together. */
  .top{ padding:6px 10px; gap:9px; flex-wrap:nowrap }
  .brandpill{ flex:0 0 auto; padding:2px 8px }
  .brandpill img{ height:28px }

  nav.mainnav{
    order:0; flex:1 1 auto; min-width:0; width:auto; margin-left:0;
    flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain;
    justify-content:flex-start; scrollbar-width:none; gap:4px;
    /* A wider fade, and a gap after it, so the last link dissolves instead
       of being chopped off flush against the button next to it. */
    padding-right:4px;
    -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 34px),transparent);
            mask-image:linear-gradient(to right,#000 calc(100% - 34px),transparent);
  }
  nav.mainnav::-webkit-scrollbar{ display:none }
  nav.mainnav > *{ flex:0 0 auto }
  nav.mainnav.at-end{ -webkit-mask-image:none; mask-image:none }
  .navbtn{ padding:5px 11px; font-size:1rem }

  /* Pricing first on a phone. Only about two and a half links fit before the
     fade, and Pricing was the fourth - so the question a parent actually
     arrives with was the one thing they could not see. The two links it
     overtakes jump to sections that the hero already covers with two large
     buttons a couple of centimetres below, so nothing is lost by their moving
     right. Everything is still there; only the order changes, and only here. */
  nav.mainnav a[href="pricing.html"]{ order:-1 }

  /* Never scrolls, never wraps. */
  .authbtn{ order:0; margin-left:0; flex:0 0 auto; border-color:var(--line); background:#fff }
  .authbtn.active{ background:var(--navy); color:#fff }
  .authchip{ order:0; margin-left:0; flex:0 0 auto; padding:3px 4px }
  .authchip .av{ width:27px; height:27px; font-size:15px }
  /* The name is decoration on a narrow bar; Log out is not. */
  .authchip .nm, .authchip .rl{ display:none !important }  /* inline style on the span, so !important is the only way */
}

/* A phone held sideways has about 375px of height. A sticky bar would
   take a fifth of it and never give it back, so on short screens it
   scrolls away with everything else. */
@media (max-height:520px) and (max-width:950px){
  .top{ position:static }
}

/* ---------- room to breathe ---------- */
@media (max-width:640px){
  main{ padding-left:14px; padding-right:14px; padding-bottom:48px }
  .panel{ padding:15px 14px; border-radius:15px }
  .pagehead{ margin-bottom:16px; gap:11px }
  .pagehead h1,.pagehead h2{ font-size:clamp(1.6rem,7vw,2.1rem) }
}

/* ---------- things you tap with a finger ---------- */
/* 44px is the size Apple and Google both settle on, and the small
   buttons here were 25-29px. The text size is left alone: it is the
   box that grows, so nothing looks blown up. */
@media (pointer:coarse){
  .btn{ min-height:44px; display:inline-flex; align-items:center; justify-content:center }
  .btn.mini{ min-height:40px; padding:6px 15px }
  .navbtn{ min-height:42px; display:inline-flex; align-items:center }
  .pwtoggle{ min-height:38px; padding:6px 12px !important }
  /* page-level pill links that are really buttons */
  .gpill, .chip[onclick], .navbtn.mini{ min-height:40px; display:inline-flex; align-items:center }
  input, select, textarea{ min-height:44px; font-size:16px }
}

/* iOS zooms the whole page in when a font under 16px gets focus, and
   then leaves it zoomed. Sixteen pixels is the price of not doing that. */
@media (max-width:900px){
  input:not([type=checkbox]):not([type=radio]), select, textarea{ font-size:16px }
}

/* ---------- wide things that have to fit ---------- */
/* A table that will not fit gets its own scroll rather than pushing the
   whole page sideways, which is the thing that makes a site feel broken. */
@media (max-width:820px){
  table{ display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; max-width:100% }
  pre, code{ overflow-x:auto; max-width:100% }
  img, svg, video, canvas{ max-width:100%; height:auto }
}

/* Nothing should ever be able to push the page sideways.

   The overflow is cut off, not scrolled. "hidden" on the body made the body
   a scrolling box of its own, and the top bar - which is meant to stay in
   view - then stuck to a box that never moves, so it scrolled away with the
   page. "clip" cuts the overflow off without doing that. A browser too old
   to know "clip" keeps "hidden", and there the bar scrolls away as before. */
html{ overflow-x:hidden }
body{ overflow-x:hidden }
@supports (overflow:clip){ body{ overflow-x:clip } }

@media (prefers-reduced-motion:reduce){ *{animation:none !important; transition:none !important} }

/* ---------- the dropdown navigation ----------
   One shared menu tree, rendered by app/nav.js. Styled to look like it
   was always here: card, 2.5px line, hard shadow, Patrick Hand. */
.mcm-item{position:relative; display:inline-block}
.mcm-trigger{display:inline-flex; align-items:center; gap:7px; cursor:pointer}
.mcm-trigger::after{
  content:''; width:7px; height:7px; margin-top:-3px;
  border-right:2.5px solid currentColor; border-bottom:2.5px solid currentColor;
  transform:rotate(45deg); transition:transform .16s ease;
}
.mcm-trigger[aria-expanded="true"]{background:#fff; border-color:var(--line)}
.mcm-trigger[aria-expanded="true"]::after{transform:rotate(-135deg) translateY(-3px)}

.mcm-menu{
  display:none; position:absolute; top:calc(100% + 9px); left:0; z-index:60;
  min-width:250px; max-width:min(330px, 86vw);
  background:var(--card); border:2.5px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow); padding:9px;
}
.mcm-menu[data-open="true"]{display:block}
/* a little paper tab, so the panel reads as pinned to its button */
.mcm-menu::before{
  content:''; position:absolute; top:-9px; left:20px; width:14px; height:14px;
  background:var(--card); border-left:2.5px solid var(--line); border-top:2.5px solid var(--line);
  transform:rotate(45deg); border-radius:3px 0 0 0;
}
.mcm-menu a, .mcm-menu button{
  display:block; width:100%; text-align:left; text-decoration:none;
  font-family:'Nunito',sans-serif; font-weight:800; font-size:.94rem; color:var(--navy);
  background:transparent; border:2.5px solid transparent; border-radius:11px;
  padding:8px 11px; cursor:pointer; position:relative; z-index:1;
}
.mcm-menu a span{
  display:block; font-weight:600; font-size:.79rem; color:var(--grey);
  line-height:1.35; margin-top:2px;
}
.mcm-menu a:hover, .mcm-menu button:hover{background:#fff; border-color:var(--line)}
.mcm-menu a.on{background:var(--navy); color:#fff; border-color:var(--navy-deep)}
.mcm-menu a.on span{color:rgba(255,255,255,.8)}
.mcm-foot{border-top:2.5px dashed var(--line); margin-top:8px; padding-top:8px}
.mcm-foot a, .mcm-foot button{background:var(--gold-soft); border-color:var(--line); text-align:center}
.mcm-cta{background:var(--gold-soft); border-color:var(--line) !important; box-shadow:var(--shadow)}

/* the phone: one Menu button, and the row becomes a stack */
.mcm-burger{display:none}
@media (max-width:900px){
  .mcm-burger{display:inline-block; margin-left:auto; order:2}
  .top nav.mainnav{
    display:none; order:5; width:100%; flex-direction:column; align-items:stretch;
    gap:6px; overflow:visible; margin-left:0; padding-top:8px;
    /* Claim a whole row. Without this the nav is still a shrinkable item in
       a header that does not wrap below 640, and it collapses to the sliver
       left beside the logo and the Menu button. */
    flex:1 0 100%; min-width:100%; padding-right:0;
    /* the scroller's right-hand fade has nothing left to fade */
    -webkit-mask-image:none; mask-image:none;
  }
  /* the header may wrap only while the menu is open, so the closed bar keeps
     its single tidy line */
  .top[data-nav-open="true"]{flex-wrap:wrap}
  .top[data-nav-open="true"] nav.mainnav{display:flex}
  /* the bar stays in view now, so a menu taller than the screen has to scroll inside itself */
  .top[data-nav-open="true"] nav.mainnav{max-height:calc(100vh - 66px); max-height:calc(100dvh - 66px);
    overflow-y:auto; overscroll-behavior:contain}
  .top nav.mainnav > *{flex:0 0 auto; width:100%}
  .mcm-item{display:block}
  /* a plain link in the stack keeps its place (an older rule moved the prices link to the front of a scrolling row) */
  .top nav.mainnav > a.navbtn{order:0}
  .mcm-trigger{width:100%; justify-content:space-between}
  /* stacked, so nothing is positioned inside a scroller and nothing clips */
  .mcm-menu{
    position:static; display:none; min-width:0; max-width:none;
    margin:4px 0 2px 12px; box-shadow:none; border-radius:13px;
  }
  .mcm-menu::before{display:none}
  .mcm-menu[data-open="true"]{display:block}
}
/* a small laptop or a tablet on its side: the whole row still fits on one
   line if it is set a little tighter, instead of spilling onto a second */
@media (min-width:901px) and (max-width:1240px){
  .top{gap:8px; padding-left:12px; padding-right:12px}
  .top nav.mainnav{gap:2px}
  .top .navbtn{padding:5px 8px; font-size:1rem}
  .top .mcm-trigger{gap:5px}
  .top .brandpill img{height:34px}
  .top .whochip{padding-right:10px}
}
@media (min-width:901px) and (max-width:1010px){
  .top{gap:6px}
  .top nav.mainnav{gap:0}
  .top .navbtn{padding:5px 6px; font-size:.95rem}
  .top .brandpill{padding:3px 7px}
  .top .brandpill img{height:30px}
  .top .whochip{padding:3px 9px 3px 4px; gap:6px}
  .top .whochip .av{width:28px; height:28px; font-size:15px}
}

/* ---------- worth a chat, explained ----------
   Grouped by the idea rather than the level, because that is the thing a
   teacher reteaches. Each block says what the idea asks for and what being
   stuck on it usually means, so nobody has to go and play the game first. */
.chatwrap{text-align:left}
.chatwrap .chatlede{font-size:.88rem; font-weight:700; opacity:.85; margin:2px 0 10px}
.chatidea{background:#fff; border:2.5px solid var(--line); border-radius:14px;
  box-shadow:2px 3px 0 rgba(31,58,114,.10); padding:11px 13px; margin:0 0 9px}
.chatidea:last-child{margin-bottom:0}
.chatidea h5{font-family:'Patrick Hand',cursive; font-size:1.14rem; color:var(--navy);
  margin:0 0 4px; font-weight:400}
.chatidea .wh{font-size:.88rem; line-height:1.5; color:var(--ink); margin:0 0 6px}
.chatidea .tn{font-size:.86rem; line-height:1.55; color:#4a5470; margin:0 0 7px;
  border-left:3px solid var(--gold); padding-left:9px}
.chatidea .lv{font-size:.8rem; font-weight:800; color:var(--grey); margin:0}
.chatidea .lv .chatlink{color:var(--teal-deep); font-weight:900}

/* ---------- the roster tools: find, filter, order ----------
   A class of thirty came out alphabetically with no way to reorder it and
   no way to search it, so finding the child who needs you meant reading
   every row. These are the three questions a teacher actually arrives with,
   made into controls. */
.rtools{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin:4px 0 12px; padding:10px 12px;
  background:var(--cream, #faf6ea); border:2.5px solid var(--line);
  border-radius:16px;
}
.rt-find input{
  font-family:'Nunito',sans-serif; font-weight:700; font-size:.9rem; color:var(--navy);
  background:#fff; border:2.5px solid var(--line); border-radius:999px;
  padding:6px 14px; width:190px; max-width:46vw;
}
.rt-find input:focus{ outline:none; border-color:var(--teal-deep, #17786f); }
.rt-chips{ display:flex; gap:7px; flex-wrap:wrap; flex:1 }
.rt-chip{
  font-family:'Nunito',sans-serif; font-weight:800; font-size:.83rem; color:var(--navy);
  background:#fff; border:2.5px solid var(--line); border-radius:999px;
  padding:5px 8px 5px 12px; cursor:pointer;
  display:inline-flex; align-items:center; gap:7px;
  box-shadow:2px 3px 0 rgba(31,58,114,.10); transition:transform .12s, background .12s;
}
.rt-chip:hover{ transform:translate(-1px,-1px); background:var(--gold-soft, #fdf3d7) }
.rt-chip span{
  font-size:.76rem; min-width:20px; text-align:center;
  background:var(--gold-soft, #fdf3d7); border-radius:999px; padding:1px 6px;
}
.rt-chip.on{ background:var(--navy); color:#fff; border-color:var(--navy-deep, #16295a) }
.rt-chip.on span{ background:rgba(255,255,255,.22); color:#fff }
.rt-sort{
  font-family:'Patrick Hand',cursive; font-size:1.02rem; color:var(--navy);
  display:inline-flex; align-items:center; gap:7px;
}
.rt-sort select{
  font-family:'Nunito',sans-serif; font-weight:700; font-size:.85rem; color:var(--navy);
  background:#fff; border:2.5px solid var(--line); border-radius:999px;
  padding:5px 10px; cursor:pointer;
}
/* the class switcher, beside the class name */
.rswitch{
  font-family:'Nunito',sans-serif; font-weight:800; font-size:.88rem; color:var(--navy);
  background:#fff; border:2.5px solid var(--line); border-radius:999px;
  padding:5px 12px; cursor:pointer;
}
@media (max-width:640px){
  .rtools{ gap:8px; padding:9px 10px }
  .rt-find input{ width:100%; max-width:none }
  .rt-find{ width:100% }
  .rt-sort{ width:100% }
  .rt-sort select{ flex:1 }
}

/* ---------- a named learner is a door ----------
   The insight blocks used to name children in plain text, so reading
   "stuck on L4" and then finding that child were two separate jobs. */
.kidlink{
  color:inherit; font-weight:800; text-decoration:none;
  border-bottom:2px dotted currentColor; cursor:pointer;
}
.kidlink:hover{ border-bottom-style:solid; background:rgba(255,255,255,.35); border-radius:3px }
.hotrow .setlvl{ margin-left:8px; vertical-align:middle; font-size:.74rem; padding:2px 9px }

/* ---------- work set for a class, shown where the class is ----------
   Setting homework used to have no visible result on the page you set it
   from. This is that result: what is out, when it is due, how far it has
   got. */
.cwork{
  background:#fff; border:2.5px solid var(--line); border-radius:16px;
  padding:12px 14px; margin:0 0 14px; box-shadow:var(--shadow);
}
.cw-head{ display:flex; align-items:center; gap:10px; margin-bottom:8px }
.cw-head h4{ flex:1; margin:0; font-size:1.15rem; color:var(--navy) }
.cw-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:7px 0; border-top:2px dashed var(--line);
}
.cw-name{ font-weight:800; font-size:.92rem; color:var(--navy); flex:1; min-width:150px }
.cw-count{ font-size:.8rem; font-weight:800; color:var(--grey); white-space:nowrap }
.cw-count.all{ color:var(--green) }
.cw-bar{
  width:96px; height:9px; background:#eee9dc; border:2px solid var(--line);
  border-radius:999px; overflow:hidden;
}
.cw-bar i{ display:block; height:100%; background:var(--teal) }
.cw-more{ font-size:.76rem; font-weight:700; color:var(--grey); padding-top:7px }
.cwork.empty2way{ display:flex; align-items:center; gap:12px; flex-wrap:wrap }
.cwork.empty2way b{ display:block; color:var(--navy) }
.cwork.empty2way span{ font-size:.85rem; color:var(--grey) }
.cwork.empty2way > div:first-child{ flex:1; min-width:200px }
.cw-acts{ display:flex; gap:7px; flex-wrap:wrap }
@media (max-width:640px){ .cw-bar{ display:none } }

/* ------------------------------------------------------------------
   A table on a phone.

   Eight columns do not fit a 375px screen. A table that scrolls sideways
   inside its card hides whatever sits at the right-hand end - which is
   where every button lives - so each row becomes its own small card and
   each cell a labelled line. The label is the cell's own data-l, so a
   table that has not been given labels simply shows its values.
   Only tables marked "stack" change; the rest are left alone.
   ------------------------------------------------------------------ */
@media (max-width:640px){
  .tbl.stack thead{ display:none }   /* every cell carries its own label instead */
  .tbl.stack tr{ display:block; background:var(--card); border:2px solid var(--line);
                 border-radius:13px; padding:9px 12px; margin:0 0 10px }
  .tbl.stack tr:hover td{ background:none }
  .tbl.stack td{ display:flex; align-items:baseline; justify-content:space-between; gap:12px;
                 border:0; padding:3px 0; text-align:left; white-space:normal }
  .tbl.stack td::before{ content:attr(data-l); flex:0 0 auto; font-size:.66rem; font-weight:900;
                         text-transform:uppercase; letter-spacing:.5px; color:var(--grey) }
  .tbl.stack td.lead{ display:block; font-size:1.02rem; font-weight:900; color:var(--navy);
                      padding:0 0 7px; border-bottom:1.5px dashed rgba(31,58,114,.2); margin-bottom:5px }
  .tbl.stack td.acts{ flex-wrap:wrap; justify-content:flex-start; gap:6px; padding-top:9px }
  .tbl.stack td.lead::before, .tbl.stack td.acts::before, .tbl.stack td.empty::before{ content:none }
  .tbl.stack td.empty{ display:block; text-align:center }
  .tbl.stack .bar{ flex:1 1 auto; min-width:100px }
}


/* ---------- Assign, from the library ----------
   A teacher who finds the right adventure should be able to give it to
   someone without crossing the site to look for it again. */
.gplay{ display:flex; gap:7px }
.gplay a, .gplay span{ flex:1; min-width:0 }
.gassign{
  flex:0 0 auto; cursor:pointer;
  font-family:'Patrick Hand',cursive; font-size:1.02rem; color:var(--navy);
  background:var(--gold-soft,#fdf3d7); border:2.5px solid var(--line);
  border-radius:999px; padding:5px 13px; box-shadow:2px 3px 0 rgba(31,58,114,.12);
  transition:transform .12s, background .12s;
}
.gassign:hover{ transform:translate(-1px,-2px); background:var(--gold,#f3c53f) }

/* the one question: who is it for */
.asgn{
  position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center;
  background:rgba(31,58,114,.34); padding:18px;
}
.asgn.hidden{ display:none }
.asgn-box{
  background:var(--card,#fffdf6); border:2.5px solid var(--line); border-radius:22px;
  box-shadow:var(--shadow); padding:20px 22px; width:min(420px,100%);
  max-height:84vh; overflow:auto;
}
.asgn-box h3{ margin:0 0 4px; font-size:1.5rem; color:var(--navy) }
.as-lede{ font-size:.88rem; color:var(--grey); margin:0 0 14px; line-height:1.5 }
.as-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px }
.as-pick{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left; cursor:pointer;
  font-family:'Nunito',sans-serif; font-weight:800; font-size:.98rem; color:var(--navy);
  background:#fff; border:2.5px solid var(--line); border-radius:14px; padding:11px 14px;
  box-shadow:2px 3px 0 rgba(31,58,114,.12); transition:transform .12s, background .12s;
}
.as-pick:hover{ transform:translate(-2px,-2px); background:var(--gold-soft,#fdf3d7) }
.as-pick span{ margin-left:auto; font-size:.78rem; font-weight:700; color:var(--grey) }

/* ---------- what is set for a child, on the child's card ---------- */
.kwork{ margin:8px 0 2px }
.kw{
  display:flex; align-items:center; gap:7px; flex-wrap:wrap;
  background:#fff; border:2.5px solid var(--line); border-radius:13px;
  padding:8px 11px; font-size:.83rem; color:var(--navy); text-align:left;
}
.kw b{ font-weight:800; flex:1; min-width:110px }
.kw.done{ background:#f2faf5 }
.kw .kwst{ font-weight:800; color:var(--grey); white-space:nowrap }
.kw.none{
  background:transparent; border-style:dashed; color:var(--grey);
  font-weight:700; display:block;
}
.kw.none a{ color:var(--navy); font-weight:800 }

/* ---------- "what is this game about?" ----------
   The teaches line named a concept and stopped, which is enough for a teacher
   who knows the game and no use at all to one who does not. It opens now. */
.gblock details.gmore{ margin-bottom:5px }
.gblock details.gmore > summary{
  font-size:.7rem; font-weight:900; text-transform:uppercase; letter-spacing:.5px;
  color:var(--teal-deep); cursor:pointer; list-style:none;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.gblock details.gmore > summary::-webkit-details-marker{ display:none }
.gm-cue{
  text-transform:none; letter-spacing:0; font-weight:800; font-size:.72rem;
  color:var(--navy); background:var(--gold-soft,#fdf3d7);
  border:2px solid var(--line); border-radius:999px; padding:1px 9px;
}
.gblock details.gmore[open] > summary .gm-cue::after{ content:' ✕' }
.gm-body{
  margin:8px 0 2px; padding:11px 13px; background:#fff;
  border:2.5px solid var(--line); border-radius:14px;
}
.gm-what{
  font-size:.9rem; font-weight:700; color:var(--navy); margin:0 0 4px;
  text-transform:none; letter-spacing:0;
}
.gm-facts{
  font-size:.76rem; font-weight:800; color:var(--grey); margin:0 0 10px;
  text-transform:none; letter-spacing:0;
}
.gm-idea{ border-top:2px dashed var(--line); padding-top:9px; margin-top:9px }
.gm-idea:first-of-type{ border-top:0; padding-top:0; margin-top:0 }
.gm-idea h6{
  margin:0 0 3px; font-family:'Patrick Hand',cursive; font-size:1.12rem;
  color:var(--navy); text-transform:none; letter-spacing:0;
}
.gm-idea .wh{
  margin:0 0 5px; font-size:.86rem; font-weight:700; color:#4a5470;
  text-transform:none; letter-spacing:0; line-height:1.5;
}
.gm-idea .tn{
  margin:0; font-size:.84rem; font-weight:600; color:#4a5470; line-height:1.55;
  text-transform:none; letter-spacing:0;
  border-left:3px solid var(--gold,#f3c53f); padding-left:9px;
}

/* ---------- choosing who a page is about ----------
   Task monitoring used to answer "open this from a class or a child", which
   is not something the person reading it can act on. */
.scopepick{ display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:14px }
.scopecard{
  display:flex; align-items:center; gap:11px; text-decoration:none;
  background:#fff; border:2.5px solid var(--line); border-radius:18px;
  padding:15px 17px; box-shadow:var(--shadow);
  transition:transform .14s, background .14s;
}
.scopecard:hover{ transform:translate(-2px,-3px); background:var(--gold-soft,#fdf3d7) }
.sc-av{ font-size:1.7rem; line-height:1 }
.sc-nm{ font-family:'Patrick Hand',cursive; font-size:1.3rem; color:var(--navy) }
.sc-sub{ font-size:.78rem; font-weight:800; color:var(--grey) }
.sc-go{ margin-left:auto; font-weight:800; font-size:.85rem; color:var(--navy) }

/* ---------- which of the three the menu asked for ----------
   Overview, Learner progress and Send encouragement used to open the same
   screen with nothing to tell them apart. */
.viewnote{
  display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
  background:var(--gold-soft,#fdf3d7); border:2.5px solid var(--line);
  border-radius:16px; padding:11px 15px; margin:0 0 14px;
}
.viewnote b{ font-family:'Patrick Hand',cursive; font-size:1.3rem; color:var(--navy) }
.viewnote > span{ font-size:.88rem; font-weight:700; color:#4a5470; flex:1; min-width:180px }
.viewnote .vn-alt{ flex:0 0 auto; font-size:.8rem; font-weight:800; color:var(--grey) }
.viewnote a{ color:var(--navy); font-weight:800; text-decoration:none;
  border-bottom:2px dotted currentColor }
.viewnote a:hover{ border-bottom-style:solid }
/* the star buttons, when that is what you came to do */
body.encouraging .btn[title^="Send"]{
  background:var(--gold,#f3c53f); border-color:var(--line);
  box-shadow:2px 3px 0 rgba(31,58,114,.22);
}

/* ============================================================
   Level marks: one small square per level, coloured by how it
   went. Drawn by levelMarkHTML() in app/game-meta.js, so a level
   looks the same on the class page, the work page, a parent's
   page and a learner's report.
   ============================================================ */
.lvmarks{display:inline-flex; gap:3px; vertical-align:middle; flex-wrap:wrap}
.lvm{width:24px; height:24px; border-radius:7px; border:2px solid #b9c0d3; background:#fff; display:inline-grid; place-items:center;
  font-size:.74rem; line-height:1; cursor:default; filter:grayscale(.9) opacity(.55)}
.lvm.s3{background:#e6f4ec; border-color:var(--green); filter:none}
.lvm.s2{background:#fff8e6; border-color:#b8860b; filter:none}
.lvm.s1{background:#fdecea; border-color:var(--red); filter:none}
.lvm.done{background:#eef2f8; border-color:#7d89a8; filter:none}
.lvm.wip{border-style:dashed; border-color:#b8860b; background:#fffdf5; filter:none}
.lvm.unset{opacity:.3}
.lvkey{display:flex; gap:6px 14px; flex-wrap:wrap; align-items:center; font-size:.74rem; font-weight:800; color:#57617e}
.lvkey span{display:inline-flex; align-items:center; gap:5px}
.lvkey .lvm{width:16px; height:16px; border-radius:5px}
@media (pointer:coarse){ .lvm{width:28px; height:28px; font-size:.85rem} }
