/*! © 2026 Dr. Oluwaseun Ogunmola · Dr. Ogunmola GameLabs · All rights reserved. Free to play at https://gamelabs.ogunmola.com.ng · Not licensed for re-hosting, copying or reuse. Terms: https://gamelabs.ogunmola.com.ng/terms/ · ref GL-KIDKIT-CSS1 */
/* KidKit styles. Each game sets --accent, --accent-deep, --bg1 and --bg2 on <body>. */
@font-face { font-family: "Fredoka"; font-weight: 500 700; font-display: swap; src: url("../fonts/fredoka-latin.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 400 600; font-display: swap; src: url("../fonts/lexend-latin.woff2") format("woff2"); }

:root {
  --ink: #102D5A; --ink-soft: #4A5876; --line: #E4E9F0; --good: #1F8A45; --bad: #D63848; --blue: #2583F5;
  --accent: #FFB703; --accent-deep: #E08E00; --bg1: #FFF6DC; --bg2: #FFFDF6;
  --display: "Fredoka", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --body: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--body); line-height: 1.5; color: var(--ink); background: linear-gradient(180deg, var(--bg1), var(--bg2) 480px) fixed; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.kk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.kk-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 8px max(12px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.kk-back { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .875rem; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
.kk-back:hover { background: var(--bg1); }
.kk-name { appearance: none; border: 0; background: none; font-family: var(--display); font-weight: 700; font-size: 1.125rem; cursor: pointer; margin-right: auto; padding: 6px 8px; border-radius: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-stars { font-weight: 700; background: var(--accent); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.kk-icon { appearance: none; border: 1px solid var(--line); background: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; flex: none; }
.kk-icon.off { opacity: .45; }
@media (max-width: 420px) { .kk-back .long { display: none; } .kk-name { font-size: 1rem; } }

/* Layout */
#app { padding: 16px 16px 56px; }
.kk-screen { max-width: 980px; margin: 0 auto; }
.kk-card { background: #fff; border-radius: 26px; padding: 24px; box-shadow: 0 2px 0 var(--line), 0 18px 40px -18px rgba(16, 45, 90, .35); max-width: 720px; margin: 0 auto; }
.kk-card.center { text-align: center; }
.kk-btn { appearance: none; border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: 12px 22px; font-weight: 600; cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .15s ease; }
.kk-btn:hover { transform: translateY(-1px); }
.kk-btn.primary { background: var(--accent); border-color: var(--accent-deep); box-shadow: 0 4px 0 var(--accent-deep); }
.kk-btn.ghost { border-color: var(--line); }
.kk-btn.small { padding: 6px 14px; min-height: 40px; font-size: .875rem; }
.kk-btn:disabled { opacity: .5; cursor: default; transform: none; }
.kk-link { appearance: none; border: 0; background: none; color: var(--blue); text-decoration: underline; cursor: pointer; font-weight: 600; padding: 4px; }
.kk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; justify-content: center; }
.kk-sub { color: var(--ink-soft); margin: 10px auto 0; max-width: 34em; }

/* Home */
.kk-home { text-align: center; }
.kk-mascot svg { width: 150px; height: 150px; display: block; margin: 0 auto; animation: kkBob 3.2s ease-in-out infinite; }
@keyframes kkBob { 50% { transform: translateY(-8px) rotate(-2deg); } }
.kk-title { font-size: clamp(2.25rem, 7vw, 3.5rem); margin-top: 4px; }
.kk-tagline { color: var(--ink-soft); font-size: 1.125rem; margin: 8px auto 22px; max-width: 32em; }
.kk-pick { font-size: 1.25rem; margin-bottom: 12px; }
.kk-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; max-width: 820px; margin: 0 auto; }
.kk-level { appearance: none; text-align: left; border: 3px solid transparent; background: #fff; border-radius: 22px; padding: 18px; cursor: pointer; display: grid; gap: 4px; box-shadow: 0 2px 0 var(--line), 0 12px 28px -16px rgba(16, 45, 90, .4); transition: transform .15s ease, border-color .15s ease; }
.kk-level:hover, .kk-level.current { border-color: var(--accent); }
.kk-level:hover { transform: translateY(-3px); }
.kk-level-icon { font-size: 2.25rem; line-height: 1; }
.kk-level-name { font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.kk-level-years { font-weight: 600; color: var(--good); font-size: .875rem; }
.kk-level-blurb { color: var(--ink-soft); font-size: .9375rem; }
.kk-note { color: var(--ink-soft); font-size: .875rem; max-width: 36em; margin: 22px auto 0; }

/* Menu */
.kk-menu-head { text-align: center; margin-bottom: 16px; }
.kk-menu-head h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
.kk-who { color: var(--ink-soft); margin: 6px 0 0; }
.kk-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.kk-mode { appearance: none; text-align: left; border: 0; background: #fff; border-radius: 22px; padding: 18px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 4px; align-items: start; box-shadow: 0 2px 0 var(--line), 0 12px 28px -16px rgba(16, 45, 90, .4); transition: transform .15s ease; position: relative; overflow: hidden; }
.kk-mode::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--accent); }
.kk-mode:hover { transform: translateY(-3px) rotate(-.4deg); }
.kk-mode-icon { grid-row: span 3; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 2rem; background: var(--bg1); }
.kk-mode-title { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.kk-mode-blurb { color: var(--ink-soft); font-size: .9rem; }
.kk-mode-stars { color: var(--accent-deep); letter-spacing: 2px; }
.kk-mode-stars .off, .kk-big-stars .off { color: #E3E7EE; }
.kk-mode-tag { grid-column: 2; font-size: .75rem; font-weight: 600; color: var(--ink-soft); }

/* Players */
.kk-players .kk-card { text-align: center; }
.kk-count-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.kk-count { appearance: none; border: 2px solid var(--line); background: #fff; border-radius: 18px; padding: 12px 6px; cursor: pointer; display: grid; gap: 4px; }
.kk-count b { font-family: var(--display); font-size: 1.75rem; }
.kk-count:hover { border-color: var(--accent); }

/* Playing */
.kk-play-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kk-play-title { font-size: 1.375rem; }
.kk-turn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #fff; border-radius: 16px; padding: 8px 10px; margin-bottom: 10px; box-shadow: 0 2px 0 var(--line); }
.kk-team { background: var(--bg1); border-radius: 999px; padding: 4px 10px; font-weight: 600; white-space: nowrap; }
.kk-team.now { background: var(--accent); }
.kk-team.win { background: #FFE9A8; }
.kk-turn-msg { margin-left: auto; font-family: var(--display); font-weight: 700; }
.kk-dots { display: flex; gap: 6px; justify-content: center; margin: 2px 0 14px; flex-wrap: wrap; }
.kk-dots span { width: 11px; height: 11px; border-radius: 50%; background: #D8E0E9; }
.kk-dots span.on { background: var(--good); }
.kk-dots span.now { background: var(--accent-deep); transform: scale(1.35); }
.kk-step { background: #fff; border-radius: 26px; padding: 20px; box-shadow: 0 2px 0 var(--line), 0 18px 40px -22px rgba(16, 45, 90, .35); }
.kk-prompt { font-family: var(--display); font-size: clamp(1.25rem, 4vw, 1.6rem); font-weight: 600; margin: 0 0 14px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.kk-hear { appearance: none; border: 2px solid var(--line); background: #fff; border-radius: 50%; width: 46px; height: 46px; cursor: pointer; font-size: 1.25rem; flex: none; }
.kk-art { text-align: center; margin-bottom: 10px; }
.kk-options { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.kk-options.cols-2 { --cols: 2; } .kk-options.cols-3 { --cols: 3; } .kk-options.cols-4 { --cols: 4; } .kk-options.cols-1 { --cols: 1; }
@media (max-width: 520px) { .kk-options.cols-4 { --cols: 2; } }
.kk-tile { appearance: none; border: 3px solid transparent; background: linear-gradient(180deg, #fff, #F7F9FC); border-radius: 22px; padding: 14px 8px; min-height: 96px; cursor: pointer; display: grid; place-items: center; gap: 6px; box-shadow: 0 4px 0 #DCE3EC; transition: transform .12s ease, box-shadow .12s ease; }
.kk-tile:not(:disabled):hover { transform: translateY(-2px); }
.kk-tile:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #DCE3EC; }
.kk-tile-art { font-size: clamp(2.5rem, 9vw, 3.6rem); line-height: 1.1; }
.kk-options.big .kk-tile-art { font-size: clamp(3rem, 12vw, 4.5rem); }
.kk-tile-label { font-weight: 600; font-size: 1rem; }
.kk-tile.right { border-color: var(--good); background: #EAFBF0; animation: kkPop .35s ease; }
.kk-tile.wrong { border-color: #F3B0B8; background: #FFF4F5; opacity: .7; animation: kkShake .35s ease; }
.kk-tile:disabled { cursor: default; }
@keyframes kkPop { 50% { transform: scale(1.08); } }
@keyframes kkShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.kk-feedback { margin-top: 14px; border-radius: 16px; }
.kk-feedback:empty { display: none; }
.kk-feedback.good, .kk-feedback.bad, .kk-feedback.soft { padding: 12px 16px; }
.kk-feedback.good { background: #EAFBF0; border: 1px solid #BBF0CF; }
.kk-feedback.bad { background: #FFF6EC; border: 1px solid #FFD6AE; }
.kk-feedback.soft { background: #EEF6FF; border: 1px solid #CFE3FB; }
.kk-next { display: flex; margin: 12px auto 0; }
.kk-confetti { position: fixed; width: 9px; height: 9px; border-radius: 2px; z-index: 50; pointer-events: none; animation: kkFly .9s ease-out forwards; }
@keyframes kkFly { to { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }

/* Results */
.kk-kicker { font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; font-size: .8125rem; margin: 0 0 6px; }
.kk-results h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
.kk-big-stars { font-size: 3rem; color: var(--accent-deep); letter-spacing: 6px; margin: 6px 0; }
.kk-score { margin: 6px 0 0; }
.kk-podium { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.kk-h2 { font-size: 1.125rem; margin-top: 18px; }
.kk-learned, .kk-missed { text-align: left; list-style: none; padding: 0; margin: 10px auto 0; max-width: 36em; display: grid; gap: 8px; }
.kk-learned li { background: #EEF6FF; border-radius: 12px; padding: 10px 14px 10px 40px; position: relative; }
.kk-learned li::before { content: "✓"; position: absolute; left: 14px; top: 9px; color: var(--good); font-weight: 700; }
.kk-missed li { background: #FFF6EC; border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.kk-missed .mq { font-weight: 600; }
.kk-missed .ma { color: var(--ink-soft); font-size: .9375rem; }

/* Shared game pieces */
.kk-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kk-chip { background: #fff; border-radius: 18px; box-shadow: 0 3px 0 #DCE3EC; padding: 10px 14px; font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1.1; min-width: 72px; text-align: center; }
.kk-input-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kk-input { flex: 0 1 220px; min-height: 52px; padding: 10px 14px; border: 3px solid var(--line); border-radius: 14px; font-size: 1.25rem; text-align: center; font-weight: 600; }
.kk-input:focus { border-color: var(--blue); outline: none; }
.kk-canvas-wrap { position: relative; touch-action: none; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.kk-canvas-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }
.kk-swatches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.kk-swatch { appearance: none; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.kk-swatch.sel { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.1); }

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