:root {
  --navy: #123a72;
  --navy-dark: #09264d;
  --cyan: #0eb7c5;
  --yellow: #ffd447;
  --coral: #ff6b5d;
  --green: #33b679;
  --ink: #17243a;
  --muted: #627089;
  --paper: #f7f9fc;
  --white: #fff;
  --line: #dfe6f0;
  --shadow: 0 14px 40px rgba(18, 58, 114, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif; min-width: 320px; }
body.site-locked { overflow: hidden; }
body.site-locked > :not(.site-gate):not(script) { visibility: hidden; }
.site-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 15%, #215b9e 0, #123a72 38%, #08264c 100%); }
.site-gate-card { width: min(430px, 100%); padding: clamp(28px, 6vw, 46px); text-align: center; background: white; border: 1px solid rgba(255,255,255,.45); border-radius: 28px; box-shadow: 0 28px 70px rgba(2,20,45,.35); }
.site-gate-card .brand-mark { margin: 0 auto 18px; }
.site-gate-card h1 { margin: 6px 0 10px; font-size: clamp(29px, 6vw, 40px); }
.site-gate-card > p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); }
.site-gate-card label { display: block; margin-bottom: 8px; color: var(--navy); text-align: left; font-weight: 850; }
.site-gate-card input { width: 100%; height: 58px; margin-bottom: 14px; color: var(--navy); background: #f8fafc; border: 2px solid #cbd8e7; border-radius: 14px; font-size: 28px; font-weight: 900; letter-spacing: .35em; text-align: center; }
.site-gate-card input:focus { outline: 4px solid rgba(14,183,197,.2); border-color: var(--cyan); }
.site-gate-card .primary-button { width: 100%; }
.access-status { min-height: 24px; margin-top: 12px; color: #a33535; font-weight: 800; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 4px solid rgba(14, 183, 197, .32); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--navy-dark); color: white; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.topbar { height: 82px; padding: 0 clamp(18px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: var(--navy-dark); background: var(--yellow); border: 3px solid var(--navy-dark); border-radius: 14px 14px 18px 18px; font-weight: 900; font-size: 24px; transform: rotate(-3deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.local-pill, .demo-tag { display: inline-flex; align-items: center; gap: 7px; color: #176143; background: #e4f7ee; border: 1px solid #b7e8d2; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.local-pill span { color: var(--green); }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 14px; background: white; font-size: 20px; }

.role-nav { display: flex; justify-content: center; gap: 8px; padding: 12px 18px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 82px; z-index: 15; }
.role-nav:not(.is-adult-unlocked) { display: none; }
.nav-item { min-height: 44px; padding: 10px 22px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-weight: 800; }
.nav-item.is-active { color: white; background: var(--navy); box-shadow: 0 6px 16px rgba(18, 58, 114, .2); }

main { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.view { display: none; padding: 42px 0 72px; }
.view.is-active { display: block; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 34px clamp(24px, 5vw, 56px); color: white; background: linear-gradient(125deg, var(--navy-dark), var(--navy) 58%, #176aa1); border-radius: 28px 28px 10px 10px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -120px; border: 40px solid rgba(255,255,255,.08); border-radius: 50%; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .11em; }
.hero .eyebrow { color: var(--yellow); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 5vw, 52px); line-height: 1.02; letter-spacing: -.04em; }
.hero p:last-child { margin: 0; color: #dce9f8; }
.score-card { display: flex; z-index: 1; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; background: rgba(3,24,51,.35); backdrop-filter: blur(8px); }
.score-card div { min-width: 104px; padding: 16px 20px; text-align: center; }
.score-card div + div { border-left: 1px solid rgba(255,255,255,.18); }
.score-card strong, .score-card span { display: block; }
.score-card strong { color: var(--yellow); font-size: 26px; }
.score-card span { color: #dce9f8; font-size: 12px; }
.progress-track { height: 9px; margin: 0 12px 26px; background: #dce5f0; border-radius: 0 0 10px 10px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--yellow)); transition: width .4s ease; }

.avatar-journey { margin: 26px 0; padding: clamp(22px, 4vw, 34px); background: linear-gradient(145deg, #fff 0 65%, #eef9fb 100%); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(18,58,114,.08); overflow: hidden; }
.journey-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.journey-heading h2 { margin: 0 0 7px; font-size: clamp(23px, 3vw, 32px); }
.journey-heading > div:first-child > p:last-child { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.5; }
.bonus-reveal { --bonus-progress: 0%; flex: 0 0 min(360px, 38%); padding: 16px 18px; text-align: center; color: white; background: var(--navy); border-radius: 17px; }
.bonus-reveal > span { color: var(--yellow); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.bonus-name { display: grid; margin: 7px 0 4px; font-size: clamp(16px, 2vw, 21px); }
.bonus-name > * { grid-area: 1 / 1; }
.bonus-ghost { opacity: .2; filter: blur(4px); }
.bonus-clear { color: var(--yellow); clip-path: inset(0 calc(100% - var(--bonus-progress)) 0 0); transition: clip-path .55s ease; }
.bonus-reveal small { display: block; color: #dce9f8; }
.bonus-reveal.is-complete { background: linear-gradient(135deg, #176143, #208257); }
.bonus-reveal.is-complete .bonus-clear { color: white; }
.journey-track { position: relative; min-height: 330px; margin-top: 18px; }
.journey-line { position: absolute; z-index: 1; top: 220px; right: 6%; left: 6%; height: 12px; background: #dbe3ed; border: 3px solid white; border-radius: 999px; box-shadow: 0 2px 0 #b9c5d5; }
.journey-line span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--yellow)); border-radius: inherit; transition: width .55s ease; }
.avatar-runner { position: absolute; z-index: 3; top: 16px; left: 6%; width: 128px; height: 214px; transform: translateX(-50%); transition: left .65s cubic-bezier(.2,.8,.2,1); }
.avatar-runner img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 8px rgba(18,58,114,.22)); }
.avatar-accessory { position: absolute; z-index: 4; display: grid; place-items: center; width: 42px; height: 42px; background: white; border: 2px solid var(--yellow); border-radius: 50%; box-shadow: 0 5px 12px rgba(18,58,114,.2); font-size: 24px; animation: reward-pop .45s both; }
.slot-shoes { right: -8px; bottom: 5px; }
.slot-hat { top: 4px; right: -7px; }
.slot-medal { top: 73px; left: -13px; }
.slot-shirt { top: 112px; right: -16px; }
.slot-trophy { right: -20px; bottom: 56px; }
@keyframes reward-pop { from { opacity: 0; transform: scale(.35) rotate(-15deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.journey-stops { position: absolute; inset: 0; }
.journey-stop { position: absolute; z-index: 2; top: 202px; left: var(--stop-position); width: 126px; transform: translateX(-50%); text-align: center; }
.journey-stop > span { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 5px; color: #7c899b; background: #edf1f6; border: 3px solid white; border-radius: 50%; box-shadow: 0 3px 0 #c4cfdd; font-size: 20px; font-weight: 900; }
.journey-stop strong, .journey-stop small { display: block; }
.journey-stop strong { color: var(--navy); font-size: 12px; }
.journey-stop small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.15; }
.journey-stop.is-unlocked > span { color: var(--navy); background: #fff5b8; box-shadow: 0 3px 0 #d9b82e; }
.unlocked-items { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 42px; padding-top: 12px; border-top: 1px solid var(--line); }
.unlocked-items strong { margin-right: 4px; color: var(--navy); }
.unlocked-items span { padding: 7px 10px; color: var(--muted); background: #f1f4f8; border-radius: 999px; font-size: 12px; font-weight: 800; }
.unlocked-items span.is-unlocked { color: #125437; background: #dcf7ea; }

.week-board { margin: 0 0 28px; padding: clamp(20px, 4vw, 32px); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(18,58,114,.07); }
.week-board-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.week-board-heading h2 { margin: 0; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.03em; }
.week-board-heading > p { max-width: 390px; margin: 0; color: var(--muted); text-align: right; }
.week-rows { display: grid; gap: 10px; }
.week-row { display: grid; grid-template-columns: 224px minmax(930px, 1fr); gap: 14px; align-items: stretch; padding: 10px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; transition: border-color .2s ease, background .2s ease; }
.week-row.is-active { background: #eef9fb; border-color: var(--cyan); box-shadow: inset 5px 0 0 var(--cyan); }
.week-row.is-complete { background: #eff9f4; border-color: #afe0c8; }
.week-day-info { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; min-height: 58px; padding: 2px 8px 2px 2px; }
.week-day-info > span { display: grid; place-items: center; width: 44px; height: 44px; color: white; background: var(--navy); border-radius: 13px; font-size: 13px; font-weight: 900; }
.week-row.is-active .week-day-info > span { color: var(--navy-dark); background: var(--yellow); }
.week-row.is-complete .week-day-info > span { background: var(--green); }
.week-day-info strong, .week-day-info small { display: block; }
.week-day-info strong { font-size: 17px; }
.week-day-info small { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.week-day-info em { color: var(--navy); font-size: 12px; font-style: normal; font-weight: 900; }
.week-activities { display: grid; grid-template-columns: repeat(15, minmax(54px, 1fr)); gap: 7px; min-width: 930px; }
.week-activity { min-height: 58px; padding: 5px 3px; color: var(--navy); background: white; border: 1px solid #ccd8e7; border-radius: 12px; box-shadow: 0 3px 0 #dae2ec; }
.week-activity strong, .week-activity span { display: block; }
.week-activity strong { font-size: 14px; }
.week-activity span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.week-activity:hover { border-color: var(--cyan); transform: translateY(-1px); }
.week-activity.is-current { color: white; background: var(--navy); border-color: var(--navy); box-shadow: 0 3px 0 var(--navy-dark); }
.week-activity.is-current span { color: #dce9f8; }
.week-activity.is-done { color: #125437; background: #dcf7ea; border-color: #8fd5b1; box-shadow: 0 3px 0 #9edbbc; }
.week-activity.is-done span { color: #176143; }
.week-activity.is-done.is-current { color: white; background: var(--green); }
.week-activity.is-done.is-current span { color: white; }
.week-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.week-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 11px; height: 11px; display: inline-block; background: white; border: 1px solid #ccd8e7; border-radius: 4px; }
.legend-dot.is-current { background: var(--navy); border-color: var(--navy); }
.legend-dot.is-done { background: var(--green); border-color: var(--green); }

.game-card { max-width: 880px; margin: 0 auto; padding: clamp(22px, 5vw, 44px); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.game-heading, .panel-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.mission-number { display: block; margin-bottom: 8px; color: var(--coral); font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.game-heading h2 { margin: 0; font-size: clamp(22px, 3.5vw, 34px); letter-spacing: -.03em; }
.listen-button, .secondary-button, .primary-button, .outline-button, .text-button { min-height: 48px; border-radius: 14px; padding: 11px 18px; font-weight: 850; border: 0; }
.listen-button, .secondary-button { color: var(--navy); background: #edf5ff; border: 1px solid #cfe0f6; }
.primary-button { color: white; background: var(--navy); box-shadow: 0 6px 14px rgba(18,58,114,.18); }
.outline-button { color: var(--navy); background: white; border: 2px solid var(--navy); }
.outline-button:disabled { cursor: not-allowed; color: #8a96a8; border-color: #cbd3df; background: #f3f5f8; }
.text-button { color: var(--navy); background: transparent; }
.danger { color: #a33535; }
.mission-fact { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 28px 0 0; padding: 15px 17px; color: #21456f; background: #edf5ff; border: 1px solid #cfe0f6; border-radius: 15px; }
.mission-fact div { display: flex; align-items: center; gap: 10px; }
.mission-fact strong { flex: 0 0 auto; color: var(--navy); }
.mission-fact span { color: var(--muted); }
.mission-fact.has-source { color: #55470c; background: #fff8d9; border-color: #f2dc7e; }
.mission-fact.has-source strong { color: #715c0d; }
.mission-fact a { flex: 0 0 auto; color: var(--navy); font-size: 12px; font-weight: 800; }
.story-text { max-width: 720px; margin: 28px auto 20px; color: var(--ink); font-size: clamp(18px, 2.5vw, 23px); line-height: 1.55; text-align: center; font-weight: 750; }
.ready-step { max-width: 620px; margin: 22px auto 6px; padding: 22px; text-align: center; background: #eef9fb; border: 2px solid #a6e0e5; border-radius: 18px; }
.ready-step p { margin: 0 0 16px; color: var(--navy); font-size: clamp(20px, 3vw, 27px); font-weight: 900; }
.ready-button { min-width: 190px; font-size: 17px; }
.operation-stage { margin-top: 26px; }
.instruction { margin: 0 0 20px; text-align: center; font-size: clamp(19px, 3vw, 27px); font-weight: 800; }
.operation-workspace { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: stretch; }
.vertical-sum { display: flex; flex-direction: column; justify-content: center; min-height: 260px; padding: 26px 38px; color: var(--navy); background: #f5f8fc; border: 2px solid #cbd8e7; border-radius: 22px; font-variant-numeric: tabular-nums; }
.vertical-sum div { display: grid; grid-template-columns: 34px 1fr; align-items: center; text-align: right; font-size: 42px; line-height: 1.15; }
.vertical-sum div span { font-weight: 900; }
.vertical-sum div strong { font-size: inherit; }
.vertical-sum hr { width: 100%; margin: 8px 0; border: 0; border-top: 4px solid var(--navy); }
.vertical-result { min-height: 50px; text-align: right; font-size: 42px; line-height: 1.15; }
.counting-support { padding: 18px; background: #eef9fb; border: 2px solid #bde2ed; border-radius: 22px; }
.counting-support > p { margin: 0 0 10px; color: var(--navy); text-align: center; font-weight: 850; }

.play-field { min-height: 190px; padding: 24px 18px; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 32px); border-radius: 18px; background: radial-gradient(circle at 50% 150%, #3ba56c 0 42%, #2b8d5a 43% 46%, transparent 47%), linear-gradient(#dff5ff 0 63%, #7bd49f 63%); border: 2px solid #bde2ed; overflow: hidden; }
.dot-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 260px; padding: 18px; border: 3px dashed transparent; border-radius: 18px; }
.dot-group.is-highlighted { border-color: var(--yellow); background: rgba(255,255,255,.45); }
.operator { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 auto; color: white; background: var(--navy); border: 4px solid white; border-radius: 50%; box-shadow: 0 6px 12px rgba(18,58,114,.2); font-size: 34px; font-weight: 900; }
.count-dot { position: relative; width: 58px; height: 58px; border: 4px solid white; border-radius: 50%; background: var(--coral); box-shadow: 0 7px 0 #c9413c, 0 9px 15px rgba(20,55,80,.18); transition: transform .15s ease, filter .15s ease; }
.dot-group:nth-child(3) .count-dot { background: var(--yellow); box-shadow: 0 7px 0 #d5a91d, 0 9px 15px rgba(20,55,80,.18); }
.count-dot:hover { transform: translateY(-3px); }
.count-dot.is-counted { filter: saturate(.55); transform: scale(.9); }
.count-dot .count-label { position: absolute; inset: -10px -10px auto auto; display: grid; place-items: center; width: 28px; height: 28px; color: white; background: var(--navy-dark); border: 2px solid white; border-radius: 50%; font-size: 13px; font-weight: 900; }
.count-status { min-height: 25px; margin: 12px 0 18px; color: var(--muted); text-align: center; font-weight: 750; }
.number-line { display: flex; justify-content: center; gap: 5px; margin: 0 auto 18px; }
.number-line span { display: grid; place-items: center; width: 38px; height: 38px; background: #edf2f8; border-radius: 10px; font-weight: 800; }
.number-line span.is-stop { color: white; background: var(--navy); transform: scale(1.1); }
.answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 590px; margin: 0 auto; }
.answer-button { min-height: 66px; border: 2px solid #cbd8e7; border-radius: 16px; color: var(--navy); background: white; font-size: 26px; font-weight: 900; box-shadow: 0 5px 0 #d6deea; }
.answer-button:hover { border-color: var(--cyan); transform: translateY(-2px); }
.answer-button:disabled { cursor: default; }
.answer-button.is-correct { color: #125437; border-color: var(--green); background: #dcf7ea; box-shadow: 0 5px 0 #9edbbc; }
.answer-button.is-gentle-wrong { animation: gentle-shake .35s ease; border-color: var(--yellow); background: #fff8d9; }
@keyframes gentle-shake { 25%, 75% { transform: translateX(3px); } 50% { transform: translateX(-3px); } }
.feedback { min-height: 56px; max-width: 620px; margin: 18px auto 0; padding: 12px 16px; border-radius: 14px; text-align: center; font-weight: 800; }
.feedback:empty { padding: 0; }
.feedback.success { color: #125437; background: #dcf7ea; }
.feedback.support { color: #715c0d; background: #fff8d9; }
.game-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.is-hidden { display: none !important; }
.effort-note { max-width: 880px; margin: 18px auto 0; display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: #55470c; background: #fff8d9; border: 1px solid #f2dc7e; border-radius: 16px; }
.effort-note > span { font-size: 28px; }
.effort-note p { margin: 0; }

.reward-strip { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 28px clamp(24px, 5vw, 44px); border-radius: var(--radius); background: white; border: 1px solid var(--line); }
.reward-strip h2 { margin-bottom: 5px; }
.reward-strip p:last-child { margin: 0; color: var(--muted); }
.reward-meter-wrap { width: min(420px, 100%); }
.reward-numbers { margin-bottom: 8px; text-align: right; color: var(--muted); }
.reward-meter { height: 14px; margin-bottom: 14px; background: #e5ebf3; border-radius: 999px; overflow: hidden; }
.reward-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--yellow)); transition: width .4s ease; }
.reward-meter-wrap .outline-button { width: 100%; }
.reward-meter-wrap small { display: block; margin-top: 8px; color: var(--muted); text-align: center; }
.reward-decision { margin-top: 14px; padding: 13px 14px; border-radius: 13px; font-weight: 800; text-align: center; }
.reward-decision.approved { color: #125437; background: #dcf7ea; border: 1px solid #9edbbc; }
.reward-decision.declined { color: #715c0d; background: #fff8d9; border: 1px solid #f2dc7e; }

.section-heading { align-items: center; margin-bottom: 28px; }
.section-heading h1 { margin-bottom: 6px; }
.section-heading p:last-child { margin: 0; color: var(--muted); }
.demo-tag { color: #735a00; background: #fff6ce; border-color: #f2df81; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stats-grid article { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.stats-grid span, .stats-grid small, .stats-grid strong { display: block; }
.stats-grid span { color: var(--muted); font-size: 13px; font-weight: 800; }
.stats-grid strong { margin: 5px 0; color: var(--navy); font-size: 30px; }
.stats-grid small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 22px; }
.fono-grid { grid-template-columns: 1fr 1fr; }
.panel { padding: clamp(22px, 4vw, 32px); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 7px 25px rgba(18,58,114,.06); }
.panel-heading { margin-bottom: 22px; }
.panel-heading h2 { margin: 0; letter-spacing: -.025em; }
.panel-heading > span { font-size: 26px; }
.panel label, fieldset { display: block; margin: 0 0 18px; color: #35445a; font-size: 14px; font-weight: 800; }
.panel input, .panel select, .panel textarea { width: 100%; min-height: 46px; margin-top: 7px; padding: 11px 12px; color: var(--ink); background: #fbfcfe; border: 1px solid #cbd5e2; border-radius: 11px; }
.panel textarea { resize: vertical; }
.day-reward-approval { margin: 4px 0 20px; padding: 16px; background: #fff8d9; border: 1px solid #f2dc7e; border-radius: 14px; }
.day-reward-approval > strong { display: block; color: #715c0d; font-size: 17px; }
.day-reward-approval > p { margin: 5px 0 12px; color: #665b32; line-height: 1.4; }
.panel .approval-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--navy); font-weight: 800; }
.panel .approval-check input { flex: 0 0 auto; width: 22px; height: 22px; min-height: 22px; margin: 1px 0 0; accent-color: var(--green); }
fieldset { padding: 0; border: 0; }
legend { margin-bottom: 7px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.segmented span { min-height: 44px; display: grid; place-items: center; border: 1px solid #cbd5e2; border-radius: 11px; background: #fbfcfe; }
.segmented input:checked + span { color: white; background: var(--navy); border-color: var(--navy); }
.form-status { min-height: 20px; margin: 10px 0 0; color: #176143; font-weight: 800; }
.muted { color: var(--muted); }
.subsection-title { margin: 20px 0 10px; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.pending-approvals { margin: 18px 0; }
.pending-approval { padding: 18px; background: #fff8d9; border: 2px solid #f0cf42; border-radius: 16px; }
.pending-approval + .pending-approval { margin-top: 10px; }
.pending-approval-tag { display: block; margin-bottom: 5px; color: #715c0d; font-size: 12px; font-weight: 900; letter-spacing: .07em; }
.pending-approval strong, .pending-approval span { display: block; }
.pending-approval span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.approval-actions button { min-height: 46px; border-radius: 12px; font-weight: 850; }
.approve-reward { color: white; background: var(--green); border: 0; }
.decline-reward { color: #85422f; background: white; border: 1px solid #d8a797; }
.no-pending { padding: 14px; color: var(--muted); background: #f8fafc; border: 1px dashed #cbd5e2; border-radius: 13px; font-size: 14px; text-align: center; }
.reward-list { display: grid; gap: 10px; margin-bottom: 22px; }
.reward-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; padding: 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; }
.reward-item strong { align-self: center; }
.reward-item span { color: var(--muted); font-size: 13px; }
.reward-item button { grid-row: 1 / 3; grid-column: 2; min-width: 44px; border: 0; background: transparent; color: #a33535; font-weight: 800; }
.reward-item.is-selected { border-color: var(--cyan); background: #edfbfc; }
.inline-form { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: end; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-form label { margin: 0; }
.inline-form button { grid-column: 1 / -1; }
.reward-history-section { margin-top: 22px; padding-top: 2px; border-top: 1px solid var(--line); }
.reward-history { display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 13px; background: #f8fafc; border-radius: 12px; font-size: 13px; }
.history-item strong { font-size: 14px; }
.history-item span { color: var(--muted); }
.history-status { grid-row: 1 / 3; grid-column: 2; align-self: center; font-weight: 850; }
.history-status.approved { color: #176143; }
.history-status.declined { color: #8a5b0a; }
.report-panel { margin-top: 22px; }
.weekly-report { margin-bottom: 22px; }
.week-insight { margin: 18px 0 0; padding: 14px 16px; color: #21456f; background: #edf5ff; border-radius: 13px; font-weight: 800; text-align: center; }
.day-status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.status-open { color: var(--muted); background: #edf1f6; }
.status-active { color: #715c0d; background: #fff3bd; }
.status-done { color: #125437; background: #dcf7ea; }
.session-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.active-plan dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 0; }
.active-plan dt { color: var(--muted); font-weight: 800; }
.active-plan dd { margin: 0; font-weight: 850; }
.principles { margin-top: 28px; padding: 20px; color: #21456f; background: #edf5ff; border-radius: 16px; }
.principles h3 { margin-bottom: 10px; }
.principles ul { margin: 0; padding-left: 21px; }
.principles li + li { margin-top: 7px; }
.fono-week-readout { margin-top: 18px; padding: 20px; color: #125437; background: #e8f8f0; border: 1px solid #b7e8d2; border-radius: 16px; }
.fono-week-readout h3 { margin-bottom: 8px; }
.fono-week-readout p { margin: 0; line-height: 1.5; }

.celebration { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 12px; height: 20px; border-radius: 3px; animation: fall 1.3s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0; } }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px max(18px, calc((100vw - 1160px)/2)); color: #d9e4f2; background: var(--navy-dark); font-size: 13px; }
footer > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
footer span { max-width: 680px; text-align: right; }
.adult-access-link { padding: 0; color: #9fb8d6; background: transparent; border: 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.adult-access-link:hover { color: white; }

.adult-dialog { width: min(420px, calc(100% - 28px)); padding: 0; color: var(--ink); background: white; border: 0; border-radius: 22px; box-shadow: 0 24px 70px rgba(4, 25, 52, .35); }
.adult-dialog::backdrop { background: rgba(4, 25, 52, .72); backdrop-filter: blur(4px); }
.adult-dialog form { position: relative; display: flex; flex-direction: column; padding: 32px; }
.adult-dialog h2 { margin: 10px 0 8px; font-size: 28px; text-align: center; }
.adult-dialog p { color: var(--muted); text-align: center; }
.adult-dialog label { color: #35445a; font-size: 14px; font-weight: 800; }
.adult-dialog input { width: 100%; min-height: 50px; margin-top: 7px; padding: 11px 12px; border: 1px solid #cbd5e2; border-radius: 11px; font-size: 20px; letter-spacing: .16em; text-align: center; }
.adult-dialog small { display: block; margin-top: 14px; color: var(--muted); text-align: center; }
.dialog-lock { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; background: #edf5ff; border-radius: 16px; font-size: 25px; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; color: var(--muted); background: transparent; border: 0; font-size: 28px; }
.adult-error { min-height: 22px; margin: 8px 0; color: #a33535 !important; }

@media (max-width: 800px) {
  .local-pill { display: none; }
  .hero, .reward-strip { align-items: stretch; flex-direction: column; }
  .score-card { width: fit-content; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .fono-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .week-board-heading { align-items: flex-start; flex-direction: column; }
  .week-board-heading > p { text-align: left; }
  .week-row { grid-template-columns: 190px minmax(930px, 1fr); }
  footer { flex-direction: column; }
  footer span { text-align: left; }
}

@media (max-width: 560px) {
  .topbar { height: 70px; padding: 0 14px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .role-nav { top: 70px; justify-content: stretch; padding: 8px; }
  .nav-item { flex: 1; padding: 9px 7px; font-size: 13px; }
  main { width: min(100% - 20px, 1160px); }
  .view { padding-top: 22px; }
  .hero { padding: 25px 22px; border-radius: 22px 22px 8px 8px; }
  .score-card { width: 100%; }
  .score-card div { flex: 1; min-width: 0; }
  .score-card div { padding: 13px 7px; }
  .score-card strong { font-size: 21px; }
  .week-board { padding: 16px 12px; }
  .journey-heading { align-items: stretch; flex-direction: column; }
  .bonus-reveal { flex-basis: auto; width: 100%; }
  .journey-track { min-height: 285px; }
  .journey-line { top: 184px; }
  .avatar-runner { top: 8px; width: 104px; height: 180px; }
  .journey-stop { top: 166px; width: 62px; }
  .journey-stop small { display: none; }
  .avatar-accessory { width: 34px; height: 34px; font-size: 19px; }
  .week-row { display: block; overflow-x: hidden; }
  .week-day-info { grid-template-columns: 46px 1fr auto; }
  .week-activities { margin-top: 8px; overflow-x: auto; padding-bottom: 6px; }
  .week-legend { justify-content: flex-start; }
  .game-card { padding: 20px 14px; }
  .game-heading { align-items: stretch; flex-direction: column; }
  .mission-fact, .mission-fact div { align-items: flex-start; flex-direction: column; }
  .listen-button { width: 100%; }
  .operation-workspace { grid-template-columns: 1fr; }
  .vertical-sum { width: min(210px, 100%); min-height: 220px; margin: 0 auto; }
  .play-field { min-height: 210px; gap: 8px; padding: 20px 8px; }
  .dot-group { gap: 8px; padding: 10px 5px; }
  .count-dot { width: 48px; height: 48px; }
  .operator { width: 42px; height: 42px; font-size: 26px; }
  .answers { grid-template-columns: repeat(2, 1fr); }
  .game-actions { align-items: stretch; flex-direction: column; }
  .game-actions button { width: 100%; }
  .reward-strip { padding: 22px 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats-grid article { padding: 15px; }
  .report-actions > * { width: 100%; }
  .approval-actions { grid-template-columns: 1fr; }
  .active-plan dl { grid-template-columns: 1fr; gap: 3px; }
  .active-plan dd { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .role-nav, #view-jogar, #view-fono, .report-actions, footer, .dashboard-grid { display: none !important; }
  #view-responsavel { display: block !important; padding: 0; }
  body, .panel, .stats-grid article { background: white; box-shadow: none; }
  main { width: 100%; }
}
