/* PrepMyPSAC pilot: bright, colourful, big touch targets, iPad first.
   Loaded only by layouts/psac.html.erb, after the shared app stylesheet. */
html.psac { --bg:#fff8e7; --panel:#ffffff; --panel-2:#fff1cc; --ink:#22223b; --muted:#5c5f7a; --line:#ffd99a; --cyan:#0077b6; --accent:#ff6b6b;
  --sun:#ffd166; --coral:#ff6b6b; --sky:#4cc9f0; --leaf:#06d6a0; --grape:#9b5de5; --shadow:0 10px 0 #0000000d, 0 14px 32px #f4a26126; }
html.psac body.psac-body { font:19px/1.5 "Fredoka", "Inter", system-ui, sans-serif; background:
  radial-gradient(circle at 10% 0%, #ffe5ec 0, transparent 40%), radial-gradient(circle at 100% 20%, #d0f4de 0, transparent 35%),
  radial-gradient(circle at 40% 100%, #cde7ff 0, transparent 45%), var(--bg); min-height:100vh; color:var(--ink); }
.psac h1, .psac h2, .psac h3 { font-family:"Fredoka", system-ui, sans-serif; letter-spacing:0; }
.psac h1 { font-size:clamp(30px, 4vw, 44px); font-weight:700; }
.psac h2 { font-size:clamp(22px, 3vw, 30px); font-weight:600; }

.psac-top { position:-webkit-sticky; position:sticky; top:0; z-index:50; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:calc(10px + env(safe-area-inset-top)) 20px 10px; background:#fff; border-bottom:3px solid var(--sun); }
.psac-brand { display:flex; align-items:center; gap:10px; font-size:26px; font-weight:700; color:var(--ink); }
.psac-brand b { color:var(--coral); } .psac-brand i { font-style:normal; color:var(--grape); }
.psac-brand-mark { width:44px; height:44px; border-radius:14px; display:grid; place-items:center; background:var(--sun); color:#fff; font-size:28px; text-shadow:0 2px 0 #f4a261; box-shadow:0 4px 0 #f4a261; }
.psac-top-right { display:flex; align-items:center; gap:12px; }
.psac-tokens { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:999px; background:#fff3c4; border:3px solid var(--sun); font-size:22px; font-weight:700; }
.psac-tokens.pop, .psac-bubble.pop { animation:psac-pop .45s ease; }
.psac-bye { min-height:48px; padding:0 18px; border-radius:16px; border:3px solid #e9e9f2; background:#fff; font:600 18px "Fredoka", sans-serif; color:var(--muted); }
.psac-main { max-width:1040px; margin:0 auto; padding:20px 20px 80px; }
.psac-page { display:flex; flex-direction:column; gap:20px; }
.psac-center { text-align:center; justify-content:center; }
.psac-lead { color:var(--muted); font-size:20px; }
.psac-kicker { margin:0 0 6px; font-size:15px; font-weight:700; letter-spacing:.12em; color:var(--coral); }
.psac-back { align-self:flex-start; display:inline-flex; align-items:center; min-height:52px; padding:0 20px; border-radius:18px; background:#fff; border:3px solid var(--line); font-weight:600; }
.psac-flash { margin:0 0 16px; padding:14px 20px; border-radius:18px; background:#d8f3dc; border:3px solid var(--leaf); font-size:20px; }
.psac-flash.alert { background:#ffe5e5; border-color:var(--coral); }

.psac-card { background:var(--panel); border:3px solid var(--line); border-radius:28px; padding:24px; box-shadow:var(--shadow); }
.psac-button, .psac-option, .psac-step, .psac-activity, .psac-word, .psac-hear { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.psac-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:60px; padding:0 26px; border-radius:20px; border:0;
  background:var(--sky); color:#fff; font:600 21px "Fredoka", sans-serif; box-shadow:0 6px 0 #1b98c4; transition:transform .1s; }
.psac-button.go { background:var(--leaf); box-shadow:0 6px 0 #05a77d; }
.psac-button.big { min-height:72px; font-size:26px; padding:0 36px; }
.psac-button:active, .psac-option:active, .psac-step:active, .psac-activity:active, .psac-character:active { transform:translateY(4px); box-shadow:none; }
.psac-button:disabled { opacity:.75; cursor:default; }
.psac-actions { display:flex; flex-wrap:wrap; gap:14px; margin-top:16px; }

/* Layout: the page takes the full width. Hub pages (home, my journey, settings) have the
   dashboard column on the left. The mascot floats over the bottom-right corner, a little
   see-through, so the page behind it can still be seen and scrolled. */
.psac-shell { max-width:1400px; margin:0 auto; }
.psac-shell.with-side { display:grid; grid-template-columns:230px minmax(0, 1fr); gap:6px; align-items:start; }
.psac-shell .psac-main { max-width:1100px; width:100%; min-width:0; padding-bottom:230px; }
.psac-aside { position:fixed; right:calc(8px + env(safe-area-inset-right)); bottom:calc(6px + env(safe-area-inset-bottom)); z-index:40; width:min(300px, 62vw); pointer-events:none; }
.psac-teacher { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.psac-teacher-figure { pointer-events:auto; border:0; padding:0; background:none; cursor:pointer; opacity:.86; filter:drop-shadow(0 8px 10px #0000002e); transform-origin:50% 90%;
  animation:psac-idle 3.2s ease-in-out infinite; transition:opacity .2s; }
.psac-teacher-figure:active { opacity:1; }
.psac-teacher-figure.mood-waving { animation:psac-wave 1.4s ease-in-out, psac-idle 3.2s ease-in-out 1.4s infinite; }
.psac-teacher-figure.mood-happy { animation:psac-hop .7s ease 2, psac-idle 3.2s ease-in-out 1.4s infinite; }
.psac-teacher-figure.mood-thinking { animation:psac-think 2.2s ease-in-out, psac-idle 3.2s ease-in-out 2.2s infinite; }
.psac-teacher-figure.mood-cheering { animation:psac-cheer 1.1s ease 2, psac-idle 3.2s ease-in-out 2.2s infinite; }
/* The bubble's paper is about 70% solid, so what is behind shows through; the words stay dark. */
.psac-bubble { pointer-events:auto; position:relative; width:100%; background:rgba(255, 255, 255, .72); -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  border:3px solid rgba(155, 93, 229, .75); border-radius:22px; padding:12px 14px; font-size:18px; line-height:1.4; box-shadow:0 8px 20px #0000001f;
  max-height:38vh; overflow:auto; transition:opacity .35s, transform .35s; transform-origin:85% 100%; cursor:pointer; }
.psac-bubble::after { content:""; position:absolute; right:74px; bottom:-15px; border:13px solid transparent; border-top-color:rgba(155, 93, 229, .75); border-bottom:0; }
.psac-bubble.folded { opacity:0; transform:scale(.6); pointer-events:none; }
.psac-bubble p { margin:0; min-height:1.4em; color:var(--ink); font-weight:500; }
.psac-bubble p.typing::after { content:"▍"; color:var(--grape); animation:psac-caret .7s steps(1) infinite; margin-left:1px; }
@keyframes psac-caret { 50% { opacity:0; } }
@media (max-width: 760px) {
  .psac-aside { width:min(240px, 66vw); }
  .psac-teacher .psac-avatar-lg.has-image { width:120px !important; height:120px !important; }
}
.psac-avatar { display:inline-grid; place-items:center; border-radius:50%; background:radial-gradient(circle at 35% 30%, #fff 0, var(--teacher) 70%); border:4px solid #fff; box-shadow:0 6px 0 #0000001a; overflow:hidden; flex:0 0 auto; }
.psac-avatar img { width:100%; height:100%; object-fit:cover; }
.psac-avatar-sm { width:52px; height:52px; } .psac-avatar-sm .psac-avatar-emoji { font-size:30px; }
.psac-avatar-md { width:96px; height:96px; } .psac-avatar-md .psac-avatar-emoji { font-size:56px; }
.psac-avatar-lg { width:128px; height:128px; } .psac-avatar-lg .psac-avatar-emoji { font-size:78px; }
.psac-avatar-emoji { line-height:1; }
/* Real mascot art: no round badge, the picture keeps its own shape. */
.psac-avatar.has-image { background:none; border:0; border-radius:0; box-shadow:none; overflow:visible; }
.psac-avatar.has-image img { object-fit:contain; }
.psac-teacher .psac-avatar-lg.has-image { width:170px; height:170px; }
.psac-character .psac-avatar-lg.has-image { width:150px; height:150px; }

/* Choose your teacher */
.psac-characters { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:18px; }
.psac-character-form { margin:0; }
.psac-character { width:100%; min-height:220px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; border-radius:28px;
  border:4px solid var(--teacher); background:#fff; font:600 21px "Fredoka", sans-serif; color:var(--ink); box-shadow:0 8px 0 var(--teacher); }
.psac-character.chosen { background:color-mix(in srgb, var(--teacher) 25%, #fff); }

/* Home: today's loop and units */
.psac-today h1 { margin:0 0 16px; }
.psac-loop { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.psac-step { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:170px; padding:16px; border-radius:26px; text-align:center;
  color:#fff; font-size:24px; font-weight:700; }
.psac-step b { display:inline-grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#ffffff40; margin-right:4px; }
.psac-step small { font-size:17px; font-weight:500; opacity:.95; }
.psac-step-emoji { font-size:46px; line-height:1; }
.psac-step.play { background:var(--coral); box-shadow:0 8px 0 #e04f4f; }
.psac-step.read { background:var(--sky); box-shadow:0 8px 0 #1b98c4; }
.psac-step.choose { background:var(--grape); box-shadow:0 8px 0 #7b3fc4; }
.psac-step.off { opacity:.5; }
.psac-section-title { margin:12px 0 0; }
.psac-units { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.psac-unit { display:flex; flex-direction:column; gap:6px; min-height:140px; padding:18px; border-radius:24px; background:#fff; border:3px solid var(--line); box-shadow:var(--shadow); }
.psac-unit.current { border-color:var(--coral); background:#fff5f5; }
.psac-unit strong { font-size:21px; }
.psac-unit-label { font-size:15px; font-weight:700; color:var(--muted); letter-spacing:.06em; }
.psac-stars { color:#f4a100; font-size:26px; letter-spacing:2px; white-space:nowrap; }

/* Unit page */
.psac-lesson { border-color:var(--sky); }
.psac-lesson-text { font-size:clamp(22px, 2.6vw, 28px); line-height:1.5; }
.psac-next { border-color:var(--grape); }
.psac-options { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:16px; }
.psac-option-form { margin:0; display:contents; }
.psac-option { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; width:100%; min-height:140px; padding:16px; border-radius:24px; border:0;
  background:#f6f0ff; color:var(--ink); font:600 21px "Fredoka", sans-serif; text-align:center; box-shadow:0 6px 0 #d9c8f7; }
.psac-notes { font-size:20px; } .psac-notes h2 { color:var(--grape); }
.psac-notes blockquote, .psac-notes .note-tip { background:#fff8db; border-radius:16px; padding:12px 16px; border-left:6px solid var(--sun); }
.psac-words ul { list-style:none; margin:0; padding:0; display:grid; gap:12px; }
.psac-words li { display:flex; flex-wrap:wrap; align-items:center; gap:12px; font-size:20px; }
.psac-word { min-height:52px; padding:0 18px; border-radius:16px; border:3px solid var(--sky); background:#e8f7fd; font:600 20px "Fredoka", sans-serif; color:var(--ink); }
.psac-activities { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:16px; }
.psac-activity { width:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:150px; padding:16px; border-radius:24px; border:0;
  font:600 20px "Fredoka", sans-serif; color:var(--ink); text-align:center; }
.psac-activity.game { background:#ffe5e5; box-shadow:0 6px 0 #ffb3b3; }
.psac-activity.cards { background:#e2f7ff; box-shadow:0 6px 0 #a8e3f7; }
.psac-activity.quiz { background:#ddfbef; box-shadow:0 6px 0 #9ee9c9; }
.psac-pager { display:flex; justify-content:space-between; gap:12px; }

/* Games in the PSAC layout: bigger cards and buttons */
.psac-game-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.psac-game-head h1 { margin:0; }
.psac-game .game { border:3px solid var(--line); border-radius:28px; }
.psac-game .game-stage button, .psac-game .game-stage [role="button"] { min-height:56px; font-size:20px; }
.psac-game .game-overlay-card { font-size:20px; }
.psac-game .game-overlay-card .button { min-height:60px; font-size:21px; border-radius:20px; }
.psac-game .game-feedback { font-size:20px; }

/* Flashcards and quizzes in the PSAC layout */
.psac-flashcard .flashcard-text { font-size:clamp(24px, 3vw, 32px); }
.psac .test-choice, .psac .test-match-row select, .psac .test-blank input { min-height:52px; font-size:19px; }
.psac .test-choice { border-radius:16px; }
.psac .button { min-height:52px; border-radius:16px; font-size:18px; }
.psac .inline-form { display:inline; }

/* Sign-in */
.psac-signin { max-width:520px; margin:24px auto; text-align:center; }
.psac-signin .psac-card { display:flex; flex-direction:column; gap:10px; text-align:left; }
.psac-signin label { font-weight:600; font-size:20px; }
.psac-signin input[type=text], .psac-signin input[type=password] { min-height:60px; padding:0 16px; border-radius:16px; border:3px solid var(--line); font:500 22px "Fredoka", sans-serif; background:#fffdf7; color:var(--ink); }
.psac-signin input[type=submit] { margin-top:12px; width:100%; }

@keyframes psac-pop { 0% { transform:scale(1); } 40% { transform:scale(1.06); } 100% { transform:scale(1); } }
@keyframes psac-idle { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@keyframes psac-wave { 0%,100% { transform:rotate(0); } 20% { transform:rotate(-12deg); } 40% { transform:rotate(10deg); } 60% { transform:rotate(-8deg); } 80% { transform:rotate(6deg); } }
@keyframes psac-hop { 0%,100% { transform:translateY(0) scale(1); } 40% { transform:translateY(-22px) scale(1.05); } }
@keyframes psac-think { 0%,100% { transform:rotate(0); } 30%,70% { transform:rotate(-10deg) translateX(-4px); } }
@keyframes psac-cheer { 0% { transform:translateY(0) rotate(0); } 40% { transform:translateY(-34px) rotate(-12deg) scale(1.12); } 70% { transform:translateY(-10px) rotate(10deg); } 100% { transform:translateY(0) rotate(0); } }
@keyframes psac-bounce { 0%,100% { transform:translateY(0); } 30% { transform:translateY(-18px) rotate(-4deg); } 60% { transform:translateY(0) rotate(3deg); } }

@media (max-width: 700px) {
  .psac-loop { grid-template-columns:1fr; }
  .psac-step { min-height:110px; flex-direction:row; }
  .psac-avatar-lg { width:88px; height:88px; } .psac-avatar-lg .psac-avatar-emoji { font-size:54px; }
  .psac-brand { font-size:21px; }
}
@media (prefers-reduced-motion: reduce) { .psac-teacher-figure, .psac-bubble.pop, .psac-tokens.pop { animation:none !important; } }

/* Optional background picture (public/psac/background.*), behind a soft wash so text stays readable. */
html.psac body.psac-body.has-bg { background:var(--bg); }
/* iPad Safari ignores fixed backgrounds; a fixed layer behind the page keeps the scenery still. */
html.psac body.psac-body.has-bg::before { content:""; position:fixed; inset:0; z-index:-1; background:var(--psac-bg) center / cover no-repeat; }
.psac-section-title { display:inline-block; align-self:flex-start; background:#ffffffe6; border-radius:16px; padding:4px 16px; }
.psac-back, .psac-lead.psac-center { background:#ffffffe6; }
.psac-lead.psac-center { border-radius:16px; padding:6px 14px; align-self:center; }
.psac-tokens img { width:30px; height:30px; }
.psac-settings-link { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; min-height:48px; padding:0 14px; border-radius:16px; border:3px solid #e9e9f2; background:#fff; font:600 18px "Fredoka", sans-serif; color:var(--ink); }
@media (max-width: 700px) { .psac-settings-label { display:none; } }

/* Settings: choose mascot and scenery */
.psac-sceneries { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.psac-scenery { width:100%; padding:0; border:4px solid #fff; border-radius:24px; overflow:hidden; background:#fff; box-shadow:var(--shadow); font:600 20px "Fredoka", sans-serif; color:var(--ink); }
.psac-scenery img { display:block; width:100%; aspect-ratio:3 / 2; object-fit:cover; }
.psac-scenery span { display:block; padding:10px; }
.psac-scenery.chosen { border-color:var(--leaf); box-shadow:0 0 0 4px var(--leaf); }

.psac-scenery-auto { display:grid !important; place-items:center; aspect-ratio:3 / 2; font-size:64px; background:linear-gradient(135deg, #ffe5ec, #d0f4de, #cde7ff); padding:0 !important; }

/* ---- Visual lessons (picture cards) ---- */
.pl-title { margin:0; background:#ffffffeb; border-radius:22px; padding:12px 20px; align-self:flex-start; }
.pl-title span { display:block; font-size:16px; color:var(--coral); letter-spacing:.08em; text-transform:uppercase; }
.pl-toc { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; padding:14px; }
.pl-toc .psac-option { min-height:90px; }
.pl-cards { display:flex; flex-direction:column; gap:20px; }
.pl-card h2 { margin:0 0 12px; }
.pl-card.pl-extra { border-color:var(--grape); background:#fbf7ff; }
.pl-body { display:grid; grid-template-columns:minmax(0, 1.1fr) minmax(0, 1fr); gap:20px; align-items:start; }
.pl-body:not(:has(.pl-figure)) { grid-template-columns:1fr; }
.pl-figure { margin:0; }
.pl-pic-wrap { position:relative; border-radius:20px; border:3px solid var(--line); background:#fff; }
.pl-pic-wrap img { display:block; width:100%; height:auto; border-radius:17px; }
.pl-label { position:absolute; transform:translate(-50%, -50%); background:#fff; border:3px solid var(--grape); color:var(--ink); border-radius:12px; padding:2px 10px; font-size:16px; line-height:1.15; font-weight:600; max-width:46%; text-align:center; overflow-wrap:anywhere; box-shadow:0 3px 0 #0000001a; }
.pl-pic-missing { display:grid; place-items:center; gap:4px; aspect-ratio:3 / 2; border-radius:20px; border:3px dashed var(--line); background:#fffdf5; color:var(--muted); }
.pl-pic-missing span { font-size:56px; }
.pl-legend { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.pl-legend span { background:#f1e8ff; color:var(--grape); border-radius:10px; padding:2px 10px; font-weight:600; font-size:16px; }
.pl-text { font-size:clamp(19px, 2vw, 22px); line-height:1.55; }
.pl-text p { margin:0 0 10px; }
.pl-text strong { color:var(--coral); }
.pl-words { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:12px; margin-top:16px; }
.pl-word { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px; border-radius:18px; background:#f2fbff; border:3px solid #cdeefc; text-align:center; }
.pl-word img { width:100%; max-width:120px; aspect-ratio:1; object-fit:contain; border-radius:12px; background:#fff; }
.pl-word strong { font-size:20px; } .pl-word span { font-size:16px; color:var(--muted); }
.pl-table { border-collapse:collapse; margin:10px 0 4px; font-size:clamp(16px, 1.7vw, 19px); }
.pl-table td { border:2px solid #e6e0f5; padding:6px 12px; background:#fff; }
.pl-table tr:first-child td { background:#f3efff; font-weight:700; }
.pl-dyk { margin:16px 0 0; padding:12px 16px; border-radius:16px; background:#fff8db; border-left:6px solid var(--sun); font-size:18px; }
.pl-check { margin-top:18px; padding:16px; border-radius:20px; background:#f6fff9; border:3px dashed var(--leaf); }
.pl-episodes ol { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px; }
.pl-episode { display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:14px; padding:12px 16px; border-radius:20px; background:#f6f0ff; }
.pl-episode.expert { background:#fff3d6; }
.pl-episode-num { display:grid; place-items:center; width:46px; height:46px; border-radius:50%; background:var(--grape); color:#fff; font-size:22px; font-weight:700; }
.pl-episode.expert .pl-episode-num { background:#f4a100; }
.pl-episode-title strong { display:block; font-size:21px; } .pl-episode-title small { color:var(--muted); font-size:16px; }
.pl-episode-stars img { width:30px; height:30px; } .pl-episode-stars img.lost { filter:grayscale(1); opacity:.35; }
.pl-soon { color:var(--muted); font-size:16px; }
@media (max-width: 900px) { .pl-body { grid-template-columns:1fr; } .pl-episode { grid-template-columns:auto 1fr; } }

/* ---- Questions (episodes and mini-challenges) ---- */
.pq-card { border-color:var(--grape); }
.pq-head { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.pq-count { font-weight:700; color:var(--grape); }
.pq-progress { height:12px; border-radius:99px; background:#eee6ff; overflow:hidden; margin:8px 0 18px; }
.pq-progress span { display:block; height:100%; width:0; background:linear-gradient(90deg, var(--grape), var(--sky)); transition:width .4s; }
.pq-prompt { font-size:clamp(22px, 2.6vw, 30px); margin:0 0 12px; color:var(--grape); overflow-wrap:anywhere; }
.pq { min-width:0; }
.pq-hint { color:var(--muted); font-size:17px; margin:0 0 10px; }
.pq-statement { font-size:24px; font-weight:600; margin:6px 0 14px; }
.pq-hero { text-align:center; margin:0 0 14px; } .pq-hero img { max-width:min(100%, 520px); border-radius:18px; border:3px solid var(--line); }
.pq-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.pq-tap { min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; min-height:64px; padding:10px 14px; border-radius:18px; border:3px solid #ddd3f5; background:#fff; font:600 20px "Fredoka", sans-serif; color:var(--ink); box-shadow:0 5px 0 #e6def8; text-align:center; transition:transform .08s; }
.pq-tap:active { transform:translateY(3px); box-shadow:none; }
.pq-tap.active { border-color:var(--grape); background:#f1e8ff; }
.pq-tap.right { border-color:var(--leaf); background:#ddfbef; }
.pq-tap.wrong { border-color:var(--coral); background:#ffe5e5; }
.pq-pics .pq-tap { padding:8px; } .pq-pics img { width:100%; aspect-ratio:1; object-fit:contain; }
.pq-tf .tf-true { color:#05a77d; } .pq-tf .tf-false { color:#e04f4f; }
.pq-item-face { display:flex; flex-direction:column; align-items:center; gap:4px; }
.pq-item-face img { width:92px; height:92px; object-fit:contain; }
.pq-match { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:16px; }
.pq-col { display:flex; flex-direction:column; gap:10px; min-width:0; }
.pq-tap.paired.c1 { border-color:#4cc9f0; background:#e4f7fd; } .pq-tap.paired.c2 { border-color:#f4a100; background:#fff4d6; }
.pq-tap.paired.c3 { border-color:#06d6a0; background:#dcfbf1; } .pq-tap.paired.c4 { border-color:#ff6b6b; background:#ffe5e5; }
.pq-tap.paired.c5 { border-color:#9b5de5; background:#f1e8ff; } .pq-tap.paired.c6 { border-color:#8d6e63; background:#f3ebe7; }
.pq-tray { display:flex; flex-wrap:wrap; gap:10px; margin:10px 0; min-height:70px; padding:10px; border-radius:18px; background:#faf8ff; }
.pq-chip { min-height:56px; }
.pq-chip.used { opacity:.35; }
.pq-buckets { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:12px; }
.pq-bucket { min-width:0; cursor:pointer; min-height:140px; border-radius:20px; border:3px dashed var(--grape); background:#fff; padding:10px; font:600 20px "Fredoka", sans-serif; color:var(--grape); display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.pq-bucket-list { display:flex; flex-wrap:wrap; gap:6px; } .pq-bucket-list .pq-tap { font-size:16px; min-height:44px; }
.pq-order-line { list-style:none; margin:0; padding:10px; min-height:80px; display:flex; flex-wrap:wrap; gap:10px; align-items:center; border-radius:18px; background:#f1fff8; counter-reset:step; }
.pq-order-line li { display:flex; align-items:center; gap:6px; counter-increment:step; }
.pq-order-line li::before { content:counter(step); display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:var(--leaf); color:#fff; font-weight:700; }
.pq-order-line.cycle::after { content:"↻"; font-size:32px; color:var(--leaf); }
.pq-label-stage { position:relative; max-width:640px; margin:0 auto 10px; border-radius:18px; border:3px solid var(--line); background:#fff; }
.pq-label-stage .pq-pic { display:block; width:100%; border-radius:15px; }
.pq-spot { position:absolute; transform:translate(-50%, -50%); min-width:44px; min-height:44px; max-width:46%; border-radius:22px; border:3px solid var(--grape); background:#fff; font:700 17px/1.15 "Fredoka", sans-serif; color:var(--grape); padding:4px 10px; overflow-wrap:anywhere; }
/* A label near the left or right edge grows inwards, so its words never leave the picture. */
.pq-spot.edge-l, .pl-label.edge-l { transform:translate(-14%, -50%); }
.pq-spot.edge-r, .pl-label.edge-r { transform:translate(-86%, -50%); }
.pq-spot.filled { background:#f1e8ff; }
.pq-gap-text { font-size:24px; line-height:2.2; overflow-wrap:anywhere; }
.pq-gap { min-width:90px; min-height:48px; margin:0 4px; border:0; border-bottom:4px solid var(--grape); background:#f6f0ff; border-radius:10px; font:600 22px "Fredoka", sans-serif; color:var(--grape); }
/* The "spot the mistake" question box shares the class name of the label spots above: undo their styles. */
.pq.pq-spot { position:static; transform:none; min-width:0; min-height:0; max-width:none; border:0; border-radius:0; background:none; padding:0; font:inherit; color:inherit; }
.pq-spot-text { display:flex; flex-wrap:wrap; gap:8px; } .pq-word { min-height:56px; font-size:22px; }
.pq-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:12px; margin-top:16px; }
.pq-feedback { margin-top:12px; font-size:19px; } .pq-feedback:empty { display:none; }
.pq-right .pq-feedback { padding:12px 16px; border-radius:16px; background:#ddfbef; }
.pq-wrong .pq-feedback { padding:12px 16px; border-radius:16px; background:#fff1e6; }
.pq-explain { color:var(--ink); margin:6px 0 0; }
.pq-complete { text-align:center; padding:10px 0; }
.pq-stars { display:flex; justify-content:center; gap:12px; margin-bottom:8px; }
.pq-stars img { width:90px; height:90px; animation:psac-starpop .6s ease both; } .pq-stars img.lost { filter:grayscale(1); opacity:.3; }
@keyframes psac-starpop { 0% { transform:scale(0) rotate(-30deg); } 70% { transform:scale(1.2) rotate(8deg); } 100% { transform:scale(1) rotate(0); } }
.pq-score-row { display:flex; justify-content:center; gap:14px; margin:12px 0; flex-wrap:wrap; }
.pq-score { min-width:160px; padding:12px 18px; border-radius:18px; background:#f1e8ff; } .pq-score.gold { background:#fff3d6; }
.pq-score strong { display:block; font-size:34px; } .pq-score span { color:var(--muted); }

/* ---- Levels: 4 levels × 3 quizzes ---- */
.pl-levels { display:flex; flex-direction:column; gap:14px; }
.pl-level { padding:14px 16px; border-radius:22px; background:#f2fbf6; border:3px solid #c9f0dc; }
.pl-level.medium { background:#eef7ff; border-color:#cde7ff; }
.pl-level.hard { background:#f6f0ff; border-color:#e0d1fb; }
.pl-level.champion { background:#fff6dc; border-color:#ffe08a; }
.pl-level.locked { filter:grayscale(.7); opacity:.75; }
.pl-level-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.pl-level-head strong { font-size:24px; } .pl-level-head small { color:var(--muted); font-size:16px; }
.pl-level-icon { font-size:32px; }
.pl-quizzes { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
.pl-quiz { display:flex; flex-direction:column; align-items:center; gap:6px; min-height:96px; justify-content:center; border-radius:18px; background:#fff; border:3px solid #fff; box-shadow:0 6px 0 #0000000f; font:600 20px "Fredoka", sans-serif; color:var(--ink); }
.pl-quiz:not(.locked):active { transform:translateY(3px); box-shadow:none; }
.pl-quiz.locked { cursor:pointer; }
.pq-unlocked { font-size:22px; font-weight:700; color:#05a77d; }
.pl-episode-stars { display:inline-flex; gap:4px; }
.pl-episode-stars img { display:block; }

/* Typed number answers (maths) */
.pq-number-row { display:flex; align-items:center; gap:12px; margin:10px 0; }
.pq-number-input { width:min(260px, 70%); min-height:64px; padding:0 18px; border-radius:18px; border:3px solid var(--grape); font:700 30px "Fredoka", sans-serif; color:var(--ink); background:#fff; text-align:center; }
.pq-unit { font-size:24px; font-weight:600; color:var(--muted); }

/* Picture gallery on units without a picture lesson yet */
.pl-gallery-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:14px; }
.pl-gallery-grid figure { margin:0; border-radius:18px; overflow:hidden; border:3px solid var(--line); background:#fff; }
.pl-gallery-grid img { display:block; width:100%; aspect-ratio:3 / 2; object-fit:cover; }
.pl-gallery-grid figcaption { padding:8px 12px; font-weight:600; font-size:17px; }

.pl-check-wait { margin:0; padding:8px 4px; color:#4b5563; }

/* ---- Coins: gold, and the same coin in silver ---- */
.psac-coin { display:inline-block; vertical-align:middle; }
.psac-coin.silver { filter:grayscale(1) brightness(1.18) contrast(1.05); }
.psac-coins { display:inline-flex; gap:8px; color:var(--ink); }
.psac-tokens.silver { background:#f1f3f7; border-color:#c3c9d6; }
.psac-top-right { flex-wrap:nowrap; }
.psac-button.small { min-height:46px; font-size:17px; padding:0 16px; border-radius:16px; box-shadow:0 4px 0 #1b98c4; }
.psac-button.small.go { box-shadow:0 4px 0 #05a77d; }
.psac-button.notes { background:var(--sky); }
.psac-button small { font-size:.7em; font-weight:600; background:#ffffff40; border-radius:99px; padding:2px 10px; }
/* The Check button before the answer is complete: it looks asleep but still answers a tap. */
.psac-button.off { background:#cfd3dc; box-shadow:0 6px 0 #b4b9c6; }
.psac-button.busy { opacity:.6; }
.pq-sending .pq-tap.active { border-color:var(--grape); background:#f1e8ff; animation:psac-wait .7s ease-in-out infinite; }
@keyframes psac-wait { 50% { opacity:.55; } }
.pq-shake { animation:psac-shake .45s ease; }
@keyframes psac-shake { 20% { transform:translateX(-7px); } 40% { transform:translateX(7px); } 60% { transform:translateX(-5px); } 80% { transform:translateX(5px); } }
.pq-score.silver { background:#f1f3f7; }

/* ---- Progress bars ---- */
.ph-bar, .ps-bar { display:block; height:12px; border-radius:99px; background:#ece8f6; overflow:hidden; }
.ph-bar span, .ps-bar span { display:block; height:100%; min-width:0; border-radius:99px; background:linear-gradient(90deg, var(--leaf), var(--sky)); transition:width .5s; }
.ps-bar span { background:linear-gradient(90deg, var(--sun), var(--coral)); }
.ps-bar.big { height:18px; }

/* ---- Dashboard column (hub pages) ---- */
.psac-side { position:-webkit-sticky; position:sticky; top:86px; margin:20px 0 0 14px; display:flex; flex-direction:column; gap:12px; padding:16px 14px; border-radius:26px; background:#ffffffee; border:3px solid var(--line); box-shadow:var(--shadow); }
.ps-me { display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--ink); text-align:center; }
.ps-name strong { display:block; font-size:22px; line-height:1.1; } .ps-name small { font-size:16px; font-weight:700; color:var(--coral); }
.ps-level small { display:block; margin-top:4px; font-size:13px; line-height:1.25; color:var(--muted); text-align:center; }
.ps-stats { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.ps-stats li { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:14px; background:#fff8e7; font-size:16px; }
.ps-stats b { font-size:20px; } .ps-stats span { color:var(--muted); }
.ps-links { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.ps-links a { display:flex; align-items:center; gap:8px; min-height:50px; padding:0 14px; border-radius:16px; background:#f6f0ff; color:var(--ink); font-weight:600; font-size:18px; box-shadow:0 4px 0 #d9c8f7; }
.ps-links a.here { background:var(--grape); color:#fff; box-shadow:0 4px 0 #7b3fc4; }
@media (max-width: 980px) {
  .psac-shell.with-side { display:block; }
  .psac-side { position:static; margin:12px 20px 0; flex-direction:row; flex-wrap:wrap; align-items:center; padding:10px 14px; gap:10px 16px; }
  .ps-me { flex-direction:row; text-align:left; } .ps-level, .ps-stats { display:none; }
  .ps-links { display:flex; flex:1; justify-content:flex-end; flex-wrap:wrap; } .ps-links a { min-height:46px; }
  .psac-side .psac-hero-md { width:56px; height:56px; } .psac-side .psac-hero-md .psac-hero-emoji { font-size:32px; }
}

/* ---- The pupil's hero ---- */
.psac-hero { display:inline-grid; place-items:center; border-radius:50%; background:radial-gradient(circle at 35% 30%, #fff 0, var(--hero) 75%); border:4px solid #fff; box-shadow:0 5px 0 #0000001a; overflow:hidden; flex:0 0 auto; }
.psac-hero img { width:100%; height:100%; object-fit:cover; }
.psac-hero-emoji { line-height:1; }
.psac-hero-sm { width:48px; height:48px; } .psac-hero-sm .psac-hero-emoji { font-size:28px; }
.psac-hero-md { width:92px; height:92px; } .psac-hero-md .psac-hero-emoji { font-size:52px; }
.psac-hero-lg { width:128px; height:128px; } .psac-hero-lg .psac-hero-emoji { font-size:74px; }
.psac-characters.heroes { grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); }
.psac-character small { font-size:15px; color:var(--muted); }
.psac-character.locked, .psac-scenery.locked { filter:grayscale(.85); opacity:.72; }
.psac-character.locked { box-shadow:0 8px 0 #cfd3dc; }

/* ---- Home: subjects at the top, carry on, chapters ---- */
.ph-subjects[hidden] { display:none; }
.ph-subjects { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:14px; }
.ph-subject { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:4px 10px; padding:14px 16px; border-radius:24px; background:#ffffffe6; border:4px solid #fff; box-shadow:var(--shadow); color:var(--ink); }
.ph-subject strong { font-size:24px; } .ph-subject small { font-weight:700; color:var(--muted); }
.ph-subject .ph-bar { grid-column:1 / -1; }
.ph-subject-emoji { font-size:38px; line-height:1; }
.ph-subject.chosen { border-color:var(--coral); background:#fff; transform:translateY(-3px); box-shadow:0 10px 0 #ff6b6b40; }
.ph-subject:active { transform:translateY(3px); }
.ph-continue { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; border-color:var(--coral); }
.ph-continue h1 { margin:0; font-size:clamp(26px, 3.2vw, 38px); }
.ph-continue-actions { display:flex; flex-wrap:wrap; gap:14px; }
.psac-unit .ph-bar { margin-top:auto; }
.psac-unit.complete { border-color:var(--leaf); background:#f2fff9; }
.ph-unit-stats { display:flex; justify-content:space-between; font-size:15px; font-weight:600; color:var(--muted); }

/* ---- Chapter: the two doors ---- */
.pu-doors { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:18px; }
.pu-door { display:flex; flex-direction:column; align-items:center; gap:8px; padding:24px 20px; border-radius:30px; color:#fff; text-align:center; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.pu-door.notes { background:var(--sky); box-shadow:0 10px 0 #1b98c4; } .pu-door.quizzes { background:var(--grape); box-shadow:0 10px 0 #7b3fc4; }
.pu-door:active { transform:translateY(6px); box-shadow:none; }
.pu-door-emoji { font-size:72px; line-height:1; }
.pu-door strong { font-size:36px; line-height:1; }
.pu-door-text { font-size:18px; line-height:1.35; max-width:30ch; }
.pu-door .ph-bar { width:100%; background:#ffffff55; } .pu-door .ph-bar span { background:#fff; }
.pu-door-count { display:inline-flex; align-items:center; gap:8px; font-size:22px; font-weight:700; background:#ffffff30; border-radius:99px; padding:4px 16px; }
@media (max-width: 640px) { .pu-doors { grid-template-columns:1fr; } }

/* ---- Notes as swipe cards ---- */
.pd { display:flex; flex-direction:column; gap:12px; scroll-margin-top:84px; }
.pq-card { scroll-margin-top:84px; }
.pd-bar { position:-webkit-sticky; position:sticky; top:74px; z-index:20; display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:22px; background:#fffffff2; border:3px solid var(--line); box-shadow:0 6px 16px #0000001a; }
.pd-close, .pd-arrow { flex:0 0 auto; display:grid; place-items:center; width:54px; height:54px; border-radius:18px; border:0; font:700 32px/1 "Fredoka", sans-serif; color:#fff; background:var(--sky); box-shadow:0 5px 0 #1b98c4; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.pd-close { background:#fff; color:var(--muted); border:3px solid var(--line); box-shadow:none; font-size:24px; }
.pd-arrow.next { background:var(--leaf); box-shadow:0 5px 0 #05a77d; }
.pd-arrow:active { transform:translateY(4px); box-shadow:none; }
.pd-arrow.off { visibility:hidden; }
.pd-arrow.locked { background:#cfd3dc; box-shadow:0 5px 0 #b4b9c6; }
.pd-arrow.pulse { animation:psac-pulse 1s ease-in-out infinite; }
@keyframes psac-pulse { 50% { transform:scale(1.14); box-shadow:0 5px 0 #05a77d, 0 0 0 8px #06d6a040; } }
.pd-dots { flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px; }
.pd-dot { width:18px; height:18px; padding:0; border-radius:50%; border:3px solid #d9d3ea; background:#fff; font-size:0; }
.pd-dot.done { background:var(--leaf); border-color:#05a77d; }
.pd-dot.extra { border-style:dashed; }
.pd-dot.here { transform:scale(1.35); border-color:var(--coral); box-shadow:0 0 0 3px #ff6b6b33; }
.pd-dot.end { width:auto; height:auto; border:0; background:none; font-size:18px; }
.pd-count { flex:0 0 auto; font-weight:700; color:var(--grape); font-size:18px; min-width:3.4em; text-align:center; }
.pd-stage { touch-action:pan-y; }
.pd-slide[hidden] { display:none; }
.pd-slide.from-right { animation:pd-right .28s ease-out; } .pd-slide.from-left { animation:pd-left .28s ease-out; }
@keyframes pd-right { from { transform:translateX(60px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes pd-left { from { transform:translateX(-60px); opacity:0; } to { transform:none; opacity:1; } }
.pd-slide.pl-card { padding:18px 20px; }
.pd-slide .pl-body { grid-template-columns:minmax(0, 1fr) minmax(0, 1.1fr); gap:16px; }
.pd-slide .pl-body.no-pic { grid-template-columns:1fr; }
.pd-slide .pl-figure img { max-height:46vh; object-fit:contain; }
.pd-slide .pl-dyk { margin-top:8px; }
.pd-slide .pl-check { margin-top:12px; padding:12px 14px; }
.pd-slide .pl-check .pq-prompt { font-size:clamp(20px, 2.2vw, 25px); }
.pd-slide .pl-words { margin-top:10px; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); }
.pd-slide .pl-word img { max-width:84px; }
.pd-finish { text-align:center; } .pd-finish-emoji { font-size:90px; margin:0; line-height:1.1; }
.pd-swipe-hint { margin:0; text-align:center; font-size:16px; font-weight:600; color:var(--muted); background:#ffffffd9; border-radius:99px; padding:4px 14px; align-self:center; }
@media (max-width: 900px) { .pd-slide .pl-body { grid-template-columns:1fr; } .pd-dot { width:13px; height:13px; border-width:2px; } }

/* ---- My journey (dashboard) ---- */
.pm-head { display:flex; flex-wrap:wrap; align-items:center; gap:14px 22px; margin-bottom:14px; }
.pm-head h1 { margin:0; } .pm-next { flex:1; min-width:200px; } .pm-next small { color:var(--muted); font-size:16px; }
.pj-map { position:relative; aspect-ratio:16 / 9; border-radius:24px; overflow:hidden; border:3px solid var(--line);
  background:linear-gradient(var(--sky) 0, var(--sky) 30%, var(--ground) 100%) center / cover no-repeat; }
.pj-map svg { position:absolute; inset:0; width:100%; height:100%; }
.pj-path { fill:none; stroke:#ffffffd9; stroke-width:7; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:2 14; vector-effect:non-scaling-stroke; }
.pj-path.walked { stroke:var(--coral); stroke-dasharray:none; stroke-width:6; }
.pj-stop { position:absolute; transform:translate(-50%, -50%); display:grid; place-items:center; width:46px; height:46px; border-radius:50%; border:4px solid #fff; background:#b9bfcc; color:#fff; font-weight:700; font-size:18px; box-shadow:0 4px 0 #00000026; }
.pj-stop.done { background:var(--leaf); } .pj-stop.here { background:var(--coral); }
.pj-stop.ahead { filter:grayscale(1); opacity:.85; }
.pj-flag { position:absolute; top:-30px; font-size:28px; }
.pj-hero { position:absolute; transform:translate(-50%, -118%); z-index:2; }
.pj-hero-bob { display:block; animation:psac-idle 2.6s ease-in-out infinite; }
.pj-deco { position:absolute; transform:translate(-50%, -50%); font-size:clamp(26px, 4.4vw, 46px); line-height:1; opacity:.9; }
.pj-hero .psac-hero { width:70px; height:70px; } .pj-hero .psac-hero-emoji { font-size:40px; }
.pj-title { position:absolute; left:12px; top:12px; padding:4px 14px; border-radius:99px; background:#ffffffe6; font-weight:700; }
.pm-stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:12px; }
.pm-stat { display:flex; flex-direction:column; align-items:center; gap:2px; padding:14px 10px; border-radius:22px; background:#ffffffee; border:3px solid var(--line); text-align:center; box-shadow:var(--shadow); }
.pm-stat strong { font-size:32px; line-height:1.1; } .pm-stat span { color:var(--muted); font-size:15px; line-height:1.2; }
.pm-stat.gold { background:#fff6d6; border-color:var(--sun); } .pm-stat.silver { background:#f1f3f7; border-color:#c3c9d6; }
.pm-emoji { font-size:38px !important; line-height:1.15 !important; color:inherit !important; }
.pm-subjects { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.pm-subject { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:4px 10px; padding:12px 14px; border-radius:20px; background:#f8f5ff; color:var(--ink); }
.pm-subject .ph-bar { grid-column:1 / -1; } .pm-subject strong { font-size:21px; }
.pm-badges { display:grid; grid-template-columns:repeat(auto-fill, minmax(118px, 1fr)); gap:10px; }
.pm-badge { display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px 6px; border-radius:20px; border:3px dashed #d5d9e2; background:#f6f7fa; color:var(--muted); font:inherit; text-align:center; }
.pm-badge span { font-size:40px; line-height:1.1; } .pm-badge small { font-size:14px; line-height:1.2; font-weight:600; }
.pm-badge.earned { border:3px solid var(--sun); background:#fff6d6; color:var(--ink); }
.pm-unlocks { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:12px; }
.pm-unlock { display:flex; flex-direction:column; align-items:center; gap:2px; padding:12px 8px; border-radius:20px; border:3px solid #e3e6ee; background:#f6f7fa; font:inherit; color:var(--ink); text-align:center; }
.pm-unlock-emoji { font-size:44px; line-height:1.1; filter:grayscale(1); opacity:.7; } .pm-unlock strong { font-size:16px; line-height:1.2; } .pm-unlock small { color:var(--muted); font-weight:700; }

/* ---- Parent pages ---- */
.pp-children { display:grid; gap:14px; }
.pp-child { display:flex; flex-wrap:wrap; align-items:center; gap:14px 18px; color:var(--ink); }
.pp-child-name { flex:1; min-width:150px; } .pp-child-name strong { display:block; font-size:24px; } .pp-child-name small { color:var(--muted); }
.pp-child-stats { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px 16px; font-size:17px; }
.pp-head { display:flex; align-items:center; gap:18px; } .pp-head h1 { margin:0; }
.pp-percent { font-size:17px; color:var(--muted); font-weight:500; margin-left:8px; }
.pp-unit { border:3px solid var(--line); border-radius:18px; padding:10px 14px; margin-top:10px; background:#fffdf7; }
.pp-unit summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; cursor:pointer; min-height:48px; }
.pp-unit-title small { display:block; color:var(--muted); font-weight:700; font-size:14px; letter-spacing:.05em; } .pp-unit-title strong { font-size:20px; }
.pp-unit-numbers { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; font-size:16px; font-weight:600; } .pp-unit-numbers .ph-bar { width:120px; }
.pp-unit h3 { margin:14px 0 6px; font-size:18px; color:var(--grape); }
.pp-table { width:100%; border-collapse:collapse; font-size:16px; } .pp-table th, .pp-table td { text-align:left; padding:6px 8px; border-bottom:2px solid #f0e9d8; }
.pp-table th { color:var(--muted); font-size:14px; } .pp-table .psac-stars { font-size:18px; }
.pp-wrong { margin:0; padding:0; list-style:none; display:grid; gap:8px; font-size:16px; }
.pp-wrong li { padding:8px 12px; border-radius:14px; background:#fff1e6; } .pp-wrong small { color:var(--muted); }
.pp-tag { display:inline-block; padding:0 8px; border-radius:8px; background:#ffd9b8; font-size:13px; font-weight:700; }
.pp-none { color:var(--muted); font-size:16px; margin:6px 0 0; }
.pp-recent { list-style:none; margin:0; padding:0; display:grid; gap:6px; font-size:16px; }
.pp-recent li { display:flex; align-items:center; gap:8px; } .pp-recent span { flex:1; } .pp-recent small { color:var(--muted); }

/* ---- Grades 5 and 6: everything about 13% smaller, so more fits on the page ---- */
html.psac-older .psac-shell { zoom:.87; }
html.psac-older .psac-bubble { font-size:16px; }
html.psac-older .psac-top { padding-top:calc(6px + env(safe-area-inset-top)); padding-bottom:6px; }
html.psac-older .psac-brand { font-size:22px; } html.psac-older .psac-brand-mark { width:38px; height:38px; font-size:24px; }
html.psac-older .psac-tokens { font-size:19px; padding:4px 12px; } html.psac-older .psac-settings-link, html.psac-older .psac-bye { min-height:42px; font-size:16px; }
.psac-bye { white-space:nowrap; }
@media (max-width: 980px) { .psac-settings-label { display:none; } }
@media (max-width: 760px) { .psac-top { padding-left:12px; padding-right:12px; gap:8px; } .psac-top-right { gap:6px; } .psac-brand span:last-child { display:none; } }
@media (prefers-reduced-motion: reduce) { .pd-slide, .pd-arrow.pulse, .pj-hero-bob, .pq-shake { animation:none !important; } }
/* Journey by syllabus: start spot, and what is still needed for the next stop */
.pj-start { position:absolute; transform:translate(-50%, -50%); padding:2px 10px; border-radius:99px; background:#ffffffe6; border:3px solid var(--coral); font-weight:700; font-size:14px; }
.pm-need { margin:14px 0 0; padding:12px 16px; border-radius:20px; background:#fff6d6; border:3px solid var(--sun); }
.pm-need p { margin:0 0 8px; font-weight:700; font-size:18px; }
.pm-need ul { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.pm-need a { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; border-radius:99px; background:#fff; border:2px solid var(--line); color:var(--ink); font-weight:600; text-decoration:none; }
.pm-subject small b { color:var(--ink); }
.pu-journey { margin:12px 0 0; padding:10px 16px; border-radius:18px; background:#f8f5ff; font-weight:600; text-align:center; }
.pu-journey.done { background:#e5f7ea; }
/* Staff pages (teacher, director) */
.pst-nav, .pst-grades, .pst-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.pst-nav a, .pst-grades a { padding:6px 16px; border-radius:99px; background:#f6f7fa; border:2px solid var(--line); color:var(--ink); font-weight:600; text-decoration:none; }
.pst-nav a.here, .pst-grades a.here { background:var(--grape); border-color:var(--grape); color:#fff; }
.pst-grades { margin:0 0 12px; }
.pst-table-wrap { overflow-x:auto; }
.pst-table td { vertical-align:top; } .pst-table small { color:var(--muted); }
.pst-subjects { display:block; white-space:nowrap; }
.pst-row-actions { white-space:nowrap; } .pst-row-actions form { display:inline-block; } .pst-row-actions .psac-button { margin:2px; }
.pst-danger { background:#e5484d !important; color:#fff !important; }
.pst-form { display:grid; gap:14px; max-width:520px; margin-top:12px; }
.pst-form label { display:grid; gap:4px; font-weight:600; }
.pst-form input, .pst-form select { font:inherit; padding:8px 12px; border-radius:14px; border:2px solid var(--line); background:#fff; }
.pst-form fieldset { display:grid; gap:14px; border:0; padding:0; margin:0; }
.pst-form fieldset[hidden] { display:none; }
.pst-form legend { font-weight:700; color:var(--grape); margin-bottom:4px; }
.pst-waiting { border-color:var(--sun); background:#fffaf0; }
.pst-devices { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.pst-devices li { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:8px 12px; border-radius:14px; background:#fff; } .pst-devices li span { flex:1; min-width:220px; }
.pst-devices form { display:inline-block; }

/* ---- Sound on/off button (header) and celebration confetti (psac/fx.js) ---- */
.psac-mute { min-height:48px; min-width:48px; padding:0 10px; border-radius:16px; border:3px solid #e9e9f2; background:#fff; font-size:22px; line-height:1; cursor:pointer; }
.psac-mute .sound-off, .psac-mute.muted .sound-on { display:none; }
.psac-mute.muted .sound-off { display:inline; }
.psac-mute.muted { background:#f3f3f8; }
html.psac-older .psac-mute { min-height:42px; min-width:42px; font-size:19px; }
.psac-confetti { position:fixed; inset:0; pointer-events:none; z-index:9999; overflow:hidden; }
.psac-confetti i { position:absolute; top:-20px; width:10px; height:16px; border-radius:3px; animation:psac-confetti-fall linear forwards; }
@keyframes psac-confetti-fall {
  0% { transform:translate(0, 0) rotate(0); opacity:1; }
  85% { opacity:1; }
  100% { transform:translate(var(--drift), 105vh) rotate(var(--spin)); opacity:0; }
}
/* Test mode */
.pt-setup h2 { margin:18px 0 8px; font-size:22px; }
.pt-kinds { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:10px; }
.pt-kind, .pt-time { position:relative; display:flex; flex-direction:column; align-items:center; gap:2px; padding:14px 10px; border-radius:20px; border:3px solid var(--line); background:#fff; text-align:center; cursor:pointer; }
.pt-kind input, .pt-time input { position:absolute; opacity:0; pointer-events:none; }
.pt-kind:has(input:checked), .pt-time:has(input:checked) { border-color:var(--grape); background:#f3edff; box-shadow:0 0 0 3px #7b5cff33; }
.pt-kind-emoji { font-size:38px; line-height:1.1; } .pt-kind strong, .pt-time strong { font-size:19px; } .pt-kind small, .pt-time small { color:var(--muted); font-size:14px; line-height:1.2; }
.pt-times { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; max-width:520px; }
.pt-chapters { margin:16px 0; } .pt-chapters summary { font-weight:700; font-size:18px; cursor:pointer; min-height:44px; }
.pt-chapter-list { display:grid; gap:6px; margin-top:8px; } .pt-chapter-list label { display:flex; gap:8px; align-items:center; font-size:17px; padding:6px 10px; border-radius:12px; background:#f8f5ff; }
.pt-chapter-list input { width:22px; height:22px; }
.pt-past { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.pt-past a { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; padding:10px 14px; border-radius:16px; background:#f8f5ff; color:var(--ink); text-decoration:none; } .pt-past span:first-child { flex:1; } .pt-past small { color:var(--muted); }
.pt-bar { position:sticky; top:8px; z-index:5; display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; margin:12px 0; padding:10px 16px; border-radius:20px; background:#ffffffee; border:3px solid var(--grape); box-shadow:var(--shadow); }
.pt-clock { font-size:24px; } .pt-clock.low b { color:#e5484d; } .pt-done { flex:1; font-size:18px; }
.pt-questions { list-style:none; margin:0; padding:0; display:grid; gap:16px; counter-reset:q; }
.pt-q { position:relative; padding-top:42px !important; } .pt-q.saved { border-color:var(--leaf); }
.pt-num { position:absolute; left:16px; top:12px; font-weight:700; color:var(--grape); font-size:18px; }
.pt-q .pq-saved .pq-feedback strong { color:var(--leaf); }
.pt-score { text-align:center; } .pt-score h1 small { font-size:22px; color:var(--muted); }
.pt-review { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.pt-review li { display:flex; gap:12px; padding:12px 14px; border-radius:16px; background:#eefaf1; } .pt-review li.wrong { background:#fff1e6; }
.pt-review p { margin:4px 0; } .pt-review small { color:var(--muted); font-weight:700; }
.pt-mark { font-size:26px; font-weight:700; color:var(--leaf); } .pt-review li.wrong .pt-mark { color:#e5484d; }
.pt-given { color:var(--muted); } .pt-explain { font-size:16px; color:var(--muted); }
.pq.pq-match { display:block; } /* the question box itself is not the two-column grid */

/* Push-to-talk with the mascot (Gemini Live): hold to talk. No long-press menu or text selection
   on the mascot; a pulsing ring while it listens, a gentle bounce while it speaks. */
.psac-teacher-figure { -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; touch-action:manipulation; }
.psac-teacher-figure img { -webkit-user-drag:none; pointer-events:none; }
.psac-teacher-figure.listening { opacity:1; border-radius:50%; animation:psac-listen 1.1s ease-in-out infinite !important; }
.psac-teacher-figure.speaking { opacity:1; animation:psac-hop .7s ease infinite !important; }
@keyframes psac-listen {
  0%, 100% { box-shadow:0 0 0 0 rgba(155, 93, 229, .55); transform:scale(1.04); }
  50% { box-shadow:0 0 0 18px rgba(155, 93, 229, 0); transform:scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .psac-teacher-figure.listening, .psac-teacher-figure.speaking { animation:none !important; outline:4px solid #9b5de5; border-radius:50%; } }

/* ---- Chapter trophies (PsacTrophy): the cup, the shelf, the chapter trail ---- */
.psac-trophy { display:inline-grid; place-items:center; width:var(--size); height:var(--size); border-radius:50%; font-size:calc(var(--size) * .62); line-height:1; vertical-align:middle;
  background:radial-gradient(circle at 35% 30%, #fff 0, color-mix(in srgb, var(--tier, #ccc) 35%, #fff) 60%); box-shadow:0 0 0 3px var(--tier, #d5d9e2); flex:none; }
.psac-trophy img { width:100%; height:100%; object-fit:contain; }
.psac-trophy.empty { background:#f1f2f5; box-shadow:0 0 0 3px #d5d9e2; filter:grayscale(1); opacity:.55; }
.psac-trophy.locked { filter:grayscale(1); opacity:.45; }
.pu-trophy { display:flex; align-items:center; gap:14px; text-align:left; }
.pu-trophy p { margin:4px 0 0; font-weight:500; }
.pl-level-trophy { margin-left:auto; }
.pt-shelf { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; padding:14px 10px 10px; border-radius:20px; background:linear-gradient(#fff8e6, #ffeec2); border-bottom:10px solid #c98b4a; }
.pt-slot { display:flex; flex-direction:column; align-items:center; gap:4px; }
.pt-slot strong { font-size:26px; line-height:1; } .pt-slot small { font-weight:700; color:var(--muted); }
.pt-slot.empty strong { color:var(--muted); }
.pt-hint { margin:6px 0 10px; font-weight:700; }
.pt-trail h3 { margin:14px 0 8px; font-size:19px; }
.pt-trail ol { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.pt-stop { display:flex; flex-direction:column; align-items:center; gap:4px; width:84px; padding:8px 4px; border-radius:16px; background:#f8f5ff; color:var(--ink); text-align:center; text-decoration:none; }
.pt-stop:hover, .pt-stop:focus-visible { background:#efe8ff; }
.pt-stop small { font-size:12px; line-height:1.15; font-weight:600; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pt-stop-cup b { display:inline-grid; place-items:center; width:40px; height:40px; border-radius:50%; background:#e6e8ee; color:var(--muted); font-size:17px; }
@media (max-width: 560px) { .pt-stop { width:72px; } .pt-shelf .psac-trophy { --size:48px !important; } }
