/* Letter Lab — setup, player, and worksheet (print) styles.
   Activity cards use fixed light colors so they stay readable in dark mode.
   Responsive rules are scoped to .mode-play so the PDF pages never change with the viewport. */

.lab, .ws-page, #ws-root{
  --l-ink:#4A3B2A; --l-soft:#8A7660; --l-card:#FFFFFF; --l-edge:#F0DFC0; --l-bg:#FFF8EA;
  --l-ok:#E3F4E6; --l-ok-edge:#3F8F52; --l-sel:#4D7CFE; --accent:#3F8F52;
}

/* ---------- setup ---------- */
.learn-hero{ padding:40px 0 8px; text-align:center; }
.learn-hero h1{ font-size:clamp(2rem,6vw,3rem); margin:0 0 10px; }
.learn-hero p{ max-width:60ch; margin:0 auto; color:var(--ink-soft); font-size:1.1rem; }

.setup-card{
  max-width:900px; margin:24px auto 0; background:var(--card); border:2px solid var(--card-edge);
  border-radius:26px; padding:clamp(18px,4vw,34px); box-shadow:0 8px 0 var(--card-edge);
}
.step-title{ font-family:'Baloo 2',sans-serif; font-size:1.25rem; margin:22px 0 10px; display:flex; align-items:center; gap:10px; }
.step-title:first-child{ margin-top:0; }
.step-title .n{ width:34px; height:34px; border-radius:50%; background:var(--coral); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:1rem; }
.text-input{
  width:100%; max-width:420px; font:inherit; font-size:1.2rem; font-weight:800; padding:14px 18px;
  border-radius:16px; border:3px solid var(--card-edge); background:#fff; color:#4A3B2A;
}
.text-input:focus{ outline:none; border-color:var(--blue); }
.letter-row{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.letter-input{ width:96px; text-align:center; font-family:'Baloo 2',sans-serif; font-size:2.6rem; padding:4px 8px; }
.letter-hint{ color:var(--ink-soft); font-size:.95rem; }
.letter-picker{ display:grid; grid-template-columns:repeat(auto-fill,minmax(52px,1fr)); gap:8px; }
.letter-chip{
  font-family:'Baloo 2',sans-serif; font-size:1.5rem; font-weight:800; min-height:52px; border-radius:14px;
  border:2px solid var(--card-edge); background:#fff; color:#4A3B2A; cursor:pointer; box-shadow:0 3px 0 var(--card-edge);
}
.letter-chip:hover{ transform:translateY(-2px); }
.letter-chip.on{ background:var(--green); border-color:var(--green-deep); color:#fff; box-shadow:0 3px 0 var(--green-deep); }

.preview{
  display:flex; align-items:center; gap:14px; margin:18px 0 0; padding:14px 18px; border-radius:20px;
  background:var(--bg2); min-height:84px;
}
.preview .pe{ font-size:3.2rem; line-height:1; }
.preview b{ font-family:'Baloo 2',sans-serif; font-size:1.2rem; }
.preview small{ display:block; color:var(--ink-soft); }

.mode-buttons{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.mode-btn{
  display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center; cursor:pointer;
  border:3px solid transparent; border-radius:22px; padding:22px 16px; font:inherit; font-weight:800; font-size:1.15rem; color:#fff;
}
.mode-btn small{ font-weight:700; font-size:.92rem; opacity:.92; }
.mode-btn .big{ font-size:2.4rem; line-height:1; }
.mode-btn.play{ background:var(--coral); box-shadow:0 6px 0 #C6512F; }
.mode-btn.pdf{ background:var(--green); box-shadow:0 6px 0 var(--green-deep); }
.mode-btn:disabled{ opacity:.45; cursor:not-allowed; }
.mode-btn:not(:disabled):hover{ transform:translateY(-2px); }
.paper-row{ margin-top:12px; display:flex; gap:10px; align-items:center; justify-content:flex-end; color:var(--ink-soft); font-size:.95rem; flex-wrap:wrap; }
.paper-row select{ font:inherit; padding:8px 12px; border-radius:12px; border:2px solid var(--card-edge); background:#fff; color:#4A3B2A; }
.setup-msg{ margin-top:14px; font-weight:800; color:var(--green-deep); min-height:1.4em; }
.setup-msg.err{ color:#C23F30; }

@media (max-width:640px){
  .mode-buttons{ grid-template-columns:1fr; }
  .paper-row{ justify-content:flex-start; }
}

/* ---------- player ---------- */
.player{ max-width:820px; margin:0 auto; padding-bottom:110px; }
.p-top{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap; margin-bottom:12px; }
.p-hello{ display:flex; gap:12px; align-items:center; flex:1 1 300px; }
.p-emoji{ font-size:3.2rem; line-height:1; }
.p-tools{ display:flex; gap:8px; flex-wrap:wrap; }
.p-progress{ height:14px; border-radius:999px; background:var(--bg2); overflow:hidden; border:2px solid var(--card-edge); }
.p-progress > div{ height:100%; width:0; background:linear-gradient(90deg,var(--gold),var(--green)); transition:width .4s ease; }
.pips{ position:relative; display:flex; gap:6px; overflow-x:auto; padding:12px 2px; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
.pip{
  flex:0 0 auto; width:40px; height:40px; border-radius:50%; border:2px solid var(--card-edge); background:#fff; color:#4A3B2A;
  font-weight:800; cursor:pointer; font-family:'Baloo 2',sans-serif; font-size:1rem;
}
.pip.done{ background:var(--green); border-color:var(--green-deep); color:#fff; }
.pip.saved{ background:#E3F4E6; border-color:var(--green); color:#2C6B3B; }
.pip.cur{ outline:3px solid var(--blue); outline-offset:2px; }
.p-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:40; background:var(--bg); border-top:3px solid var(--card-edge);
  padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px)); display:flex; justify-content:center; gap:12px; align-items:center;
}
.p-nav .btn{ min-width:130px; justify-content:center; }
.p-count{ font-weight:800; min-width:90px; text-align:center; }
.btn.pulse{ animation:pulse 1s ease-in-out infinite; }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
@keyframes pulse{ 50%{ transform:scale(1.07); } }

.toast{
  position:fixed; left:50%; top:86px; transform:translate(-50%,-20px); background:var(--green); color:#fff; font-weight:800;
  padding:12px 22px; border-radius:999px; box-shadow:0 6px 0 var(--green-deep); opacity:0; pointer-events:none; z-index:80;
  transition:all .3s ease; text-align:center; max-width:90vw;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }
.confetti{ position:fixed; z-index:79; pointer-events:none; font-size:1.8rem; animation:fly 1.3s ease-out forwards; }
@keyframes fly{ to{ transform:translate(var(--dx),var(--dy)) rotate(var(--rot)); opacity:0; } }

.finish{ text-align:center; }
.finish .btn-row{ justify-content:center; margin-top:18px; }

/* ---------- activity cards (shared by play + print) ---------- */
.ex{
  background:var(--l-card); color:var(--l-ink); border:2px solid var(--l-edge); border-radius:24px;
  padding:18px 20px 22px; box-shadow:0 7px 0 var(--l-edge); font-family:'Nunito',system-ui,sans-serif;
  --l-ink:#4A3B2A; --l-soft:#8A7660; --l-card:#fff; --l-edge:#F0DFC0; --l-bg:#FFF8EA;
}
.ex-head{ display:flex; align-items:center; gap:10px; }
.ex-num{
  width:38px; height:38px; flex:0 0 38px; border-radius:50%; background:var(--accent); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.1rem;
}
.ex-title{ margin:0; font-size:1.35rem; line-height:1.1; }
.ex-emoji{ margin-left:auto; font-size:1.8rem; }
.speak-btn{ width:44px; height:44px; border-radius:50%; border:2px solid var(--l-edge); background:var(--l-bg); font-size:1.2rem; cursor:pointer; flex:0 0 44px; }
.ex-ins{ margin:8px 0 14px; font-size:1.08rem; color:var(--l-soft); font-weight:700; line-height:1.4; }
.ex .q{ margin:6px 0 10px; font-weight:800; font-size:1.1rem; text-align:center; }
.round{ padding:2px 0; }
.seq-dots{ display:flex; gap:8px; justify-content:center; margin-bottom:10px; }
.seq-dots .dot{ width:12px; height:12px; border-radius:50%; background:#eadfc6; }
.seq-dots .dot.on{ background:var(--accent); transform:scale(1.25); }
.seq-dots .dot.done{ background:var(--l-ok-edge); }

.ok{ background:var(--l-ok) !important; border-color:var(--l-ok-edge) !important; }
.sel{ outline:4px solid var(--l-sel); outline-offset:1px; }
.shake{ animation:shake .42s; }
@keyframes shake{ 20%{ transform:translateX(-7px);} 40%{ transform:translateX(7px);} 60%{ transform:translateX(-5px);} 80%{ transform:translateX(5px);} }

.tool-btn{
  font:inherit; font-weight:800; font-size:.98rem; padding:10px 16px; min-height:44px; border-radius:999px; border:2px solid var(--l-edge);
  background:var(--l-bg); color:var(--l-ink); cursor:pointer;
}
.tool-btn.on{ border-color:var(--l-sel); background:#E8EFFF; }

/* hello */
.hello{ display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; }
.hello-mascot{ font-size:5.5rem; line-height:1; }
.bubble{ background:var(--l-bg); border:3px solid var(--l-edge); border-radius:22px; padding:12px 18px; font-size:1.2rem; position:relative; max-width:560px; color:#4A3B2A; }
.bubble .note{ font-size:.92rem; color:var(--l-soft); margin-top:4px; font-weight:700; }
.big-letters{ font-family:'Baloo 2',sans-serif; font-weight:800; color:var(--accent); line-height:1; display:flex; gap:.18em; }
.sound-line{ font-weight:800; font-size:1.1rem; }
.stars-row{ display:flex; gap:12px; margin-top:4px; }
.star-btn{ background:none; border:0; font-size:2.6rem; line-height:1; cursor:pointer; padding:4px 8px; min-width:56px; min-height:56px; color:#C9B896; }
.star-btn.on{ animation:pop .4s; }
@keyframes pop{ 50%{ transform:scale(1.35); } }

/* pictures */
.pic-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:10px; }
.pic{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:10px 6px; min-height:104px;
  border:3px solid var(--l-edge); border-radius:18px; background:#fff; font:inherit; color:var(--l-ink); position:relative;
}
button.pic{ cursor:pointer; }
.pic-e{ font-size:3.1rem; line-height:1.1; }
.pic-e.big{ font-size:3.6rem; }
.pic-w{ font-weight:800; font-size:1rem; }
.pic.hide-w .pic-w{ visibility:hidden; }
.num-badge{ position:absolute; top:6px; left:6px; width:28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; font-size:.95rem; }
.sort-cell{ display:flex; flex-direction:column; gap:6px; align-items:stretch; }
.yn{ text-align:center; font-weight:800; font-size:.95rem; }
.bins{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.bin{ border:3px dashed #cdbf9f; border-radius:20px; background:var(--l-bg); padding:10px; min-height:130px; font:inherit; color:var(--l-ink); cursor:pointer; text-align:center; }
.bin-title{ font-weight:800; margin-bottom:6px; }
.bin-items{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; }
.bin-items .pic{ min-height:0; padding:4px 8px; border-width:2px; }
.bin-items .pic-e{ font-size:1.8rem; }

/* letters / choices */
.letter-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; max-width:520px; margin:0 auto; }
.lcell{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center; border:3px solid var(--l-edge); border-radius:16px; background:#fff;
  font-family:'Baloo 2',sans-serif; font-weight:800; font-size:2.2rem; color:var(--l-ink); min-height:52px; padding:0; cursor:default;
}
button.lcell{ cursor:pointer; }
.counter{ text-align:center; font-weight:800; margin-top:12px; font-size:1.05rem; }
.partner-show{ text-align:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:5.5rem; line-height:1; color:var(--accent); }
.choice-row{ display:flex; flex-wrap:wrap; gap:12px; justify-content:center; margin:8px 0 2px; }
.choice{
  min-width:70px; min-height:70px; padding:6px 16px; display:inline-flex; align-items:center; justify-content:center; border:3px solid var(--l-edge);
  border-radius:18px; background:#fff; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:2.1rem; color:var(--l-ink); cursor:default;
}
button.choice{ cursor:pointer; }
button.choice.used{ opacity:.35; }
.choice.hint{ min-width:56px; min-height:56px; font-size:1.6rem; border-style:dashed; }
.hint-label{ text-align:center; color:var(--l-soft); font-weight:800; margin-top:8px; font-size:.95rem; }
.chip-row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:14px; }
.chip{ font:inherit; font-weight:800; font-size:1.2rem; padding:12px 20px; min-height:48px; border-radius:999px; border:3px solid var(--l-edge); background:#fff; color:var(--l-ink); cursor:pointer; }
.word-list{ margin-top:14px; }
.word-line{ font-weight:800; font-size:1.25rem; padding:8px 0; border-bottom:2px dotted #d8c9ae; }

.missing-top{ display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.word-boxes{ display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.wbox{ width:52px; height:62px; display:inline-flex; align-items:center; justify-content:center; border:3px solid #cdbf9f; border-radius:12px; background:#fff; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:2.1rem; color:var(--l-ink); }
.wbox.blank{ border-style:dashed; background:#fffdf5; }

.count-field{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; padding:10px; background:var(--l-bg); border-radius:18px; margin-bottom:8px; }
.count-item{ font-size:3rem; line-height:1.1; display:inline-block; }
.answer-box{ width:84px; height:64px; border:3px solid #cdbf9f; border-radius:14px; margin:6px auto 0; }

.sentence{ font-size:1.5rem; font-weight:800; line-height:2.1; text-align:center; padding:6px 4px; }
.tok{ display:inline-block; padding:2px 10px; border-radius:14px; border:3px solid transparent; font:inherit; color:var(--l-ink); background:transparent; margin:2px; }
button.tok{ cursor:pointer; background:var(--l-bg); border-color:var(--l-edge); min-height:44px; }

.speed-row{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
.speed{ display:flex; flex-direction:column; align-items:center; gap:2px; min-width:104px; padding:12px 16px; border-radius:20px; border:3px solid var(--l-edge); background:var(--l-bg); font:inherit; font-weight:800; color:var(--l-ink); }
button.speed{ cursor:pointer; }
.speed-e{ font-size:2.2rem; }
.box{ width:30px; height:30px; border:3px solid #cdbf9f; border-radius:8px; background:#fff; margin-top:6px; }
.clap-dots{ display:flex; gap:12px; justify-content:center; margin:4px 0 6px; }
.clap-dot{ width:44px; height:44px; border-radius:50%; border:3px solid #cdbf9f; background:#fff; }

/* canvases */
.cv-wrap{ position:relative; width:100%; margin:0 auto; border-radius:16px; background:#fffdf7; border:3px solid #efe3c8; overflow:hidden; box-sizing:border-box; }
.cv-wrap::before{ content:''; display:block; padding-top:calc(var(--ch) / var(--cw) * 100%); }
.cv-wrap canvas{ position:absolute; left:0; top:0; width:100%; height:100%; }
.cv-ink{ cursor:crosshair; }
.cv-wrap.framed{ border-color:#cdbf9f; }
.ink-tools{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-items:center; margin-top:12px; }
.swatch{ width:42px; height:42px; border-radius:50%; border:4px solid #fff; box-shadow:0 0 0 2px #d8c9ae; cursor:pointer; padding:0; }
.swatch.on{ box-shadow:0 0 0 4px var(--l-sel); }
.sticker-bar{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-items:center; margin-top:12px; }
.sticker{ width:56px; height:56px; border-radius:16px; border:3px solid var(--l-edge); background:#fff; font-size:2rem; cursor:pointer; padding:0; line-height:1; }
.sticker.on{ border-color:var(--l-sel); background:#E8EFFF; }
.write-line{ margin-top:12px; font-weight:800; font-size:1.1rem; }

/* memory */
.mem-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.mem-card{
  min-height:104px; border-radius:16px; border:3px solid var(--l-edge); background:#fff; font:inherit; color:var(--l-ink); cursor:pointer; padding:4px;
  display:flex; align-items:center; justify-content:center; text-align:center; font-weight:800; font-size:1.1rem; position:relative;
}
.mem-back{ font-size:2.4rem; }
.mem-front{ display:none; font-size:1.15rem; align-items:center; justify-content:center; }
.mem-card.pic .mem-front{ font-size:2.8rem; }
.mem-card.flip .mem-front, .mem-card.ok .mem-front{ display:flex; }
.mem-card.flip .mem-back, .mem-card.ok .mem-back{ display:none; }
.mem-card:not(.flip):not(.ok){ background:#FFF1CC; }
.mem-card.print{ border:3px dashed #b9ab8b; cursor:default; font-size:1.3rem; min-height:118px; }
.mem-card.print.pic{ font-size:3rem; }

/* bubbles */
.bubble-field{ display:grid; grid-template-columns:repeat(5,1fr); gap:10px; padding:10px; background:#EAF6FF; border-radius:20px; }
.bubble-b{
  aspect-ratio:1; border-radius:50%; border:3px solid #8FC7EE; background:#DFF1FF; display:flex; align-items:center; justify-content:center;
  position:relative; padding:0; cursor:default; color:#2B5B80; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:2rem; transform:translateY(var(--o,0));
}
button.bubble-b{ cursor:pointer; }
.bubble-t{ pointer-events:none; }
.bubble-b.pop{ transform:scale(1.5); opacity:0; pointer-events:none; transition:all .35s ease; }
.poof{ position:absolute; font-size:1.6rem; pointer-events:none; }

/* ---------- play-mode only: responsive + motion ---------- */
.mode-play .bubble-b:not(.pop){ animation:bob 3.2s ease-in-out infinite; animation-delay:var(--d,0s); }
@keyframes bob{ 50%{ transform:translateY(calc(var(--o,0px) - 8px)); } }
.mode-play .big-letters{ font-size:clamp(4rem,18vw,7rem); }
@media (max-width:640px){
  .mode-play .ex{ padding:14px 12px 18px; border-radius:20px; }
  .mode-play .ex-title{ font-size:1.15rem; }
  .mode-play .pic-e{ font-size:2.6rem; }
  .mode-play .lcell{ font-size:1.7rem; border-radius:12px; border-width:2px; }
  .mode-play .letter-grid{ gap:6px; }
  .mode-play .mem-card{ min-height:84px; font-size:.95rem; }
  .mode-play .mem-card.pic .mem-front{ font-size:2.2rem; }
  .mode-play .mem-grid{ gap:7px; }
  .mode-play .bubble-field{ gap:6px; padding:8px; }
  .mode-play .bubble-b{ font-size:1.5rem; border-width:2px; }
  .mode-play .wbox{ width:42px; height:52px; font-size:1.7rem; }
  .mode-play .choice{ min-width:62px; min-height:62px; font-size:1.8rem; }
  .mode-play .sentence{ font-size:1.2rem; line-height:2; }
  .mode-play .count-item{ font-size:2.4rem; }
  .mode-play .bins{ gap:8px; }
  .mode-play .partner-show{ font-size:4.4rem; }
  .p-hello{ flex-basis:100%; gap:8px; }
  .p-emoji{ font-size:2.4rem; }
  .p-top .bubble{ font-size:1rem; padding:8px 12px; border-width:2px; border-radius:16px; }
  .p-tools{ width:100%; flex-wrap:nowrap; }
  .p-tools .tool-btn{ flex:1; padding:8px 6px; font-size:.82rem; min-height:40px; white-space:nowrap; }
  .p-top{ margin-bottom:6px; }
  .pips{ padding:8px 2px; }
  .pip{ width:36px; height:36px; }
  .p-nav .btn{ min-width:0; flex:1; padding:12px 10px; }
  .p-count{ min-width:60px; font-size:.9rem; }
}
@media (min-width:641px) and (max-width:1100px){
  .mode-play .ex{ padding:22px 26px 26px; }
}
@media (prefers-reduced-motion:reduce){
  .mode-play .bubble-b:not(.pop){ animation:none; }
  .btn.pulse, .shake, .star-btn.on{ animation:none; }
  .confetti{ display:none; }
}

/* ---------- PDF overlay ---------- */
.overlay{ position:fixed; inset:0; background:rgba(40,28,14,.6); z-index:100; display:flex; align-items:center; justify-content:center; padding:20px; }
.overlay[hidden]{ display:none; }
.overlay-box{ background:var(--card); border-radius:26px; padding:28px; max-width:420px; width:100%; text-align:center; border:3px solid var(--card-edge); }
.overlay-box h3{ margin:0 0 8px; font-size:1.5rem; }
.overlay-box .bar{ height:16px; border-radius:999px; background:var(--bg2); overflow:hidden; margin-top:16px; border:2px solid var(--card-edge); }
.overlay-box .bar > div{ height:100%; width:0; background:linear-gradient(90deg,var(--gold),var(--green)); transition:width .25s; }

/* ---------- worksheet pages (rendered off-screen, then into the PDF) ---------- */
#ws-root{ position:fixed; left:-12000px; top:0; width:900px; pointer-events:none; }
.ws-measure{ width:700px; }
.ws-page{
  position:relative; background:#fff; color:#3a2f22; box-sizing:border-box; overflow:hidden; font-family:'Nunito',system-ui,sans-serif;
  padding-top:26px;
}
.ws-head{ height:62px; display:flex; align-items:center; gap:12px; border-bottom:3px solid var(--accent); margin-bottom:14px; }
.ws-head .e{ font-size:2.4rem; }
.ws-head .t{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:1.35rem; line-height:1.05; }
.ws-head .who{ margin-left:auto; font-weight:800; font-size:1rem; }
.ws-foot{ position:absolute; left:0; right:0; bottom:16px; text-align:center; font-size:.78rem; color:#9a8a72; font-weight:700; }
.ws-main{ margin:0 auto; width:700px; }
.mode-print .ex{ width:700px; box-sizing:border-box; box-shadow:none; border:2px solid #cdbf9f; border-radius:18px; padding:14px 20px 16px; margin:0 0 14px; }
.mode-print .ex-ins{ margin:6px 0 10px; }
.mode-print .letter-grid{ grid-template-columns:repeat(5,80px); justify-content:center; }
.mode-print .lcell{ border-width:2px; }
.mode-print .pic-grid{ grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); }
.mode-print .sort-print{ grid-template-columns:repeat(4,1fr); }
.mode-print .mem-grid{ grid-template-columns:repeat(4,1fr); }
.mode-print .bubble-field{ grid-template-columns:repeat(5,1fr); }
.mode-print .big-letters{ font-size:6rem; }
.mode-print .cv-wrap{ width:660px; max-width:660px; }
.mode-print .sentence{ line-height:2.1; font-size:1.35rem; }
.mode-print .hello{ gap:6px; }
.mode-print .hello-mascot{ font-size:4rem; }
.mode-print .pic{ min-height:86px; padding:6px 4px; }
.mode-print .pic-e{ font-size:2.6rem; }
.mode-print .letter-grid{ grid-template-columns:repeat(5,66px); gap:6px; }
.mode-print .lcell{ font-size:1.9rem; min-height:0; }
.mode-print .partner-show{ font-size:4rem; }
.mode-print .choice{ min-width:60px; min-height:60px; font-size:1.8rem; }
.mode-print .count-item{ font-size:2.5rem; }
.mode-print .wbox{ width:46px; height:54px; font-size:1.8rem; }
.mode-print .bubble-field{ grid-template-columns:repeat(5,84px); justify-content:center; gap:8px; }
.mode-print .bubble-b{ font-size:1.7rem; }
.mode-print .mem-card.print{ min-height:92px; }
.mode-print .ex-ins{ margin:4px 0 8px; }
.mode-print .speed{ padding:8px 14px; }
.cover-letters canvas, .cert-letters canvas{ display:block; margin:0 auto; }

.ws-cover{ width:700px; margin:0 auto; text-align:center; }
.ws-cover h1{ font-family:'Baloo 2',sans-serif; font-size:2.3rem; line-height:1.3; margin:6px 0 12px; padding-bottom:4px; }
.cover-mascot{ font-size:6.5rem; line-height:1.1; }
.bubble.big{ margin:0 auto; font-size:1.5rem; }
.cover-letters{ margin:6px 0 0; }
.cover-for{ font-size:1.3rem; font-weight:800; margin:0 0 14px; }
.cover-list{ display:grid; grid-template-columns:1fr 1fr; gap:6px 24px; text-align:left; font-weight:700; font-size:1rem; margin:6px 0 14px; }
.ws-cover h4{ margin:0; font-family:'Baloo 2',sans-serif; font-size:1.2rem; }
.cover-tip{ background:#FFF8EA; border:2px dashed #cdbf9f; border-radius:14px; padding:10px 16px; font-weight:700; font-size:.95rem; }

.cert{ text-align:center; border:10px double var(--accent); border-radius:24px; padding:30px 24px; background:#fffdf7; }
.cert-emoji{ font-size:4.5rem; line-height:1; }
.cert h2{ font-family:'Baloo 2',sans-serif; font-size:2.6rem; margin:6px 0; }
.cert-line{ font-size:1.3rem; font-weight:800; margin:6px 0; }
.cert-letters{ margin:4px 0; }
.cert-mascot{ font-size:5rem; line-height:1.1; }
.cert-stars{ font-weight:800; margin-top:10px; }
.cert-sign{ display:flex; justify-content:space-around; margin-top:34px; font-weight:800; }
.ws-cert-page .cert{ width:700px; margin:50px auto 0; box-sizing:border-box; }

.glyph{ display:block; pointer-events:none; }

/* ---------- on-demand worksheets (Downloads page) ---------- */
.fc-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; width:700px; margin:0 auto; }
.fc{
  height:286px; box-sizing:border-box; border:3px dashed #b9ab8b; border-radius:20px; background:#fff; text-align:center;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:#4A3B2A;
}
.fc-e{ font-size:4.2rem; line-height:1.15; }
.fc-n{ font-family:'Nunito',system-ui,sans-serif; font-weight:900; font-size:1.7rem; line-height:1.2; }
.fc-s{ font-family:'Nunito',system-ui,sans-serif; font-weight:700; font-size:.95rem; color:#8A7660; }
.fc-note{ width:700px; margin:12px auto 0; text-align:center; font-weight:700; font-size:.95rem; color:#8A7660; }


/* ---------- stand-ins for the live site's stylesheet ---------- */
.lab h1, .lab h2, .lab h3, .ws-page h1, .ws-page h2{ font-family:'Baloo 2','Nunito',sans-serif; }
.btn-row{ display:flex; gap:12px; flex-wrap:wrap; }
.btn-green{ /* the live .btn is already green */ }
.btn-secondary{ background:var(--card); color:var(--ink); border:2px solid var(--card-edge); box-shadow:0 5px 0 var(--card-edge); padding:10px 22px; }
.btn-secondary:active{ box-shadow:0 2px 0 var(--card-edge); }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.learn-hero{ padding:20px 0 8px; }
.lab .wrap{ max-width:900px; }
