/* Safe Choices Club: main stylesheet. Plain CSS, no build step. */

/* ---------- fonts (self-hosted, SIL OFL, see /fonts/OFL.txt) ---------- */
@font-face { font-family: "Baloo 2"; src: url("../fonts/Baloo2-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- tokens (palette overwritten from data/meta.json at runtime) ---------- */
:root {
  --teal: #1BA6A6;
  --navy: #37375B;
  --yellow: #FFCF3D;
  --coral: #EF7860;
  --sky: #68A6D2;
  --purple: #834E8E;
  --green: #68B24D;
  /* accessible darker shades for text-bearing surfaces (white text >= 4.5:1) */
  --teal-dark: #0F7A79;
  --safe: #2E7D32;
  --notsafe: #C2410C;
  --ink: #26263F;
  --muted: #55556E;
  --paper: #FFF8EC;
  --card: #FFFFFF;
  --line: #E7DECF;
  --good-bg: #E8F6E4;
  --think-bg: #FFF1E0;
  --focus: #1D4ED8;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(55, 55, 91, .12), 0 2px 4px rgba(55, 55, 91, .08);
  --head: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* kids' base size is 20px, line height 1.5; grown-ups can choose larger text */
html { font-size: 125%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-text="large"] { font-size: 145%; }
html[data-text="xl"] { font-size: 170%; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.15; color: var(--navy); margin: .4em 0 .3em; letter-spacing: .2px; }
h1 { font-size: min(2rem, 10vw); }
h2 { font-size: min(1.45rem, 8vw); }
h3 { font-size: min(1.15rem, 7vw); }
p { margin: .5em 0; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
em { font-style: italic; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main:focus, section:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -100px; z-index: 50; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; }
.skip:focus { top: 8px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }
.big-text { font-size: 1.1rem; }
.noscript { padding: 16px; text-align: center; }

.sample-banner { background: var(--yellow); color: #2A2A2A; text-align: center; font-weight: 700; padding: 6px 12px; font-size: .8rem; letter-spacing: .5px; text-transform: uppercase; }

/* ---------- header with teal sunburst ---------- */
.site-header { position: relative; overflow: hidden; background-color: var(--teal-dark); color: #fff; padding: 10px 16px 6px; }
.sunburst {
  position: absolute; inset: -60% -10%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, .07) 0deg 9deg, rgba(255, 255, 255, 0) 9deg 18deg);
  pointer-events: none;
}
.brand { position: relative; max-width: 960px; margin: 0 auto; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: 56px; }
.brand-link:hover { color: #fff; }
.brand-shield { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .18)); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--head); font-weight: 800; font-size: min(1.6rem, 8.4vw); line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.brand-sub { font-size: min(.7rem, 3.8vw); opacity: .95; }

.nav { position: relative; max-width: 960px; margin: 6px auto 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; }
.nav li { flex: 1 1 auto; }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-height: 56px; min-width: 56px; padding: 4px 6px; border-radius: 16px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: min(.7rem, 4vw);
}
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--teal-dark); }
.nav .ic { width: 1.3em; height: 1.3em; min-width: 22px; min-height: 22px; }

/* ---------- layout ---------- */
main { display: block; max-width: 960px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }
.screen { animation: pop .25s ease-out; }
.screen.narrow { max-width: 620px; margin: 0 auto; }
.loading { text-align: center; padding: 48px 0; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; border: 2px solid rgba(55, 55, 91, .06); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.row.center { justify-content: center; }
.back-row { margin: 0 0 4px; }
.lead { font-size: 1rem; }
.callout { background: var(--yellow); color: #2A2A2A; border-radius: 16px; padding: 8px 16px; font-weight: 700; text-align: center; }
.eyebrow { font-weight: 600; color: var(--muted); margin: .6em 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small-h { font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 10px 22px; border-radius: 999px;
  border: 3px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
  box-shadow: 0 3px 0 rgba(55, 55, 91, .25); transition: transform .12s ease, box-shadow .12s ease;
  max-width: 100%;
}
.btn .ic { flex: none; width: 1.2em; height: 1.2em; }
.btn:hover { color: var(--navy); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(55, 55, 91, .25); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: default; opacity: .55; transform: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { color: #fff; }
.btn.ghost { background: #fff; }
.btn.warn { background: #9A2E12; border-color: #9A2E12; color: #fff; }
.btn.big { min-height: 64px; font-size: 1.05rem; padding: 12px 26px; }
.btn.small-btn { min-height: 56px; font-size: .85rem; padding: 8px 16px; }
.btn.mini { min-height: 56px; min-width: 56px; padding: 6px 10px; font-size: .75rem; border-width: 2px; }
.btn.speak { background: #FFF6D6; border-color: #C79A00; color: #3D3000; font-size: .85rem; min-height: 56px; padding: 8px 18px; margin: 6px 0; }
.btn.speak[aria-pressed="true"] { background: #FFE58A; }
.btn.fun { flex: 1 1 200px; min-height: 72px; font-size: 1rem; border: none; color: #2A2A2A; }
.btn.fun .ic { width: 1.5em; height: 1.5em; }
.f-yellow { background: var(--yellow) !important; }
.f-sky { background: #BFE0F5 !important; }
.f-coral { background: #FBD0C6 !important; }
.btn.review { background: #FFF6D6; border-color: #C79A00; color: #3D3000; white-space: normal; }

.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 8px; }

/* ---------- inputs ---------- */
.label { display: block; font-weight: 700; margin: 10px 0 4px; }
.big-input, .plan-form input {
  width: 100%; min-height: 60px; padding: 10px 16px; font-size: 1.1rem;
  border: 3px solid var(--navy); border-radius: 18px; background: #fff;
}
.code-input { text-align: center; letter-spacing: 3px; font-weight: 700; text-transform: uppercase; max-width: 360px; margin: 0 auto; display: block; }
.code-msg { font-weight: 600; min-height: 1.5em; }
.code-msg.show { background: var(--think-bg); border-radius: 14px; padding: 8px 12px; }
.welcome .team-img { width: 100%; max-width: 640px; margin: 0 auto; }
.welcome h1 { font-size: min(2.1rem, 10vw); }
.welcome .hl { color: var(--teal-dark); }
.welcome-form { max-width: 420px; margin: 8px auto 0; }
.open-btn { width: 100%; margin-top: 8px; }

/* ---------- feedback ---------- */
.feedback:empty { display: none; }
.feedback { border-radius: var(--radius); padding: 14px 18px; margin: 14px 0; }
.feedback.good { background: var(--good-bg); border: 3px solid #8CC77B; }
.feedback.think { background: var(--think-bg); border: 3px solid #F2B37A; }
.fb-head { font-family: var(--head); font-weight: 800; font-size: 1.25rem; color: var(--navy); margin: 0 0 .2em; }
.fb-verdict { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-verdict .ic { width: 1.3em; height: 1.3em; }
.fb-why { font-size: 1.05rem; }
.progress-text { font-weight: 700; color: var(--muted); margin: 4px 0; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #E2D9C8; }
.dots i.done { background: var(--teal); }
.dots i.now { background: var(--yellow); box-shadow: 0 0 0 3px var(--navy); }
.star-earned { font-family: var(--head); font-weight: 800; font-size: 1.3rem; text-align: center; color: var(--navy); display: flex; justify-content: center; align-items: center; gap: 8px; }
.star-earned .ic { width: 1.6em; height: 1.6em; }

/* stars */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars .ic { width: 1.1em; height: 1.1em; }
.ic.on { fill: var(--yellow); stroke: #8A6A00; }
.ic.off { fill: none; stroke: #B8AE9C; }

/* ---------- map path ---------- */
.greet h1 { margin-top: .1em; }
.map-h { margin-top: 1em; }
.map {
  list-style: none; margin: 8px 0 24px; padding: 8px 0; position: relative;
}
.map::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 0;
  border-left: 6px dotted #E0C98F; transform: translateX(-3px);
}
.stone-li { position: relative; display: flex; margin: 6px 0; }
.stone-li.pos0 { justify-content: flex-start; }
.stone-li.pos1 { justify-content: center; }
.stone-li.pos2 { justify-content: flex-end; }
.stone-li.pos3 { justify-content: center; }
.stone {
  position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: min(100%, 360px); min-height: 72px; padding: 10px 14px 10px 10px;
  background: #fff; border: 4px solid var(--c); border-radius: 40px;
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.stone:hover { color: var(--ink); transform: translateY(-2px); }
.stone-n {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 64px; height: 52px; padding: 0 8px; border-radius: 26px; background: var(--t);
  border: 3px solid var(--c); color: var(--navy); font-weight: 700;
}
.stone-n .ic { width: 1.1em; height: 1.1em; }
.stone-n b { font-family: var(--head); font-size: 1.15rem; }
.stone-t { flex: 1 1 120px; font-weight: 600; line-height: 1.25; }
.stone .stars { flex: none; }
.stone.done { background: #FFFBEA; }
.stone-done { position: absolute; top: -12px; right: -6px; width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.stone-done .ic { fill: #fff; stroke: #8A6A00; }

/* team */
.team-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.team-card { display: flex; gap: 14px; align-items: flex-start; margin: 0; }
.team-face { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; border: 4px solid var(--yellow); }
.team-card h3 { margin-top: 0; }

/* ---------- story hub ---------- */
.story-head { padding: 0 0 16px; overflow: hidden; border-top: 8px solid var(--c); }
.story-head > *:not(.hero) { margin-left: 18px; margin-right: 18px; }
.hero { width: 100%; aspect-ratio: 1000 / 565; object-fit: cover; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 12px; font-weight: 700; color: var(--navy); font-size: .85rem; }
.chip .ic { width: 1em; height: 1em; }
.summary { font-size: 1.05rem; }
.strip-wrap { margin: 8px 0; }
.strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.strip li { margin: 0; }
.panel-btn { display: block; width: 100%; padding: 0; border: 3px solid var(--navy); border-radius: 16px; overflow: hidden; background: #fff; cursor: zoom-in; min-height: 56px; }
.panel-btn img { width: 100%; aspect-ratio: 1000 / 565; object-fit: cover; }
.caption { font-size: .8rem; line-height: 1.35; margin: 6px 2px; }
.panel-dlg { border: none; border-radius: var(--radius); padding: 14px; width: min(96vw, 900px); max-width: 96vw; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.panel-dlg::backdrop { background: rgba(38, 38, 63, .7); }
.panel-dlg[open]:not([data-native]) { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 40; margin: 0; }
.dlg-img { width: 100%; max-height: 68vh; object-fit: contain; border-radius: 14px; }

.tiles { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px;
  min-height: 150px; padding: 16px; border-radius: var(--radius); background: #fff;
  border: 4px solid var(--c, var(--teal)); color: var(--navy); text-decoration: none; box-shadow: var(--shadow);
}
.tile:hover { color: var(--navy); transform: translateY(-2px); }
.tile-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--t, #DDF2F2); display: flex; align-items: center; justify-content: center; }
.tile-ic .ic { width: 36px; height: 36px; }
.tile-t { font-family: var(--head); font-weight: 800; font-size: 1.2rem; line-height: 1.15; }
.tile-s { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tile-s .ic { width: 1.2em; height: 1.2em; }
.tile.got { background: #FFFBEA; }
.for-grownups { text-align: center; margin-top: 28px; font-size: .8rem; }
.for-grownups a { display: inline-block; padding: 14px 8px; min-height: 56px; }

.rule-box { text-align: center; border: 4px dashed var(--c, var(--teal)); }
.rule-label { font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0; font-size: .8rem; }
.rule-big { font-family: var(--head); font-weight: 800; font-size: min(1.8rem, 9vw); line-height: 1.15; color: var(--navy); margin: .2em 0; }
.celebrate { background: #FFFBEA; border: 4px solid var(--yellow); }
.celebrate .cele-h { font-size: min(2.2rem, 11vw); animation: bounce .7s ease-out 1; }
.celebrate .stars .ic { width: 2em; height: 2em; }
.celebrate .rule-box { box-shadow: none; }

/* ---------- games ---------- */
.game h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game h1 .ic { width: 1em; height: 1em; }
.card-text { font-size: 1.2rem; font-weight: 600; line-height: 1.4; margin: .2em 0; }
.ask { font-family: var(--head); font-weight: 800; font-size: 1.2rem; text-align: center; color: var(--navy); margin: .6em 0 .2em; }
.safe-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar { width: 116px; height: 116px; border-radius: 50%; overflow: hidden; border: 5px solid var(--yellow); background: #FDF6E6; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.45); transform-origin: 50% 58%; }
.avatar.sm { width: 84px; height: 84px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.btn.choice { min-height: 96px; font-size: 1.3rem; border-radius: 28px; border: none; color: #fff; flex-direction: column; gap: 4px; }
.btn.choice .ic { width: 1.8em; height: 1.8em; }
.choice-safe { background: var(--safe); }
.choice-not { background: var(--notsafe); }
.choice-sky { background: #1F5F8B; }
.btn.choice:hover { color: #fff; }
.btn.choice.picked, .btn.option.picked { outline: 5px solid var(--yellow); outline-offset: 2px; opacity: 1; }
.btn.choice[disabled] { opacity: .75; }
.options { display: grid; gap: 10px; }
.btn.option { justify-content: flex-start; text-align: left; border-radius: 22px; min-height: 64px; font-weight: 600; white-space: normal; }
.tf-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.btn.option.tf { justify-content: center; text-align: center; font-size: 1.2rem; }
.btn.option.correct { background: var(--good-bg); border-color: var(--safe); opacity: 1; }
.btn.option[disabled]:not(.correct):not(.picked) { opacity: .6; }
.fb-rule { background: #fff; border-radius: 14px; padding: 6px 12px; }

.mode-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.btn.mode { flex: 1 1 160px; font-size: .9rem; }
.btn.mode[aria-pressed="true"] { background: var(--navy); color: #fff; }
.order-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 10px; }
.order-item {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--navy);
  border-radius: 20px; padding: 8px; box-shadow: var(--shadow); position: relative; touch-action: auto;
}
.order-item.dragging { z-index: 5; box-shadow: 0 14px 30px rgba(0, 0, 0, .25); background: #FFFBEA; transition: none; }
.order-item.in-place { border-color: var(--safe); background: var(--good-bg); }
.grip {
  flex: none; width: 56px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 14px; background: #F1EADC; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--navy);
}
.grip small { font-size: .55rem; font-weight: 700; text-transform: uppercase; }
.dragging .grip { cursor: grabbing; }
.num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: #2A2A2A; font-weight: 800; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 1.1rem; }
.step-text { flex: 1 1 auto; min-width: 0; font-weight: 600; line-height: 1.3; }
.updown { flex: none; display: flex; flex-direction: column; gap: 6px; }
.slot.empty { border-style: dashed; color: var(--muted); box-shadow: none; }
.tap-pool { display: grid; gap: 10px; margin: 8px 0; }
.btn.tap-step { justify-content: flex-start; }

.say-wrap { display: flex; align-items: flex-end; gap: 12px; margin: 16px 0 6px; }
.bubble {
  position: relative; flex: 1 1 auto; margin: 0; background: #fff; border: 4px solid var(--navy); border-radius: 28px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.bubble::before { content: ""; position: absolute; left: -16px; bottom: 18px; border: 12px solid transparent; border-right-color: var(--navy); border-left: 0; }
.bubble p { font-family: var(--head); font-weight: 800; font-size: min(1.6rem, 8vw); line-height: 1.25; color: var(--navy); margin: 0; }

.baskets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.btn.basket { min-height: 88px; border-radius: 24px; flex-direction: column; color: #fff; border: none; white-space: normal; font-size: 1.05rem; }
.btn.basket .ic { width: 1.6em; height: 1.6em; }
.b-911 { background: #B42318; }
.b-grown { background: #1F5F8B; }
.b-me { background: var(--safe); }
.btn.basket:hover { color: #fff; }

.memory-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 10px 0; }
@media (min-width: 560px) { .memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mcard {
  position: relative; min-height: 120px; border-radius: 20px; border: 4px solid var(--navy); background: var(--teal-dark);
  color: #fff; cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center; text-align: center;
}
.mcard .back { display: flex; flex-direction: column; align-items: center; font-family: var(--head); font-weight: 800; font-size: 1.4rem; }
.mcard .back .ic { width: 1.6em; height: 1.6em; fill: var(--yellow); stroke: #fff; }
.mcard .face { display: none; flex-direction: column; align-items: center; gap: 4px; }
.mcard.up, .mcard.matched { background: #fff; color: var(--navy); border-color: var(--c, var(--teal)); }
.mcard.up .back, .mcard.matched .back { display: none; }
.mcard.up .face, .mcard.matched .face { display: flex; }
.mcard.matched { background: var(--good-bg); border-color: var(--safe); cursor: default; }
.mcard .pic { width: 52px; height: 52px; border-radius: 50%; background: #F1EADC; display: flex; align-items: center; justify-content: center; }
.mcard .pic .ic { width: 30px; height: 30px; }
.mtext { font-weight: 600; font-size: .85rem; line-height: 1.25; }
.mcard.up { animation: flip .25s ease-out; }

.done-card h2 { font-size: 1.5rem; }

/* ---------- stickers ---------- */
.sticker-grid { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.sticker-grid.one { display: flex; flex-wrap: wrap; justify-content: center; }
.sticker { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.st-disc {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--c); border: 5px solid #fff; box-shadow: var(--shadow), 0 0 0 3px var(--c); color: #fff; overflow: hidden;
}
.st-disc img { width: 100%; height: 100%; object-fit: cover; }
.st-icon .ic { width: 48px; height: 48px; stroke-width: 2.4; }
.badge .st-disc { border-radius: 30px; }
.st-label { font-weight: 700; font-size: .75rem; line-height: 1.25; }
.st-hint { font-size: .65rem; color: var(--muted); line-height: 1.25; }
.sticker.locked .st-disc { background: #D9D4CB; box-shadow: inset 0 0 0 3px #C2BBAF; color: #8E877B; }
.sticker.locked .st-disc img { filter: grayscale(1) brightness(.2) opacity(.25); }
.sticker.locked .st-label { color: var(--muted); }
.champion { background: #FFFBEA; border: 4px solid var(--yellow); }

/* ---------- helpers hand ---------- */
.hand-wrap { max-width: 460px; margin: 0 auto; }
.hand-svg { width: 100%; height: auto; display: block; }
.finger { cursor: pointer; }
.finger:focus { outline: none; }
.finger:focus-visible .finger-fill, .finger.active .finger-fill { stroke: var(--focus); stroke-width: 6; }
.finger:hover .finger-fill { filter: brightness(.96); }
.finger-name { font-family: var(--head); font-weight: 800; font-size: 24px; fill: #26263F; }
.finger-role { font-family: var(--body); font-size: 16px; fill: #26263F; }
.finger-plus { font-family: var(--body); font-weight: 600; font-size: 18px; fill: #55556E; }
.palm-text { font-family: var(--head); font-weight: 800; font-size: 30px; fill: #37375B; }
.helper-list { padding-left: 1.2em; }
.helper-list li { margin: 4px 0; }
.print-only-title { display: none; }

/* ---------- certificate ---------- */
.certificate {
  background: #fff; border: 10px double var(--teal-dark); border-radius: 26px; padding: 24px 20px; text-align: center; margin: 16px 0;
  box-shadow: var(--shadow);
}
.cert-club { font-weight: 700; color: var(--teal-dark); text-transform: uppercase; letter-spacing: 2px; margin: 0; font-size: .8rem; }
.cert-title { font-size: min(2.4rem, 10vw); margin: .1em 0; }
.cert-name-line { margin: .3em 0; }
.cert-name { font-family: var(--head); font-weight: 800; font-size: min(2.2rem, 10vw); color: var(--navy); border-bottom: 3px solid var(--navy); padding: 0 16px; }
.cert-team { width: 100%; max-width: 520px; margin: 10px auto; }
.cert-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; text-align: left; }
.sign-line { display: inline-block; min-width: 180px; border-bottom: 2px solid var(--navy); height: 1.2em; vertical-align: bottom; }
.cert-book { font-size: .75rem; color: var(--muted); }

/* ---------- grown-ups area ---------- */
.grownups { font-size: .9rem; }
.grownups h1 { margin-bottom: .1em; }
.toc ul { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-flex; align-items: center; min-height: 48px; padding: 6px 14px; background: #fff; border-radius: 999px; border: 2px solid var(--line); text-decoration: none; font-weight: 600; }
.progress-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.progress-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pl-n { width: 32px; height: 32px; border-radius: 50%; background: #F1EADC; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.pl-t { flex: 1 1 160px; font-weight: 600; }
.pl-s { font-weight: 700; color: var(--muted); min-width: 3em; }
.complete-msg { background: #FFFBEA; border-radius: 18px; padding: 12px 16px; margin-top: 12px; border: 3px solid var(--yellow); }
.note { border-bottom: 1px solid var(--line); }
.note summary { cursor: pointer; padding: 12px 4px; min-height: 56px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.note-body { padding: 0 4px 12px; border-left: 5px solid var(--c); padding-left: 12px; }
.plan-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.plan-form input { min-height: 56px; font-size: 1rem; border-width: 2px; border-radius: 14px; }
.preview summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font-weight: 600; }
.plan-print { border: 3px solid var(--line); border-radius: 18px; padding: 14px; }
.plan-dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px 14px; margin: 0; }
.plan-dl dt { font-weight: 700; }
.plan-dl dd { margin: 0; border-bottom: 1px solid var(--line); min-height: 1.6em; overflow-wrap: anywhere; }
@media (max-width: 480px) { .plan-dl { grid-template-columns: 1fr; } .plan-dl dd { margin-bottom: 6px; } }
.resources { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.resources li { background: #FBF8F2; border-radius: 16px; padding: 10px 14px; }
.resources h3 { margin-top: .2em; }
.resources a { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; word-break: break-word; }
.ic.ext { width: 1em; height: 1em; }
.seg { border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px 12px; margin: 10px 0; }
.seg legend { font-weight: 700; padding: 0 6px; }
.seg-opt { display: inline-flex; margin: 4px 6px 0 0; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt label { display: inline-flex; align-items: center; min-height: 56px; padding: 6px 18px; border: 2px solid var(--navy); border-radius: 999px; cursor: pointer; font-weight: 600; background: #fff; }
.seg-opt input:checked + label { background: var(--navy); color: #fff; }
.seg-opt input:focus-visible + label { outline: 4px solid var(--focus); outline-offset: 3px; }
.privacy-strong { font-weight: 700; font-size: 1.05rem; }
.review-card { background: #FFFBEA; }

/* ---------- calm mode for body-safety stories (S04-S07) ---------- */
body.calm { background: #F6F4FA; }
body.calm .choice-safe { background: #4B7F52; }
body.calm .choice-not { background: #A15C38; }
body.calm .feedback.good { background: #EEF4EF; border-color: #B9D3BE; }
body.calm .feedback.think { background: #F7F0EA; border-color: #DCC3AE; }
body.calm .celebrate { background: #FBFAFD; border-color: #CDBFD9; }
body.calm .celebrate .cele-h { animation: none; }
body.calm .stone-done, body.calm .tile.got { background: #FBFAFD; }

/* ---------- confetti (short, never flashing; off with reduced motion) ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall 1.2s ease-in forwards; }

@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); opacity: .9; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .confetti { display: none !important; }
  .btn:hover, .stone:hover, .tile:hover { transform: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 420px) {
  main { padding: 12px 12px 40px; }
  .card { padding: 14px; }
  .story-head > *:not(.hero) { margin-left: 12px; margin-right: 12px; }
  .strip { gap: 6px; }
  .caption { font-size: .7rem; }
  .order-item { flex-wrap: wrap; }
  .order-item .step-text { flex-basis: calc(100% - 120px); }
  .updown { flex-direction: row; width: 100%; justify-content: flex-end; }
  .stone-li.pos0, .stone-li.pos1, .stone-li.pos2, .stone-li.pos3 { justify-content: center; }
  .btn { padding-left: 16px; padding-right: 16px; }
  .avatar.sm { width: 64px; height: 64px; }
}
@media (min-width: 900px) {
  .stone { width: 46%; }
}
