/* =========================================================================
   Bilo — stylesheet
   Light + dark themes, large touch targets, reduced-motion aware.
   ========================================================================= */

[hidden] { display: none !important; }

/* Nunito, shipped with the app so the look is the same offline and on every
   device (latin + latin-ext covers Turkish). */
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../assets/fonts/nunito-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../assets/fonts/nunito-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("../assets/fonts/nunito-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("../assets/fonts/nunito-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("../assets/fonts/nunito-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("../assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../assets/fonts/nunito-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* ---- Bilo brand tokens (source of truth: assets/brand/) ------------- */
  --brand:      #7D6BE0;
  --brand-2:    #CFC6FF;
  --brand-deep: #5A48C7;
  --brand-soft: #EEEAFF;

  --spark:      #F5B94D;
  --spark-deep: #A9711A;
  --spark-soft: #FFF0CF;

  --pink:       #F3A6B4;
  --pink-soft:  #FFE6EA;

  --success:      #6DBF93;
  --success-ink:  #2F7A55;
  --success-soft: #DDF2E6;

  --danger:      #E0526A;
  --danger-soft: #FDECEF;

  /* ---- mapped onto the app's semantic names --------------------------- */
  --violet: var(--brand);
  --violet-dark: var(--brand-deep);
  --teal: #12A4A0;
  --blue: #4C7DF0;
  --amber: var(--spark);
  --green: var(--success);
  --red: var(--danger);

  /* ---- "Pamuk" (v3.14): warm cream, pastel fills, almost no shadow -------
     Buttons are ink, not brand purple; the brand lives in the mascot, the
     logo and small accents. Tiles and cards take flat pastel fills. */
  --bg: #FAF6EF;
  --bg-tint: #FAF6EF;
  --surface: #FFFFFF;
  --surface-2: #F4EFE6;
  --text: #2B2540;
  --text-soft: #8A849E;
  --line: #ECE6DA;
  --primary: #2B2540;
  --primary-dark: #15112B;
  --primary-edge: #15112B;     /* the pressable bottom edge of .primary */
  --on-primary: #FFFFFF;
  --shadow: 0 2px 0 rgba(43, 37, 64, .05);
  --shadow-sm: 0 1px 0 rgba(43, 37, 64, .04);
  --wash-2: #FAF6EF;

  /* pastel fills (tiles, strips, nodes) */
  --lilac:  #E3DCFF;
  --sky:    #CFE6F5;
  --sage:   #CDE7D3;
  --peach:  #FFD9C2;
  --butter: #FFE9B3;
  --rose:   #FFE0E6;
  --lime:   #E8F2D4;
  --cloud:  #DCE8FF;
  --ink-tile: #2B2540;

  --radius: 28px;
  --radius-sm: 22px;
  --radius-btn: 18px;
  --tap: 48px;
}

[data-theme="dark"] {
  --bg: #1B1826;
  --bg-tint: #1B1826;
  --surface: #242032;
  --surface-2: #2D2840;
  --text: #F4F1FA;
  --text-soft: #A8A2BD;
  --line: #352F49;
  --brand: #B3A6FF;
  --brand-2: #8E7CFF;
  --brand-deep: #CFC6FF;
  --brand-soft: #2F2A4A;
  --primary: #E9E4FF;
  --primary-dark: #D8D0FF;
  --primary-edge: #B3A6FF;
  --on-primary: #1B1826;
  --spark-soft: #3D3118;
  --spark-deep: #FFD98A;
  --success: #7FD1A8;
  --success-soft: #1F3A2E;
  --success-ink: #9FE3C0;
  --pink-soft: #4A2E36;
  --wash-2: #1B1826;
  --shadow: none;
  --shadow-sm: none;
  --lilac: #332C52; --sky: #263A4A; --sage: #24402F; --peach: #4A3328;
  --butter: #473B1C; --rose: #47303A; --lime: #35421F; --cloud: #2A3550;
  --ink-tile: #3A3352;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #1B1826;
    --bg-tint: #1B1826;
    --surface: #242032;
    --surface-2: #2D2840;
    --text: #F4F1FA;
    --text-soft: #A8A2BD;
    --line: #352F49;
    --brand: #B3A6FF;
    --brand-2: #8E7CFF;
    --brand-deep: #CFC6FF;
    --brand-soft: #2F2A4A;
    --primary: #E9E4FF;
    --primary-dark: #D8D0FF;
    --primary-edge: #B3A6FF;
    --on-primary: #1B1826;
    --spark-soft: #3D3118;
    --spark-deep: #FFD98A;
    --success: #7FD1A8;
    --success-soft: #1F3A2E;
    --success-ink: #9FE3C0;
    --pink-soft: #4A2E36;
    --wash-2: #1B1826;
    --shadow: none;
    --shadow-sm: none;
    --lilac: #332C52; --sky: #263A4A; --sage: #24402F; --peach: #4A3328;
    --butter: #473B1C; --rose: #47303A; --lime: #35421F; --cloud: #2A3550;
    --ink-tile: #3A3352;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
               "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); letter-spacing: -.02em; }
h3 { font-size: 1.16rem; }
h4 { font-size: 1.08rem; }
p { margin: 0 0 12px; }
a { color: var(--primary); }

button { font: inherit; font-weight: 700; cursor: pointer; border: 0; }
:focus-visible {
  outline: 4px solid rgba(91, 63, 232, .35);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Headings and <main> are focused programmatically after navigation so that
   screen readers announce the new page. That is not a keyboard focus, so it
   should not paint a focus ring. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

.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 {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 12px 18px;
  border-radius: 12px; z-index: 50; box-shadow: var(--shadow);
}
.skip:focus { left: 12px; }

.app { width: min(1000px, 100% - 26px); margin: 0 auto; }

/* ------------------------------------------------------------------ top */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 0 14px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; min-width: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand-logo {
  width: 46px; height: 46px; flex: 0 0 auto; display: block;
  border-radius: 14px;
}
.hero-mascot { width: clamp(120px, 20vw, 190px); height: auto; display: block; position: relative; z-index: 2; }
.welcome-mascot { width: clamp(92px, 20vw, 118px); height: auto; margin: 0 auto; display: block; border-radius: 26px; box-shadow: var(--shadow-sm); }
.cert-logo { width: 4.6cqw; height: 4.6cqw; border-radius: 1.1cqw; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 1.14rem; letter-spacing: -.01em; }
.brand-text small { color: var(--text-soft); font-size: .82rem; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.star-pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--butter); color: #6B4A08; border: 0;
  border-radius: 999px; padding: 8px 14px; font-weight: 800;
}
[data-theme="dark"] .star-pill { color: #FFD98A; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .star-pill { color: #FFD98A; } }

.topnav { display: flex; gap: 4px; }
.nav-button {
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center; font-size: 20px;
  background: transparent; border-radius: 14px; color: inherit;
}
.nav-button:hover { background: var(--surface-2); }
.nav-button.active { background: var(--surface-2); }

.offline-banner {
  background: var(--butter); color: #6B4A08; border: 0;
  padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .92rem;
}

/* --------------------------------------------------------------- shared */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.eyebrow {
  display: inline-block; color: var(--brand);
  font-weight: 800; font-size: .72rem;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px;
}

.primary, .ghost, .danger-button, .chip-button {
  border-radius: var(--radius-btn); min-height: var(--tap); padding: 12px 20px;
  transition: transform .12s ease, background .15s ease;
}
.primary {
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 4px 0 var(--primary-edge);        /* "clay" edge: the button is a thing you press */
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.primary:hover { background: var(--primary-dark); }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-edge); }
.primary:disabled { opacity: .55; box-shadow: none; transform: none; }
.primary.big { font-size: 1.06rem; padding: 15px 26px; }
.primary.wide, .ghost.wide { width: 100%; margin-top: 16px; }

.ghost { background: transparent; color: var(--brand); }
.ghost:hover { background: var(--surface-2); }
.ghost.back { margin: 0 0 12px; padding-left: 12px; }

.danger-button { background: var(--red); color: #fff; }
.danger-text { color: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 0;
  border-radius: 999px; padding: 6px 12px;
  font-size: .82rem; font-weight: 700; color: var(--text-soft);
}
.chip.done { background: var(--sage); color: var(--success-ink); }
.chip.subtle { font-weight: 600; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-button {
  background: var(--surface-2); border: 1px solid transparent;
  color: var(--text); padding: 10px 18px;
}
.chip-button.active { background: var(--lilac); color: var(--text); }
[data-theme="dark"] .chip-button.active { color: #fff; }

.muted-text { color: var(--text-soft); }
.center { text-align: center; }
.small { font-size: .86rem; }

.progress-track {
  height: 10px; border-radius: 999px;
  background: var(--surface-2); border: 0;
  overflow: hidden; margin-top: 10px;
}
.progress-track.small { height: 7px; margin: 0; flex: 1; }
.progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--brand);
  transition: width .45s ease;
}
.progress-fill.amber { background: var(--spark); }

/* ----------------------------------------------------------------- home */

.hero {
  display: grid; grid-template-columns: 1.5fr .7fr;
  align-items: center; gap: 16px;
  padding: clamp(24px, 4.5vw, 40px);
  position: relative; overflow: hidden;
}
.hero-body { position: relative; z-index: 2; }
.hero p { color: var(--text-soft); font-size: 1.04rem; max-width: 52ch; }
.hero-next {
  display: block; width: fit-content; max-width: 100%;
  font-weight: 700; color: var(--text) !important;
  background: var(--surface); border: 0;
  border-radius: 12px; padding: 9px 14px; margin: 0 0 16px;
}
.hero-art { position: relative; display: grid; place-items: center; min-height: 130px; }
.orb { display: none; }

/* Bilo Arcade banner: the sister app's dark "arcade" look, kept on-brand */
.arcade-card {
  display: grid; grid-template-columns: 1.5fr .7fr; align-items: center; gap: 16px;
  margin-top: 18px; padding: clamp(20px, 4vw, 32px);
  background: var(--ink-tile);
  color: #fff; border-color: transparent; position: relative; overflow: hidden;
}
.arcade-card .eyebrow { color: #FFE68A; }
.arcade-card h3 { color: #fff; margin: 2px 0 6px; font-size: 1.35rem; }
.arcade-card p { color: rgba(255,255,255,.82); max-width: 48ch; margin: 0 0 14px; }
.arcade-body { position: relative; z-index: 2; }
.arcade-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--butter); color: #2B2540; box-shadow: 0 4px 0 #D9B860;
}
.arcade-btn:hover { background: #FFF0CF; color: #2B2540; }
.arcade-btn:active { box-shadow: 0 1px 0 #D9B860; }
.arcade-art { position: relative; display: grid; place-items: center; min-height: 120px; }
.arcade-art .mascot { position: relative; z-index: 2; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.arcade-pixel {
  position: absolute; width: 14px; height: 14px; border-radius: 3px; opacity: .85;
  animation: arcade-blink 2.4s ease-in-out infinite;
}
.arcade-pixel.p1 { background: #FF5C8A; top: 12%; left: 14%; }
.arcade-pixel.p2 { background: #12A4A0; bottom: 14%; left: 22%; animation-delay: .8s; }
.arcade-pixel.p3 { background: #FFE68A; top: 20%; right: 12%; animation-delay: 1.6s; }
@keyframes arcade-blink { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(.55); opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .arcade-pixel { animation: none; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.stat { padding: 18px; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.stat-total { font-size: 1rem; color: var(--text-soft); font-weight: 700; }
.stat-label { color: var(--text-soft); font-size: .9rem; font-weight: 600; }
.stat-note { color: var(--text-soft); font-size: .82rem; margin: 8px 0 0; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 26px 0 12px;
}
.section-head h3 { margin: 0; }

.unit-list, .lesson-list { display: grid; gap: 12px; }

.unit-card, .lesson-row, .quiz-teaser {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 16px; padding: 18px 20px;
}
.unit-card.locked { opacity: .58; }
.unit-card.has-badge { border-color: var(--sage); }
.unit-emoji {
  width: 54px; height: 54px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 27px;
  background: var(--surface-2); border-radius: 17px;
}
.unit-emoji.big { width: 66px; height: 66px; font-size: 33px; }
.unit-main h4 { margin: 0 0 4px; }
.unit-main p { color: var(--text-soft); margin: 0 0 8px; font-size: .93rem; }
.unit-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; color: var(--text-soft); font-weight: 600; }
.unit-meta .progress-track { max-width: 120px; }
.unit-action { display: flex; justify-content: flex-end; }
.locked-note { color: var(--text-soft); font-size: .85rem; font-weight: 600; text-align: right; max-width: 130px; }

.accent-violet .unit-emoji { background: var(--brand-soft); }
.accent-teal   .unit-emoji { background: #DFF5F3; }
.accent-blue   .unit-emoji { background: #E5EDFF; }
.accent-amber  .unit-emoji { background: var(--spark-soft); }
.accent-green  .unit-emoji { background: var(--success-soft); }
.accent-rose   .unit-emoji { background: var(--pink-soft); }
.accent-indigo .unit-emoji { background: #E8E5FF; }
.accent-orange .unit-emoji { background: #FFEBD8; }
.accent-cyan   .unit-emoji { background: #DFF3FA; }
.accent-lime   .unit-emoji { background: #EDF7DA; }
[data-theme="dark"] .unit-emoji { background: var(--surface-2); }
.unit-card { border: 1px solid var(--line); }

/* ---------------------------------------------------------------- levels */

.level { margin-bottom: 26px; }
.level-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.level-head h4 { margin: 0 0 3px; font-size: 1.12rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.level-head p { margin: 0; color: var(--text-soft); font-size: .92rem; }
.level-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.level.locked .unit-list { opacity: .72; }
.small-btn { padding: 9px 16px; min-height: 40px; font-size: .9rem; }
.level-done { margin: 10px 0 0; font-weight: 600; }
.cert-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cert-callout h3 { margin-bottom: 2px; }
.cert-callout p { margin: 0; }

.quiz-teaser.muted { opacity: .6; }
.parents-link { text-align: center; margin: 26px 0 8px; font-size: .9rem; }

/* --------------------------------------------------------------- lesson */

.unit-header { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.unit-header p { color: var(--text-soft); margin: 0; }
.unit-header h2 { margin: 0 0 4px; }

.lesson-row { grid-template-columns: auto 1fr auto; }
.lesson-row.done { background: var(--surface-2); }
.lesson-index {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; font-weight: 800;
  background: var(--surface-2); color: var(--text-soft);
}
.lesson-row.done .lesson-index { background: #d9f5e8; color: #14724f; }
[data-theme="dark"] .lesson-row.done .lesson-index { background: #16412f; color: #7fe0b6; }
.lesson-main h4 { margin: 0 0 3px; }
.lesson-main p { color: var(--text-soft); font-size: .92rem; margin: 0 0 7px; }

.lesson { padding: clamp(22px, 4.5vw, 38px); }
.lesson-head { display: flex; align-items: center; justify-content: space-between; }
.lesson-emoji { font-size: 40px; }
.lead { color: var(--text-soft); font-size: 1.06rem; }

.blocks { display: grid; gap: 12px; margin: 22px 0; }
.block {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px;
}
.block h3 { margin: 0 0 5px; font-size: 1.04rem; }
.block p { margin: 0; color: var(--text-soft); }

.callout {
  border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid var(--line);
}
.callout strong { display: block; margin-bottom: 4px; }
.callout p { margin: 0; }
.callout.try { background: var(--lilac); border-color: transparent; }
.callout.tip { background: var(--butter); border-color: transparent; }

/* ----------------------------------------------------------- checkpoint */

.checkpoint {
  margin-top: 26px; padding-top: 22px; border-top: 2px dashed var(--line);
}
.checkpoint h3 { font-size: 1.2rem; }
.options { display: grid; gap: 10px; margin: 14px 0; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: start;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 17px;
  color: var(--text); font-weight: 600; min-height: var(--tap);
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option .marker {
  width: 22px; height: 22px; flex: 0 0 auto;
  border: 2px solid var(--line); border-radius: 50%;
}
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.correct .marker { background: var(--green); border-color: var(--green); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); opacity: .82; }
.option:disabled { cursor: default; }
[data-theme="dark"] .option.correct { background: #123227; }
[data-theme="dark"] .option.wrong { background: #3a1c22; }

.feedback {
  border-radius: var(--radius-sm); padding: 15px 17px; margin-top: 12px;
  font-weight: 600; line-height: 1.5;
}
.feedback.good { background: var(--success-soft); color: var(--success-ink); border: 1px solid #BCEBD6; }
.feedback.bad  { background: var(--danger-soft); color: #A32F45; border: 1px solid #F7CBD4; }
.feedback.warn { background: var(--spark-soft); color: var(--spark-deep); border: 1px solid #FFDE9B; }
[data-theme="dark"] .feedback.good { background: #123227; color: #7fe0b6; border-color: #1d5540; }
[data-theme="dark"] .feedback.bad  { background: #3a1c22; color: #ffb3bf; border-color: #6b2f3a; }
[data-theme="dark"] .feedback.warn { background: #3a2c10; color: #ffd28a; border-color: #6b5218; }

.bonus {
  display: inline-block; margin-left: 6px; padding: 2px 9px;
  background: var(--spark-soft); color: var(--spark-deep); border-radius: 999px;
  font-size: .84rem; font-weight: 800;
}
.lesson-actions { margin-top: 20px; }

/* ----------------------------------------------------------------- quiz */

.quiz { padding: clamp(22px, 4.5vw, 38px); }
.question { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 20px 0 8px; }
.question:first-of-type { border-top: 0; }
.question legend { font-weight: 800; font-size: 1.05rem; padding: 0 0 10px; }
.answer {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; min-height: var(--tap);
}
.answer:hover { background: var(--surface-2); }
.answer input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--primary); }
.answer.is-answer { border-color: var(--green); background: #e9f9f1; }
[data-theme="dark"] .answer.is-answer { background: #123227; }

.explain {
  margin: 8px 0 0; padding: 11px 15px;
  border-radius: 12px; font-size: .92rem; line-height: 1.5;
}
.explain.good { background: #e9f9f1; color: #14724f; }
.explain.bad { background: #fdecee; color: #97283a; }
[data-theme="dark"] .explain.good { background: #123227; color: #7fe0b6; }
[data-theme="dark"] .explain.bad { background: #3a1c22; color: #ffb3bf; }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* --------------------------------------------------------------- badges */

.page-head { margin: 4px 0 18px; }
.page-head p { color: var(--text-soft); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.badge { padding: 20px; text-align: center; }
.badge h4 { margin: 10px 0 5px; font-size: 1rem; }
.badge p { color: var(--text-soft); font-size: .87rem; min-height: 40px; }
.badge-icon {
  width: 72px; height: 72px; margin: 0 auto;
  display: grid; place-items: center; font-size: 36px;
  border-radius: 22px; background: var(--spark-soft);
}
.badge.locked .badge-icon { filter: grayscale(1); opacity: .35; background: var(--surface-2); }
.badge.earned { border-color: #FFD98A; }

/* ------------------------------------------------------------- settings */

.setting { padding: 20px 22px; margin-bottom: 12px; }
.setting h3 { margin-bottom: 8px; }
.setting p { margin-bottom: 10px; }
.setting.danger { border-color: #f6c7ce; }
[data-theme="dark"] .setting.danger { border-color: #6b2f3a; }

.curriculum { padding-left: 20px; }
.curriculum > li { margin-bottom: 12px; }
.curriculum ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-soft); }
.curriculum ul li { margin-bottom: 3px; }

/* ----------------------------------------------------------- onboarding */

.welcome {
  padding: clamp(28px, 6vw, 48px);
  text-align: center;
  max-width: 620px; margin: 12px auto 0;
}
.welcome h2 { margin: 10px 0 12px; }
.welcome .lead { max-width: 44ch; margin: 0 auto 8px; }
.welcome-dots { justify-content: center; margin-bottom: 18px; }
.welcome-emoji { font-size: clamp(64px, 14vw, 92px); line-height: 1; }

.welcome-langs { display: grid; gap: 12px; margin: 22px 0 6px; }
.lang-choice {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; min-height: 72px;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text);
  font-weight: 800; font-size: 1.1rem;
}
.lang-choice:hover { border-color: var(--primary); }
.lang-choice.active { border-color: var(--primary); background: var(--brand-soft); }
[data-theme="dark"] .lang-choice.active { background: #23214d; }
.lang-choice .flag { font-size: 30px; }

.welcome-points { list-style: none; padding: 0; margin: 22px 0 6px; display: grid; gap: 12px; text-align: start; }
.welcome-points li {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.welcome-points li > span { font-size: 28px; }
.welcome-points strong { display: block; }
.welcome-points small { color: var(--text-soft); }

.welcome-ready {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px; margin-top: 18px;
}
.welcome-ready p { margin: 4px 0 0; color: var(--text-soft); }
.welcome-actions { margin-top: 24px; display: grid; gap: 8px; justify-items: center; }
.welcome-actions .wide { margin-top: 0; }

/* ----------------------------------------------------------- read aloud */

.listen-bar { margin: 2px 0 14px; }
.listen-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: 999px; padding: 10px 20px; min-height: 46px;
  color: var(--primary); font-weight: 800;
}
.listen-btn:hover { border-color: var(--primary); }
.listen-btn.playing { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.listen-icon { font-size: 18px; }

/* Whatever is being read is gently highlighted so she can follow along. */
.speaking {
  background: var(--butter) !important;
  box-shadow: 0 0 0 3px var(--butter);
  border-radius: 10px;
  transition: background .2s ease;
}

/* ------------------------------------------------------------ activities */

.activity {
  padding: 20px 22px; margin-bottom: 12px;
  border: 2px solid var(--lilac); background: var(--surface);
}
.activity.done { border-color: var(--sage); }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.activity h3 { margin: 2px 0 4px; font-size: 1.16rem; }
.activity-body { margin-top: 14px; }

.sort-progress { color: var(--text-soft); font-size: .84rem; font-weight: 700; margin-bottom: 8px; }
.sort-item {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px;
  font-weight: 700; font-size: 1.04rem; text-align: center; margin-bottom: 12px;
}
.sort-buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bucket {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 12px; min-height: 88px;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text); font-weight: 700;
}
.bucket:hover:not(:disabled) { border-color: var(--primary); }
.bucket-emoji { font-size: 26px; }
.bucket.correct { border-color: var(--green); background: #e9f9f1; }
.bucket.wrong { border-color: var(--red); background: #fdecee; }
[data-theme="dark"] .bucket.correct { background: #123227; }
[data-theme="dark"] .bucket.wrong { background: #3a1c22; }

.rank-list { display: grid; gap: 10px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; text-align: start;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 17px;
  color: var(--text); font-weight: 600; min-height: var(--tap);
}
.rank-item:hover:not(:disabled) { border-color: var(--primary); }
.rank-badge {
  width: 30px; height: 30px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--line);
  font-weight: 800; font-size: .9rem;
}
.rank-item.picked { border-color: var(--green); background: #e9f9f1; opacity: .85; }
.rank-item.picked .rank-badge { background: var(--green); color: #fff; border-color: var(--green); }
[data-theme="dark"] .rank-item.picked { background: #123227; }
.shake { animation: shake .35s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.activity-score { font-size: 1.3rem; font-weight: 800; text-align: center; margin: 6px 0 12px; }

/* ------------------------------------------------------- daily challenge */

.daily-card {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 18px;
  padding: 20px 24px; margin-bottom: 14px;
  border: 2px solid transparent;
}
.daily-card.live { background: var(--lilac); color: var(--text); }
.daily-card.live .eyebrow { color: var(--brand-deep); }
.daily-card.live .chip { background: rgba(255,255,255,.5); color: var(--text); }
[data-theme="dark"] .daily-card.live .chip { background: rgba(255,255,255,.12); }
.daily-card.done { background: var(--sage); border-color: transparent; }
[data-theme="dark"] .daily-card.done { color: var(--text); }

.daily-icon {
  width: 62px; height: 62px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 30px;
  border-radius: 20px; background: rgba(255,255,255,.55);
}
[data-theme="dark"] .daily-icon { background: rgba(255,255,255,.1); }
[data-theme="dark"] .daily-card.done .daily-icon { background: #16412f; }
.daily-title { font-size: 1.32rem; margin: 2px 0 6px; line-height: 1.25; }
.daily-body p { margin: 0 0 8px; opacity: .92; font-size: .96rem; }
.daily-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.daily-action { display: flex; }

.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

.daily-quiz { padding: clamp(22px, 4.5vw, 36px); }
.daily-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dots { display: flex; gap: 6px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line); transition: background .2s ease, transform .2s ease;
}
.dot.past { background: var(--green); }
.dot.now { background: var(--primary); transform: scale(1.35); }

.big-emoji { font-size: 58px; line-height: 1; margin-bottom: 6px; }
.daily-result h2 { margin: 6px 0 10px; }
.center-actions { justify-content: center; }

/* ---------------------------------------------------------------- trivia */

.trivia-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 16px 22px; margin-bottom: 14px;
}
.trivia-card .daily-icon { background: var(--spark-soft); }
.trivia-card .daily-title { font-size: 1.12rem; margin: 0 0 3px; }
.trivia-card p { margin: 0 0 6px; color: var(--text-soft); font-size: .92rem; }
.trivia-setup { padding: clamp(24px, 5vw, 40px); text-align: center; max-width: 620px; margin: 0 auto; }
.trivia-setup .lead { max-width: 46ch; margin: 0 auto 8px; }
.trivia-label { margin: 18px 0 8px; font-size: 1rem; color: var(--text-soft); }
.center-row { justify-content: center; }
.trivia-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.mode-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 12px; background: var(--surface-2); border: 2px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text);
}
.mode-card.active { border-color: var(--primary); background: var(--brand-soft); }
.mode-card small { color: var(--text-soft); font-weight: 600; }
.mode-emoji { font-size: 26px; }
.trivia-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.chip.timer { font-variant-numeric: tabular-nums; }
.chip.timer.urgent { background: var(--danger-soft); color: #A32F45; border-color: #F7CBD4; }
.timer-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 0 0 14px; }
.timer-fill { height: 100%; width: 100%; background: var(--spark); transition: width 1s linear; }

@media (max-width: 760px) {
  .trivia-card { grid-template-columns: auto 1fr; row-gap: 10px; }
  .trivia-card .daily-action { grid-column: 1 / -1; }
  .trivia-card .daily-action button { width: 100%; }
}

/* ------------------------------------------------------ glossary/search */

.search-box { position: relative; margin: 4px 0 18px; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 18px; pointer-events: none; opacity: .65;
}
.search-box input {
  width: 100%; font: inherit; padding: 14px 16px 14px 48px; min-height: 52px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.search-box input:focus { border-color: var(--primary); outline: none; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

.result-head { margin: 20px 0 10px; font-size: 1rem; color: var(--text-soft); }
.term-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.term { padding: 18px 20px; }
.term h4 { margin: 0 0 6px; color: var(--primary); }
.term p { color: var(--text-soft); font-size: .93rem; margin: 0 0 10px; }
.term .small-btn { padding: 7px 12px; min-height: 36px; font-size: .84rem; text-align: start; }

/* ------------------------------------------------------------------ pack */

.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.pack-item {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
}
.pack-item strong { font-size: 1.02rem; }
.pack-item small { color: var(--text-soft); flex: 1; }
.pack-item button { margin-top: 6px; }
.field.compact { margin: 4px 0 0; }
.field.compact select {
  width: 100%; font: inherit; padding: 10px 12px; min-height: 44px;
  border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
.field.compact select:focus { border-color: var(--primary); outline: none; }

/* ---------------------------------------------------------- certificate */

.field { display: block; margin: 14px 0 6px; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field input {
  width: 100%; font: inherit; padding: 13px 16px; min-height: var(--tap);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}
.field input:focus { border-color: var(--primary); outline: none; }
.next-level { border-color: #cdd6ff; }

.certificate-wrap { margin: 18px 0; }
.certificate {
  background: #fffdf7;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  color: #2b2a4a;
  /* A4 landscape proportions so the print preview matches the screen */
  aspect-ratio: 297 / 210;
  container-type: inline-size;
}
.cert-border {
  height: 100%;
  border: 3px double #c9a227;
  border-radius: 16px;
  padding: 4cqw 5cqw;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 12% 12%, rgba(201,162,39,.09), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(108,99,255,.09), transparent 34%);
}
.cert-top { display: flex; align-items: center; gap: 2cqw; margin-bottom: 1.5cqw; }
.cert-logo { font-size: 4.4cqw; }
.cert-app { font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: 1.7cqw; color: #6c63ff; }
.cert-title { font-size: 5.6cqw; margin: 0 0 .4cqw; letter-spacing: -.01em; color: #2b2a4a; }
.cert-sub { font-size: 2.5cqw; color: #8a6d1f; font-weight: 700; margin: 0 0 2.6cqw; letter-spacing: .04em; }
.cert-awarded { font-size: 1.9cqw; color: #6a6a86; margin: 0; }
.cert-name {
  font-size: 6.2cqw; font-weight: 800; margin: .8cqw 0; line-height: 1.1;
  color: #4b41d8; border-bottom: 2px solid #e3ddb8; padding: 0 4cqw .8cqw;
  max-width: 92%; word-break: break-word;
}
.cert-body { font-size: 2.1cqw; color: #4a4a68; max-width: 74%; margin: 1.6cqw 0 0; line-height: 1.5; }
.cert-stats { display: flex; gap: 5cqw; margin: 2.8cqw 0 0; }
.cert-stats div { display: flex; flex-direction: column; }
.cert-stats strong { font-size: 3.2cqw; color: #6c63ff; line-height: 1; }
.cert-stats span { font-size: 1.6cqw; color: #6a6a86; text-transform: uppercase; letter-spacing: .06em; }
.cert-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  width: 100%; margin-top: auto; padding-top: 2.6cqw; gap: 3cqw;
}
.cert-foot div { display: flex; flex-direction: column; min-width: 22%; }
.cert-foot span { font-size: 1.5cqw; color: #8a8aa3; text-transform: uppercase; letter-spacing: .07em; }
.cert-foot strong { font-size: 1.9cqw; border-top: 1px solid #d8d3b4; padding-top: .7cqw; margin-top: .5cqw; }
.cert-foot div:last-child { text-align: right; }
.cert-seal { font-size: 5cqw; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px 20px; z-index: 40; max-width: min(420px, calc(100% - 32px));
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-emoji { font-size: 30px; }

.footer { text-align: center; color: var(--text-soft); font-size: .85rem; padding: 30px 0 34px; }
.footer a { color: var(--text-soft); }
.foot-made { margin-top: 4px; font-size: .78rem; opacity: .75; letter-spacing: .02em; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand-text small { display: none; }

  /* Stack the daily card so the button gets a full-width row of its own
     instead of being squeezed into a third column. */
  .daily-card { grid-template-columns: auto 1fr; row-gap: 14px; padding: 18px 20px; }
  .daily-action { grid-column: 1 / -1; }
  .daily-action button { width: 100%; }
  .daily-icon { width: 52px; height: 52px; font-size: 26px; border-radius: 17px; }
  .daily-title { font-size: 1.16rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; order: -1; }
  .arcade-card { grid-template-columns: 1fr; }
  .arcade-art { min-height: 0; order: -1; }
  .hero-mascot { width: 108px; }
  .orb { width: 130px; height: 130px; }
  .stats { grid-template-columns: 1fr; }
  .stat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; }
  .stat-value { font-size: 1.45rem; }
  .stat .progress-track { grid-column: 1 / -1; }
  .stat-note { grid-column: 1 / -1; }

  .unit-card, .lesson-row, .quiz-teaser {
    grid-template-columns: auto 1fr; row-gap: 12px;
  }
  .unit-action { grid-column: 1 / -1; justify-content: stretch; }
  .unit-action button { width: 100%; }
  .locked-note { max-width: none; text-align: center; width: 100%; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .badge p { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ---------------------------------------------------------------- print */

@page { size: A4 landscape; margin: 6mm; }

@media print {
  .topbar, .footer, .toast, .nav-button, .skip,
  .offline-banner, .no-print, .back { display: none !important; }

  html, body {
    background: #fff !important;
    color: #000;
    font-size: 12pt;
  }
  .app { width: 100%; }
  .card { box-shadow: none; }

  /* The certificate is the only thing that should reach the paper.
     Height is pinned to the printable area (A4 landscape 210mm minus the 6mm
     margins) instead of an aspect-ratio, because a 297:210 box is slightly
     taller than the page once margins are subtracted and spills to page 2. */
  .certificate-wrap { margin: 0; }
  .certificate {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    height: 197mm;
    aspect-ratio: auto;
    background: #fff;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cert-border { padding: 3.2cqw 5cqw; }
  .cert-border { border-color: #b8912a; }
  .cert-name { color: #3c33c0; }

  /* Anything that is not the certificate is dropped from the printout. */
  main > *:not(.certificate-wrap) { display: none !important; }
}

/* ---- Golden rules ------------------------------------------------------ */
.golden-rules { padding: 14px 18px; }
.golden-rules summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 800; font-size: 1.05rem; list-style: none; }
.golden-rules summary::-webkit-details-marker { display: none; }
.golden-rules .chev { transition: transform .2s; }
.golden-rules[open] .chev { transform: rotate(180deg); }
.golden-rules > p { margin: 8px 0 4px; }
.rule-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; counter-reset: rule; }
.rule-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--wash-2, var(--surface-2)); }
.rule-list li::before { counter-increment: rule; content: counter(rule); font-weight: 900; color: var(--primary); min-width: 1.2em; }
.rule-list .rule-emoji { font-size: 1.15rem; }
.rule-list li div { display: grid; gap: 2px; }
.rule-list li strong { font-size: .98rem; }
.rule-list li span:not(.rule-emoji) { color: var(--text-soft); font-size: .9rem; }
.rule-list.compact li { padding: 6px 8px; }
.rule-chip { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: #fff8; border: 1px solid #FFDE9B; font-size: .82rem; font-weight: 700; color: var(--text); }
[data-theme="dark"] .rule-chip, .dark .rule-chip { background: #0003; }
.level-goal { margin: 6px 0 0; font-size: .9rem; color: var(--text-soft); }
.level-goal strong { color: var(--text); }
@media print { .golden-rules { display: none; } }

/* ---- Profiles ---------------------------------------------------------- */
.profile-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 8px; min-height: 44px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; max-width: 140px; }
.profile-pill .profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.profile-pill:hover { border-color: var(--primary); }
@media (max-width: 420px) { .profile-pill .profile-name { display: none; } }
/* Narrow phones: the top bar must never overflow — drop the wordmark
   (the logo carries the brand), tighten the pills, keep 44px tap targets. */
@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .brand { gap: 0; }
  .brand-text { display: none; }
  .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
  .topbar-right { gap: 4px; flex: 1; justify-content: flex-end; min-width: 0; }
  .star-pill { padding: 6px 10px; font-size: .92rem; }
  .topnav { gap: 0; }
}
.profile-list { display: grid; gap: 12px; margin-bottom: 16px; }
.profile-card { display: flex; gap: 14px; align-items: flex-start; }
.profile-card.active { border: 2px solid var(--primary); }
.profile-avatar { font-size: 2rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-2); flex: none; }
.profile-body { flex: 1; min-width: 0; }
.profile-body h3 { margin: 0 0 4px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rename-box:not([hidden]) { display: flex; gap: 8px; margin-top: 8px; }
.rename-box input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font: inherit; }
.confirm-box { margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--danger-soft); }
.confirm-box p { margin: 0 0 8px; }
.danger-text { color: var(--danger); }
.emoji-row .emoji-choice { font-size: 1.3rem; padding: 6px 10px; }

/* ---- Cloud: account / classes ---------------------------------------- */
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip.warn { background: var(--spark-soft); border-color: #FFDE9B; color: var(--text); }
.login-box .field input { width: 100%; }
.cloud-kids, .class-list { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 8px; }
.cloud-kids li, .class-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.cloud-kids li div, .class-list li div { display: grid; flex: 1; min-width: 0; }
.cloud-kids .avatar { font-size: 1.4rem; }
.join-form { display: grid; gap: 8px; }
.join-form input, .join-form select { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font: inherit; background: var(--surface); color: var(--text); }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
.code-card { text-align: center; }
.big-code { font-size: 2.4rem; font-weight: 900; letter-spacing: .25em; color: var(--primary); user-select: all; margin-top: 4px; }
.board, .mini-board { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.board li, .mini-board li { display: grid; grid-template-columns: 2em 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.mini-board li { grid-template-columns: 2em 1fr auto; }
.board li.me, .mini-board li.me { outline: 2px solid var(--primary); }
.board .rank, .mini-board .rank { font-weight: 900; color: var(--primary); }
.board .who em { font-style: normal; color: var(--text-soft); font-size: .85rem; }
.class-card .class-card-head h3 { margin: 2px 0 6px; }
.table-wrap { overflow-x: auto; }
.roster { width: 100%; border-collapse: collapse; font-size: .9rem; }
.roster th, .roster td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster .lvls { display: flex; gap: 3px; }
.roster .lvl { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; font-weight: 800; background: var(--surface-2); color: var(--text-soft); }
.roster .lvl.part { background: var(--brand-soft); color: var(--primary); }
.roster .lvl.full { background: var(--primary); color: #fff; }

.backup-code { width: 100%; box-sizing: border-box; margin: 10px 0 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; background: var(--surface-2); color: var(--text); resize: vertical; }

/* ---- Course switcher --------------------------------------------------- */
.course-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .course-row { grid-template-columns: 1fr; } }
.course-card { display: flex; gap: 12px; align-items: center; text-align: start; padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); transition: transform .12s ease, border-color .15s ease; }
.course-card:hover { transform: translateY(-1px); }
.course-card.active { border-color: var(--course-accent, var(--brand)); }
.course-emoji { font-size: 1.8rem; }
.course-body { display: grid; gap: 4px; flex: 1; min-width: 0; }
.course-body strong { font-size: 1.02rem; }
.course-card .progress-track { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.course-card .progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--course-accent, var(--primary)); }

/* ---- Admin ------------------------------------------------------------- */
.visit-bars { display: flex; align-items: flex-end; gap: 6px; padding-top: 8px; }
.vday { display: grid; justify-items: center; gap: 4px; flex: 1; }
.vbar { width: 100%; max-width: 26px; background: var(--brand-soft); border-radius: 6px 6px 3px 3px; display: flex; flex-direction: column-reverse; overflow: hidden; }
.vapp { background: var(--primary); width: 100%; }
.vbar.lesson { background: #34d399; }
.vlabel { font-size: .7rem; color: var(--text-soft); }
/* ------------------------------------------------------------ Star Shop */
[data-accent="okyanus"] { --brand: #0B7BD0; --brand-2: #3DA5F5; --brand-deep: #075A9C; --brand-soft: #E3F2FF; }
[data-accent="orman"] { --brand: #148A46; --brand-2: #2FB56A; --brand-deep: #0C6331; --brand-soft: #E2F7EA; }
[data-accent="gunbatimi"] { --brand: #E86A2E; --brand-2: #FF8F55; --brand-deep: #B34A17; --brand-soft: #FFEDE2; }
[data-accent="seftali"] { --brand: #E0605E; --brand-2: #F58A88; --brand-deep: #B03F3D; --brand-soft: #FFE9E8; }
[data-accent="altin"] { --brand: #B8860B; --brand-2: #D9A521; --brand-deep: #8A6508; --brand-soft: #FFF4D6; }
[data-accent="lavanta"] { --brand: #7B5FD0; --brand-2: #9F86E6; --brand-deep: #5A429E; --brand-soft: #EFEAFF; }
[data-accent="gece"] { --brand: #2F3B8F; --brand-2: #4D5BB5; --brand-deep: #1F2860; --brand-soft: #E4E7F7; }
[data-accent="lav"] { --brand: #C9382A; --brand-2: #E85A4B; --brand-deep: #962819; --brand-soft: #FFE6E2; }
[data-accent="nane"] { --brand: #16957A; --brand-2: #2FB89A; --brand-deep: #0F6B58; --brand-soft: #DFF7F0; }
[data-theme="dark"][data-accent="okyanus"] { --primary: #6FBDFF; --primary-dark: #4FA9F5; --brand-soft: #10283D; }
[data-theme="dark"][data-accent="orman"] { --primary: #58D08C; --primary-dark: #3DBD77; --brand-soft: #0F2E1C; }
[data-theme="dark"][data-accent="gunbatimi"] { --primary: #FFA070; --primary-dark: #FF8A50; --brand-soft: #38200F; }
[data-theme="dark"][data-accent="seftali"] { --primary: #FF9E9C; --primary-dark: #F58A88; --brand-soft: #3A1A1A; }
[data-theme="dark"][data-accent="altin"] { --primary: #F0C24A; --primary-dark: #D9A521; --brand-soft: #3A2E0E; }
[data-theme="dark"][data-accent="lavanta"] { --primary: #B9A4F5; --primary-dark: #9F86E6; --brand-soft: #241A44; }
[data-theme="dark"][data-accent="gece"] { --primary: #8C9AE8; --primary-dark: #6F7FD6; --brand-soft: #161B3A; }
[data-theme="dark"][data-accent="lav"] { --primary: #FF8A7C; --primary-dark: #E85A4B; --brand-soft: #3A1612; }
[data-theme="dark"][data-accent="nane"] { --primary: #5FD9BC; --primary-dark: #2FB89A; --brand-soft: #0F2E27; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"][data-accent="okyanus"] { --primary: #6FBDFF; --primary-dark: #4FA9F5; --brand-soft: #10283D; }
  [data-theme="auto"][data-accent="orman"] { --primary: #58D08C; --primary-dark: #3DBD77; --brand-soft: #0F2E1C; }
  [data-theme="auto"][data-accent="gunbatimi"] { --primary: #FFA070; --primary-dark: #FF8A50; --brand-soft: #38200F; }
  [data-theme="auto"][data-accent="seftali"] { --primary: #FF9E9C; --primary-dark: #F58A88; --brand-soft: #3A1A1A; }
  [data-theme="auto"][data-accent="altin"] { --primary: #F0C24A; --primary-dark: #D9A521; --brand-soft: #3A2E0E; }
  [data-theme="auto"][data-accent="lavanta"] { --primary: #B9A4F5; --primary-dark: #9F86E6; --brand-soft: #241A44; }
  [data-theme="auto"][data-accent="gece"] { --primary: #8C9AE8; --primary-dark: #6F7FD6; --brand-soft: #161B3A; }
  [data-theme="auto"][data-accent="lav"] { --primary: #FF8A7C; --primary-dark: #E85A4B; --brand-soft: #3A1612; }
  [data-theme="auto"][data-accent="nane"] { --primary: #5FD9BC; --primary-dark: #2FB89A; --brand-soft: #0F2E27; }
}
.stat-link { cursor: pointer; text-align: left; border: 2px solid var(--line); font: inherit; color: inherit; }
.stat-link:hover { border-color: var(--brand); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; text-align: center; }
.shop-item.owned { border-color: var(--brand); }
.shop-item { position: relative; }
.shop-season-chip { position: absolute; top: 8px; right: 8px; font-size: .7rem; }
.shop-seasonal { border: 2px dashed var(--brand-2); }
.cert-bonus { border: 2px solid var(--spark); background: var(--spark-soft); }
.unlock-card { border: 2px dashed var(--line); }
.unlock-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.unlock-row input { flex: 1; min-width: 150px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.unlock-status { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.level-paid-locked { opacity: .75; }
.course-lock { font-size: .95rem; }
[data-theme="dark"] .cert-bonus { background: #3a2f10; }
.shop-preview { height: 84px; display: flex; align-items: center; justify-content: center; }
.accent-dot { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.shop-earned { border: 2px solid var(--spark); background: var(--spark-soft); }
[data-theme="dark"] .shop-earned { background: #3a2f10; }
.earned-item.locked { opacity: .6; }
.earned-lock { font-size: 2.2rem; }
.item-emoji { font-size: 2.6rem; line-height: 1; }
.course-gift { text-align: center; }
.shop-shelf h3 .chip { margin-left: 6px; font-size: .7rem; vertical-align: middle; }
.shop-shelf-new { border: 2px solid var(--brand-2); }
.shop-shelf-locked { border: 2px dashed var(--line); background: transparent; }
.shelf-more { margin-top: 10px; }

.bot-buy { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.pin-box:not([hidden]) { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pin-box input { width: 90px; font-size: 1.2rem; letter-spacing: .35em; text-align: center; }
.pin-error { color: var(--danger, #dc2626); font-weight: 700; }

/* ------------------------------------------------------------ Bilo Botu */
.bot-card { border-left: 6px solid var(--brand); }
.bot-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.chip-btn { border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.chip-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.bot-task { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bot-task p { margin: 4px 0 0; }
.bot-chat-card { padding: 16px; }
.bot-chat { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; min-height: 180px; overflow-y: auto; padding: 4px 2px; }
.bot-msg { max-width: 85%; border-radius: 16px; padding: 10px 14px; line-height: 1.45; }
.bot-msg p { margin: 0; }
.bot-msg.bot { align-self: flex-start; background: var(--surface-2, rgba(91,63,232,0.08)); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bot-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bot-msg.thinking { opacity: 0.7; font-style: italic; }
.bot-input-row { display: flex; gap: 8px; margin-top: 12px; }
.bot-input-row input { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; font: inherit; background: var(--surface); color: var(--text); }
.bot-input-row input:focus { outline: none; border-color: var(--brand); }
.bot-note { margin-top: 10px; }
.bot-lesson-row { margin: 14px 0; }
.bot-log { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.bot-log:last-child { border-bottom: none; }


/* ------------------------------------------------- "new course" balloon */
.course-row { overflow: visible; }
.course-card { position: relative; overflow: visible; }
.course-new {
  position: absolute; top: -10px; right: 6px; z-index: 2;
  background: var(--butter);
  color: #6B4A08; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
  padding: 4px 11px; border-radius: 999px; transform: rotate(6deg);
  animation: courseNewPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes courseNewPulse {
  0%, 100% { transform: rotate(6deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) { .course-new { animation: none; } }

/* --------------------------------------------------- big course projects */
.project-card .progress-track { margin-top: 12px; }
.project-week h3 { margin-bottom: 12px; }
.project-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.project-step { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font: inherit; color: var(--text); cursor: pointer; }
.project-step:hover { border-color: var(--brand); }
.project-step .step-box { flex: 0 0 auto; width: 24px; height: 24px; border: 2px solid var(--line);
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.project-step.done { border-color: #16A34A; }
.project-step.done .step-box { background: #16A34A; border-color: #16A34A; color: #fff; }
.project-step.done > span:last-child { text-decoration: line-through; opacity: 0.75; }

/* ---------------------------------------------------------- expert exam */
.expert-card { border-left: 6px solid #B45309; }
.expert-q .options { margin-top: 14px; }
.callout.family { border-left: 4px solid #16A34A; background: rgba(22, 163, 74, 0.07); margin-bottom: 14px; }

/* ------------------------------------------------------------ Faz 1: fx */
#fxLayer { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.fx-confetti {
  position: absolute; top: -16px; display: block;
  animation-name: fxFall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes fxFall {
  to { transform: translate(var(--fx-drift, 0), 105vh) rotate(var(--fx-spin, 360deg)); opacity: 0.9; }
}
.fx-star {
  position: fixed; z-index: 999; pointer-events: none; transform: translate(-50%, -50%);
  animation: fxBurst 0.9s ease-out forwards;
}
@keyframes fxBurst {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--fx-x, 0)), calc(-50% + var(--fx-y, -40px))) scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .fx-confetti, .fx-star { display: none; } }

/* mascot */
.mascot { display: inline-block; vertical-align: middle; }
.fb-row { display: flex; align-items: flex-start; gap: 10px; }
.fb-row .mascot { flex: 0 0 auto; margin-top: -4px; }
.fb-body { flex: 1; min-width: 0; }
.result-mascot { margin-bottom: 6px; }
.result-mascot .mascot { animation: mascotPop 0.5s ease-out; }
@keyframes mascotPop { 0% { transform: scale(0.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.mascot-say { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; }
.mascot-bubble { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; border-bottom-left-radius: 4px; padding: 12px 16px; flex: 1; }
.toast .mascot { flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .result-mascot .mascot { animation: none; } }

/* ------------------------------------------------------ concept diagrams */
.lesson-diagram { margin: 16px 0 6px; }
.lesson-diagram svg { width: 100%; height: auto; display: block; }

/* -------------------------------------------------------- level comics */
.comic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px; margin-bottom: 18px; }
.comic-panel { position: relative; background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 14px 12px 12px; text-align: center; }
.comic-no { position: absolute; top: -10px; left: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 900; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.comic-bubble { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.45; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; position: relative; }
.comic-bubble::before { content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); border: 8px solid transparent; border-bottom-color: var(--line); border-top: none; }
@media (max-width: 640px) { .comic { grid-template-columns: 1fr; } .comic-panel { display: flex; align-items: center; gap: 12px; text-align: left; } .comic-bubble { margin: 0; flex: 1; } .comic-bubble::before { display: none; } }

/* unit card unlock polish */
.unit-card { transition: transform 0.15s ease, border-color 0.2s ease; }
.unit-card:not(.locked):hover { transform: translateY(-2px); }

/* ------------------------------------------------------- playground sims */
.sim-card { border-left: 6px solid #12A4A0; }
.sim-stage { display: flex; flex-direction: column; gap: 14px; }
.sim-bigcard { font-size: 84px; text-align: center; background: var(--bg); border: 2px dashed var(--line); border-radius: 20px; padding: 26px; }
.sim-choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sim-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.sim-result { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 1.1rem; }
.sim-result.good { border-color: #16A34A; }
.sim-result.bad { border-color: #E11D48; }
.sim-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sim-tile { font-size: 44px; background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 18px 0; cursor: pointer; text-align: center; }
.sim-tile:hover { border-color: var(--brand); }
.sim-feed.narrow .sim-tile { cursor: default; }
.sim-meter { display: flex; align-items: center; gap: 10px; }
.sim-meter .progress-track { flex: 1; }
.sim-jars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sim-jar { position: relative; border: 2px solid var(--line); border-radius: 16px; padding: 14px 8px 10px; text-align: center; overflow: hidden; display: flex; flex-direction: column; gap: 4px; align-items: center; min-height: 150px; justify-content: flex-end; }
.sim-jar-fill { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0.18; transition: height 0.5s ease; }
.sim-jar-emoji { font-size: 30px; }
.sim-jar-btns { display: flex; gap: 6px; }
.sim-headline { font-size: 1.05rem; font-weight: 700; background: var(--bg); border: 2px solid var(--line); border-left: 6px solid var(--brand); border-radius: 14px; padding: 16px; line-height: 1.5; }
.sim-log { border-top: 1px dashed var(--line); padding-top: 8px; }

/* fair test lab table */
.sim-table { width: 100%; border-collapse: collapse; }
.sim-table th, .sim-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.sim-table th { font-size: 0.85rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.sim-table td:first-child, .sim-table th:first-child { text-align: left; font-weight: 700; }
.sim-table tr.differs { background: rgba(14, 165, 233, 0.09); }
.sim-table tr.sim-avg td { font-weight: 900; border-top: 2px solid var(--line); border-bottom: none; }
.sim-table .chip-btn { padding: 6px 14px; font-size: 0.9rem; }

/* ---------------------------------------------- playground gallery + new sims */
.sim-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sim-chip { border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.sim-chip:hover { border-color: #12A4A0; }
.sim-chip.done { border-color: #16A34A; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sim-tile-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.sim-tile-card.done { border-color: #16A34A; }
.sim-tile-emoji { font-size: 40px; }
.sim-tile-card h4 { margin: 0; font-size: 1.05rem; }
.sim-tile-card p { flex: 1; margin: 0; font-size: 0.9rem; }
.sim-choices.column { flex-direction: column; align-items: stretch; }
.sim-sentence { font-size: 1.15rem; line-height: 1.6; background: var(--bg); border: 2px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.sim-preds { display: grid; gap: 10px; }
.sim-pred { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.sim-pred:hover { border-color: var(--brand); }
.sim-pred-word { font-weight: 700; }
.sim-pred-track { background: var(--bg); border-radius: 999px; height: 16px; overflow: hidden; }
.sim-pred-fill { display: block; height: 100%; border-radius: 999px; }
.sim-pred-pct { font-weight: 800; font-size: 0.9rem; color: var(--text-soft); }
.sim-parts { display: grid; gap: 8px; }
.sim-part { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.sim-part.on { border-color: #16A34A; }
.sim-part.on .step-box { background: #16A34A; border-color: #16A34A; color: #fff; }
.sim-part .step-box { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.sim-prompt-box, .sim-answer-box { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.sim-answer-box { background: var(--bg); }
.sim-prompt-box p, .sim-answer-box p { margin: 6px 0 0; line-height: 1.5; }
.sim-photo { position: relative; background: linear-gradient(#BFE3FF, #E7F6E7); border: 2px solid var(--line); border-radius: 18px; height: 230px; overflow: hidden; }
.sim-photo-kid { position: absolute; left: 44%; top: 42%; font-size: 64px; }
.sim-spot { position: absolute; transform: translate(-50%, -50%); font-size: 34px; background: transparent; border: 3px dashed transparent; border-radius: 50%; padding: 4px; cursor: pointer; }
.sim-spot:hover { border-color: rgba(0,0,0,0.25); }
.sim-spot.hit { border-color: #E11D48; background: rgba(225,29,72,0.15); }
.sim-spot.safe { border-color: #16A34A; background: rgba(22,163,74,0.12); }
.sim-chatmsg { background: var(--bg); border-left: 5px solid var(--brand); border-radius: 12px; padding: 14px 16px; font-size: 1.02rem; line-height: 1.5; }
.sim-offers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sim-offer { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px; font: inherit; color: var(--text); cursor: pointer; }
.sim-offer.good { border-color: #16A34A; background: rgba(22,163,74,0.08); }
.sim-offer.bad { border-color: #E11D48; opacity: 0.75; }
.sim-price { display: flex; align-items: center; justify-content: center; gap: 18px; }
.sim-price-tag { font-size: 2rem; font-weight: 900; min-width: 110px; text-align: center; }
.big-btn { font-size: 1.6rem; padding: 4px 20px; }
.sim-chart { border: 2px solid var(--line); border-radius: 16px; padding: 16px; background: var(--bg); }
.sim-chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 40px; height: 170px; }
.sim-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sim-bar { width: 58px; border-radius: 8px 8px 0 0; transition: height 0.15s ease; }
.sim-bar.a { background: #5B3FE8; }
.sim-bar.b { background: #E11D48; }
.sim-axis-label { text-align: center; margin-top: 10px; color: var(--text-soft); }
.sim-range { width: 100%; }
.sim-triple { display: flex; justify-content: center; gap: 18px; }
.sim-num { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 14px; padding: 10px 16px; }
.sim-num strong { font-size: 1.8rem; }
.sim-tests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sim-test { border: 2px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 0.9rem; }
.sim-test.ok { border-color: #16A34A; }
.sim-test.no { border-color: #E11D48; }
.sim-scale-view { text-align: center; padding: 10px; }
.sim-scale-emoji { font-size: 76px; }
.sim-scale-size { font-weight: 800; font-size: 1.1rem; margin: 4px 0; }
.sim-scale-ticks { display: flex; justify-content: space-between; }
.sim-scale-ticks span { opacity: 0.35; font-size: 20px; }
.sim-scale-ticks span.on { opacity: 1; transform: scale(1.25); }
@media (max-width: 560px) { .sim-offers { grid-template-columns: 1fr; } }

/* ---- certificate frames (Star Shop, kind "frame") ---------------------- */
.certificate.frame-altin .cert-border { border: 6px double #c9a227; box-shadow: inset 0 0 0 3px #fff3c4, inset 0 0 0 5px #c9a227; }
.certificate.frame-gokkusagi { border: 10px solid transparent; background: linear-gradient(#fffdf7, #fffdf7) padding-box, linear-gradient(135deg, #ff5c7a, #ffae18, #2ed38a, #2e86c1, #7c63ff) border-box; }
.certificate.frame-yildizli .cert-border { border: 4px solid #5b3fe8; background-image: radial-gradient(#ffd76a 1.4px, transparent 1.8px), radial-gradient(circle at 12% 12%, rgba(201,162,39,.09), transparent 34%); background-size: 28px 28px, 100% 100%; }
.certificate.frame-orman .cert-border { border: 5px solid #148a46; box-shadow: inset 0 0 0 4px #d9f2dc; background-image: radial-gradient(circle at 8% 92%, rgba(20,138,70,.14), transparent 30%), radial-gradient(circle at 92% 8%, rgba(20,138,70,.14), transparent 30%); }
.frame-preview { display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 54px; border-radius: 8px; font-size: 26px; background: #fffdf7; border: 3px double #c9a227; color: #2b2a4a; }
.frame-preview.frame-gokkusagi { border: 4px solid transparent; background: linear-gradient(#fffdf7, #fffdf7) padding-box, linear-gradient(135deg, #ff5c7a, #ffae18, #2ed38a, #2e86c1, #7c63ff) border-box; }
.frame-preview.frame-yildizli { border: 3px solid #5b3fe8; background-image: radial-gradient(#ffd76a 1.5px, transparent 1.9px); background-size: 12px 12px; }
.frame-preview.frame-orman { border: 3px solid #148a46; box-shadow: inset 0 0 0 2px #d9f2dc; }
.daily-second-chance { display: flex; flex-direction: column; gap: 8px; }
.daily-second-chance .muted-text { margin: 0; }

/* ------------------------------------------------------ Giydirme Odası */
.dress-room { padding: 16px; }
.dress-stage {
  position: relative; display: grid; place-items: center; min-height: 260px;
  border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; overflow: hidden; transition: background .3s ease;
}
.dress-stage:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.dress-mascot { width: min(230px, 60vw); height: auto; position: relative; z-index: 2; filter: drop-shadow(0 10px 18px rgba(0,0,0,.18)); }
.dress-scene-hint { position: absolute; right: 12px; bottom: 10px; font-size: .78rem; color: var(--text-soft); z-index: 3; }
.dress-hint { text-align: center; margin: 10px 0 6px; }
.dress-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.dress-buy { display: grid; gap: 8px; margin: 8px 0; }
.dress-buy-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 14px; background: var(--spark-soft); border: 2px solid var(--spark);
}
[data-theme="dark"] .dress-buy-row { background: #3a2f10; }
.dress-why { flex-basis: 100%; }
.dress-price { font-weight: 800; color: var(--text); }
.dress-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 2px 6px; }
.dress-tabs::-webkit-scrollbar { display: none; }
.dress-tabs .chip-button { white-space: nowrap; flex: 0 0 auto; }
.dress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.dress-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px 10px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: center;
  transition: transform .12s ease, border-color .15s ease;
}
.dress-tile:hover { transform: translateY(-2px); }
.dress-tile.owned { border-color: var(--brand-2, var(--line)); }
.dress-tile.equipped { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.dress-tile.trying { border-style: dashed; border-color: var(--spark); }
.dress-preview { height: 68px; display: flex; align-items: center; justify-content: center; }
.dress-preview .mascot { width: 64px; height: 64px; }
.dress-name { font-weight: 700; font-size: .86rem; line-height: 1.2; }
.dress-state { font-size: .76rem; color: var(--text-soft); font-weight: 600; }
.dress-state.on { color: var(--primary); }
.dress-lock { position: absolute; top: 6px; left: 6px; font-size: .68rem; }
.swatch { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.scene-swatch { border-radius: 14px; width: 60px; height: 52px; }
.look-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.look-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; text-align: center; }
.look-card.empty { border-style: dashed; }
.look-preview { height: 68px; display: flex; align-items: center; justify-content: center; }
.look-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dress-promo { margin: 14px 0; border: 2px solid var(--brand-2, var(--line)); }
.hero-art .hero-dress {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}
.hero-art.scene-uzay, .hero-art.scene-orman, .hero-art.scene-plaj, .hero-art.scene-sehir, .hero-art.scene-gokkusagi, .hero-art.scene-kutup, .hero-art.scene-bahce, .hero-art.scene-gece { border-radius: 22px; padding: 10px 10px 34px; }
.hero-art[class*="scene-"] .orb { display: none; }

/* scenes — one class, used on the stage, the hero and the swatches */
[class*="scene-"] { position: relative; }
.scene-uzay { background: radial-gradient(circle at 20% 20%, #4a2fb8 0, transparent 40%), linear-gradient(160deg, #1B1538, #3A1FA6); }
.scene-orman { background: linear-gradient(180deg, #8FD19E 0, #1E6B3A 100%); }
.scene-plaj { background: linear-gradient(180deg, #7FD3F7 0 55%, #FFE3A3 55% 100%); }
.scene-sehir { background: linear-gradient(180deg, #D7DEEE 0, #6A7BA8 100%); }
.scene-gokkusagi { background: linear-gradient(180deg, #FF8FA8, #FFD23F, #8FE3B0, #8FC7FF, #C9B6FF); }
.scene-kutup { background: linear-gradient(180deg, #DDF3FF 0, #9BD1F2 100%); }
.scene-bahce { background: linear-gradient(180deg, #FFF1B8 0, #B9E8A5 100%); }
.scene-gece { background: radial-gradient(circle at 80% 15%, #FFE68A 0 14px, transparent 15px), linear-gradient(180deg, #0F1B3D, #2F3B8F); }
.dress-stage.scene-uzay::before, .hero-art.scene-uzay::before { content: "✨ 🪐        ⭐"; }
.dress-stage.scene-orman::before, .hero-art.scene-orman::before { content: "🌲 🌳   🍄   🌲"; }
.dress-stage.scene-plaj::before, .hero-art.scene-plaj::before { content: "☀️     🌴  🐚"; }
.dress-stage.scene-sehir::before, .hero-art.scene-sehir::before { content: "🏙️  🚌   🏢"; }
.dress-stage.scene-gokkusagi::before, .hero-art.scene-gokkusagi::before { content: "🌈   ☁️   ☁️"; }
.dress-stage.scene-kutup::before, .hero-art.scene-kutup::before { content: "❄️  🧊   🐧  ❄️"; }
.dress-stage.scene-bahce::before, .hero-art.scene-bahce::before { content: "🌷 🌼  🦋  🌻"; }
.dress-stage.scene-gece::before, .hero-art.scene-gece::before { content: "⭐   ✨      ⭐"; }
.dress-stage[class*="scene-"]::before, .hero-art[class*="scene-"]::before {
  position: absolute; inset: 10px 12px auto 12px; font-size: 1.4rem; letter-spacing: .1em; opacity: .9; z-index: 1; white-space: pre; pointer-events: none;
}
.hero-art[class*="scene-"]::before { font-size: 1.05rem; }
.dress-stage.scene-uzay .dress-scene-hint, .dress-stage.scene-gece .dress-scene-hint { color: #fff; }
@media (max-width: 720px) {
  .dress-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .dress-tabs::-webkit-scrollbar { display: none; }
  .hero-art .hero-mascot { width: 132px; }
  .hero-art[class*="scene-"] { padding-bottom: 42px; }
  .look-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .look-card { padding: 10px 4px; }
  .dress-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------------------------------------------------------- Türkiye Haritası */
.harita-card { margin: 14px 0; border: 2px solid var(--brand-2, var(--line)); }
.harita-cats, .harita-modes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.harita-count { font-size: .72rem; opacity: .8; margin-left: 4px; }
.harita-progress { margin-left: auto; }
.harita-stage { padding: 12px; }
.harita-prompt { min-height: 40px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 1.05rem; }
.harita-prompt-text strong { color: var(--primary); font-size: 1.15rem; }
.harita-mapwrap { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #cfe6fb; touch-action: none; }
.harita { display: block; width: 100%; height: auto; max-height: 62vh; cursor: crosshair; user-select: none; --zoom: 1; }
.hz-bg { fill: #cfe6fb; }
.hz-sea { fill: #bfdcf6; stroke: none; }
.hz-nb { fill: #ece7dc; stroke: #d6cfbf; stroke-width: 1; }
.hz-il { fill: var(--rc); fill-opacity: .42; stroke: #fff; stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: fill-opacity .15s ease; }
.hz-il:hover { fill-opacity: .7; }
.cat-il .hz-il, .cat-bolge .hz-il { cursor: pointer; }
.hz-river-hit { fill: none; stroke: transparent; stroke-width: 26; stroke-linejoin: round; stroke-linecap: round; }
.hz-river-line { fill: none; stroke: #2a6fb8; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.hz-lake { fill: #3b8ee0; stroke: #1f5fa8; stroke-width: 1; vector-effect: non-scaling-stroke; }
.hz-lake.dam { fill: #5aa3e8; stroke-dasharray: 3 2; }
.hz-mtn polygon { fill: #6b4f2a; }
.hz-mtn .hz-snow { fill: #fff; }
.hz-mtn-body { transform: scale(calc(1 / var(--zoom))); transform-box: fill-box; transform-origin: center; }
.hz-mtn-hit { fill: transparent; }
.hz-labels { pointer-events: none; }
.hz-lbl { display: none; font-family: inherit; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 2.5px; stroke-linejoin: round; fill: #1B1538; }
.labels-on .hz-lbl.sea, .labels-on .hz-lbl.nb { display: block; font-size: calc(15px / var(--zoom)); stroke-width: calc(2.5px / var(--zoom)); fill: #2a6fb8; stroke: #cfe6fb; }
.labels-on .hz-lbl.nb { fill: #6b6b7b; stroke: #ece7dc; }
.labels-on.cat-il .hz-lbl.il, .labels-on.cat-bolge .hz-lbl.il, .labels-on.zoomed .hz-lbl.il { display: block; font-size: calc(9.5px / var(--zoom)); stroke-width: calc(2.5px / var(--zoom)); }
.labels-on.cat-gol .hz-lbl.lake, .labels-on.zoomed .hz-lbl.lake { display: block; font-size: calc(8.5px / var(--zoom)); stroke-width: calc(2.5px / var(--zoom)); fill: #1f5fa8; }
.labels-on.cat-dag .hz-lbl.mtn, .labels-on.zoomed .hz-lbl.mtn { display: block; font-size: calc(8.5px / var(--zoom)); stroke-width: calc(2.5px / var(--zoom)); fill: #4a3418; }
.labels-on.cat-akarsu .hz-lbl.river, .labels-on.zoomed .hz-lbl.river { display: block; font-size: calc(8.5px / var(--zoom)); stroke-width: calc(2.5px / var(--zoom)); fill: #0b3d7a; font-style: italic; text-anchor: start; }
/* in the games the answer stays secret: no labels for the active category */
.harita.playing.cat-il .hz-lbl.il, .harita.playing.cat-bolge .hz-lbl.il, .harita.playing.cat-gol .hz-lbl.lake,
.harita.playing.cat-dag .hz-lbl.mtn, .harita.playing.cat-akarsu .hz-lbl.river, .harita.playing.cat-deniz .hz-lbl.sea, .harita.playing.cat-deniz .hz-lbl.nb { display: none; }
/* states */
.hz-pick { fill-opacity: .85 !important; filter: brightness(1.05); }
.hz-il.hz-target, .hz-il.hz-hit, .hz-il.hz-miss { fill-opacity: .95 !important; }
.hz-il.hz-target { fill: #FFE68A !important; stroke: #FFAE18 !important; stroke-width: 3; }
.hz-lake.hz-target { fill: #FFAE18 !important; stroke: #b86e00 !important; }
.hz-target { animation: hz-blink 1s ease-in-out infinite; }
.hz-hit { fill: #2ED38A !important; stroke: #0a6b40 !important; }
.hz-miss { fill: #FF5C7A !important; stroke: #8f1f36 !important; }
.hz-river.hz-target .hz-river-line, .hz-river.hz-pick .hz-river-line { stroke: #FFAE18; stroke-width: 4.5; }
.hz-river.hz-hit .hz-river-line { stroke: #0a6b40; stroke-width: 4.5; }
.hz-river.hz-miss .hz-river-line { stroke: #FF5C7A; stroke-width: 4.5; }
.hz-mtn.hz-target polygon:first-of-type, .hz-mtn.hz-pick polygon:first-of-type { fill: #FFAE18; }
.hz-mtn.hz-hit polygon:first-of-type { fill: #2ED38A; }
.hz-mtn.hz-miss polygon:first-of-type { fill: #FF5C7A; }
.hz-sea.hz-target, .hz-sea.hz-pick, .hz-nb.hz-target, .hz-nb.hz-pick { fill: #FFAE18; fill-opacity: .55; }
.hz-sea.hz-hit, .hz-nb.hz-hit { fill: #2ED38A; fill-opacity: .6; }
.hz-sea.hz-miss, .hz-nb.hz-miss { fill: #FF5C7A; fill-opacity: .6; }
@keyframes hz-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .hz-target { animation: none; } }
.hz-tag { pointer-events: none; }
.hz-tag rect { fill: #1B1538; opacity: .9; }
.hz-tag text { fill: #fff; font-weight: 800; text-anchor: middle; font-family: inherit; }
.hz-tag.hit rect { fill: #0a6b40; }
.hz-tag.miss rect { fill: #8f1f36; }
.hz-tag.pick rect { fill: var(--primary); }
.harita-tools { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.harita-tools .small-btn.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.harita-panel { min-height: 56px; }
.harita-info { display: flex; align-items: center; gap: 12px; }
.harita-info-emoji { font-size: 1.8rem; }
.harita-info p { margin: 2px 0 0; }
.harita-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.harita-opt { border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 10px; font: inherit; font-weight: 700; cursor: pointer; min-height: var(--tap); }
.harita-opt:hover { border-color: var(--primary); }
.harita-opt:disabled { opacity: .6; cursor: default; }
.harita-result { display: grid; gap: 10px; }
.harita-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.harita-review { margin: 0; }
@media (max-width: 560px) {
  .harita-progress { margin-left: 0; width: 100%; }
  .harita { max-height: 52vh; }
  .harita-options { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   v3.13 — one-screen home, lessons path, games hub, bottom tab bar
   ========================================================================= */

/* ---- tab bar ---------------------------------------------------------- */
.app { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1 1 0; max-width: 132px; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 4px; border-radius: 16px; background: transparent; color: var(--text-soft);
  font-size: .72rem; font-weight: 800; letter-spacing: .01em; line-height: 1.1;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.tab-emoji { font-size: 22px; line-height: 1; }
.tab:hover { background: var(--surface-2); }
.tab:active { transform: scale(.95); }
.tab.active { color: var(--brand-deep); background: var(--lilac); }
@media (min-width: 761px) {
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%); bottom: 12px;
    width: min(560px, 100% - 24px); border-radius: 22px; border: 1px solid var(--line);
    padding: 6px 8px;
  }
}
/* the tab bar (and the logo) already go home; on phones the glossary moves to the footer too */
.topnav [data-nav="#/"] { display: none; }
@media (max-width: 760px) { .topnav [data-nav="#/glossary"] { display: none; } }
@media print { .tabbar { display: none; } .app { padding-bottom: 0; } }

/* ---- home: greeting + stat strip -------------------------------------- */
.home-top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin: 2px 0 14px; }
.greet h2 { margin: 0 0 2px; font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.greet p { margin: 0; }
.stat-strip { display: flex; gap: 8px; padding: 0; background: transparent; border: 0; }
.ss-item { display: grid; gap: 1px; padding: 10px 14px; min-width: 96px; align-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.ss-item strong { font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; line-height: 1.2; }
.ss-item strong small { font-size: .78rem; color: var(--text-soft); font-weight: 700; }
.ss-item span { font-size: .74rem; color: var(--text-soft); font-weight: 700; white-space: nowrap; }
.ss-item .progress-track.small { margin-top: 5px; height: 5px; }
@media (max-width: 760px) {
  .home-top { grid-template-columns: 1fr; gap: 10px; }
  .stat-strip { justify-content: space-between; }
  .ss-item { min-width: 0; flex: 1; padding: 4px 10px; }
}

/* ---- home: continue card ---------------------------------------------- */
.continue-card { margin-bottom: 18px; background: var(--lilac); border-color: transparent; }
.continue-card .eyebrow { color: var(--brand-deep); }
.continue-card .ghost { color: var(--brand-deep); }
.continue-title { font-size: clamp(1.35rem, 3.4vw, 1.9rem); margin: 4px 0 6px; letter-spacing: -.01em; line-height: 1.2; }
.continue-sub { color: var(--text-soft); margin: 0 0 16px; font-size: .96rem; }
.continue-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.continue-card.is-locked .continue-title { font-size: 1.4rem; }
.daily-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  padding: 12px 14px; margin-bottom: 14px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--butter); color: #3A2E10; border-color: transparent;
  transition: transform .08s ease;
}
[data-theme="dark"] .daily-strip { color: var(--text); }
.daily-strip:active { transform: scale(.985); }
.daily-strip .daily-icon { width: 46px; height: 46px; font-size: 22px; border-radius: 15px; background: rgba(255,255,255,.55); flex: 0 0 auto; }
.daily-strip-body { display: grid; gap: 1px; flex: 1; min-width: 0; }
.daily-strip-body strong { font-size: 1.02rem; }
.daily-strip-body span { font-size: .8rem; font-weight: 700; opacity: .8; }
.daily-strip-cta { flex: 0 0 auto; background: var(--primary); color: var(--on-primary); border-radius: var(--radius-btn); padding: 10px 16px; font-weight: 800; box-shadow: 0 3px 0 var(--primary-edge); }
.daily-strip:active .daily-strip-cta { box-shadow: 0 1px 0 var(--primary-edge); }
@media (max-width: 760px) {
  .continue-card { grid-template-columns: 1fr auto; gap: 8px; padding: 20px 18px; }
  .continue-card .hero-art { order: 0; min-height: 0; min-width: 128px; padding-bottom: 32px; align-self: start; }
  .continue-card .hero-mascot { width: 88px; }
  .continue-card .orb { width: 100px; height: 100px; }
  .continue-card .hero-art .hero-dress { font-size: .72rem; padding: 5px 9px; }
  .continue-card .continue-actions .ghost { padding-left: 10px; padding-right: 10px; }
}

/* ---- tiles (home + games hub) ----------------------------------------- */
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile-grid.wide { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .tile-grid, .tile-grid.wide { grid-template-columns: 1fr 1fr; } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: start; text-decoration: none; padding: 16px 16px 14px; min-height: 138px;
  border-radius: var(--radius); border: 0; background: var(--surface-2);
  color: var(--text); font: inherit; cursor: pointer; overflow: hidden;
  transition: transform .08s ease, filter .15s ease;
}
.tile:hover { filter: brightness(.97); }
.tile:active { transform: scale(.97); }
.tile-emoji { font-size: 38px; line-height: 1; margin-bottom: auto; position: relative; z-index: 1; }
.tile-title { font-weight: 800; font-size: 1.04rem; line-height: 1.2; margin-top: 12px; position: relative; z-index: 1; }
.tile-sub { font-size: .8rem; font-weight: 700; color: var(--text); opacity: .62; line-height: 1.3; position: relative; z-index: 1; }
.tile-ext { position: absolute; top: 12px; right: 14px; font-weight: 800; opacity: .7; z-index: 1; }
.tile-map     { background: var(--sky); }
.tile-sim     { background: var(--sage); }
.tile-shop    { background: var(--peach); }
.tile-project { background: var(--butter); }
.tile-daily   { background: var(--lilac); }
.tile-trivia  { background: var(--rose); }
.tile-expert  { background: var(--lime); }
.tile-bot     { background: var(--cloud); }
.tile-arcade { background: var(--ink-tile); color: #fff; }
.tile-arcade .tile-sub { color: #fff; opacity: .72; }
.tile-arcade .tile-ext { color: #FFE68A; opacity: 1; }
.games-note { margin: 14px 0 18px; }

/* ---- course chips (home strip + lessons selector) --------------------- */
.course-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) {
  .course-strip { display: flex; overflow-x: auto; gap: 10px; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .course-strip .course-chip { flex: 0 0 190px; scroll-snap-align: start; }
}
.course-chip {
  display: flex; align-items: center; gap: 10px; text-align: start; padding: 12px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; min-width: 0;
  transition: transform .08s ease, border-color .15s ease;
}
.course-chip:active { transform: scale(.98); }
.course-chip.active { border-color: var(--course-accent, var(--brand)); }
.course-chip.no-entry { opacity: .72; }
.course-chip-emoji { font-size: 1.6rem; }
.course-chip-body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.course-chip-body strong { font-size: .92rem; line-height: 1.2; }
.course-chip-body .muted-text { font-size: .76rem; font-weight: 700; }
.course-chip .progress-track { display: block; height: 5px; margin: 0; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.course-chip .progress-fill { display: block; height: 100%; background: var(--course-accent, var(--brand)); }

/* ---- lessons path ----------------------------------------------------- */
.lessons-head { margin-bottom: 12px; }
.course-intro { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin: 14px 0 16px; }
.course-intro-emoji { font-size: 34px; width: 64px; height: 64px; display: grid; place-items: center; background: var(--surface-2); border-radius: 18px; flex: 0 0 auto; }
.course-intro h3 { margin: 0 0 2px; }
.course-intro p { margin: 0 0 6px; font-size: .93rem; }
.course-intro .unit-meta .progress-track { max-width: 160px; }
.path-wrap { display: grid; gap: 12px; margin-bottom: 16px; }
.path-level { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.path-level.current { border-color: var(--brand-2); }
.path-level > summary { list-style: none; cursor: pointer; padding: 16px 18px; border-radius: var(--radius); }
.path-level > summary::-webkit-details-marker { display: none; }
.path-level > summary:hover { background: var(--surface-2); }
.path-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.path-head-main { min-width: 0; }
.path-head-main h3 { margin: 0 0 2px; font-size: 1.08rem; }
.path-head-main p { margin: 0; font-size: .88rem; }
.path-head-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mini-dots { display: flex; gap: 4px; }
.mini-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mini-dot.done { background: var(--success); }
.mini-dot.open { background: var(--brand); }
.path-level .chev { color: var(--text-soft); transition: transform .2s ease; }
.path-level[open] .chev { transform: rotate(180deg); }
.path-level.paid > summary, .path-level.future > summary { opacity: .78; }
.path-body { padding: 0 18px 18px; }
.path-body .level-goal { margin: 0 0 10px; font-size: .9rem; color: var(--text-soft); }
.path-cert { margin: 0 0 10px; }
.path-paid-note { margin: 0; }
.path { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; justify-items: center; }
.path-node { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(100%, 170px); transform: translateX(calc(var(--dx, 0) * 64px)); }
.path-node.card-node { width: 100%; transform: none; }
.path-node.card-node .unit-card { width: 100%; border: 0; background: var(--lilac); }
.path-node.card-node .unit-emoji { background: rgba(255,255,255,.6); }
[data-theme="dark"] .path-node.card-node .unit-emoji { background: rgba(255,255,255,.1); }
.node {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-size: 28px; background: var(--surface-2); border: 2px solid var(--line); padding: 0;
  transition: transform .08s ease;
}
.path-node.done .node { background: var(--sage); border-color: transparent; cursor: pointer; }
.path-node.done .node:active { transform: scale(.94); }
.node-check {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--success); color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.node-lock { position: absolute; right: -8px; bottom: -6px; font-size: 15px; background: var(--surface); border-radius: 50%; padding: 2px; line-height: 1; }
[data-theme="dark"] .node-check { border-color: var(--surface); }
.path-node.locked .node { width: 52px; height: 52px; font-size: 22px; opacity: .62; filter: grayscale(.4); }
.node-label { font-size: .78rem; font-weight: 700; color: var(--text-soft); text-align: center; line-height: 1.25; max-width: 170px; }
.path-node.locked .node-label { opacity: .75; }
@media (max-width: 560px) {
  .path-node { transform: translateX(calc(var(--dx, 0) * 40px)); }
  .path-head { flex-wrap: wrap; }
}

