/* iPhazili theme — the night look (glitch diamonds) is the default; light mode keeps the bright sky, drifting clouds and chunky cartoon buttons. */
:root {
  --sky-top: #5ec8ff;
  --sky-bottom: #c9f0ff;
  --ink: #23305a;
  --ink-soft: #5a6690;
  --card: #ffffff;
  --surface: #ffffff;       /* white cards, tiles, inputs */
  --surface-2: #eef5ff;     /* soft panels inside cards */
  --line: #d6e2f5;          /* borders and soft shadows on cards */
  --line-2: #cfdcf3;
  --line-3: #e3ecfa;
  --good-bg: #c9f7d9; --good-ink: #1f7a45;
  --warn-bg: #fff3c4; --warn-ink: #8a6400; --banner-ink: #6b4e00;
  --bad-bg: #ffe3e3;  --bad-ink: #b02f2f;
  --inverse: #23305a;       /* dark chips and toasts that sit on top of anything */
  --on-sun: #23305a;        /* text on the yellow buttons stays dark in both themes */
  --tab-bg: rgba(255,255,255,.7);
  --sky-end: #eafaff;
  --cloud: #ffffff; --cloud-opacity: 0.95;
  --hill-back: #7fe0a0; --hill-front: #4cd07d;
  --sun-disc: radial-gradient(circle at 40% 40%, #fff3a8, #ffcc33 60%);
  --sun-halo-1: rgba(255, 220, 90, 0.25); --sun-halo-2: rgba(255, 220, 90, 0.12);
  color-scheme: light;
  --sun: #ffcc33;
  --sun-dark: #e0a800;
  /* Deep enough for white text (4.6:1). Dark mode keeps brighter versions for text and decoration, and gives buttons these (see the dark mode section). */
  --deep-ocean: #0177d1; --deep-ocean-ledge: #005aa1;
  --deep-grass: #048745; --deep-grass-ledge: #006632;
  --deep-coral: #d14046; --deep-coral-ledge: #ae1829;
  --deep-grape: #8856e9; --deep-grape-ledge: #6c34c6;
  --grass: var(--deep-grass);
  --grass-dark: var(--deep-grass-ledge);
  --coral: var(--deep-coral);
  --coral-dark: var(--deep-coral-ledge);
  --grape: var(--deep-grape);
  --grape-dark: var(--deep-grape-ledge);
  --grape-bg: #dcd0ff;
  --blue-ink: #1f7fe0;       /* blue TEXT on cards */
  --grape-ink: #7443e0;      /* purple TEXT on cards (the button purple stays) */
  --ocean: var(--deep-ocean);
  --ocean-dark: var(--deep-ocean-ledge);
  --bubble: #ff8fd0;
  --radius: 22px;
  --shadow: 0 8px 0 rgba(35, 48, 90, 0.12), 0 14px 30px rgba(35, 48, 90, 0.12);
  --font-display: 'Fredoka', 'Baloo 2', 'Comic Sans MS', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--sky-end); }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 70%, var(--sky-end) 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: 0.5px; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- sky decorations ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky-sun {
  position: absolute; top: 40px; right: 8vw; width: 110px; height: 110px; border-radius: 50%;
  background: var(--sun-disc);
  box-shadow: 0 0 0 18px var(--sun-halo-1), 0 0 0 40px var(--sun-halo-2);
  animation: pulse 5s ease-in-out infinite;
}
.cloud {
  position: absolute; background: var(--cloud); border-radius: 100px; opacity: var(--cloud-opacity, 0.95);
  width: 180px; height: 56px; left: 0; --s: 1; --travel: 110vw;
  transform: translate3d(-260px, 0, 0) scale(var(--s));
  animation: drift linear infinite; will-change: transform;   /* moves with transform (the phone's graphics chip does it), not left (which stalls and stutters on phones) */
  filter: drop-shadow(0 6px 0 rgba(35, 48, 90, 0.06));
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: var(--cloud); border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -40px; left: 28px; }
.cloud::after { width: 104px; height: 104px; top: -56px; right: 22px; }
.cloud.c1 { top: 12%; animation-duration: 60s; animation-delay: -10s; }
.cloud.c2 { top: 30%; --s: 0.7; animation-duration: 80s; animation-delay: -45s; opacity: 0.8; }
.cloud.c3 { top: 55%; --s: 1.2; animation-duration: 95s; animation-delay: -70s; opacity: 0.7; }
.cloud.c4 { top: 78%; --s: 0.6; animation-duration: 70s; animation-delay: -25s; opacity: 0.85; }
.hills { position: absolute; bottom: -40px; left: -5%; right: -5%; height: 180px; }
.hills::before, .hills::after {
  content: ''; position: absolute; bottom: 0; border-radius: 50% 50% 0 0;
}
.hills::before { left: 0; width: 60%; height: 150px; background: var(--hill-back); }
.hills::after { right: 0; width: 65%; height: 120px; background: var(--hill-front); }

@keyframes drift { from { transform: translate3d(-260px, 0, 0) scale(var(--s)); } to { transform: translate3d(var(--travel), 0, 0) scale(var(--s)); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* The clouds are gentle background scenery, not an attention-grabbing effect, so they keep drifting when a phone has "reduce motion" or battery saver on, only
   much more slowly. Anyone who wants them still can switch them off with the ☁️ button (remembered on that device). */
@media (prefers-reduced-motion: reduce) { .sky .cloud { animation: drift linear infinite !important; animation-duration: 120s !important; } .sky-sun { animation: none !important; } }
html[data-clouds='off'] .sky .cloud { animation: none !important; opacity: 0.55; }

/* ---------- layout ---------- */
.page { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 20px 16px 120px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-size: 28px; font-weight: 700; color: #fff; text-shadow: 0 3px 0 rgba(35, 48, 90, 0.25); }
.logo .mark { width: 46px; height: 46px; border-radius: 14px; background: var(--sun); display: grid; place-items: center; font-size: 26px; box-shadow: 0 4px 0 var(--sun-dark); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.center { text-align: center; }
.stack { display: grid; gap: 14px; align-content: start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-soft); }
.pop { animation: pop 0.35s ease-out both; }
.shake { animation: shake 0.35s; }

/* ---------- buttons & inputs ---------- */
.btn {
  --c: var(--ocean); --d: var(--ocean-dark);
  appearance: none; border: 0; cursor: pointer; font-family: var(--font-display); font-weight: 600;
  font-size: 20px; color: #fff; background: var(--c); padding: 14px 26px; border-radius: 18px;
  box-shadow: 0 6px 0 var(--d); transform: translateY(0); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
@media (max-width: 420px) { .btn { padding: 12px 16px; } }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--d); }
.btn:disabled { filter: grayscale(0.7) opacity(0.6); cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn.sun { --c: var(--sun); --d: var(--sun-dark); color: var(--on-sun); }
.btn.grass { --c: var(--grass); --d: var(--grass-dark); }
.btn.coral { --c: var(--coral); --d: var(--coral-dark); }
.btn.grape { --c: var(--grape); --d: var(--grape-dark); }
.btn.white, .btn.ghost { --c: var(--surface); --d: var(--line); color: var(--ink); }
.btn.big { font-size: 26px; padding: 18px 34px; border-radius: 22px; }
.btn.small { font-size: 16px; padding: 8px 14px; border-radius: 12px; box-shadow: 0 4px 0 var(--d); }

.input {
  font-family: var(--font-display); font-size: 24px; padding: 14px 18px; border-radius: 16px; width: 100%;
  border: 3px solid var(--line); color: var(--ink); background: var(--surface-2); outline: none; text-align: center;
}
.input:focus { border-color: var(--ocean); background: var(--surface); }
label.field { display: grid; gap: 6px; font-weight: 700; }
select.input { text-align: left; font-size: 20px; }

/* ---------- chips / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 800; font-size: 14px; }
.band-J { background: var(--warn-bg); } .band-I { background: var(--good-bg); } .band-S { background: var(--grape-bg); } .band-F { background: var(--sky-bg, var(--grape-bg)); } .band-A { background: var(--bad-bg); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.choice {
  border: 4px solid transparent; background: var(--surface); border-radius: 20px; padding: 16px; cursor: pointer; text-align: left;
  box-shadow: 0 5px 0 var(--line); font: inherit; color: inherit; display: grid; gap: 6px; transition: transform 0.1s;
}
.choice:hover { transform: translateY(-2px); }
.choice[aria-pressed='true'] { border-color: var(--ocean); box-shadow: 0 5px 0 var(--ocean-dark); }
.choice .emoji { font-size: 38px; }
.choice .name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }

/* ---------- players / leaderboard ---------- */
.avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: var(--surface-2); flex: none; }
.lobby-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; justify-content: center; }
.lobby-player { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 999px; padding: 6px 16px 6px 6px; box-shadow: 0 4px 0 var(--line); font-weight: 800; animation: pop 0.35s both; }
.lobby-player .avatar { width: 40px; height: 40px; font-size: 24px; }
.lobby-player.offline { background: var(--surface-2); }

.board { display: grid; gap: 10px; }
.board-row.offline { background: var(--surface-2); box-shadow: none; }
.board-row { display: grid; grid-template-columns: 40px 54px 1fr auto; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 8px 14px; box-shadow: 0 4px 0 var(--line); transition: transform 0.3s; }
.board-row .rank { font-family: var(--font-display); font-size: 24px; text-align: center; }
.board-row .who { display: grid; gap: 6px; min-width: 0; }
.board-row .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .score { font-family: var(--font-display); font-size: 26px; }
.bar { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--grass), var(--sun)); border-radius: 99px; transition: width 0.3s; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 20px 0; }
.podium .step { width: 140px; text-align: center; display: grid; gap: 8px; justify-items: center; animation: pop 0.5s both; }
.podium .block { width: 100%; border-radius: 18px 18px 0 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 42px; color: var(--on-sun); }
.podium .p1 .block { height: 170px; background: var(--sun); color: var(--on-sun); }
.podium .p2 .block { height: 120px; background: #b8c6dd; }
.podium .p3 .block { height: 90px; background: #e0a070; }
.podium .p1 { animation-delay: 0.6s; } .podium .p2 { animation-delay: 0.3s; }

/* ---------- misc ---------- */
.pin { font-family: var(--font-display); font-size: clamp(48px, 10vw, 88px); letter-spacing: 8px; color: var(--ink); line-height: 1; }
.timer { font-family: var(--font-display); font-size: 28px; background: var(--surface); padding: 6px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--line); }
.timer.low { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-dark); }
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { background: var(--inverse); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; text-align: center; animation: pop 0.3s both; }
.mascot { font-size: 64px; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.confetti { position: fixed; top: -20px; width: 12px; height: 18px; z-index: 60; pointer-events: none; border-radius: 3px; }

/* ---------- puzzle area (shared by all puzzles) ---------- */
.puzzle-host { display: grid; justify-items: center; gap: 18px; }
/* A puzzle may never push the page sideways on a phone: grid children get min-width:auto by default, which lets wide content spill. */
.puzzle-host > *, .puzzle-stage { min-width: 0; max-width: 100%; }
/* Question puzzles (.pz) are a fixed-width column. The stage is a shrink-to-fit grid item, so without this its width followed the longest text of the moment and the whole puzzle jumped sideways between questions. */
.puzzle-stage:has(> .pz) { width: min(620px, 100%); }
.puzzle-title { display: flex; align-items: center; gap: 10px; }
.skip-bar { display: flex; justify-content: center; margin: 8px 0; } .skip-bar[hidden] { display: none; }
.hud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.hud .pill { font-size: 16px; background: var(--surface); box-shadow: 0 3px 0 var(--line); }

@media (max-width: 600px) {
  .btn.big { font-size: 22px; padding: 16px 24px; }
  .board-row { grid-template-columns: 30px 44px 1fr auto; gap: 8px; }
  .board-row .avatar { width: 44px; height: 44px; font-size: 26px; }
  .podium .step { width: 100px; }
  .sky-sun { width: 70px; height: 70px; top: 20px; }
  /* a phone screen is a third as wide: with the desktop speeds the clouds crawl about 6 px a second and look frozen */
  .cloud { --travel: 130vw; filter: none; }
  .cloud.c1 { animation-duration: 18s; } .cloud.c2 { animation-duration: 26s; } .cloud.c3 { animation-duration: 32s; } .cloud.c4 { animation-duration: 22s; }
  @media (prefers-reduced-motion: reduce) { .sky .cloud { animation-duration: 45s !important; } }   /* many phones report "reduce motion" (battery saver): still clearly moving there */
}


/* ───── accounts & dashboards ───── */
.form-card { width: min(520px, 100%); margin: 3vh auto; display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 800; font-size: 14px; }
.field .err { color: var(--coral-dark); font-weight: 800; font-size: 13px; min-height: 0; }
.input, select.input { width: 100%; font: inherit; font-weight: 700; padding: 12px 14px; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.input:focus { outline: none; border-color: var(--ocean); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.tabs button { font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: 10px 18px; background: var(--tab-bg); color: var(--ink); cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--surface); box-shadow: 0 4px 0 rgba(35,48,90,.15); color: var(--grape-ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 14px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good-ink); } .chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); } .chip.muted { background: var(--surface-2); color: var(--ink-soft); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-weight: 700; font-size: 15px; }
table.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 8px 10px; }
table.tbl td { padding: 10px; border-top: 2px solid var(--line-3); vertical-align: middle; }
table.tbl tr.click { cursor: pointer; } table.tbl tr.click:hover td { background: var(--surface-2); }

/* On a phone the class overview is a list of small cards (name and status on top, the numbers underneath) instead of a nine-column table you have to scroll sideways. */
@media (max-width: 700px) {
  .tbl-wrap:has(.tbl-cards) { overflow-x: visible; }
  table.tbl-cards, table.tbl-cards tbody { display: block; }
  table.tbl-cards thead { display: none; }
  table.tbl-cards tr.click { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px; margin-bottom: 10px; border: 2px solid var(--line-3); border-radius: 16px; background: var(--surface); }
  table.tbl-cards td { display: block; padding: 0; border: 0; }
  table.tbl-cards tr.click:hover td { background: none; }
  table.tbl-cards td:nth-child(1) { grid-column: 1; grid-row: 1; }
  table.tbl-cards td:nth-child(3) { grid-column: 2; grid-row: 1; align-self: start; }
  table.tbl-cards td:nth-child(n+2):not(:nth-child(3)) { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
  table.tbl-cards td:nth-child(n+2):not(:nth-child(3))::before { content: attr(data-l); color: var(--ink-soft); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
  table.tbl-cards td:nth-child(2):empty, table.tbl-cards td:nth-child(2):has(.chip.muted:only-child) { display: none; }
}
/* ...but a saved picture or PDF keeps the proper table */
.shot-stage table.tbl-cards { display: table !important; } .shot-stage table.tbl-cards tbody { display: table-row-group !important; } .shot-stage table.tbl-cards thead { display: table-header-group !important; }
.shot-stage table.tbl-cards tr.click { display: table-row !important; padding: 0 !important; margin: 0 !important; border: 0 !important; background: none !important; }
.shot-stage table.tbl-cards td { display: table-cell !important; padding: 7px 5px !important; border-top: 2px solid var(--line-3) !important; }
.shot-stage table.tbl-cards td::before { content: none !important; }
.shot-stage .tbl-wrap:has(.tbl-cards) { overflow: visible; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; display: grid; gap: 2px; }
.stat b { font-family: var(--font-display); font-size: 28px; line-height: 1.1; } .stat span { font-size: 13px; color: var(--ink-soft); font-weight: 800; }
.bar { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--grass); }
.bar.warn i { background: var(--sun); } .bar.bad i { background: var(--coral); }
.demo-banner { background: var(--warn-bg); color: var(--banner-ink); font-weight: 800; text-align: center; padding: 8px 12px; border-radius: 14px; margin-bottom: 12px; font-size: 14px; }
.chart { width: 100%; height: auto; }
.chart text { font: 700 11px var(--font-body); fill: var(--ink-soft); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.cols-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cols-pick label { display: flex; gap: 6px; align-items: center; background: var(--surface-2); padding: 6px 10px; border-radius: 12px; font-weight: 800; font-size: 14px; }
.code-big { font-family: var(--font-display); font-size: 30px; letter-spacing: .12em; color: var(--grape-ink); }
.cred-print { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- dark mode ----------
   Chosen with the 🌙/☀️ button (remembered), or follows the phone/computer setting until the button is used.
   The head of every page sets data-theme on <html> before it paints, so there is no white flash. */
html[data-theme='dark'] {
  color-scheme: dark;
  --sky-top: #0b1026; --sky-bottom: #0e1433; --sky-end: #121a42;
  --ink: #e9edff; --ink-soft: #a9b4e0;
  --card: #222b55; --surface: #222b55; --surface-2: #2c3668;
  --line: #3b4786; --line-2: #46528f; --line-3: #2f3a6e;
  --good-bg: #1f5a3e; --good-ink: #8ff0b6;
  --warn-bg: #5a4a17; --warn-ink: #ffd877; --banner-ink: #ffe08a;
  --bad-bg: #5e2a33;  --bad-ink: #ffa3ad;
  --grape-bg: #3d3480; --blue-ink: #8fc9ff; --grape-ink: #c8b3ff; --inverse: #0b1030; --tab-bg: rgba(34,43,85,.75);
  --cloud: #4b5a9c; --cloud-opacity: 0.5;
  --hill-back: #1e5a47; --hill-front: #2b7a5a;
  --sun-disc: radial-gradient(circle at 40% 40%, #ffffff, #cfd8ff 60%);
  --sun-halo-1: rgba(190, 205, 255, 0.18); --sun-halo-2: rgba(190, 205, 255, 0.08);
  --shadow: 0 8px 0 rgba(0, 0, 0, 0.28), 0 14px 30px rgba(0, 0, 0, 0.35);
  --ocean: #2f9bff; --ocean-dark: #1c73cc; --grass: #4cd07d; --grass-dark: #2fa65c; --coral: #ff6b6b; --coral-dark: #d94848; --grape: #9b6bff; --grape-dark: #7443e0;   /* bright enough to read on the night sky */
}
html[data-theme='dark'] :is(.btn, .timer.low, .quicknav a[aria-current='page'], .acc-head.has .acc-count) {   /* anything with white text on it keeps the deep colours */
  --ocean: var(--deep-ocean); --ocean-dark: var(--deep-ocean-ledge); --grass: var(--deep-grass); --grass-dark: var(--deep-grass-ledge); --coral: var(--deep-coral); --coral-dark: var(--deep-coral-ledge); --grape: var(--deep-grape); --grape-dark: var(--deep-grape-ledge);
}
/* The night look: glitch diamonds (a cyan and a magenta copy, a few pixels apart) fading out down the page, in place of the sun, clouds and hills. The same pattern as the home page. */
html[data-theme='dark'] .sky::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 460px; opacity: .2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpolygon points='31,4 55,28 31,52 7,28' fill='none' stroke='%23ff3df0' stroke-width='2.5'/%3E%3Cpolygon points='25,4 49,28 25,52 1,28' fill='none' stroke='%233df5ff' stroke-width='2.5'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent);
}
html[data-theme='dark'] :is(.sky-sun, .cloud, .hills, .cloud-toggle) { display: none !important; }
html[data-theme='dark'] .logo { text-shadow: -2px 0 #ff3df0, 2px 0 #3df5ff; }
html[data-theme='dark'] .logo .mark { background: none; box-shadow: none; font-size: 0; }
html[data-theme='dark'] .logo .mark::before { content: ''; display: block; width: 46px; height: 46px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpolygon points='22,3 39,20 22,37 5,20' fill='none' stroke='%23ff3df0' stroke-width='3'/%3E%3Cpolygon points='18,3 35,20 18,37 1,20' fill='none' stroke='%233df5ff' stroke-width='3'/%3E%3C/svg%3E") center / 78% no-repeat; }
html[data-theme='dark'] .foot-links::after { content: ''; display: block; height: 44px; margin-top: 16px; opacity: .45; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpolygon points='31,4 55,28 31,52 7,28' fill='none' stroke='%23ff3df0' stroke-width='2.5'/%3E%3Cpolygon points='25,4 49,28 25,52 1,28' fill='none' stroke='%233df5ff' stroke-width='2.5'/%3E%3C/svg%3E"); background-position: center; }
html[data-theme='dark'] .card { border: 2px solid var(--line); }
html[data-theme='dark'] a:focus-visible, html[data-theme='dark'] button:focus-visible { outline-color: #ffb000; }
html[data-theme='dark'] .input, html[data-theme='dark'] select.input { background: var(--surface-2); }
html[data-theme='dark'] .btn.white { --d: var(--line); }

/* the 🌙/☀️ button that sits at the end of every top bar */
.theme-toggle, .cloud-toggle { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 0 var(--line); display: grid; place-items: center; }
.theme-toggle:active, .cloud-toggle:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.theme-toggle:focus-visible, .cloud-toggle:focus-visible { outline: 4px solid var(--ocean); outline-offset: 2px; }
.topbar { flex-wrap: wrap; }
.topbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; position: relative; }
.topbar .btn.small { white-space: nowrap; }
@media (max-width: 430px) {                       /* small phones: keep the top bar on one tidy line */
  .topbar { gap: 8px; }
  .topbar .logo { font-size: 23px; gap: 7px; } .topbar .logo .mark { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
  .theme-toggle, .cloud-toggle { width: 40px; height: 40px; font-size: 19px; }
  .topbar-tools { gap: 6px; } .sound-btn { width: 40px; height: 40px; font-size: 19px; }
  .topbar .btn.small { padding: 7px 11px; font-size: 15px; }
}

/* printing (class logins!) is always dark-on-white, whatever the screen theme */
@media print {
  .sky, .topbar, .tabs, .quicknav, .classtabs, .no-print, .test-badge { display: none !important; }
  html[data-theme='dark'] { --ink: #23305a; --ink-soft: #5a6690; --card: #fff; --surface: #fff; --surface-2: #eef5ff; --line: #d6e2f5; --line-3: #e3ecfa; --good-bg: #c9f7d9; --warn-bg: #fff3c4; --bad-bg: #ffe3e3; color-scheme: light; }
  body { background: #fff !important; }
}


.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { font: inherit; font-weight: 800; border: 3px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 10px 16px; cursor: pointer; }
.seg button[aria-pressed='true'] { border-color: var(--ocean); background: var(--surface-2); }

/* ---------- battle results: well done message and honourable mentions ---------- */
.welldone { text-align: center; background: linear-gradient(135deg, var(--warn-bg), var(--good-bg)); }
.welldone h2 { color: var(--ink); } .welldone p { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.45; color: var(--ink); }
.mention-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mention { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 10px 14px; }
.mention .avatar { flex: none; }
.mention-text { display: grid; gap: 2px; min-width: 0; } .mention-text b { overflow-wrap: anywhere; }
.mention .badge { display: inline-block; justify-self: start; background: var(--warn-bg); color: var(--ink); font-weight: 800; font-size: 14px; border-radius: 999px; padding: 2px 10px; }
.small { font-size: 13px; }
.mention-self { display: grid; gap: 2px; background: var(--surface); border-radius: 16px; padding: 10px 14px; }

/* ---------- sound button and menu ---------- */
.sound-group { position: relative; display: flex; align-items: center; }
.sound-btn { width: 46px; height: 46px; border: 0; border-radius: 999px 0 0 999px; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 0 var(--line); display: grid; place-items: center; }
.sound-caret { height: 46px; width: 26px; border: 0; border-radius: 0 999px 999px 0; background: var(--surface); color: var(--ink-soft); font-size: 14px; cursor: pointer; box-shadow: 0 4px 0 var(--line); border-left: 2px solid var(--line-3); }
.sound-btn:active, .sound-caret:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.sound-btn:focus-visible, .sound-caret:focus-visible, .sound-opt:focus-visible { outline: 4px solid var(--ocean); outline-offset: 2px; }
.sound-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(280px, 86vw); background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 6px; }
.sound-pop[hidden] { display: none; }
.sound-state { font-weight: 800; text-align: center; }
.sound-h { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.sound-opt { display: flex; align-items: center; gap: 10px; text-align: left; border: 3px solid var(--line-2); background: var(--surface-2); color: var(--ink); border-radius: 14px; padding: 8px 10px; font: inherit; cursor: pointer; }
.sound-opt small { display: block; color: var(--ink-soft); font-size: 12px; }
.sound-opt[aria-checked='true'] { border-color: var(--ocean); }
.sound-emoji { font-size: 22px; }
@media (max-width: 430px) { .sound-caret { height: 40px; width: 22px; } .sound-pop { right: -48px; } }

/* ---------- ✨ NEW badge on recently added puzzles ---------- */
.choice { position: relative; }
.new-badge { position: absolute; top: -9px; right: -6px; z-index: 2; background: var(--sun); color: var(--on-sun); font: 800 12px var(--font-display, inherit); letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; box-shadow: 0 3px 0 var(--sun-dark); transform: rotate(4deg); pointer-events: none; }
.new-shelf { background: var(--warn-bg); border-radius: 22px; padding: 6px 14px 14px; margin-bottom: 14px; }
@media (prefers-reduced-motion: no-preference) { .new-badge { animation: newpulse 2.4s ease-in-out infinite; } }
@keyframes newpulse { 0%, 100% { transform: rotate(4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.08); } }

.stretch-tag { background: var(--grape-bg); color: var(--ink); font-weight: 800; font-size: 14px; border-radius: 999px; padding: 4px 14px; }
.stretch-tag[hidden] { display: none; }

/* ---------- the teacher plays along (host page) ---------- */
#stage { display: grid; gap: 16px; }
#playAlongWrap { padding: 12px; }
#paFrame { width: 100%; height: 280px; border: 0; border-radius: 16px; background: transparent; }
#paFrame[hidden] { display: none; }
#stage.state-game.has-player #paFrame { height: min(78vh, 800px); }
@media (min-width: 980px) {
  #stage.state-game.has-player { grid-template-columns: minmax(380px, 1.15fr) minmax(320px, 1fr); align-items: start; }
  #stage.state-game.has-player #playAlongWrap { order: -1; }
}
/* the player page when it sits inside the host page: no logo, sky or badges, see-through background */
html.embed .sky, html.embed .test-badge, html.embed .topbar .logo, html.embed .topbar-tools { display: none !important; }
html.embed, html.embed body { background: transparent !important; }
html.embed .page { padding: 4px 8px; } html.embed .topbar { margin-bottom: 8px; justify-content: center; }

/* ---------- feedback page ---------- */
.fb label { display: grid; gap: 6px; font-weight: 800; }
.fb label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; }
.fb .input { text-align: left; font-weight: 600; }
.fb textarea.input { resize: vertical; min-height: 130px; font-weight: 600; line-height: 1.4; }
.fb-set { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; } .fb-set legend { font-weight: 800; padding: 0; margin-bottom: 6px; }
.fb-chips, .fb-rate { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { border: 3px solid var(--line-2); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 800 15px var(--font-body, inherit); cursor: pointer; }
.fb-chip[aria-checked='true'] { border-color: var(--ocean); background: var(--surface); box-shadow: 0 3px 0 var(--ocean-dark); }
.fb-face { width: 54px; height: 54px; border: 3px solid var(--line-2); background: var(--surface-2); border-radius: 50%; font-size: 28px; cursor: pointer; line-height: 1; }
.fb-face[aria-checked='true'] { border-color: var(--sun-dark); background: var(--warn-bg); transform: scale(1.1); }
.fb-chip:focus-visible, .fb-face:focus-visible { outline: 4px solid var(--ocean); outline-offset: 2px; }
.fb-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 520px) { .fb-two { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.foot-links { text-align: center; font-size: 14px; font-weight: 800; margin: 18px 0 8px; } .foot-links a { margin: 0 8px; }

/* ---------- connection bars and "now playing" on the teacher's board ---------- */
.link { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; margin-left: 8px; vertical-align: -1px; }
.link i { display: block; width: 4px; border-radius: 1px; background: var(--line-2); }
.link i:nth-child(1) { height: 5px; } .link i:nth-child(2) { height: 9px; } .link i:nth-child(3) { height: 13px; }
.link-good i { background: var(--grass); }
.link-ok i:nth-child(-n+2) { background: var(--sun-dark); }
.link-poor i:nth-child(1) { background: var(--coral); }
.nowrow { display: block; font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- live mini-screens on the teacher's board ---------- */
#board.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--surface-2); border-radius: 16px; overflow: hidden; display: grid; align-content: start; }
.tile.off { opacity: .55; }
.tile-img, .tile-ph { width: 100%; aspect-ratio: 16 / 11; object-fit: contain; background: var(--surface); display: block; }
.tile-img.old { opacity: .45; }
.tile-ph { display: grid; place-items: center; text-align: center; font-weight: 800; color: var(--ink-soft); font-size: 14px; padding: 8px; }
.tile-info { padding: 8px 10px 10px; display: grid; gap: 2px; font-size: 14px; position: relative; }
.tile-score { position: absolute; right: 10px; top: 8px; font: 700 18px var(--font-display, inherit); }

/* ---------- pictures of the dashboard ---------- */
.shot-only { display: none; } .shooting .shot-only { display: block; }
.shot-title { font: 700 20px var(--font-display, inherit); color: var(--ink); padding: 4px 4px 0; }
.shooting .no-shot { display: none !important; }

/* ───── tours, tips and the Help page ───── */
.tour-back { position: fixed; inset: 0; z-index: 200; background: rgba(20, 30, 60, 0.55); display: grid; place-items: center; padding: 16px; }
.tour-card { background: var(--surface); color: var(--ink); width: min(460px, 100%); max-height: 92vh; overflow: auto; border-radius: 28px; padding: 22px 22px 18px; box-shadow: 0 10px 0 rgba(35, 48, 90, 0.18), var(--shadow); display: grid; gap: 10px; text-align: center; justify-items: center; }
.tour-emoji { font-size: 58px; line-height: 1; } .tour-card h2 { margin: 0; font-size: 26px; }
.tour-text { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 700; } .tour-tip { margin: 0; background: var(--warn-bg); color: var(--ink); border-radius: 16px; padding: 10px 14px; font-weight: 700; font-size: 16px; line-height: 1.4; text-align: left; }
.tour-tip[hidden] { display: none; }
.tour-dots { display: flex; gap: 8px; } .tour-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); } .tour-dots i.on { background: var(--sun); box-shadow: 0 2px 0 var(--sun-dark); }
.tour-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: 100%; align-items: center; }
.tour-actions [hidden] { display: none; } .tour-skip { background: transparent; box-shadow: none; color: var(--ink-soft, var(--ink)); text-decoration: underline; }
.tour-hl { outline: 4px solid var(--sun) !important; outline-offset: 3px; position: relative; z-index: 201; border-radius: 14px; }
@media (max-width: 600px) { .tour-back { place-items: end center; padding: 10px; } .tour-card { padding: 18px 16px 14px; border-radius: 26px 26px 20px 20px; } .tour-emoji { font-size: 48px; } .tour-text { font-size: 17px; } }
.tip-card { gap: 8px; } .tip-card .tip-text { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.help-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.help-tabs button { border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 800; background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line); } .help-tabs button[aria-pressed='true'] { background: var(--grape); color: #fff; box-shadow: 0 3px 0 var(--grape-dark); }
.help-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-weight: 700; font-size: 17px; }
.help-card details { border-top: 2px dashed var(--line-3); padding: 10px 0; } .help-card summary { cursor: pointer; font-weight: 800; font-size: 18px; } .help-card details p { margin: 8px 0 0; font-weight: 600; line-height: 1.5; }
.help-card h2 { margin: 18px 0 4px; } .help-card h3 { margin: 22px 0 8px; } .help-card #guide > .row { margin: 12px 0 4px; }

.choice-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.choice-head:first-child { margin-top: 0; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* class leaderboard + new-work banner */
.board-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.board-list .board-row { display:grid; grid-template-columns:2.2em 1fr auto; align-items:center; gap:8px; background:var(--surface-2); border-radius:14px; padding:8px 12px; }
.board-list .board-row.me { box-shadow:inset 0 0 0 3px var(--ocean); }
.board-list .board-row .rk { font-size:1.3em; text-align:center; } .board-list .board-row .up { color:var(--grass-dark); }
.new-work { border:3px solid var(--sun); background:var(--surface); }

/* ───── quick links bar + dashboard filters (v0.22) ───── */
.quicknav { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.quicknav.sticky { position: sticky; top: 0; z-index: 40; margin: -8px -8px 14px; padding: 8px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(6px); border-radius: 18px; box-shadow: 0 3px 0 var(--line); }
.quicknav a { font-weight: 800; text-decoration: none; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.quicknav a:hover, .quicknav a:focus-visible { border-color: var(--ocean); }
.quicknav a[aria-current='page'] { background: var(--ocean); border-color: var(--ocean-dark, var(--ocean)); color: var(--on-ocean, #fff); }
@media (max-width: 560px) { .quicknav { flex-wrap: nowrap; overflow-x: auto; } .quicknav a { padding: 6px 11px; font-size: 15px; } }
.filters { display: grid; gap: 10px; }
.classtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.classtabs button { font: inherit; font-weight: 800; border: 0; border-radius: 12px 12px 4px 4px; padding: 8px 14px; background: var(--tab-bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.classtabs button[aria-selected='true'] { background: var(--surface); box-shadow: inset 0 -4px 0 var(--ocean); color: var(--grape-ink); }
.classtabs .n { font-weight: 600; opacity: .7; margin-left: 4px; }
.datebar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.datebar button { font: inherit; font-weight: 800; border: 3px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--ink); }
.datebar button[aria-pressed='true'] { border-color: var(--ocean); background: var(--surface-2); }
.datebar input[type=date] { width: auto; }
.asg-group > h3 { margin: 6px 0; display: flex; gap: 8px; align-items: baseline; }
.asg { padding: 0; overflow: hidden; }
.asg > .asg-head { all: unset; box-sizing: border-box; display: grid; gap: 6px; padding: 14px 18px; cursor: pointer; width: 100%; }
.asg > .asg-head:focus-visible { outline: 3px solid var(--ocean); outline-offset: -3px; }
.asg .asg-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.asg .asg-body { padding: 0 18px 16px; }

/* the off-screen, phone-shaped copy used for pictures that get shared (see snapshot.js) */
.shot-stage { font-size: 16px; line-height: 1.3; }
.shot-stage .card { padding: 14px; }
.shot-stage table.tbl th, .shot-stage table.tbl td { padding: 7px 5px; }
.shot-stage:not(.full) .shot-hide { display: none !important; }   /* the PDF (.full) keeps everything */
.shot-stage .split { grid-template-columns: 1fr; }
.shot-stage .chart { width: 100%; height: auto; }
.shot-stage .tbl-wrap { overflow: visible; }
.shot-stage table.tbl { display: table; overflow: visible; font-size: 16px; width: 100%; }
.shot-stage table.tbl th { font-size: 11px; letter-spacing: 0; }
.shot-stage .stats { grid-template-columns: 1fr 1fr; }
.shot-stage .shot-title { font-size: 22px; }
.shot-stage .stat b { font-size: 30px; }

.shot-stage.full table.tbl { font-size: 14px; } .shot-stage.full table.tbl th, .shot-stage.full table.tbl td { padding: 6px 4px; }

/* a plain-looking button that reads as a link (used for "switch it on in …" hints) */
.linkish { border:0; background:none; padding:0; font:inherit; font-weight:800; color:var(--ocean-dark); text-decoration:underline; cursor:pointer; }
.linkish:hover { color:var(--grape); }

/* battle board: the progress bar gets the full width of the name column, and the puzzle each player is on stays readable */
.board-row .who .bar { width: 100%; min-width: 0; height: 14px; }
.board-row .who .nowrow { white-space: normal; }

/* ---------- v0.27 puzzle chooser: coloured tiles, search, filters, "My mix" tray ---------- */
.choice-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.choice { align-content: start; justify-items: center; text-align: center; padding: 18px 10px 14px; border-radius: 22px; background: var(--tile, var(--surface)); border-width: 3px; }
.choice .name { font-size: 17px; line-height: 1.15; }
.choice[aria-pressed='true'] { border-color: var(--tile-ink, var(--ocean)); box-shadow: 0 5px 0 var(--tile-ink, var(--ocean-dark)); }
.choice[aria-pressed='true']::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--tile-ink, var(--ocean)); color: #fff; font: 800 15px/24px var(--font-display, inherit); text-align: center; }
.choice.t-spatial { --tile: #e3f1ff; --tile-ink: #2f9bff; } .choice.t-memory { --tile: #ffe6f4; --tile-ink: #e0529f; } .choice.t-logic { --tile: #efe6ff; --tile-ink: #8a5cf0; }
.choice.t-maths { --tile: #fff3d1; --tile-ink: #d99200; } .choice.t-words { --tile: #e1f8e8; --tile-ink: #2f9a55; } .choice.t-attention { --tile: #ffe5e5; --tile-ink: #e0504f; }
.choice.t-chess { --tile: #e6e9ff; --tile-ink: #5566e6; } .choice.t-machines { --tile: #ffeadb; --tile-ink: #e07a1f; }
.choice.t-languages { --tile: #ffe3f0; --tile-ink: #c23a78; } .choice.t-subjects { --tile: #dff5ea; --tile-ink: #007749; } .choice.t-challenge { --tile: #e9eef7; --tile-ink: #5a6a99; } .choice.t-x { --tile: #eef1fb; --tile-ink: #5566e6; }   /* every section needs a pastel tile: without one the dark-mode surface showed dark writing on dark */
.mix-search { width: 100%; box-sizing: border-box; height: 46px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px; font: 700 16px var(--font-body, inherit); background: var(--surface); color: inherit; }
.mix-chips button, .mix-saved button { white-space: nowrap; }
.saved-mix { display: inline-flex; } .saved-mix .x { padding-left: 8px; padding-right: 8px; }
.mix-tray { position: sticky; bottom: 8px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border-radius: 22px; padding: 10px 14px; box-shadow: 0 0 0 2px var(--line), 0 8px 24px rgba(35,48,90,.16); margin-top: 14px; }
.mix-chips-row { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 200px; max-height: 64px; overflow: auto; }
.mix-pill { background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px; white-space: nowrap; }

/* ---------- v0.27 learner islands ---------- */
.isl-world { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 10px; justify-items: center; padding: 6px 0 24px; }
.isl-world .isl:nth-child(even) { margin-top: 30px; }
.isl { min-width: 0; max-width: 100%; position: relative; background: none; border: 0; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; color: inherit; }
.isl svg { filter: drop-shadow(0 6px 0 rgba(35,48,90,.12)); transition: transform .2s; width: 176px; max-width: 100%; height: 150px; }
.isl:hover svg, .isl:focus-visible svg { transform: translateY(-4px); }
.isl:focus-visible { outline: 3px solid var(--ocean-dark, #23305a); outline-offset: 3px; border-radius: 18px; }
.isl-pill { background: var(--surface); border-radius: 16px; padding: 4px 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 3px 0 var(--line); }
.isl-nm { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.1; }
.isl-pr { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; }
.isl-bar { width: 58px; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; } .isl-bar i { display: block; height: 100%; border-radius: 99px; }
.isl-new { position: absolute; top: 2px; right: 8px; z-index: 2; background: var(--sun); color: var(--on-sun); font: 800 11px var(--font-display, inherit); padding: 2px 8px; border-radius: 99px; box-shadow: 0 2px 0 var(--sun-dark); transform: rotate(6deg); }
.isl-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 22px; } .isl-title { margin: 0; color: #fff; text-shadow: 0 3px 0 rgba(35,48,90,.25); }
.isl-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 10px; justify-items: center; }
.isl-pz { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.isl-pz:nth-child(3n+2) { margin-top: -22px; }
.bub { position: relative; width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; margin: 5px; box-shadow: 0 0 0 5px var(--surface), 0 6px 0 5px rgba(35,48,90,.16); transition: transform .2s; }
.bub.done { box-shadow: 0 0 0 5px #4cd07d, 0 6px 0 5px rgba(35,48,90,.16); }
.bub:hover, .bub:focus-visible { transform: translateY(-4px) scale(1.04); } .bub:focus-visible { outline: 3px solid var(--ocean-dark, #23305a); outline-offset: 4px; }
.bub-emoji { font-size: 40px; line-height: 1; }
.bub-done { position: absolute; top: -4px; right: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--sun); box-shadow: 0 2px 0 var(--sun-dark); display: grid; place-items: center; }
.bub .new-badge { top: -8px; right: auto; left: -6px; }
.bub-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; text-align: center; line-height: 1.1; background: var(--surface); border-radius: 12px; padding: 3px 8px; max-width: 120px; opacity: .95; }
@media (max-width: 430px) { .isl-world { grid-template-columns: repeat(2, minmax(0, 1fr)); } .isl-bubbles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bub { width: 80px; height: 80px; } .bub-emoji { font-size: 34px; } }
.choice[class*='t-'] { color: #23305a; }   /* the pastel tiles keep dark writing, also in dark mode */
.choice[class*='t-'] .muted { color: #4a587f; }

/* Build a mix by feel */
.feel-box { background: var(--surface); border-radius: 22px; padding: 12px 14px; box-shadow: 0 0 0 2px var(--line); }
.feel-head, .feel-len, .feel-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feel-head { justify-content: space-between; margin-bottom: 8px; }
.feel-moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.feel-mood { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--surface-2); border-radius: 16px; padding: 10px 12px; border: 2px solid transparent; cursor: pointer; font: inherit; color: inherit; }
.today-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.today-card { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 2px solid var(--line-2); border-radius: 18px; padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); }
.today-card:hover { border-color: var(--brand, #6c8cff); } .today-emoji { font-size: 30px; } .today-text { display: flex; flex-direction: column; gap: 2px; font-weight: 700; color: var(--ink); }
.feel-sub { grid-column: 1 / -1; font-weight: 800; color: var(--ink-soft); margin-top: 4px; }
.feel-mood[aria-pressed="true"] { border-color: var(--brand, #6c8cff); }
.feel-emoji { font-size: 26px; }
.feel-custom { width: 72px; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--line); font: inherit; }
.feel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0; }
.feel-card { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 16px; padding: 8px 10px; }
.feel-card-emoji { font-size: 26px; }
.feel-card-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.feel-foot { justify-content: space-between; }

/* Order Up and Colour Recall */
.ou-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; background: var(--surface); padding: 14px; border-radius: 20px; box-shadow: var(--shadow); }
.cr-swatch { display: inline-block; min-width: 84px; padding: 6px 10px; border-radius: 12px; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.45); }

/* ---------- v0.45 subject folders (learners) and collapsible subject sections (teachers) ---------- */
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.sub-tile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 16px 10px 14px; border: 3px solid transparent; border-radius: 22px; background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; box-shadow: 0 5px 0 var(--line); transition: transform .12s, box-shadow .12s; min-height: 132px; align-content: start; }
.sub-tile:hover, .sub-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 0 var(--line); } .sub-tile:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--line); }
.sub-tile.all { border-color: #4cd07d; }
.sub-emoji { font-size: 40px; line-height: 1; } .sub-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1.15; text-align: center; }
.sub-bar { width: 80%; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; } .sub-bar i { display: block; height: 100%; background: #4cd07d; border-radius: 99px; }
.sub-n { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.isl-page > .mix-search { width: 100%; box-sizing: border-box; }
@media (max-width: 430px) { .sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
/* teacher pickers */
.acc { background: var(--surface); border-radius: 18px; box-shadow: 0 3px 0 var(--line); padding: 4px; }
.acc-row { display: flex; align-items: center; gap: 6px; }
.acc-head { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.acc-head:hover, .acc-head:focus-visible { background: var(--surface-2); }
.acc-emoji { font-size: 26px; } .acc-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; flex: 1; }
.acc-count { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.acc-head.has .acc-count { background: var(--ocean); color: #fff; padding: 2px 9px; border-radius: 99px; }
.acc-chev { font-size: 24px; line-height: 1; transition: transform .15s; } .acc.open .acc-chev { transform: rotate(90deg); }
.acc-body { padding: 8px 6px 10px; } .acc-body[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .acc-chev, .sub-tile { transition: none; } }
.tortoise { position: fixed; bottom: 6px; left: -60px; z-index: 40; font-size: 40px; background: none; border: 0; cursor: pointer; padding: 8px; animation: tortoise-walk 20s linear forwards; }
@keyframes tortoise-walk { to { left: calc(100vw + 20px); } }
.egg-line { white-space: normal; text-align: center; height: auto; }
@media (prefers-reduced-motion: reduce) { .tortoise { animation-duration: 40s; } }
.toast { white-space: pre-line; }

/* ---------- co-op: team bar ---------- */
.team-bar { display: grid; gap: 8px; width: min(720px, 100%); margin: 0 auto 10px; padding: 10px 12px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); } .team-bar[hidden] { display: none; }
.tb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tb-meter { height: 12px; border-radius: 99px; background: rgba(0,0,0,.1); overflow: hidden; } .tb-meter span { display: block; height: 100%; background: linear-gradient(90deg, #6bd36b, #ffd23f); border-radius: 99px; transition: width .4s; }
.tb-members { display: flex; flex-wrap: wrap; gap: 6px; } .tb-chip { padding: 3px 10px; border-radius: 99px; background: rgba(94,200,255,.2); font-weight: 800; font-size: .85rem; } .tb-chip.done { background: rgba(107,211,107,.3); } .tb-chip.away { opacity: .5; }
.tb-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,210,63,.25); font-weight: 800; } .tb-note.ask { background: rgba(255,120,120,.22); } .tb-note.helping { background: rgba(107,211,107,.25); }
.ask-btn[disabled] { opacity: .55; }
.puzzle-title.rescue h2 { color: inherit; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; } .team-grid[hidden] { display: none; }
.team-card { display: grid; gap: 6px; padding: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); align-content: start; }
.tc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1.05rem; }
.tc-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-weight: 800; } .tc-row.away { opacity: .5; } .tc-extra { flex-basis: 100%; color: var(--muted, #6b7390); }

.tb-note.spy { background: rgba(120,90,200,.2); } .tb-note.hint { background: rgba(94,200,255,.22); font-weight: 700; }
.hint-menu { display: grid; gap: 6px; } .hint-menu .btn { text-align: left; white-space: normal; } .hint-menu .sneaky { outline: 2px dashed #8a5cd8; }
.meeting { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(35,48,90,.72); overflow: auto; } .meeting[hidden] { display: none; }
.m-card { width: min(520px, 100%); } .m-clock { font-family: var(--font-display); font-size: 2rem; } .m-hints { text-align: left; }
.grade-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.grade-row .seg button { padding: 6px 14px; border-width: 2px; }

/* Share card (end of Today's mix / Topic of the week) */
.share-card { margin: 16px auto 14px; max-width: 420px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 2px dashed var(--line-3); display: grid; gap: 10px; }
.share-title { font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.share-box { margin: 0; padding: 14px 16px; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font: 600 15px/1.5 var(--font-body, inherit); color: var(--ink); background: var(--surface); border: 2px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); user-select: all; -webkit-user-select: all; }
@media (max-width: 420px) { html[data-theme='dark'] .topbar .logo .mark::before { width: 38px; height: 38px; } }
