/* Playful theme (2026-10-28) for players aged 8–17. Loads after styles.css and only restyles:
   colors, fonts, sizes, shapes. Puzzle drawings keep their cream-on-dark chalkboard contrast. */
@font-face { font-family: "Fredoka"; src: url("assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("assets/fonts/great-vibes-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Nunito"; src: url("assets/fonts/nunito-latin-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --paper: #f4f1ff;
  --paper-deep: #e9e3ff;
  --ink: #1f1b3a;
  --muted: #5d5878;
  --line: #e2dcf7;
  --white: #ffffff;
  --teal: #6a4cf5;          /* main brand: grape */
  --teal-dark: #4f33d6;
  --teal-soft: #ece7ff;
  --coral: #ff5b8a;         /* bubblegum */
  --yellow: #ffc93c;        /* sunshine */
  --blue: #2ec4ff;          /* sky */
  --lime: #6fdc52;
  --orange: #ff8a3d;
  --board: #2a2266;
  --shadow: 0 14px 34px rgba(64, 43, 160, .12), 0 3px 0 rgba(64, 43, 160, .06);
  --pop: 0 5px 0;
  font-family: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255, 201, 60, .35) 0 70px, transparent 71px),
    radial-gradient(circle at 92% 8%, rgba(46, 196, 255, .28) 0 110px, transparent 111px),
    radial-gradient(circle at 96% 62%, rgba(255, 91, 138, .18) 0 90px, transparent 91px),
    radial-gradient(circle at 3% 78%, rgba(111, 220, 82, .22) 0 80px, transparent 81px),
    radial-gradient(rgba(106, 76, 245, .10) 1.4px, transparent 1.6px);
  background-size: auto, auto, auto, auto, 22px 22px;
  background-attachment: fixed;
}

h1, h2, h3, .wordmark, .brand-name, .score-value, .check-button, .next-button, .guided-button, .profile-action,
.eyebrow, .puzzle-number, .puzzle-category, .difficulty, .card-heading, .score-label, footer, .info-guide h2 {
  font-family: "Fredoka", "Nunito", sans-serif;
}

/* Top bar */
.topbar { background: rgba(255, 255, 255, .72); backdrop-filter: blur(8px); border-bottom: 3px solid var(--line); }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.brand-mark { background: linear-gradient(135deg, var(--coral), var(--orange)); border-radius: 12px; box-shadow: var(--pop) #c9406a; font-family: "Fredoka", sans-serif; }
.brand-mark i { color: var(--yellow); }
.wordmark-light { color: var(--teal); }
.topbar-note { color: var(--muted); font-size: 14px; font-weight: 700; }

/* Hero */
.eyebrow { color: var(--teal); font-size: 13px; font-weight: 600; letter-spacing: .12em; }
.eyebrow-spark { color: var(--coral); }
h1 { font-weight: 700; letter-spacing: -1px; line-height: 1.02; }
h1 span { background: linear-gradient(90deg, var(--teal), var(--coral) 55%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-text { color: var(--muted); font-size: 17px; font-weight: 600; }
.intro-meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.meta-icon { color: var(--coral); }
.hero-art { border-radius: 24px; box-shadow: 0 8px 0 rgba(42, 34, 102, .25), 0 18px 40px rgba(42, 34, 102, .25); transform: rotate(1.5deg); }

/* Sidebar cards */
.score-card, .progress-card { border: 3px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow); }
.score-card { background: linear-gradient(160deg, #fff7d6, #ffffff 60%); border-color: #ffe6a0; }
.score-label, .card-heading { color: var(--teal); font-size: 13px; letter-spacing: .08em; }
.score-value { color: var(--orange); font-size: 44px; font-weight: 700; letter-spacing: -1px; }
.score-value small { color: #b49a55; font-size: 16px; }
.score-card p, .tiny-note p { color: var(--muted); font-size: 13px; }
.progress-track { height: 12px; border-radius: 99px; background: #efeaff; }
.progress-track span { background: linear-gradient(90deg, var(--lime), var(--blue), var(--teal), var(--coral)); }
.puzzle-list li { font-size: 14px; color: var(--muted); }
.puzzle-nav { border-radius: 12px; padding: 6px 6px; }
.puzzle-nav:hover { background: var(--teal-soft); }
.puzzle-list li.is-current .puzzle-nav { background: linear-gradient(90deg, #ece7ff, #ffe8f0); color: var(--ink); }
.puzzle-list li.is-done .puzzle-nav { color: #2f8a3d; }
.puzzle-dot { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 800; background: #fff; }
.puzzle-list li.is-current .puzzle-dot { border-color: var(--teal); background: var(--teal); color: #fff; }
.puzzle-list li.is-done .puzzle-dot { border-color: var(--lime); background: var(--lime); color: #fff; }

/* Puzzle card */
.puzzle-card { border: 3px solid var(--line); border-radius: 28px; box-shadow: 0 8px 0 #ddd5fb, 0 24px 50px rgba(64, 43, 160, .12); }
.puzzle-card-head { height: 64px; border-bottom: 3px dashed var(--line); }
.puzzle-category { color: var(--teal); font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.category-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
.difficulty { padding: 7px 12px; background: #fff1c4; color: #a26a00; font-size: 12px; font-weight: 600; }
.puzzle-number { color: var(--coral); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
h2 { color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.4px; }
.puzzle-prompt { color: var(--muted); font-size: 16px; font-weight: 600; }
.puzzle-visual-panel {
  border: 0; border-radius: 22px;
  background-color: var(--board);
  background-image: radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1.2px), linear-gradient(145deg, #2f2575, #241d5c 60%, #1d3f78);
  background-size: 16px 16px, auto;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .08), 0 6px 0 #18134a;
}
.puzzle-visual-question { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; }

/* Answer + buttons: chunky, pressable */
.answer-row input { height: 52px; border: 3px solid var(--line); border-radius: 16px; font-size: 17px; font-weight: 700; }
.answer-row input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 4px rgba(106, 76, 245, .18); }
.label-hint, .helper-text { font-size: 13px; }
.check-button, .next-button, .guided-button, .profile-action {
  border-radius: 16px; font-size: 16px; font-weight: 600; letter-spacing: .01em;
  background: var(--teal); color: #fff; box-shadow: var(--pop) var(--teal-dark);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.check-button { min-width: 140px; height: 52px; background: linear-gradient(180deg, #7d62ff, var(--teal)); }
.check-button:hover:not(:disabled), .next-button:hover:not(:disabled), .guided-button:hover, .profile-action:hover { background: var(--teal-dark); transform: translateY(-2px); box-shadow: 0 7px 0 #3a22b0; }
.check-button:active:not(:disabled), .next-button:active:not(:disabled), .guided-button:active, .profile-action:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--teal-dark); }
.next-button { min-height: 46px; background: linear-gradient(180deg, #ff7aa2, var(--coral)); box-shadow: var(--pop) #d23c69; font-size: 15px; }
.next-button:hover:not(:disabled) { background: #f0467a; box-shadow: 0 7px 0 #b92f59; }
.next-button:disabled { background: #ece9f6; color: #a29dbd; box-shadow: var(--pop) #ddd8ee; }
.quiet-button { color: var(--muted); font-size: 14px; font-weight: 800; }
.quiet-button:hover { color: var(--teal); }
.quiet-button span { color: var(--yellow); }
.feedback { font-size: 15px; font-weight: 800; color: #e0475f; }
.feedback.is-correct { color: #23964a; }
.hint-box { border: 3px solid #ffe08a; border-radius: 16px; background: #fffbe8; color: #7a5b00; }
.hint-box p { font-size: 14px; }
.puzzle-card-foot { border-top: 3px dashed var(--line); min-height: 70px; }

/* Guidance + info sections */
.tutorial-card, .info-guide { border: 3px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.info-guide:nth-child(1) { border-color: #cfe9ff; background: linear-gradient(170deg, #eef8ff, #fff 45%); }
.info-guide:nth-child(2) { border-color: #ffd7e4; background: linear-gradient(170deg, #fff0f5, #fff 45%); }
.info-guide h2 { color: var(--teal); font-size: 26px; }
.info-guide h3 { color: var(--ink); font-size: 16px; font-family: "Fredoka", sans-serif; font-weight: 600; }
.info-guide p, .info-guide li { color: var(--muted); font-size: 15px; }
.info-guide li::marker { color: var(--coral); }

/* Dialogs (sign-in, shop, manager) */
.profile-dialog { border: 3px solid var(--line); border-radius: 28px; }
.profile-dialog h2 { font-size: 32px; }

footer { color: var(--muted); font-size: 13px; border-top: 3px dashed var(--line); }
footer span:first-child span { color: var(--coral); }
footer nav a { color: var(--teal); font-weight: 600; }

/* A little bounce on the things kids click, never for people who prefer less motion. */
@media (prefers-reduced-motion: no-preference) {
  .brand-mark { animation: gng-wobble 6s ease-in-out infinite; }
  .feedback.is-correct { animation: gng-pop .45s ease-out; }
  @keyframes gng-wobble { 0%, 90%, 100% { transform: rotate(-5deg); } 94% { transform: rotate(8deg); } 97% { transform: rotate(-10deg); } }
  @keyframes gng-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
}
@media (prefers-reduced-motion: reduce) {
  .check-button, .next-button, .guided-button, .profile-action { transition: none; }
}

@media (max-width: 760px) {
  h2 { font-size: 26px; }
  .puzzle-card { border-radius: 24px; }
  .intro-text { font-size: 15px; }
}
@media (max-width: 470px) {
  .puzzle-list li { font-size: 13px; }
  .check-button { min-width: 108px; }
  .next-button { min-width: 110px; font-size: 14px; }
  .reveal-button, .quiet-button { font-size: 13px; }
}

.nowrap { white-space: nowrap; }
#answer-form label { font-family: "Fredoka", sans-serif; font-size: 16px; font-weight: 600; color: var(--ink); }
/* Bigger type must never push cards past a phone screen. */
.arcade > *, .sidebar > *, .puzzle-card, .puzzle-body, .answer-row > * { min-width: 0; }
@media (max-width: 760px) { .puzzle-card-head { gap: 8px; } .difficulty { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; } }
.puzzle-list { grid-template-columns: minmax(0, 1fr); }
.puzzle-list li, .puzzle-nav { min-width: 0; }
.puzzle-nav > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .puzzle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 470px) { .puzzle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .puzzle-nav { grid-template-columns: 26px minmax(0, 1fr); } .puzzle-dot { width: 24px; height: 24px; font-size: 10px; } }
@media (max-width: 760px) { .puzzle-list { max-height: 360px; overflow-y: auto; padding-right: 4px; } }

/* "Are you ready?" entry puzzle shown before a new player is created. */
.ready-check { display: grid; gap: 12px; padding: 26px; }
.profile-dialog .ready-check-form { padding: 0; }
.ready-check[hidden] { display: none; }
.ready-check .eyebrow { margin: 0; color: var(--coral); }
.ready-check h2 { margin: 0; font-size: 30px; }
.ready-check-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 20px; color: #fffbe9;
  background: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1.2px) 0 0/16px 16px, linear-gradient(145deg, #2f2575, #1d3f78); box-shadow: 0 5px 0 #18134a; }
.ready-check-badge { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 14px; background: var(--yellow); color: #5a3d00; font: 700 26px "Fredoka", sans-serif; box-shadow: 0 4px 0 #d9a21c; }
.ready-check-question { margin: 0; font: 600 18px/1.4 "Fredoka", "Nunito", sans-serif; }
.ready-check-form { display: flex; align-items: flex-end; gap: 10px; }
.ready-check-form label { display: grid; flex: 1; gap: 6px; font: 600 15px "Fredoka", sans-serif; color: var(--ink); }
.ready-check-form input { height: 52px; padding: 0 14px; border: 3px solid var(--line); border-radius: 16px; font-size: 20px; font-weight: 800; }
.ready-check-form input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 4px rgba(106, 76, 245, .18); }
.ready-check-status { min-height: 22px; margin: 0; font-size: 15px; font-weight: 800; color: var(--muted); }
.ready-check-status.is-wrong { color: #e0475f; }
.ready-check-status.is-correct { color: #23964a; }
.ready-check-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
@media (prefers-reduced-motion: no-preference) { .ready-check-status.is-correct { animation: gng-pop .45s ease-out; } }
@media (max-width: 470px) { .ready-check h2 { font-size: 26px; } .ready-check-question { font-size: 16px; } .ready-check-form { flex-wrap: wrap; } .ready-check-form .check-button { width: 100%; } }

/* Owner's neon "Giant Crab GG" app-icon logo replaces the old "n" mark. */
.brand-mark.brand-mark-gg { width: 46px; height: 46px; padding: 0; background: none; border-radius: 12px; box-shadow: none; transform: none; animation: none; overflow: visible; }
.brand-mark-gg .gg-logo { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 8px rgba(42, 34, 102, .35)); }
@media (prefers-reduced-motion: no-preference) { .brand-mark-gg .gg-logo { transition: transform .2s ease; } .wordmark:hover .brand-mark-gg .gg-logo { transform: rotate(-6deg) scale(1.06); } }
@media (max-width: 470px) { .brand-mark.brand-mark-gg { width: 40px; height: 40px; } }
