/* Reading Maze: the family's paper theme (the tokens, cards, buttons, sheets, rooms and lists are Math Cube's css/game.css,
   copied 2026-11-25 so the games look alike; keep them in step). The maze, the door card and the HUD's letter slots are css/maze.css. */
:root{
  --paper:#edf2f8; --rule:rgba(38,78,150,.09); --ink:#18263f; --muted:#5b6983;
  --tile:#ffffff; --tile-edge:#c3cfe0; --given:#dfe7f2; --slot:#f8fafd; --slot-line:#9cadc9;
  --face:#f9fbfe; --face-line:#b8c6dc;
  --you:#2f5bff; --you-soft:#dde5ff; --you-edge:#1c3dc2; --on-you:#ffffff;
  --good:#12a165; --on-good:#ffffff; --bad:#e0434a; --bad-soft:#ffd9da; --gold:#f2b705;
  --r0:#ef5a4f; --r1:#f39a1e; --r2:#13a89e; --r3:#8b5cf6; --r4:#e2468f; --r5:#1f9fd6; --r6:#6aa121; --r7:#c2410c; --r8:#4f46e5;
  --ball-face:#ffffff; --ball-ink:#18263f;
  --warn:#ffd84d; --warn-edge:#d9a400; --on-warn:#3d2c00;
  --panel:rgba(255,255,255,.75); --panel-line:rgba(24,38,63,.1); --scrim:rgba(237,242,248,.72);
  --lift:0 1px 2px rgba(24,38,63,.06),0 16px 44px rgba(24,38,63,.16);
  --font-display:"Fredoka","Baloo 2","Trebuchet MS",system-ui,sans-serif;
  --font-body:"Nunito",system-ui,-apple-system,"Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --paper:#0e1525; --rule:rgba(140,170,255,.07); --ink:#e6ecfa; --muted:#93a0bb;
  --tile:#1b2640; --tile-edge:#070b15; --given:#24304d; --slot:#121a2d; --slot-line:#4a5b82;
  --face:#151e33; --face-line:#3c4c70;
  --you:#6684ff; --you-soft:#1d2858; --you-edge:#3550d0; --on-you:#ffffff;
  --good:#38d895; --on-good:#062a1a; --bad:#ff6a70; --bad-soft:#4a1a1f; --gold:#ffd23f;
  --r0:#ff7a6e; --r1:#ffb347; --r2:#2fd0c3; --r3:#a98bff; --r4:#ff6fb1; --r5:#4cc3f5; --r6:#8fd14f; --r7:#ff8a4c; --r8:#8b8cff;
  --ball-face:#ffffff; --ball-ink:#18263f;
  --warn:#f5c518; --warn-edge:#a87f00; --on-warn:#2a1e00;
  --panel:rgba(22,31,52,.8); --panel-line:rgba(230,236,250,.1); --scrim:rgba(14,21,37,.74);
  --lift:0 1px 0 rgba(230,236,250,.06) inset,0 18px 48px rgba(0,0,0,.5);
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --paper:#0e1525; --rule:rgba(140,170,255,.07); --ink:#e6ecfa; --muted:#93a0bb;
  --tile:#1b2640; --tile-edge:#070b15; --given:#24304d; --slot:#121a2d; --slot-line:#4a5b82;
  --face:#151e33; --face-line:#3c4c70;
  --you:#6684ff; --you-soft:#1d2858; --you-edge:#3550d0; --on-you:#ffffff;
  --good:#38d895; --on-good:#062a1a; --bad:#ff6a70; --bad-soft:#4a1a1f; --gold:#ffd23f;
  --r0:#ff7a6e; --r1:#ffb347; --r2:#2fd0c3; --r3:#a98bff; --r4:#ff6fb1; --r5:#4cc3f5; --r6:#8fd14f; --r7:#ff8a4c; --r8:#8b8cff;
  --ball-face:#ffffff; --ball-ink:#18263f;
  --warn:#f5c518; --warn-edge:#a87f00; --on-warn:#2a1e00;
  --panel:rgba(22,31,52,.8); --panel-line:rgba(230,236,250,.1); --scrim:rgba(14,21,37,.74);
  --lift:0 1px 0 rgba(230,236,250,.06) inset,0 18px 48px rgba(0,0,0,.5);
  color-scheme:dark;
}
html,body{height:100%; touch-action:manipulation}   /* no double-tap zoom (the game script stops pinches) */
body{background-color:var(--paper); background-image:linear-gradient(var(--rule) 1px,transparent 1px),linear-gradient(90deg,var(--rule) 1px,transparent 1px); background-size:22px 22px;
  color:var(--ink); font-family:var(--font-body); margin:0; overflow:hidden; -webkit-tap-highlight-color:transparent; user-select:none; -webkit-user-select:none}
button{font:inherit; color:inherit; cursor:pointer}
[hidden]{display:none!important}
#app{height:100vh; height:100dvh; max-width:640px; margin:0 auto; display:flex; flex-direction:column; gap:6px; box-sizing:border-box;
  padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px));
  padding-top:max(8px, env(safe-area-inset-top, 0px)); padding-bottom:max(8px, env(safe-area-inset-bottom, 0px))}
.chip{min-height:44px; padding:6px 12px; border-radius:999px; border:1px solid var(--panel-line); background:var(--panel); font-size:12px; font-weight:800}
.card .chip{border:0; background:var(--given); color:var(--ink)}
.overlay{position:fixed; inset:0; z-index:40; display:grid; place-items:center; background:var(--scrim); backdrop-filter:blur(5px); overflow:auto;
  padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); padding-block:max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-bottom, 0px))}
/* Cards (the 2026-11-24 clean pass: one soft lift, no outline; 4/8/12/16/24 spacing; title, h2, 16 body, 13 small) */
.card{width:100%; max-width:420px; box-sizing:border-box; padding:24px 20px 20px; border-radius:24px; background:var(--tile); border:0; box-shadow:var(--lift); display:flex; flex-direction:column; gap:16px; animation:cardIn .4s cubic-bezier(.3,1.4,.5,1)}
@keyframes cardIn{0%{transform:translateY(20px) scale(.95); opacity:0}}
h1,h2{margin:0; font-family:var(--font-display); font-weight:700; line-height:1.05; text-wrap:balance}
h1{font-size:36px} h2{font-size:26px}
.card h2{text-align:center}
.lede{margin:0; font-size:15px; line-height:1.45; color:var(--muted); font-weight:600; text-align:center}
.how .lede{text-align:left}
.rules{margin:0; padding-left:20px; display:flex; flex-direction:column; gap:7px; font-size:14px; line-height:1.4}
.k-good{color:var(--good); font-weight:800} .k-bad{color:var(--bad); font-weight:800} .k-warn{color:var(--warn-edge); font-weight:800}
.btn{border:0; border-radius:16px; min-height:56px; padding:12px 18px; font-family:var(--font-display); font-weight:600; font-size:20px; background:var(--you); color:var(--on-you); box-shadow:0 4px 0 var(--you-edge); touch-action:manipulation}
.btn:active{transform:translateY(3px); box-shadow:0 1px 0 var(--you-edge)}
/* (secondary: tonal, flat, no outline) */
/* A text-link button, the quietest way out (Math Racing's .linkbtn): Home on the end card. */
.linkbtn{align-self:center; min-height:44px; padding:8px 16px; border:0; border-radius:12px; background:none; color:var(--you); font:600 16px/1.2 var(--font-display); cursor:pointer}
.linkbtn:active{background:var(--you-soft)}
.linkbtn:focus-visible{outline:3px solid var(--you); outline-offset:2px}
.linkbtn[hidden]{display:none}
.btn.ghost{min-height:48px; background:var(--given); color:var(--ink); box-shadow:none; font-size:17px}
.btn.ghost:active{transform:translateY(1px); box-shadow:none; background:color-mix(in srgb, var(--given) 85%, var(--ink))}
.btns{display:flex; flex-direction:column; gap:10px}
/* (the end card's numbers: three tiles, the number big, its name small under it) */
.tally{display:grid; grid-template-columns:repeat(3, 1fr); gap:8px}
.tally div{display:flex; flex-direction:column-reverse; align-items:center; gap:2px; padding:12px 4px 10px; border-radius:16px; background:var(--given); font-weight:800; font-size:12px; color:var(--muted)}
.tally b{font-family:var(--font-display); font-weight:600; font-size:24px; line-height:1; font-variant-numeric:tabular-nums; color:var(--ink)}
.tally div:first-child b{color:var(--you)}
.card.start{max-width:460px; gap:12px}
.grades{display:flex; flex-wrap:wrap; gap:6px; justify-content:center}
.grade{min-width:44px; min-height:44px; padding:7px 11px; border-radius:999px; border:0; background:var(--given); font:600 15px/1 var(--font-display); color:var(--ink)}
.grade[aria-selected="true"]{background:var(--you); color:var(--on-you)}
.topics-head{font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); text-align:center; margin-bottom:-4px}
.topics{display:grid; grid-template-columns:repeat(auto-fill, minmax(128px, 1fr)); gap:8px}
.topic{display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:10px 12px; border-radius:16px; border:0; background:var(--given); text-align:left; min-width:0}
.topic b{font-family:var(--font-display); font-weight:600; font-size:16px; line-height:1.1}
.topic span{font-size:12.5px; font-weight:700; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%}
.topic[aria-checked="true"]{background:var(--you-soft); box-shadow:inset 0 0 0 2px var(--you)}
.diffs{display:flex; justify-content:center; align-items:center; gap:6px}
.diffs .lab{font-size:13px; font-weight:800; color:var(--muted); margin-right:2px}
.diff{min-width:72px; min-height:44px; padding:6px 14px; border-radius:999px; border:0; background:var(--given); font:600 15px/1 var(--font-display); color:var(--ink)}
.diff[aria-checked="true"]{background:var(--you); color:var(--on-you)}
.diff:focus-visible,.grade:focus-visible,.topic:focus-visible{outline:3px solid var(--you); outline-offset:2px}
.how summary{cursor:pointer; font-weight:800; font-size:14px; color:var(--muted)}
.how[open]{display:flex; flex-direction:column; gap:10px}
.btn[disabled]{opacity:.55; pointer-events:none}
.card.room{gap:12px}
.pickhead{font-size:13px; font-weight:800; color:var(--muted); text-align:center; margin-bottom:-4px}
.endteam .pickhead{margin-bottom:0}
.room .field{display:grid; gap:4px; font-size:13px; font-weight:800; color:var(--muted); text-align:left}
.room input{font:700 18px/1.2 var(--font-body); padding:10px 12px; border-radius:12px; border:2px solid var(--panel-line); background:var(--tile); color:var(--ink); min-width:0}
.room .roompick,.room .roomin{display:grid; gap:10px}
.room .or{font-size:13px; font-weight:800; color:var(--muted); text-align:center}
.room .joinrow{display:flex; gap:8px}
.room .joinrow input{flex:1; text-transform:uppercase; letter-spacing:.2em; text-align:center; font-family:var(--font-display)}
.room .code{font:700 44px/1 var(--font-display); letter-spacing:.18em; text-align:center; color:var(--you)}
.room .roomlink{display:flex; gap:8px; align-items:center; justify-content:center; font-size:12px; color:var(--muted); min-width:0}
.room .roomlink span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0}
.room .diff[disabled]{opacity:.75}
.room .diff[disabled][aria-checked="false"]{opacity:.45}
.roomtopic{margin:0; text-align:center; font-weight:800; font-size:14px; color:var(--muted)}
.roomstatus{margin:0; min-height:1.3em; text-align:center; font-weight:700; color:var(--muted)}
/* "Show on a big screen" (src/screen.js; EdGames docs/family/SCREEN-PRINT-NOTE.md §1) */
.bigscreen{margin:0; font-size:13px; line-height:1.35; text-align:center; color:var(--muted); overflow-wrap:anywhere}
.bigscreen b{color:var(--ink)}
.room .players,.team-end{display:flex; flex-wrap:wrap; gap:6px; justify-content:center}
.who{padding:5px 10px; border-radius:999px; background:var(--c); color:#fff; font-weight:800; font-size:14px}
.who.off{opacity:.45}
/* (2026-11-23) the waiting room: someone invited and on the way; players popping in; the one line of what will be played */
.who.invited{background:transparent; color:var(--muted); border:2px dashed var(--panel-line); padding:3px 8px}
.who.new{animation:joinIn .5s ease-out}
@keyframes joinIn{0%{opacity:0; transform:translateY(6px)}}
@media (prefers-reduced-motion: reduce){ .who.new{animation:none!important} }
.setupline{display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; font-size:16px; text-align:center}
.setupline .chip{font-size:14px; padding:6px 14px}
/* The end card: Team's tally, Race's ranking */
.endteam{display:flex; flex-direction:column; gap:8px}
.rank{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; counter-reset:place}
.rank li{display:flex; align-items:center; gap:10px; padding:6px 10px; border-radius:12px; background:var(--given); font-weight:700; font-size:15px}
.rank li::before{counter-increment:place; content:counter(place); flex:none; width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:var(--c); color:#fff; font:700 15px/1 var(--font-display)}
.rank li.going::before{content:'…'}
.rank li.me{box-shadow:inset 0 0 0 2px var(--you)}
.rank li b{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rank li span{font-family:var(--font-display); font-variant-numeric:tabular-nums; color:var(--muted)}
.toast{position:fixed; left:50%; top:90px; transform:translateX(-50%); z-index:30; padding:6px 14px 6px 10px; border-radius:999px; background:var(--tile); border:2px solid var(--c); color:var(--ink); font-weight:800; font-size:15px; box-shadow:0 4px 14px rgba(0,0,0,.12); white-space:nowrap; max-width:calc(100vw - 32px); box-sizing:border-box; overflow:hidden; text-overflow:ellipsis; pointer-events:none}
.toast::before{content:''; display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--c); margin-right:8px; vertical-align:middle}
.toast.in{animation:toastIn .35s cubic-bezier(.3,1.5,.5,1)}
@keyframes toastIn{0%{opacity:0; transform:translate(-50%,-6px)}}
.react{position:fixed; left:var(--x); top:var(--y); transform:translateX(-50%); z-index:45; display:flex; gap:4px; padding:6px; border-radius:16px; background:var(--tile); border:1px solid var(--panel-line); box-shadow:0 8px 24px rgba(0,0,0,.18)}
.react button{border:0; background:var(--panel); border-radius:12px; min-width:44px; height:44px; font-size:22px; padding:0 6px; touch-action:manipulation}
.react button.go{font:800 14px/1 var(--font-body); color:var(--ink); padding:0 10px; white-space:nowrap}
.bubble{position:fixed; left:var(--x); top:var(--y); transform:translateX(-50%); font-size:30px; z-index:50; pointer-events:none; filter:drop-shadow(0 2px 0 var(--c)); animation:bubble 1.8s ease-out forwards}
@keyframes bubble{0%{opacity:0; transform:translate(-50%,6px) scale(.6)} 15%{opacity:1; transform:translate(-50%,0) scale(1)} 80%{opacity:1} 100%{opacity:0; transform:translate(-50%,30px)}}
/* Who's playing, Nearby, invites */
/* (the player's name sits on its own line above the logo, never over it: a long name shortens with …) */
.mebtn{position:static; align-self:flex-end; justify-self:end; margin:-8px -4px -8px 0; font-size:13px; padding:5px 10px; border:0; background:var(--given); color:var(--ink); max-width:60%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.nearby{display:grid; gap:6px}
.nearby .list{display:grid; gap:6px}
.near{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 6px 6px 12px; border-radius:14px; background:var(--given)}
.near .nm{font-weight:800; font-size:16px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.near .chip{font-size:14px; padding:7px 14px; background:var(--you); color:var(--on-you); border-color:transparent}
.near .chip:disabled{background:var(--panel-line); color:var(--muted)}
.count{position:fixed; inset:0; z-index:45; display:grid; place-content:center; justify-items:center; gap:6px; background:color-mix(in srgb, var(--paper) 55%, transparent); pointer-events:auto}
.count .cnum{font:700 min(34vw, 180px)/1 var(--font-display); color:var(--you); text-shadow:0 6px 0 var(--paper), 0 0 24px var(--paper); min-height:1em}
.count.waiting .cnum{min-height:0}
.count .ctext{margin:0; font:700 22px/1.2 var(--font-display); color:var(--ink); text-align:center; padding:0 16px}
.count .cnum.tick{animation:tick .7s ease-out}
@keyframes tick{0%{transform:scale(.6); opacity:0} 30%{transform:scale(1); opacity:1}}
@media (prefers-reduced-motion: reduce){ .count .cnum.tick{animation:none} }
.near{cursor:pointer}
.near .tag{font-style:normal; margin-left:8px; padding:2px 7px; border-radius:999px; background:var(--you-soft); color:var(--you); font-size:11px; font-weight:800; vertical-align:middle}
.near .rec{margin-left:8px; font-size:12px; font-weight:800; color:var(--muted); font-variant-numeric:tabular-nums}
.nearby .empty{padding:8px 12px; border-radius:14px; background:var(--given); color:var(--muted); font-size:13px; font-weight:700; text-align:center}
.rank.board li::before{content:attr(data-place)}
.feed{display:grid; gap:6px}
.feed .list{display:grid; gap:6px}
.feed .empty{padding:8px 12px; border-radius:14px; background:var(--given); color:var(--muted); font-size:13px; font-weight:700; text-align:center}
.frow{display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:14px; border:2px solid transparent; background:var(--given); text-align:left; min-width:0; touch-action:manipulation}
.frow .fav{font-size:22px; line-height:1; flex:none}
.frow .fmid{flex:1; min-width:0; display:grid; gap:2px}
.frow .fl1{display:flex; align-items:center; gap:6px; min-width:0}
.frow .fl1 b{font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.choice{display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:52px; padding:10px 16px; border:0; border-radius:16px; background:var(--given); color:var(--ink); text-align:left; touch-action:manipulation}
.choice .ct{min-width:0; font:600 17px/1.2 var(--font-display); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.choice .cg{flex:none; font-size:15px; font-weight:800; color:var(--you)}
.choice:focus-visible,.pl-strip:focus-visible,.gb:focus-visible,.gm:focus-visible{outline:3px solid var(--you); outline-offset:2px}
.pl-strip{display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; min-height:44px; padding:8px 16px; border:0; border-radius:14px; background:transparent; color:var(--muted); font:800 15px/1.2 var(--font-body); box-shadow:inset 0 0 0 1.5px var(--panel-line); text-align:left; touch-action:manipulation}
.pl-strip .pl-t{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pl-strip > span:last-child{font-size:20px; line-height:1}
.pl-row{display:flex; gap:8px; width:100%}
.pl-row .pl-strip{flex:1 1 auto; width:auto; min-width:0}
.pl-row .pl-tgt:not([hidden]) + .pl-strip{flex:0 1 auto; max-width:44%; padding:8px 12px}
.pl-tgt{flex:1 1 0; min-width:0; min-height:44px; padding:8px 14px; border:0; border-radius:14px; background:var(--you-soft); color:var(--ink); font:800 15px/1.25 var(--font-body); text-align:left; touch-action:manipulation}
.pl-tgt{display:flex; flex-direction:column; gap:2px; justify-content:center}
.pl-tgt .tg-what{overflow-wrap:anywhere}
.pl-tgt .tg-go{color:var(--you); font-size:14px}
.pl-tgt:focus-visible{outline:3px solid var(--you); outline-offset:2px}
.card.sheet{gap:14px; max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain}
.card.sheet > *{flex-shrink:0}
.room .choice{min-height:44px}
.together{margin:0; text-align:center; text-wrap:balance; font-size:13px; font-weight:700; color:var(--muted)}
.together-end{margin:0; text-align:center; font-size:15px; font-weight:800; color:var(--you)}
.pl-tgt.has-vs{display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:8px; align-items:center; align-content:center}
.pl-tgt.has-vs .pl-vs{grid-row:1 / span 2}
