/* A small stylesheet: ordinary layout, soft colours, and large controls. */
:root { font-family: "Trebuchet MS", Arial, sans-serif; color: #15385d; background: #edf7fd; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 0% 60%, #e9efda 0, transparent 50%), #edf7fd; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; min-height: 46px; padding: 12px 22px; border: 0; border-radius: 12px; font-weight: bold; transition: background .15s; }
button:disabled { cursor: default; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #bd7820; outline-offset: 4px; }
h1:focus { outline: none; }
.primary { color: white; background: #268348; box-shadow: 0 3px 0 #247542; }
.primary:hover { background: #27814b; }
.secondary { background: #edf5fd; color: #184d83; border: 1px solid #cbddec; }
.secondary:hover, .quiet:hover { background: #dfedfa; }
.quiet { background: transparent; color: #214e7b; }
.site-header { max-width: 1280px; margin: auto; padding: 28px 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: #284e3a; font-size: 24px; font-weight: bold; text-decoration: none; white-space: nowrap; }
.brand span { margin-right: 8px; }
nav { display: flex; gap: 4px; }
#user-menu { position: relative; }
#user-menu summary { cursor: pointer; padding: 12px 22px; min-height: 46px; font-weight: bold; border-radius: 12px; }
#user-menu summary:focus-visible { outline: 3px solid #bd7820; outline-offset: 4px; }
.user-menu-items { position: absolute; right: 0; z-index: 5; min-width: 200px; padding: 8px; background: #fff; border: 1px solid #cbddec; border-radius: 12px; box-shadow: 0 4px 12px #15385d20; }
.user-menu-items button { display: block; width: 100%; text-align: left; }
#account-screen dd { margin: 6px 0 20px; overflow-wrap: anywhere; }
.small-label { color: #5d6d5e; font-size: 13px; }
main { max-width: 1184px; min-height: calc(100vh - 180px); padding: 35px 32px; margin: auto; }
h1 { margin: 12px 0 16px; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.6px; }
h2 { font-size: 25px; margin-bottom: 10px; }
p { line-height: 1.7; }
.eyebrow { font-size: 11px; font-weight: bold; letter-spacing: 2px; color: #597344; }
.muted { color: #556c82; font-size: 15px; }
.panel { background: #ffffff; border: 1px solid #dce7f1; border-radius: 14px; padding: 28px; box-shadow: 0 2px 6px #163a6008; }
.login-panel > .primary { width: 100%; margin-top: 26px; background: #176bc6; box-shadow: 0 2px 0 #155bac; }
.mascot { font-size: 64px; display: block; }
label { display: block; font-size: 14px; font-weight: bold; margin: 22px 0 8px; }
input, select { width: 100%; min-height: 48px; padding: 12px; border: 1px solid #ccdaea; border-radius: 10px; background: white; color: #15385d; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 35px; }
.child-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.child-card { text-align: center; padding: 28px; max-width: 420px; }
.child-avatar { display: grid; place-items: center; width: 110px; height: 110px; margin: 0 auto; background: #edf1dc; border-radius: 50%; font-size: 70px; }
.child-card h2 { margin: 18px 0 6px; }
.child-card .primary { width: 100%; margin-top: 8px; }
.child-card .quiet { margin-top: 8px; font-size: 13px; }
.narrow { max-width: 620px; margin: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.archive { display: block; margin-top: 32px; color: #805046; }
.centered { text-align: center; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.game-toolbar h1 { font-size: 26px; letter-spacing: -.5px; margin: 0; }
.game-status { display: flex; gap: 25px; background: white; padding: 14px 22px; border-radius: 16px; }
.game-status strong { margin-left: 8px; }
.game-instruction { text-align: center; color: #5d7058; margin: 24px 0 18px; }
.game-meadow { position: relative; padding: 26px; border-radius: 30px; background: #e4ecdb; border: 1px solid #d4e0c8; }
.board { display: grid; grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr)); gap: 12px; max-width: 660px; margin: auto; }
.card { aspect-ratio: 1; padding: 0; min-width: 0; min-height: 48px; display: grid; place-items: center; font-size: clamp(24px, 4.5vw, 54px); color: #8dc9e6; background: #3484b5; border: 3px solid #fffdf3; box-shadow: 0 3px 0 #236795; border-radius: 14px; }
.card:hover:not(:disabled) { background: #2874a4; }
.card.revealed, .card.matched { background: #ffffff; color: #15385d; }
.card.revealed { animation: reveal-card .15s ease-out; }
@keyframes reveal-card { from { transform: rotateY(60deg); } to { transform: rotateY(0); } }
.card:disabled { opacity: 1; }
.card.matched { background: #f2f7df; border-color: #86a869; box-shadow: none; }
.card-face { line-height: 1; }
.card-face.letter { font-family: Georgia, serif; font-weight: bold; }
.shape-picture { display: block; width: 68%; height: 68%; }
.color-swatch { display: block; width: 68%; height: 68%; border: 2px solid #15385d44; border-radius: 10px; }
.pattern-striped { background-image: repeating-linear-gradient(45deg, transparent 0 7px, #ffffffaa 7px 13px); }
.pattern-dotted { background-image: radial-gradient(circle, #ffffffcc 25%, transparent 28%); background-size: 14px 14px; }
.pattern-checked { background-image: conic-gradient(#ffffffaa 25%, transparent 0 50%, #ffffffaa 0 75%, transparent 0); background-size: 22px 22px; }
.match-overlay { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: #e4ecdbcc; border-radius: inherit; pointer-events: none; }
.match-panel { padding: 18px 28px; border-radius: 22px; background: #ffffff; border: 2px solid #91ad6c; text-align: center; color: #356140; box-shadow: 0 8px 24px #15385d1a; }
.match-panel h2 { margin: 0 0 14px; }
.match-panel p { font-weight: bold; margin: 12px 0 0; }
.match-pair { display: flex; justify-content: center; gap: 14px; }
.match-card { display: grid; place-items: center; width: 80px; height: 80px; font-size: 48px; border: 2px solid #91ad6c; border-radius: 14px; background: #f2f7df; }
/* The overlay shows this message visually; this copy announces it to screen readers. */
.match-message { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stack { display: grid; gap: 12px; }
.history-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 24px; }
.history-card h2 { margin-top: 0; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.facts dt { color: #556c82; }
.facts dd { margin: 0; text-align: right; font-weight: bold; }
.attempt-details { margin-top: 24px; }
summary { cursor: pointer; font-weight: bold; }
.table-scroll { overflow-x: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.range-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.range-filters [aria-pressed="true"] { background: #268348; color: white; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.summary-grid .panel { padding: 22px; }
.summary-grid span { display: block; font-size: 14px; color: #556c82; margin-bottom: 12px; }
.summary-grid strong { font-size: 24px; }
.chart-grid-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.chart-panel { padding: 20px 12px; }
.chart-panel h2 { font-size: 19px; margin: 0 12px 18px; }
.progress-chart { display: block; width: 100%; }
.progress-chart text { fill: #536d86; font: 12px "Trebuchet MS", Arial, sans-serif; }
.chart-grid { stroke: #dbe7f2; stroke-width: 1; }
.chart-point { cursor: pointer; }
.chart-point:hover, .chart-point:focus { stroke: #15385d; stroke-width: 3; outline: none; }
.chart-empty { padding: 24px; text-align: center; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #dce7f1; }
.error { background: #fff0e8; color: #853a25; border: 1px solid #e1b4a1; padding: 12px 20px; border-radius: 12px; }
dialog { width: min(430px, calc(100% - 32px)); padding: 30px; border: 1px solid #d8e0cd; border-radius: 24px; color: #15385d; background: #ffffff; }
dialog::backdrop { background: #15385d77; }
footer { text-align: center; color: #64715e; padding: 24px; font-size: 12px; }
footer span { margin: 0 14px; color: #82916a; }
body.child-mode .site-header { display: none; }
body.child-mode main { padding-top: 24px; }
@media (max-width: 800px) {
  .chart-grid-layout { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  nav { flex-wrap: wrap; }
  .site-header { padding: 20px 24px; flex-wrap: wrap; }
  .small-label { display: none; }
  main { padding: 20px; }
  .welcome-layout { gap: 30px; padding: 0; }
  .panel { padding: 26px; }
  .game-toolbar { flex-wrap: wrap; }
  .game-status { order: 4; width: 100%; justify-content: center; }
  .game-meadow { padding: 16px; }
  .board { gap: 8px; }
}
@media (max-width: 560px) {
  .detail-columns { grid-template-columns: 1fr; }
  .welcome-layout { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .child-list { grid-template-columns: 1fr; }
  .child-card { max-width: none; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .game-meadow { overflow-x: auto; padding: 10px; }
  .board { min-width: calc(var(--columns) * 52px); }
  .card { border-width: 2px; border-radius: 9px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* The specification separates woodland play screens from blue adult pages. */
body { background: #c7ecfa url('/static/assets/woodland.jpg') center center / cover fixed no-repeat; color: #123760; }
.site-header { max-width: 1280px; padding: 22px 36px; }
.brand { display: flex; align-items: center; gap: 12px; color: #103767; font-size: 19px; line-height: 1.2; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: #247be0; font-size: 30px; }
body:not(.adult-workspace):not([data-screen="login"]) .brand { background: #ffffffee; padding: 8px 12px; border-radius: 12px; }
nav { padding: 5px; background: #ffffffee; border-radius: 12px; }
nav .current { color: #1266be; background: #e1efff; }
.small-label { color: #234a6b; }
main { max-width: 1180px; min-height: calc(100vh - 172px); }
.welcome-layout { display: flex; justify-content: center; padding: 48px 0 100px; }
.login-panel { width: 360px; padding: 32px; box-shadow: 0 8px 24px #183e6720; }
.login-panel h1, .login-panel > p { text-align: center; }
.login-panel h1 { margin-top: 0; }
.login-panel label { font-weight: normal; }
body[data-screen="login"] .site-header { justify-content: center; }
body[data-screen="login"] .small-label { display: none; }
#children-screen { max-width: 850px; margin: 12px auto; }
#children-screen .section-heading { justify-content: center; margin-bottom: 24px; }
.child-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.child-card { padding: 22px 16px 12px; border-radius: 14px; box-shadow: 0 4px 10px #18446715; }
.child-avatar { width: 94px; height: 94px; font-size: 64px; background: #fff0d7; }
.child-card h2 { color: #143e6e; font-size: 25px; }
.child-card p { margin: 8px 0; }
.child-card .quiet { padding: 10px 7px; font-size: 12px; }
.add-child-button { display: block; width: min(100%, 380px); margin: 24px auto; background: #ffffffed; border: 2px dashed #9fc7ea; color: #1665b9; }
#profile-screen { max-width: 530px; }
#profile-screen h1 { font-size: 28px; }
#profile-screen .form-row { grid-template-columns: 1fr; gap: 0; }
.game-toolbar { max-width: 850px; margin: auto; padding: 12px 16px; background: #ffffffef; border-radius: 14px; gap: 12px; }
.game-toolbar h1 { font-size: 21px; }
.game-status { background: transparent; padding: 0; gap: 20px; font-size: 14px; }
.game-instruction { color: #123e66; font-size: 20px; font-weight: bold; margin: 18px 0; }
.game-meadow { background: transparent; border: 0; padding: 8px 20px 24px; border-radius: 18px; }
.board { max-width: min(640px, 68vh); gap: 9px; }
.card { border: 2px solid #fff9e6; border-radius: 10px; box-shadow: 0 3px 0 #226892; background: #3484b5; }
.card:not(.revealed)::before { content: ""; width: 45%; height: 45%; background: url('/static/assets/paw.svg') center / contain no-repeat; }
.match-overlay { background: #ddf1e7b8; backdrop-filter: blur(5px); }
.match-panel { padding: 28px 40px; border-color: #a7d997; background: #fffff5; }
.match-panel h2 { font-size: 36px; color: #138552; }
footer { color: #234a62; }
body.child-mode footer { display: none; }
/* Adult pages use the sidebar and pale blue workspace shown in S07–S10. */
body.adult-workspace { background: #eaf6ff; padding-left: 210px; }
.adult-workspace .site-header { position: fixed; inset: 0 auto 0 0; width: 210px; padding: 28px 18px; background: #174c80; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 34px; }
.adult-workspace .brand { color: white; font-size: 17px; gap: 6px; }
.adult-workspace .brand-mark { background: #367bb7; width: 36px; height: 36px; flex-shrink: 0; }
.adult-workspace nav { flex-direction: column; background: transparent; padding: 0; gap: 8px; }
.adult-workspace nav > button, .adult-workspace #user-menu summary { color: #fff; text-align: left; border-radius: 8px; padding: 13px 16px; }
.adult-workspace nav .current, .adult-workspace nav > button:hover { background: #3173b0; }
.adult-workspace .user-menu-items { position: static; min-width: 0; margin-top: 8px; }
.adult-workspace main { padding: 38px 32px; max-width: 1360px; }
.adult-workspace .section-heading { margin-bottom: 20px; }
.adult-workspace .section-heading h1 { margin-top: 0; }
.adult-workspace .section-heading .primary { background: #176bc6; box-shadow: none; }
.adult-workspace .panel { border-color: #dceaf6; }
.adult-workspace table { margin-top: 0; }
th { color: #365575; font-size: 13px; font-weight: normal; }
td { font-size: 14px; }
th, td { padding: 18px 12px; }
#dashboard-rows .secondary { background: #e6f4ff; border-color: #cee7f8; color: #1262ae; }
.range-filters { gap: 4px; }
.range-filters button { min-height: 38px; padding: 8px 14px; font-size: 13px; border: 0; }
.range-filters [aria-pressed="true"] { background: #176bc6; }
.summary-grid .panel { padding: 16px; }
.summary-grid strong { font-size: 22px; }
.chart-panel h2 { font-size: 16px; }
#about-screen h2 { font-size: 20px; color: #1c588e; }
#account-screen { background: white; padding: 28px; border-radius: 14px; }
@media (max-width: 1000px) {
  body.adult-workspace { padding-left: 175px; }
  .adult-workspace .site-header { width: 175px; padding: 24px 12px; }
  .adult-workspace main { padding: 28px 20px; }
  .chart-grid-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .site-header { padding: 16px 20px; }
  .game-toolbar { flex-wrap: wrap; }
  .game-status { order: 4; width: 100%; justify-content: center; }
  .child-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-layout { padding-top: 24px; }
}
@media (max-width: 600px) {
  body { background-position: center; }
  body.adult-workspace { padding-left: 0; }
  .adult-workspace .site-header { position: static; width: auto; padding: 16px; gap: 16px; }
  .adult-workspace nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .adult-workspace nav > button, .adult-workspace #user-menu summary { padding: 10px; font-size: 13px; }
  .adult-workspace .user-menu-items { position: absolute; right: 0; min-width: 180px; z-index: 5; }
  .site-header { justify-content: center; }
  .brand { font-size: 16px; }
  nav button { padding: 10px; font-size: 13px; }
  .child-list { grid-template-columns: 1fr; max-width: 320px; margin: auto; }
  #children-screen .section-heading h1 { font-size: 28px; }
  .welcome-layout { padding: 12px 0 40px; }
  .login-panel { width: 100%; max-width: 360px; }
  .board { max-width: none; }
  .game-meadow { padding: 10px; }
}

/* S04–S06: compact game panels and storybook headings from the UI board. */
@font-face { font-family: "Baloo"; src: url('/static/assets/baloo2.ttf') format('truetype'); font-weight: 400 800; font-display: swap; }
#game-screen h1, .game-instruction, .match-panel h2, .match-panel p, .completion-panel h1 { font-family: "Baloo", "Trebuchet MS", sans-serif; font-weight: 700; }
#game-screen { position: relative; max-width: 980px; margin: auto; }
.game-toolbar { max-width: 780px; padding: 8px 12px; box-shadow: 0 3px 0 #31608018; }
.game-toolbar h1 { font-size: 23px; }
.game-status { background: #eff9ff; padding: 10px 14px; border-radius: 12px; }
.game-instruction { font-size: 24px; line-height: 1.15; }
.card { background: linear-gradient(145deg, #4499bf, #2879aa); box-shadow: 0 3px 0 #235d85; }
.card:hover:not(:disabled) { background: #3189b3; }
.card.revealed { background: #fffdf4; }
.card.matched { background: #f5ffe9; }
.match-panel { position: relative; border: 1px solid #dce8b4; border-radius: 26px; padding: 22px 36px; box-shadow: 0 8px 40px #ffffb066; }
.match-panel::before, .match-panel::after { content: "★"; position: absolute; color: #ffc549; font-size: 27px; top: 86px; }
.match-panel::before { left: 10px; transform: rotate(-15deg); }
.match-panel::after { right: 10px; transform: rotate(15deg); }
.match-panel h2 { font-size: 40px; line-height: 1.15; margin: 0 0 20px; }
.match-panel p { font-size: 23px; color: #157945; }
.match-card { border: 3px solid #73be48; background: #fffef9; box-shadow: 0 0 0 3px #dff3b4; }
#complete-screen { width: min(100%, 370px); margin: 8px auto 30px; }
body[data-screen="complete"] main { min-height: 100svh; display: grid; align-content: center; }
.completion-mascot { position: relative; display: block; width: 100%; height: auto; margin: 0 auto -48px; pointer-events: none; }
.completion-panel { position: relative; width: calc(100% - 20px); margin: 0 auto; padding: 18px 22px 16px; border-radius: 21px; border: 1px solid #e0ebef; box-shadow: 0 5px 16px #16496a20; }
.completion-panel h1 { font-size: 39px; line-height: 1.05; letter-spacing: -.6px; margin: 0 0 5px; color: #103772; }
.completion-message { font-size: 15px; margin: 0; line-height: 1.4; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; text-align: left; }
.result-stats > div { display: flex; align-items: center; gap: 9px; padding: 10px; background: #e5f5ff; border-radius: 12px; }
.result-stats span { font-size: 12px; color: #153b70; }
.result-stats strong { display: block; margin-top: 2px; font-size: 18px; }
.stat-icon { width: 30px; height: 30px; flex-shrink: 0; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.time-icon { stroke: #2586ee; fill: none; }
.star-icon { stroke: #efb43c; fill: #ffd467; }
.effort-message { color: #1766ac; font-size: 18px; font-style: italic; margin: 13px 0; }
.effort-message span { color: #e76690; }
.completion-panel .stack { gap: 8px; }
.completion-panel button { min-height: 44px; padding: 10px 16px; font-size: 15px; border-radius: 12px; }
.completion-panel .primary { background: linear-gradient(#40a665, #298549); box-shadow: 0 2px 0 #24713f; text-shadow: 0 1px 1px #225e38; }
.completion-panel .primary:hover { background: #27824a; }
.completion-panel .secondary { background: #f0eeeb; border-color: #dfdcd8; color: #163d72; }
@media (min-width: 1000px) {
  #game-screen .board { max-width: min(560px, 68vh); margin-left: 80px; margin-right: 190px; }
  .game-instruction { position: absolute; right: 4px; top: 180px; z-index: 1; width: 155px; padding: 20px 12px; color: #69421d; background: #efd098; border: 3px solid #d4a86b; border-radius: 12px; transform: rotate(4deg); box-shadow: 0 4px 0 #a8743d; }
  #game-screen .game-meadow { padding-top: 28px; }
}
@media (max-width: 560px) {
  body.child-mode { background-attachment: scroll; }
  #complete-screen { width: min(100%, 340px); margin-top: 0; }
  .completion-panel { padding: 16px 18px; }
  .completion-mascot { margin-bottom: -42px; }
}

/* A woodland progress journal for adults: portraits, clear rows, warm paper. */
body.adult-workspace { background: #f6f7ed; }
.adult-workspace .site-header { background: #234d50; border-right: 5px solid #d8e5cf; }
.adult-workspace .brand-mark { background: #43766b; }
.adult-workspace nav .current, .adult-workspace nav > button:hover { background: #3b706a; }
.adult-workspace .site-header::after { content: "Play. Learn. Grow."; margin-top: auto; padding: 100px 0 12px; color: #d1e5d7; font-family: "Baloo", sans-serif; font-size: 21px; background: url('/static/assets/paw.svg') center 28px / 46px no-repeat; text-align: center; }
.adult-workspace main { max-width: 1190px; padding-top: 28px; }
.adult-workspace h1, .adult-workspace h2, .dashboard-child strong { font-family: "Baloo", "Trebuchet MS", sans-serif; font-weight: 700; }
.adult-workspace h1 { color: #284f48; }
.animal-portrait { display: inline-block; width: 68px; height: 68px; flex-shrink: 0; background-image: url('/static/assets/animal-portraits.png'); background-size: 300% 200%; background-repeat: no-repeat; }
.animal-portrait[data-animal="fox"] { background-position: 0 0; }
.animal-portrait[data-animal="lion"] { background-position: 50% 0; }
.animal-portrait[data-animal="panda"] { background-position: 100% 0; }
.animal-portrait[data-animal="rabbit"] { background-position: 0 100%; }
.animal-portrait[data-animal="koala"] { background-position: 50% 100%; }
.animal-portrait[data-animal="frog"] { background-position: 100% 100%; }
.adult-workspace .dashboard-heading { position: relative; min-height: 220px; padding: 30px 34px; border-radius: 12px 36px 12px 36px; overflow: hidden; background: #d4edf0 url('/static/assets/woodland.jpg') center 12% / cover; border: 1px solid #c6ddd1; }
.dashboard-heading > div { position: relative; z-index: 1; }
.dashboard-heading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #e8f5e8 25%, #e8f5e8ed 50%, #e8f5e833); }
.dashboard-kicker { color: #4c6c59; font-size: 11px; font-weight: bold; letter-spacing: 1px; margin: 0 0 8px; }
.dashboard-heading h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; margin-bottom: 12px; }
.dashboard-heading .muted { color: #3e6057; line-height: 1.5; margin: 0; }
.dashboard-guide { position: absolute; width: 180px; height: 180px; right: 22px; bottom: -5px; }
.dashboard-list-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 8px; gap: 14px; }
.dashboard-list-heading h2 { font-size: 28px; color: #284f48; margin: 0; }
#dashboard-add { background: #357255; color: white; box-shadow: 0 3px 0 #24503a; border-radius: 10px; }
.adult-workspace .dashboard-register { padding: 0; background: transparent; border: 0; box-shadow: none; }
#dashboard-table table { border-collapse: separate; border-spacing: 0 9px; table-layout: auto; }
#dashboard-table th { padding: 6px 16px; color: #526956; border: 0; font-size: 12px; }
#dashboard-rows tr { --row-paper: #fff6e3; --row-edge: #e6d5aa; }
#dashboard-rows tr:nth-child(3n+2) { --row-paper: #edf5ed; --row-edge: #c7dcc8; }
#dashboard-rows tr:nth-child(3n+3) { --row-paper: #fff0ea; --row-edge: #e9cfc0; }
#dashboard-rows td { background: var(--row-paper); border-top: 1px solid var(--row-edge); border-bottom: 2px solid var(--row-edge); padding: 12px 16px; color: #3e514d; }
#dashboard-rows td:first-child { border-left: 1px solid var(--row-edge); border-radius: 16px 0 0 16px; }
#dashboard-rows td:last-child { border-right: 1px solid var(--row-edge); border-radius: 0 16px 16px 0; }
.dashboard-child { min-width: 180px; }
.dashboard-child .animal-portrait { vertical-align: middle; margin-right: 10px; }
.dashboard-child strong { font-size: 22px; color: #284f48; vertical-align: middle; display: inline-block; max-width: 160px; overflow-wrap: anywhere; }
#dashboard-rows td:nth-child(3) { font-size: 22px; font-family: "Baloo", sans-serif; font-weight: 700; }
#dashboard-rows .secondary { background: #fffdf5; border: 1px solid #bacdb8; color: #315b46; white-space: nowrap; font-size: 13px; padding: 10px 12px; box-shadow: 0 2px 0 #cad7bb; }
#dashboard-rows .secondary:hover { background: #e0ecd9; }
#dashboard-empty { padding: 30px; background: #fff9eb; border: 1px dashed #c8b988; border-radius: 16px; }
@media (max-width: 1150px) {
  #dashboard-table table, #dashboard-rows { display: block; }
  #dashboard-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #dashboard-rows tr { display: grid; grid-template-columns: 1fr 1fr; background: var(--row-paper); border: 1px solid var(--row-edge); border-bottom-width: 3px; border-radius: 16px; padding: 12px 18px; margin: 12px 0; }
  #dashboard-rows td, #dashboard-rows td:first-child, #dashboard-rows td:last-child { display: block; border: 0; border-radius: 0; padding: 8px 0; min-width: 0; }
  #dashboard-rows .dashboard-child { grid-column: 1 / -1; }
  #dashboard-rows td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; color: #637266; font: 12px "Trebuchet MS", sans-serif; margin-bottom: 4px; }
  #dashboard-rows td:last-child { align-self: end; text-align: right; }
  .dashboard-heading h1 { max-width: 330px; }
  .dashboard-guide { width: 125px; height: 125px; right: 0; }
}
@media (max-width: 600px) {
  .adult-workspace .site-header::after { display: none; }
  .adult-workspace .site-header { border-right: 0; border-bottom: 4px solid #d8e5cf; }
  .adult-workspace .dashboard-heading { padding: 22px; min-height: 215px; align-items: start; background-size: auto 700px; background-repeat: no-repeat; }
  .dashboard-heading h1 { max-width: 240px; }
  .dashboard-heading .muted { max-width: 205px; font-size: 13px; }
  .dashboard-guide { width: 96px; height: 96px; right: -8px; bottom: -2px; }
  .dashboard-list-heading h2 { font-size: 25px; }
  #dashboard-add { font-size: 13px; padding: 10px 12px; }
}
.adult-workspace .brand { white-space: normal; }
.adult-workspace .brand span { margin-right: 0; }
.adult-workspace nav { min-width: 0; }
@media (min-width: 601px) and (max-width: 1000px) {
  .adult-workspace .brand { font-size: 14px; }
  .adult-workspace .site-header::after { font-size: 17px; }
}

/* Screen-by-screen storybook pass: shared drawings, distinct page compositions. */
h1, h2, .brand, .book-label, .login-guide p, .profile-guide p, .about-guide > p { font-family: "Baloo", "Trebuchet MS", sans-serif; font-weight: 700; }
h1 { line-height: 1.12; }
h2 { line-height: 1.2; }
.brand-mark { background: #34786a url('/static/assets/paw.svg') center / 65% no-repeat !important; }
.story-guide { display: inline-block; width: 180px; height: 180px; background: url('/static/assets/story-guides.png') no-repeat; background-size: 300% 200%; flex-shrink: 0; }
.story-guide[data-animal="owl"] { background-position: 0 0; }
.story-guide[data-animal="giraffe"] { background-position: 50% 0; }
.story-guide[data-animal="turtle"] { background-position: 100% 0; }
.story-guide[data-animal="dog"] { background-position: 0 100%; }
.story-guide[data-animal="cat"] { background-position: 50% 100%; }
.story-guide[data-animal="pig"] { background-position: 100% 100%; }
.card .illustrated-face, .match-card .illustrated-face { display: block; width: 85%; height: auto; aspect-ratio: 1; }
.book-label { color: #66765b; font-size: 15px; margin: 0 0 4px; }
/* S01: an owl beside a compact welcome form, as on the concept board. */
.welcome-layout { position: relative; width: min(100%, 720px); margin: auto; justify-content: flex-end; align-items: center; padding: 30px 50px 60px 0; }
.login-guide { position: absolute; left: 0; top: 90px; width: 280px; text-align: center; }
.login-guide .story-guide { width: 260px; height: 260px; }
.login-guide p { color: #174b6e; font-size: 23px; line-height: 1.15; margin: -8px 0 0; transform: rotate(-5deg); }
.login-panel { position: relative; width: 350px; padding: 28px; border-radius: 24px 24px 18px 18px; border: 2px solid #e2edf0; }
.login-panel h1 { font-size: 38px; margin-bottom: 6px; }
.login-panel > p { margin: 0 0 20px; }
.login-panel label { color: #34596d; font-size: 13px; }
.login-panel input { background: #f9fcff; }
/* S02: real animal portraits, small player cards and one clear play action. */
#children-screen { max-width: 900px; }
#children-screen h1 { font-size: 38px; text-shadow: 0 2px #ffffff99; }
.child-list { align-items: start; }
.child-card { background: #fffef7; border: 2px solid #d9e6d0; border-bottom: 5px solid #bcd4b0; padding: 14px 16px; border-radius: 22px; }
.child-card:nth-child(3n+2) { background: #f3fbff; border-color: #c9e3ef; border-bottom-color: #abcbdc; }
.child-card:nth-child(3n+3) { background: #fff5ef; border-color: #efdad1; border-bottom-color: #dec0b3; }
.child-card .child-avatar { display: block; width: 128px; height: 128px; border-radius: 0; margin: 0 auto; background-color: transparent; }
.child-card h2 { font-size: 28px; margin: 8px 0 4px; }
.child-card .primary { font-size: 17px; margin-top: 12px; }
.child-card .quiet { min-height: 44px; margin-top: 5px; }
.empty-friend { width: 115px; height: 115px; }
.add-child-button { background: #fffef4; border-color: #87a990; color: #316445; }
/* S03: a giraffe accompanies the form; the selected animal is always visible. */
#profile-screen { position: relative; max-width: 720px; padding-right: 190px; }
#profile-form { position: relative; border: 2px solid #d6e5d1; border-radius: 24px; padding: 24px 28px; background: #fffef8; }
.profile-heading { display: flex; align-items: center; gap: 12px; }
.profile-heading h1 { flex: 1; font-size: 29px; }
.profile-heading .animal-portrait { width: 68px; height: 68px; }
.profile-guide { position: absolute; right: 0; top: 85px; width: 190px; text-align: center; }
.profile-guide .story-guide { width: 190px; height: 190px; }
.profile-guide p { color: #225347; font-size: 25px; line-height: 1.15; transform: rotate(4deg); margin: 6px 0; }
#profile-form label { margin-top: 17px; }
#profile-form .muted { font-size: 13px; }
#profile-form .actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; }
#create-play { grid-column: 1 / -1; }
#archive-child { margin-top: 18px; font-size: 13px; }
/* S08: a child's illustrated journal, chart tabs, and a compact facts strip. */
.journal-heading { display: flex; gap: 18px; align-items: center; border-bottom: 2px solid #d8dfc9; padding-bottom: 18px; margin-bottom: 20px; }
.journal-heading > div { flex: 1; min-width: 0; }
.journal-heading h1 { margin: 0; overflow-wrap: anywhere; }
.journal-heading p.muted { margin: 8px 0 0; font-size: 13px; }
.journal-heading > .quiet { margin-left: auto; white-space: nowrap; padding: 10px; font-size: 13px; color: #3e6854; }
#history-portrait .animal-portrait, .journal-owl { width: 95px; height: 95px; }
.range-filters { margin-top: 12px; gap: 6px; }
.range-filters button { background: #e7e8dc; color: #435d50; border-radius: 9px 9px 2px 2px; border-bottom: 3px solid #b9c3ac; min-height: 44px; }
.range-filters [aria-pressed="true"] { color: white; background: #3b7659; border-color: #24543c; }
#range-status { margin: 12px 0; font-size: 13px; }
.summary-grid { gap: 0; background: #fff9e8; border: 1px solid #dfd7b6; border-bottom: 3px solid #d8cda4; border-radius: 8px; margin: 20px 0 26px; }
.summary-grid .panel { background: transparent; border: 0; border-right: 1px dashed #d9ceb0; border-radius: 0; box-shadow: none; padding: 16px 20px; }
.summary-grid .panel:last-child { border-right: 0; }
.summary-grid span { color: #64725b; font-size: 12px; margin-bottom: 6px; }
.summary-grid strong { font-family: "Baloo", sans-serif; color: #35583e; font-size: 26px; }
.chart-panel { border-radius: 8px 18px 8px 8px; padding-top: 0; border-bottom: 3px solid #cbdde5 !important; }
.chart-panel h2 { background: #e0eef9; padding: 12px; margin: 0 -12px 16px; border-radius: 7px 17px 0 0; font-size: 19px; color: #285b84; }
.chart-panel:nth-child(2) { border-bottom-color: #c9ddbd !important; }
.chart-panel:nth-child(2) h2 { background: #e7f1df; color: #3b683f; }
.chart-panel:nth-child(3) { border-bottom-color: #ead4af !important; }
.chart-panel:nth-child(3) h2 { background: #fff0d9; color: #815927; }
.history-list { display: block; border-top: 1px solid #d7dfc9; }
.history-card { display: grid; grid-template-columns: 120px 1fr 1fr auto; align-items: center; gap: 10px 18px; padding: 16px 0; border: 0 !important; border-bottom: 1px dashed #c9d4bd !important; border-radius: 0; background: transparent; box-shadow: none; }
.history-card h2 { font-size: 21px; margin: 0; grid-row: span 2; }
.history-card p { font-size: 13px; margin: 0; }
.history-card p:nth-of-type(3) { grid-column: 2 / 4; }
.history-card button { grid-column: 4; grid-row: 1 / 3; }
/* S09: game notes with ruled facts and a highlighted next step. */
#detail-screen { max-width: 950px; margin: auto; }
#detail-screen .detail-columns > .panel { background: #fffef8; border-color: #e2ddc4; border-bottom: 3px solid #ded5b5; border-radius: 8px; }
#detail-screen h2 { font-size: 23px; color: #395f47; margin-top: 0; }
.facts { gap: 0; }
.facts dt, .facts dd { border-bottom: 1px dashed #dedfcf; padding: 11px 0; font-size: 14px; }
.facts dt { color: #5c6e5e; }
.facts dd { color: #354c3f; padding-left: 10px; overflow-wrap: anywhere; }
#game-scores dt:last-of-type, #game-scores dd:last-of-type { background: #e0efd5; color: #2d613c; padding: 12px 8px; border-bottom: 0; font-weight: bold; }
.adult-workspace .next-game-note { border: 1px solid #c4d9bb; background: #eaf3df; border-radius: 6px 18px 18px 6px; border-left: 6px solid #78a46b; }
#next-difficulty { font-weight: bold; color: #2b613c; }
#score-context { font-size: 12px; }
.attempt-details { box-shadow: none; background: #fffef8; border-radius: 8px; }
/* S10: four numbered pages with the turtle from the concept board. */
#about-screen { position: relative; max-width: 880px; margin: auto; padding-left: 190px; }
.about-guide { position: absolute; left: 0; top: 45px; width: 190px; text-align: center; }
.about-guide > p { color: #367257; font-size: 32px; line-height: 1.15; transform: rotate(-6deg); margin: 0 0 15px; }
.about-guide > p span { color: #d8677d; display: block; font-size: 26px; }
.about-guide .story-guide { width: 200px; height: 200px; }
.adult-workspace .about-book { background: #fffef7; border: 1px solid #e0dcc5; border-left: 8px solid #ddd6b9; border-radius: 8px 24px 24px 8px; padding: 28px; }
.about-book h1 { margin-top: 0; }
.story-steps { list-style: none; counter-reset: steps; padding: 0; margin: 0; }
.story-steps li { counter-increment: steps; position: relative; padding-left: 44px; margin: 24px 0; }
.story-steps li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #307cbb; color: white; font-family: "Baloo", sans-serif; font-size: 21px; }
.story-steps li:nth-child(2)::before { background: #3d804e; }
.story-steps li:nth-child(3)::before { background: #b86b26; }
.story-steps li:nth-child(4)::before { background: #86649b; }
#about-screen .story-steps h2 { color: #31523c; font-size: 21px; margin: 0 0 6px; }
.story-steps p { margin: 0; font-size: 14px; line-height: 1.6; }
.learning-note { border-top: 1px dashed #d2d7bd; padding-top: 14px; font-size: 12px; }
/* M01 and the adult account share the same quiet, illustrated paper treatment. */
#leave-dialog { width: min(360px, calc(100% - 32px)); background: #fffef7; border: 2px solid #d4e3c5; border-radius: 24px; padding: 24px; }
#leave-dialog::backdrop { background: #193f3b88; backdrop-filter: blur(5px); }
#leave-dialog h2 { font-size: 29px; color: #153d70; margin: 0; }
#leave-dialog p { font-size: 14px; margin: 10px 0 0; }
.leave-friend { width: 140px; height: 140px; display: block; margin: 8px auto -4px; }
#leave-dialog .secondary { background: #f0eeeb; color: #24446b; border-color: #ddd9d2; }
#account-screen { position: relative; max-width: 580px; background: #fffbed; border: 1px solid #ddd5b8; border-bottom: 4px solid #d2c79d; padding: 32px; border-radius: 12px; }
.account-guide { float: right; width: 100px; height: 100px; }
#account-screen dt { color: #698062; font-size: 13px; }
#account-screen dd { color: #284d3e; font-size: 18px; border-bottom: 1px dashed #d9d6be; padding-bottom: 14px; }
#account-screen > p:not(.book-label) { color: #61715b; font-size: 13px; }
@media (max-width: 1000px) {
  .journal-heading { flex-wrap: wrap; gap: 12px; }
  .journal-heading > .quiet { margin-left: 0; }
  #history-portrait .animal-portrait, .journal-owl { width: 72px; height: 72px; }
  #about-screen { padding-left: 0; }
  .about-guide { position: relative; top: auto; display: flex; align-items: center; justify-content: center; width: auto; gap: 12px; margin-bottom: -8px; }
  .about-guide > p { font-size: 25px; margin: 0; }
  .about-guide .story-guide { width: 140px; height: 140px; }
  .history-card { grid-template-columns: 1fr 1fr; }
  .history-card h2 { grid-row: auto; }
  .history-card p:nth-of-type(3) { grid-column: auto; }
  .history-card button { grid-column: 2; grid-row: 3; }
}
@media (max-width: 700px) {
  .welcome-layout { padding: 20px 0 50px; justify-content: center; }
  .login-guide { position: relative; left: auto; top: auto; width: 140px; margin-right: -25px; z-index: 1; }
  .login-guide .story-guide { width: 150px; height: 150px; }
  .login-guide p { font-size: 19px; }
  #profile-screen { padding-right: 0; max-width: 500px; }
  .profile-guide { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; top: auto; right: auto; width: auto; margin-bottom: -15px; }
  .profile-guide .story-guide { width: 120px; height: 120px; }
  .profile-guide p { font-size: 22px; margin: 0; }
  .detail-columns { grid-template-columns: 1fr; }
}
@media (max-width: 450px) {
  .welcome-layout { display: block; padding-top: 0; }
  .login-guide { width: auto; margin: 0 0 -12px; display: flex; align-items: center; justify-content: center; }
  .login-guide .story-guide { width: 105px; height: 105px; }
  .login-guide p { margin: 0; font-size: 18px; }
  .login-panel { margin: auto; padding: 24px; }
  #profile-form { padding: 18px; }
  .summary-grid .panel { padding: 12px; }
  .journal-heading h1 { font-size: 27px; }
  .journal-heading > div { flex-basis: 200px; }
  .about-book { padding: 22px 18px !important; }
}
