/* Speaklish – style. Tokeny zgodne z „Założeniami graficznymi”. */
@font-face { font-family: 'Andika'; font-weight: 400; font-display: swap; src: url(../fonts/andika-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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Andika'; font-weight: 400; font-display: swap; src: url(../fonts/andika-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Andika'; font-weight: 700; font-display: swap; src: url(../fonts/andika-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+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Andika'; font-weight: 700; font-display: swap; src: url(../fonts/andika-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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(../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+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(../fonts/nunito-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 900; font-display: swap; src: url(../fonts/nunito-latin-900-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, 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: 900; font-display: swap; src: url(../fonts/nunito-latin-ext-900-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #FFF8EC; --card: #FFFFFF; --ink: #2B2D42; --ink2: #4A4D63;
  --orange: #FF8A3D; --orange-d: #E8692A; --orange-dd: #B44E1A;
  --blue: #3D7BFF; --blue-d: #2B5FD9;
  --green: #2FB36B; --green-d: #1E8A50;
  --gold: #FFC93C; --gold-d: #D99A00;
  --grey: #C9C3B8; --shadow: #E8DCC8;
  --r-card: 24px;
  --head: 'Nunito', 'Andika', system-ui, sans-serif;
  --body: 'Andika', system-ui, sans-serif;
  --emoji: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { display: block; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

#app {
  position: relative; max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 18px;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center { align-items: center; text-align: center; }
.spacer56 { width: 56px; flex: none; }
.title { font-family: var(--head); font-weight: 900; font-size: 34px; line-height: 1.1; margin: 0; }
.sub { margin: 0; font-size: 20px; color: var(--ink2); }
.emoji { font-family: var(--emoji); line-height: 1; }

/* Karty i przyciski 3D */
.card3d { border: none; background: var(--card); border-radius: var(--r-card); box-shadow: 0 6px 0 var(--shadow); transition: transform .08s ease-out, box-shadow .08s ease-out; }
button.card3d:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow); }
.card-flat { background: var(--card); border-radius: var(--r-card); box-shadow: 0 4px 0 var(--shadow); }

.round { width: 56px; height: 56px; flex: none; border: none; border-radius: 50%; background: var(--card); box-shadow: 0 4px 0 var(--shadow); display: flex; align-items: center; justify-content: center; transition: transform .08s; }
.round svg { width: 30px; height: 30px; }
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.round.blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.round.sm { width: 48px; height: 48px; }
.round.sm svg { width: 26px; height: 26px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.chip { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 18px 0 8px; border-radius: 999px; font-family: var(--head); font-weight: 900; font-size: 20px; box-shadow: 0 4px 0 var(--shadow); }
.chip > svg { width: 30px; height: 30px; margin-left: 8px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; }
.avatar.sm { width: 42px; height: 42px; font-size: 26px; }
.avatar.lg { width: 64px; height: 64px; font-size: 38px; }
.avatar.xl { width: 88px; height: 88px; font-size: 52px; }

/* Dymek maskotki */
.bubble { display: inline-flex; align-items: center; gap: 12px; background: var(--card); border-radius: 24px; padding: 14px 18px; box-shadow: 0 4px 0 var(--shadow); font-family: var(--head); font-weight: 900; font-size: 24px; line-height: 1.2; }
.bubble.big { font-size: 28px; padding: 16px 22px; text-align: center; justify-content: center; }
.bubble b { color: var(--blue-d); }
.hello { display: flex; align-items: flex-end; gap: 10px; }
.hello .bubble { flex: 1; justify-content: space-between; margin-bottom: 22px; }
.fox-btn { width: 104px; height: 104px; padding: 0; border: none; background: none; flex: none; }
.fox-hello { width: 140px; height: 140px; margin-top: 20px; }
.fox-mid { width: clamp(96px, 20vh, 150px); height: clamp(96px, 20vh, 150px); }
.fox-result { width: 140px; height: 140px; }

/* Ekran profili i formularz rodzica */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; margin-top: 10px; }
.profile-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; }
.profile-name { font-family: var(--head); font-weight: 900; font-size: 22px; }
.add-ico { background: #F1ECE3; color: var(--ink2); }
.add-ico svg { width: 40px; height: 40px; }

.parent { display: flex; flex-direction: column; gap: 16px; padding-bottom: 20px; -webkit-user-select: text; user-select: text; }
.parent-card { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: 0 2px 0 var(--shadow); }
.ptitle { font-family: var(--head); font-weight: 900; font-size: 22px; margin: 0 0 8px; }
.ptitle-bar { font-family: var(--head); font-weight: 900; font-size: 22px; }
.psub { font-family: var(--head); font-weight: 800; font-size: 18px; margin: 18px 0 6px; }
.pnote { margin: 6px 0; color: var(--ink2); font-size: 16px; line-height: 1.4; }
.pnote.warn { color: #A84A10; }
.pform { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.pfield { display: flex; flex-direction: column; gap: 8px; border: none; padding: 0; margin: 0; font-weight: 700; }
.pfield input { font: inherit; font-size: 20px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--shadow); background: #FFFDF8; color: var(--ink); -webkit-user-select: text; user-select: text; }
.pfield input:focus { border-color: var(--blue); outline: none; }
.av-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; justify-items: center; }
.av-pick input { position: absolute; opacity: 0; pointer-events: none; }
.av-pick .avatar { border: 4px solid transparent; cursor: pointer; }
.av-pick input:checked + .avatar { border-color: var(--orange); }
.av-pick input:focus-visible + .avatar { outline: 4px solid var(--blue); outline-offset: 2px; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 2px solid var(--shadow); background: #FFFDF8; font-weight: 700; font-size: 16px; cursor: pointer; }
.pbtn.primary { background: var(--orange-d); border-color: var(--orange-d); color: #fff; font-family: var(--head); font-weight: 900; font-size: 20px; min-height: 56px; }
.pbtn.danger { color: #B3261E; border-color: #F2C4C0; }
.pbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.prow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F3EADB; }
.prow:last-of-type { border-bottom: none; }
.seg-ctl { display: inline-flex; background: #F3EADB; border-radius: 12px; padding: 3px; gap: 3px; }
.seg-ctl button { border: none; background: transparent; border-radius: 10px; min-height: 40px; padding: 6px 12px; font-weight: 700; font-size: 15px; }
.seg-ctl button.on { background: #fff; box-shadow: 0 1px 3px rgba(43, 45, 66, .18); }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
.ptable th, .ptable td { text-align: left; padding: 8px 4px; border-bottom: 1px solid #F3EADB; }
.ptable th { color: var(--ink2); font-weight: 700; }
.hard { margin: 4px 0; padding-left: 18px; }
.hard li { margin: 6px 0; }
.hard span { color: var(--ink2); font-size: 14px; }

/* Wybór zabawy */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; }
.tile.wide { grid-column: span 2; flex-direction: row; padding: 14px 20px; }
.tile.wide .tile-name { flex: 1; text-align: left; }
.tile-icon { width: 84px; height: 84px; border-radius: 50%; border: 5px solid; display: flex; align-items: center; justify-content: center; flex: none; }
.tile-icon svg { width: 54px; height: 54px; }
.icon-num { font-family: var(--head); font-weight: 900; font-size: 26px; }
.tile-name { font-family: var(--head); font-weight: 900; font-size: 22px; }
.mini-stars { display: inline-flex; gap: 2px; }
.mini-stars svg { width: 20px; height: 20px; }
.mini-stars.xs svg { width: 16px; height: 16px; }
.bottom-row { display: flex; justify-content: center; gap: 14px; margin-top: auto; }
.pill { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 14px; border-radius: 999px; font-family: var(--head); font-weight: 800; font-size: 20px; box-shadow: 0 4px 0 var(--shadow); }
.pill svg { width: 30px; height: 30px; }
.gate { position: relative; overflow: hidden; color: var(--ink2); }
.gate-ring { position: absolute; inset: 0; background: #FFE3CF; transform-origin: left; transform: scaleX(0); }
.gate.holding .gate-ring { transform: scaleX(1); transition: transform 2s linear; }
.gate > :not(.gate-ring) { position: relative; }

/* Ile pytań */
.sec-chip { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 8px; border-radius: 999px; font-family: var(--head); font-weight: 900; font-size: 22px; }
.sec-chip-ico { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.sec-chip-ico svg { width: 32px; height: 32px; }
.sec-chip-ico .icon-num { font-size: 15px; }
.counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.count { height: 170px; border: 6px solid #fff; border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.count.is-on { border-color: var(--orange); }
.count-num { font-family: var(--head); font-weight: 900; font-size: 56px; line-height: 1; }
.dots { display: grid; grid-template-columns: repeat(5, 14px); gap: 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.play-btn { align-self: center; width: 120px; height: 120px; border: none; border-radius: 50%; background: var(--orange-d); color: #fff; box-shadow: 0 8px 0 var(--orange-dd); display: flex; align-items: center; justify-content: center; transition: transform .08s; }
.play-btn svg { width: 56px; height: 56px; margin-left: 6px; }
.play-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--orange-dd); }

/* Pytanie */
.progress { flex: 1; max-width: 260px; display: flex; align-items: center; gap: 4px; padding: 10px 12px; background: var(--card); border-radius: 999px; box-shadow: 0 4px 0 var(--shadow); }
.seg { flex: 1; height: 14px; border-radius: 999px; background: #EFE6D6; }
.seg.done { background: var(--gold); }
.seg.now { background: #FFF3CC; box-shadow: inset 0 0 0 2px var(--gold); animation: nowPulse 1.2s ease-in-out infinite; }
.progress svg { width: 26px; height: 26px; flex: none; margin-left: 2px; }
.quiz-body { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.ask { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ask.with-stim { justify-content: flex-start; }
.stim { position: relative; width: 100%; min-height: 150px; flex: 1; max-height: 260px; display: flex; align-items: center; justify-content: center; padding: 16px; }
.stim .emoji.big { font-size: clamp(80px, 16vh, 130px); }
.fox-corner { position: absolute; left: -10px; bottom: -14px; width: 72px; height: 72px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.opts.n3 .opt:last-child { grid-column: 1 / span 2; justify-self: center; width: calc(50% - 8px); }
.opt { position: relative; height: clamp(120px, 21vh, 190px); border: 6px solid transparent; display: flex; align-items: center; justify-content: center; padding: 6px; }
.opts.n2 .opt { height: clamp(140px, 26vh, 220px); }
.opt .blob { width: 72%; height: 72%; }
.opt .scene { width: 100%; height: 100%; max-width: 160px; }
.opt .sign { width: 78%; height: 78%; }
.opt > .emoji { font-size: clamp(64px, 11vh, 96px); }
.digit { font-family: var(--head); font-weight: 900; font-size: clamp(56px, 10vh, 84px); line-height: 1; }
.group { display: grid; gap: 4px; justify-content: center; align-content: center; }
.gcell { display: flex; align-items: center; justify-content: center; line-height: 1; }
.gcell .emoji { font-size: 1em; }
.gcell .upimg, .gcell svg { width: 1em; height: 1em; object-fit: contain; }
.group-lg { font-size: clamp(40px, 7vh, 60px); }
.group-sm { font-size: clamp(26px, 4.5vh, 38px); }
.group-xs { gap: 3px; font-size: clamp(22px, 4vh, 34px); }
.upimg { display: block; object-fit: contain; -webkit-user-drag: none; }
.opt > .upimg { width: 82%; height: 82%; }
.stim-img { display: flex; align-items: center; justify-content: center; font-size: clamp(80px, 16vh, 130px); }
.stim-img .upimg, .stim-img svg { width: 1.2em; height: 1.2em; }
.tile-icon .upimg, .sec-chip-ico .upimg { width: 70%; height: 70%; }
.tile-icon > .emoji { font-size: 44px; }
.sec-chip-ico > .emoji { font-size: 24px; }
.loading { justify-content: center; opacity: .9; }
.opt.is-right { border-color: var(--green); box-shadow: 0 6px 0 var(--green-d); animation: pop .35s ease-out; }
.opt.is-wrong { background: #F1ECE3; box-shadow: none; opacity: .5; filter: grayscale(1); animation: shake .3s ease-in-out; }
.opt.is-hint { animation: hintPulse 1s ease-in-out infinite; box-shadow: 0 0 0 5px var(--gold), 0 6px 0 var(--shadow); }
.badge-ok { position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%; background: var(--green); border: 4px solid #fff; color: #fff; display: flex; align-items: center; justify-content: center; }
.badge-ok svg { width: 24px; height: 24px; }

/* Wynik */
.rstars { display: flex; align-items: flex-end; gap: 6px; margin-top: 10px; }
.rstar svg { width: 76px; height: 76px; }
.rstar.r1 svg { width: 100px; height: 100px; margin-bottom: 14px; }
.rstar.r0 { transform: rotate(-12deg); }
.rstar.r2 { transform: rotate(12deg); }
.rstar { animation: starIn .45s ease-out both; }
.rstar.r1 { animation-delay: .15s; }
.rstar.r2 { animation-delay: .3s; }
.stickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.stickers.n1 { grid-template-columns: minmax(0, 120px); justify-content: center; }
.sticker { height: 104px; font-size: 56px; border: 5px solid transparent; display: flex; align-items: center; justify-content: center; }
.sticker.is-picked { border-color: var(--gold); box-shadow: 0 6px 0 var(--gold-d); transform: scale(1.08); animation: pop .35s ease-out; }
.sticker.is-dim { opacity: .35; }
.end-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.end-btn { border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--head); font-weight: 800; font-size: 18px; }
.end-ico { width: 80px; height: 80px; border-radius: 50%; background: var(--card); box-shadow: 0 6px 0 var(--shadow); display: flex; align-items: center; justify-content: center; transition: transform .08s; }
.end-ico svg { width: 36px; height: 36px; }
.end-ico.orange { background: var(--orange-d); color: #fff; box-shadow: 0 6px 0 var(--orange-dd); }
.end-btn:active .end-ico { transform: translateY(4px); }

/* Album */
.album { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-bottom: 20px; }
.acell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(36px, 10vw, 52px); border-radius: 20px; }
.acell.locked { background: #F1ECE3; color: var(--grey); font-family: var(--head); font-weight: 900; font-size: 28px; }
.bounce { animation: pop .4s ease-out; }

/* Konfetti */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.conf { position: absolute; width: 10px; height: 16px; border-radius: 2px; animation: confBurst 1s ease-out forwards; }
.conf.fall { top: -20px; animation: confFall 2s ease-in forwards; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 17%, 50%, 83% { transform: translateX(-8px); } 33%, 67% { transform: translateX(8px); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1.05); } }
@keyframes hintPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes nowPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes starIn { 0% { opacity: 0; transform: scale(.3) rotate(-30deg); } 100% { opacity: 1; } }
@keyframes confBurst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rot)); opacity: 0; } }
@keyframes confFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(110vh) rotate(var(--rot)); opacity: .8; } }

/* Memory: wybór liczby kart i plansza z odwracanymi kartami */
.counts.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.counts.n3 .count { height: 160px; }
.mdots { display: grid; grid-template-columns: repeat(var(--mcols, 5), 10px); gap: 4px; }
.mdot { width: 10px; height: 12px; border-radius: 3px; background: var(--blue); }
.mstatus { align-self: center; font-family: var(--head); font-weight: 800; font-size: 18px; padding: 6px 16px; }
.mboard {
  --gap: 10px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin: 0 auto;
  /* plansza mieści się na ekranie bez przewijania: szerokość ograniczona wysokością okna */
  width: min(100%, calc((100vh - 210px) / var(--rows) * var(--cols) / 1.15));
  width: min(100%, calc((100dvh - 210px) / var(--rows) * var(--cols) / 1.15));
}
.mcard { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); aspect-ratio: 1 / 1.1; padding: 0; border: none; background: none; perspective: 700px; }
.mcard.is-done { animation: pop .35s ease-out; cursor: default; }
.mflip { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .35s ease; }
.mcard.is-open .mflip { transform: rotateY(180deg); }
.mface { position: absolute; inset: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.mback { background: linear-gradient(135deg, var(--blue), var(--blue-d)); box-shadow: 0 5px 0 #1F469F; color: rgba(255, 255, 255, .6); font-family: var(--head); font-weight: 900; font-size: clamp(24px, 7vw, 44px); }
.mfront { transform: rotateY(180deg); background: var(--card); border: 4px solid var(--gold); box-shadow: 0 5px 0 var(--shadow); padding: 2px; container-type: size; }
.mcard.is-done .mfront { border-color: var(--green); background: #E6F6DF; box-shadow: 0 5px 0 var(--green-d); }
.mpic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.mpic > .emoji { font-size: 60cqmin; }
.mpic > .upimg, .mpic > svg { width: 94%; height: 94%; }
.mword { font-family: var(--head); font-weight: 900; color: var(--ink); text-align: center; line-height: 1.05; overflow-wrap: anywhere; font-size: 36cqmin; }
.mword.mid { font-size: 25cqmin; }
.mword.long { font-size: 21cqmin; }
.mword.xl { font-size: 16cqmin; }
.mword.two { font-size: 23cqmin; overflow-wrap: normal; } /* nazwy dwuczłonowe („pencil case”) w dwóch liniach */

/* Premium: kłódki i karta w panelu rodzica */
.tile-icon, .set-chip, .count, .avatar.add-ico { position: relative; }
.lock-badge { position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 var(--shadow); display: flex; align-items: center; justify-content: center; }
.lock-badge > .emoji { font-size: 17px; }
.set-chip .lock-badge { width: 22px; height: 22px; right: -7px; bottom: -7px; }
.set-chip .lock-badge > .emoji { font-size: 12px; }
.count .lock-badge { right: 10px; bottom: auto; top: 10px; }
.is-locked .tile-icon > :not(.lock-badge), .is-locked .tile-name, .set-chip.is-locked > .emoji, .count.is-locked > :not(.lock-badge), .profile-btn.is-locked .profile-name { opacity: .5; filter: grayscale(.7); }
.lock-big { font-size: 72px; }
.acell.prem { background: #F1ECE3; }
.acell.prem .emoji { font-size: 26px; opacity: .6; }
.shake { animation: shake .3s ease-in-out; }
.pnote.ok { color: var(--green-d); }
.perks { margin: 6px 0 10px; padding-left: 22px; color: var(--ink); font-size: 16px; line-height: 1.45; }

/* Zegar */
.levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lvl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 5px solid #fff; border-radius: 22px; }
.lvl.is-on { border-color: var(--orange); }
.lvl .clock { width: 58px; height: 58px; flex: none; }
.lvl-name { font-family: var(--head); font-weight: 900; font-size: 18px; text-align: left; line-height: 1.1; }
.count.sm { height: 84px; }
.count.sm .count-num { font-size: 44px; }
.opt > .clock { width: auto; height: 86%; aspect-ratio: 1; }
.stim-clock { display: flex; align-items: center; justify-content: center; }
.stim-clock .clock { width: clamp(150px, 26vh, 240px); height: clamp(150px, 26vh, 240px); }
.time-txt { font-family: var(--head); font-weight: 900; font-size: clamp(19px, 3.2vh, 26px); line-height: 1.15; text-align: center; color: var(--ink); padding: 0 6px; }

/* Zestawy słów (wybór przed grą) */
.sets-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.sets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.set-chip { width: 52px; height: 52px; padding: 0; border: 4px solid transparent; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.set-chip > .emoji { font-size: 26px; }
.set-chip.is-on { border-color: var(--orange); background: #FFF4EA; }
.set-all { font-family: var(--head); font-weight: 900; font-size: 15px; }
.set-chip.range { width: auto; min-width: 72px; padding: 0 12px; }
.set-chip.range .set-all { font-size: 18px; }
.sets-names { margin: 0; font-family: var(--head); font-weight: 800; font-size: 16px; color: var(--ink2); text-align: center; }

/* Krzyżówka */
.count-sub { font-family: var(--head); font-weight: 800; font-size: 16px; color: var(--ink2); }
.xwrap { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.xboard {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 4px; margin: 0 auto;
  width: min(100%, calc(var(--cols) * 50px)); container-type: inline-size;
}
.xcell {
  position: relative; aspect-ratio: 1; border: none; padding: 0; border-radius: 9px; background: var(--card); box-shadow: 0 3px 0 var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 900; color: var(--ink); font-size: calc(100cqi / var(--cols) * .56); line-height: 1;
}
.xcell.none { background: transparent; box-shadow: none; }
.xcell i { position: absolute; top: 2px; left: 4px; font-style: normal; font-weight: 800; color: var(--ink2); font-size: calc(100cqi / var(--cols) * .22); }
.xcell.sel { background: #FFF4CC; box-shadow: 0 0 0 3px var(--gold); }
.xcell.cur { background: #FFE9D9; box-shadow: 0 0 0 4px var(--orange); }
.xcell.ok { background: #E6F6DF; box-shadow: 0 3px 0 var(--green); color: var(--green-d); }
.xcell.bad { background: #FDE2E2; box-shadow: 0 0 0 3px #E53935; color: #C62828; animation: shake .3s ease-in-out; }
.xside { display: flex; flex-direction: column; gap: 14px; }
.xclues { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.xclue { position: relative; width: 66px; height: 70px; padding: 0; display: flex; align-items: center; justify-content: center; border: 4px solid transparent; }
.xclue > .emoji { font-size: 36px; }
.xclue > .upimg, .xclue > svg { width: 44px; height: 44px; }
.xclue i { position: absolute; top: 1px; left: 5px; font-style: normal; font-family: var(--head); font-weight: 900; font-size: 12px; color: var(--ink2); }
.xclue.on { border-color: var(--gold); }
.xclue.done { background: #E6F6DF; box-shadow: 0 6px 0 var(--green-d); }
.xclue.done::after { content: '✓'; position: absolute; top: 0; right: 5px; font-weight: 900; font-size: 14px; color: var(--green-d); }
.xbank {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding: 10px 0 max(6px, env(safe-area-inset-bottom)); background: var(--bg); min-height: 74px;
}
.xtile {
  width: 52px; height: 56px; border: none; border-radius: 14px; background: var(--blue); color: #fff; box-shadow: 0 5px 0 #1F469F;
  font-family: var(--head); font-weight: 900; font-size: 30px; transition: transform .08s;
}
.xtile:active { transform: translateY(3px); box-shadow: 0 2px 0 #1F469F; }
.xtile.used { background: #E8E2D6; box-shadow: none; color: transparent; }

/* Tablet w poziomie: bodziec po lewej, odpowiedzi po prawej */
@media (min-width: 760px) and (orientation: landscape) {
  #app { max-width: 1040px; }
  .screen-quiz .quiz-body { display: grid; grid-template-columns: 45% 1fr; align-items: center; gap: 32px; }
  .screen-quiz .opt { height: clamp(140px, 30vh, 220px); }
  .screen-home .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .screen-home .tile.wide { grid-column: auto; flex-direction: column; }
  .screen-home .tile.wide .tile-name { text-align: center; flex: none; }
  .album { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .screen-xgame .xwrap { flex-direction: row; align-items: flex-start; gap: 32px; }
  .screen-xgame .xboard { flex: 1; margin: 0; width: auto; max-width: min(calc(var(--cols) * 60px), calc((100vh - 120px) / var(--rows) * var(--cols))); }
  .screen-xgame .xside { flex: 0 0 340px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Konto: logowanie Google / kod e-mail */
.google-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 8px 0; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 14px; margin: 10px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--shadow); }
.otp-row { display: flex; gap: 8px; justify-content: flex-start; margin: 6px 0 4px; }
.otp { width: 46px; height: 56px; text-align: center; font-family: var(--head); font-weight: 900; font-size: 26px; border: 2px solid var(--shadow); border-radius: 12px; background: #fff; color: var(--ink); }
.otp:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 61, .25); }
@media (max-width: 380px) { .otp { width: 40px; height: 50px; font-size: 22px; } .otp-row { gap: 6px; } }
.ptag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #F1ECE3; font-size: 14px; color: var(--ink); }
.pnote.small { font-size: 14px; }
.linkbtn { border: none; background: none; padding: 0; color: var(--blue-d); font: inherit; text-decoration: underline; cursor: pointer; }
.pnote a { color: var(--blue-d); }

/* Zadanie z klasy */
/* Warcaby */
.tile.is-ready { box-shadow: 0 6px 0 var(--shadow), 0 0 0 4px #8E6CEF55; }
.ck-prog { font: 800 14px/1 var(--head); color: #5B3FC4; }
.ck-dot { width: 54px; height: 54px; border-radius: 50%; box-shadow: inset 0 -5px 0 rgba(0,0,0,.2), 0 3px 0 rgba(0,0,0,.18); }
.ck-dot.r { background: #E53935; }
.ck-dot.w { background: #FFF8EC; border: 4px solid #CFC3A8; box-sizing: border-box; }
.ck-levels .count { height: 90px; }
.ck-lv { font: 900 22px/1 var(--head); color: var(--ink); }
.ck-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ck-frame { display: grid; grid-template-columns: 16px minmax(0, 1fr); width: min(100%, 440px); }
.ck-cols { display: grid; grid-template-columns: repeat(8, 1fr); }
.ck-rows { display: grid; grid-template-rows: repeat(8, 1fr); }
.ck-col, .ck-row { display: flex; align-items: center; justify-content: center; font: 800 12px/1 var(--head); color: #8A7E66; }
.ck-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 0 var(--shadow); touch-action: manipulation; }
.ck-sq { position: relative; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; margin: 0; }
.ck-sq.light { background: #F2E2C4; }
.ck-sq.dark { background: #A8744F; cursor: pointer; }
.ck-sq.last { background: #B98760; }
.ck-sq.sel { background: #FFC93C; }
.ck-sq.via { background: #8FB5FF; }
.ck-sq.hl::after { content: ''; position: absolute; inset: 26%; border-radius: 50%; background: #3D7BFF; opacity: .75; }
.ck-sq.hint { box-shadow: inset 0 0 0 4px #FF8A3D; }
.ck-pc { position: relative; width: 78%; height: 78%; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), 0 2px 0 rgba(0,0,0,.25); box-sizing: border-box; }
.ck-pc.r { background: #E53935; }
.ck-pc.w { background: #FFF8EC; border: 3px solid #CFC3A8; }
.ck-pc.king::after { content: '♛'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #FFC93C; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.ck-pc.w.king::after { color: #B8860B; }
.ck-sq.must .ck-pc { animation: ckglow 1.4s ease-in-out infinite; }
@keyframes ckglow { 50% { box-shadow: inset 0 -4px 0 rgba(0,0,0,.25), 0 0 0 5px #FFC93C; } }
.ck-status { margin: 0; text-align: center; font: 900 20px/1.2 var(--head); color: var(--ink); min-height: 1.3em; }
.ck-count { margin: 0; text-align: center; font: 700 14px/1 var(--body); color: #6B6E85; }
.ck-bar { display: flex; gap: 10px; justify-content: center; }
.ck-bar .pbtn:disabled { opacity: .45; }
.ck-note { margin: 4px 0 0; text-align: center; font: 800 16px/1.2 var(--head); color: var(--ink); }
.ck-note.ready { color: var(--green-d, #2A9D5C); }
/* Czas przed ekranem */
.time-up .fox-btn { cursor: default; }
.time-up { flex-wrap: wrap; }
.time-up-pl { flex: 0 0 100%; margin: 6px 16px 0; text-align: center; font-size: 14px; color: #6B6E85; }
.time-up-note { margin: 0 0 8px; text-align: center; font: 900 20px/1.2 var(--head); color: var(--ink); }
.time-ring { flex: none; width: 30px; height: 30px; display: inline-flex; }
.time-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.time-ring .tr-bg, .time-ring .tr-fg { fill: none; stroke-width: 5; }
.time-ring .tr-bg { stroke: #EADFC9; }
.time-ring .tr-fg { stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 1.5s ease; }
.time-ring.lv-ok .tr-fg { stroke: var(--green); }
.time-ring.lv-mid .tr-fg { stroke: #F5B700; }
.time-ring.lv-low .tr-fg { stroke: var(--orange-d); }
.tl-select { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--shadow); background: #FFFDF8; color: var(--ink); }
.hbar.over i { background: var(--orange-d); }
/* Wykreślanka */
.ws-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ws-grid { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 480px); aspect-ratio: 1; background: #fff; border-radius: 18px; box-shadow: 0 5px 0 var(--shadow); padding: 4px; box-sizing: border-box; touch-action: none; user-select: none; -webkit-user-select: none; }
.ws-cell { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; font: 900 clamp(14px, calc(min(100vw - 32px, 480px) / var(--n) * 0.55), 30px)/1 var(--head); color: var(--ink); cursor: pointer; }
.ws-cell.sel { color: #fff; }
.ws-cell.sel::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; background: #8E6CEF; z-index: -1; }
.ws-cell.hint1 { outline: 3px solid var(--orange); outline-offset: -3px; border-radius: 50%; animation: wsblink 0.9s ease-in-out infinite; } /* obwódka widoczna także bez animacji */
.ws-cell.hint2 { background: #FFF1C2; border-radius: 6px; }
@keyframes wsblink { 50% { color: #fff; background: var(--orange); border-radius: 50%; } }
.ws-lines { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); pointer-events: none; z-index: 0; }
.ws-line { stroke-width: 0.78; stroke-linecap: round; opacity: 0.38; }
.ws-line.cur { opacity: 0.5; }
.ws-line.miss { animation: wsshake 0.4s; }
@keyframes wsshake { 25% { transform: translateX(-0.12px); } 75% { transform: translateX(0.12px); } }
.ws-bar { font: 900 18px/1 var(--head); color: var(--ink); }
.ws-pics { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ws-pic { width: 76px; padding: 6px 4px; border: 4px solid #fff; border-radius: 18px; background: var(--card); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ws-pic .ws-img { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.ws-pic .ws-img > * { max-width: 100%; max-height: 100%; }
.ws-pic .ws-img > .emoji { font-size: 44px; }
.ws-pic .ws-cap { min-height: 16px; font: 700 14px/1.1 var(--body); color: var(--ink); }
.ws-pic.is-target { border-color: var(--orange); }
.ws-pic.is-found { border-color: var(--c); background: #fff; }
.ws-hint span { font-size: 28px; line-height: 1; }
/* PIN rodzica */
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 16px 24px; text-align: center; }
.pin-title { font-family: var(--head); font-weight: 900; font-size: 26px; margin: 8px 0 0; }
.pin-dots { display: flex; gap: 16px; margin: 10px 0 2px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--orange-d); }
.pin-dots i.on { background: var(--orange-d); }
.pin-msg { min-height: 1.4em; margin: 0; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; margin: 4px 0 10px; }
.pin-key { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.12); font: 900 30px/1 var(--head); color: var(--ink); cursor: pointer; }
.pin-key:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.pin-key.del { background: transparent; box-shadow: none; font-size: 26px; }
.task-tile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; border: 4px solid var(--orange); background: #FFF4EA; box-shadow: 0 6px 0 var(--orange-dd); }
.task-tile.is-done { border-color: var(--green); background: #E6F6DF; box-shadow: 0 6px 0 var(--green-d); }
.task-pin > .emoji { font-size: 34px; }
.task-name { flex: 1; text-align: left; font-family: var(--head); font-weight: 900; font-size: 22px; }
.task-count { font-family: var(--head); font-weight: 900; font-size: 18px; color: var(--orange-dd); }
.task-tile.is-done .task-count { color: var(--green-d); }
.cwords { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cword { width: 56px; height: 56px; border-radius: 16px; background: var(--card); box-shadow: 0 3px 0 var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cword > .emoji { font-size: 32px; }
.cword > .upimg, .cword > svg { width: 44px; height: 44px; }
.cwords.small { justify-content: flex-start; margin: 6px 0; }
.cwords.small .cword { width: 64px; height: 72px; }
.cwords.small .cword > .emoji { font-size: 26px; }
.cwords.small .cword > .upimg { width: 34px; height: 34px; }
.cword small { font-size: 11px; color: var(--ink2); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctask-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ctask-btn { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-family: var(--head); font-weight: 900; font-size: 22px; }
.ctask-btn > .emoji { font-size: 44px; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin: 6px 0; }
.hbar { flex: 1; height: 100%; background: #F1ECE3; border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.hbar i { display: block; width: 100%; background: var(--gold); }
.hbar.ok i { background: var(--green); }
.pcheck { display: flex; align-items: center; gap: 8px; font-size: 17px; padding: 4px 0; }
.pcheck input { width: 20px; height: 20px; }
