:root {
  --ink: #2A2550;
  --ink-soft: #6B6790;
  --primary: #6C4CF1;
  --primary-d: #4D2FD0;
  --yellow: #FFC93C;
  --yellow-d: #E0A400;
  --green: #22C38E;
  --green-d: #149A6C;
  --red: #FA5252;
  --red-d: #C92A2A;
  --line: #E6E1F7;
  /* +12px: iOS 26 rozmywa pas tuż pod paskiem statusu, treść zaczyna się poniżej */
  --pad-t: max(10px, calc(env(safe-area-inset-top) + 12px));
  --pad-r: max(14px, env(safe-area-inset-right));
  --pad-b: max(10px, env(safe-area-inset-bottom));
  --pad-l: max(14px, env(safe-area-inset-left));
  /* 1vw / 1vh ekranu gry; w trybie "Obróciłem" (strona obrócona o 90°) osie są zamienione */
  --vw: 1vw;
  --vh: 1vh;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background:
    radial-gradient(circle at 8% 12%, #FFE3A3 0 9vmax, transparent 9.2vmax),
    radial-gradient(circle at 96% 90%, #C9E7FF 0 13vmax, transparent 13.2vmax),
    radial-gradient(circle at 90% 6%, #FFD0E0 0 6vmax, transparent 6.2vmax),
    linear-gradient(160deg, #FFF4DE, #EAF4FF);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
input { user-select: text; -webkit-user-select: text; }
svg { display: block; }

h1 { margin: 0; font-weight: 900; font-size: clamp(22px, 4.6vmin + 6px, 40px); line-height: 1.1; }

#app { position: relative; flex: 1; min-height: 0; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
  animation: screen-in .3s ease both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }

/* --- przyciski --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  border: 0;
  border-radius: 999px;
  padding: .7em 1.4em;
  font-size: clamp(17px, 2vmin + 10px, 22px);
  font-weight: 900;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 5px 0 var(--primary-d), 0 10px 18px rgba(77, 47, 208, .22);
  transition: transform .08s, box-shadow .08s;
  white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-d); }
.btn-big { font-size: clamp(20px, 2.4vmin + 12px, 28px); }
.btn-small { font-size: 16px; padding: .5em 1.1em; }
.btn-green { background: var(--green); box-shadow: 0 5px 0 var(--green-d), 0 10px 18px rgba(20, 154, 108, .25); }
.btn-green:active { box-shadow: 0 1px 0 var(--green-d); }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 var(--yellow-d); }
.btn-yellow:active { box-shadow: 0 1px 0 var(--yellow-d); }
.btn-red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn-red:active { box-shadow: 0 1px 0 var(--red-d); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.btn-ghost:active { box-shadow: 0 1px 0 var(--line); }

.icon-btn {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 var(--line);
}
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.corner-btn { position: absolute; top: var(--pad-t); left: var(--pad-l); z-index: 2; }

/* --- ekran powitalny --- */
.screen-welcome { justify-content: center; align-items: center; }
.welcome-wrap { display: flex; align-items: center; gap: clamp(16px, 5vw, 56px); }
.mascot-box .mascot { width: clamp(110px, 30vmin, 220px); height: auto; }
.bob { animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.name-form { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 3vmin, 20px); text-align: center; }
.name-form input {
  width: min(78vw, 360px);
  font: inherit;
  font-size: clamp(24px, 3vmin + 14px, 34px);
  font-weight: 900;
  text-align: center;
  color: var(--primary);
  padding: .35em .6em;
  border: 4px solid var(--line);
  border-radius: 22px;
  background: #fff;
  outline: none;
}
.name-form input:focus { border-color: var(--primary); }
.name-form input::placeholder { color: #C5BFE3; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (orientation: portrait) {
  .welcome-wrap { flex-direction: column; }
}

.logo { display: flex; justify-content: center; gap: .02em; font-size: clamp(30px, 6vmin + 10px, 54px); font-weight: 900; line-height: 1; }
.logo span {
  color: var(--c);
  text-shadow: 0 .06em 0 rgba(42, 37, 80, .18);
  -webkit-text-stroke: .04em #fff;
  paint-order: stroke fill;
  display: inline-block;
  animation: logo-hop 2.4s calc(var(--i) * .12s) ease-in-out infinite;
}
@keyframes logo-hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-.12em) rotate(-4deg); } }

/* --- chłopiec / dziewczynka --- */
.screen-gender { align-items: center; justify-content: center; gap: clamp(10px, 3vmin, 24px); text-align: center; }
.gender-cards { display: flex; gap: clamp(14px, 4vw, 40px); min-height: 0; flex: 0 1 auto; max-height: 72%; }
.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 28px;
  padding: 14px 22px 12px;
  background: #fff;
  box-shadow: 0 6px 0 var(--line);
  font-size: clamp(18px, 2.5vmin + 8px, 24px);
  font-weight: 900;
  min-height: 0;
}
.gender-card.boy { background: linear-gradient(#E3F1FF, #fff); }
.gender-card.girl { background: linear-gradient(#FFE3EF, #fff); }
.gender-card .avatar { height: clamp(140px, 48vmin, 340px); width: auto; flex: 1; min-height: 0; }
.gender-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }

/* --- kreator postaci --- */
.screen-creator { flex-direction: row; gap: clamp(10px, 2vw, 20px); }
.creator-stage {
  flex: 0 0 36%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(#DDEEFF, #ffffffb0 70%);
  min-height: 0;
}
.stage-name { font-weight: 900; font-size: clamp(18px, 2vmin + 10px, 26px); }
/* Postać wypełnia pudełko przez position: absolute. Safari (iPhone) nie liczy height: 100% + width: auto
   dla SVG w elemencie flex i postać znikała. SVG sam zachowuje proporcje (viewBox). */
.stage-avatar { position: relative; flex: 1 1 0; align-self: stretch; min-height: 120px; min-width: 0; }
.stage-avatar .avatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar.bounce { animation: bounce .35s ease; transform-origin: 50% 100%; }
@keyframes bounce { 40% { transform: scale(1.04, .96); } 70% { transform: scale(.98, 1.03); } }

.creator-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tabs { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-soft);
  background: #fff;
  box-shadow: 0 3px 0 var(--line);
}
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-d); }
.options {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: #fff;
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 0 var(--line);
}
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--c);
  box-shadow: 0 0 0 2px var(--line), inset 0 -5px 0 rgba(0, 0, 0, .12);
  transition: transform .12s;
}
.swatch.selected { transform: scale(1.1); box-shadow: 0 0 0 4px var(--primary), inset 0 -5px 0 rgba(0, 0, 0, .12); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 3px solid transparent;
  border-radius: 18px;
  background: #F4F1FF;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}
.tile .avatar { width: 100%; height: 66px; }
.tile.selected { border-color: var(--primary); background: #fff; color: var(--primary); }
.creator-actions { flex: none; display: flex; justify-content: space-between; gap: 10px; padding-bottom: 5px; }

@media (orientation: portrait) {
  .screen-creator { flex-direction: column; }
  .creator-stage { flex: 0 0 34%; flex-direction: row; }
  .stage-name { writing-mode: initial; }
}

/* --- menu --- */
/* Pasek menu: postać, pod nią „Cześć, …!”; po prawej przyciski, pod nimi gwiazdki, żetony i czas. */
.topbar {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "avatar actions" "hello chips";
  align-items: center;
  gap: 6px 10px;
}
.topbar .avatar-btn { grid-area: avatar; }
.topbar .hello { grid-area: hello; }
.topbar .chips { grid-area: chips; justify-content: flex-end; }
/* Delikatna linia oddziela pasek od kafelków gier (na iOS przy górnej krawędzi i tak jest rozmycie). */
.screen-menu .topbar { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 2px solid rgba(42, 37, 80, .08); }
.top-actions { grid-area: actions; display: flex; gap: 10px; justify-content: flex-end; }
.avatar-btn {
  position: relative;
  flex: none;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(#CFE6FF, #F2F8FF);
  box-shadow: 0 4px 0 var(--line);
}
.avatar-btn .avatar { width: 100%; height: 100%; border-radius: 50%; }
.edit-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.edit-badge svg { width: 14px; height: 14px; }
.hello { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.hello strong { font-size: clamp(20px, 2vmin + 12px, 28px); font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--line);
}
.chip svg { width: 24px; height: 24px; }
.chip-time { padding-left: 10px; }
/* Wąski ekran (telefon w pionie): gwiazdki, żetony i czas zabawy w osobnym rzędzie pod imieniem. */
@media (max-width: 600px) {
  .topbar { grid-template-areas: "avatar actions" "hello hello" "chips chips"; }
  .topbar .chips { justify-content: flex-start; }
  .topbar .chip { font-size: 16px; }
}
.game-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 18px); padding-bottom: 6px; }
/* więcej niż 12 gier: 5 kolumn w poziomie, żeby kafelki nie były za niskie */
@media (orientation: landscape) { .game-grid:has(> :nth-child(13)) { grid-template-columns: repeat(5, 1fr); } }
.game-tile {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 12px;
  border: 0;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(160deg, var(--c2), var(--c1));
  box-shadow: 0 6px 0 rgba(42, 37, 80, .18), inset 0 -6px 0 rgba(0, 0, 0, .08);
  overflow: hidden;
  transition: transform .1s;
}
.game-tile:active { transform: translateY(4px) scale(.98); }
/* Gwiazdka „ulubiona” w rogu kafelka: pusta (obrys) albo żółta */
.fav-star {
  position: absolute; top: 0; right: 0; z-index: 1;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; color: rgba(255, 255, 255, .35); -webkit-text-stroke: 1.5px rgba(255, 255, 255, .9);
}
.fav-star.on { color: #FFD43B; -webkit-text-stroke: 1.5px #B8860B; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.game-art { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.game-art svg { width: 100%; height: 100%; max-height: 160px; }
.game-name { font-size: clamp(15px, 1.5vw + 8px, 22px); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); text-align: center; line-height: 1.1; }
@media (orientation: portrait) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .chip { font-size: 16px; }
}
@media (max-width: 520px) {
  .chips .chip { padding: 4px 9px 4px 5px; }
  .topbar .icon-btn { width: 42px; height: 42px; }
  .topbar .parent-btn { width: auto; }
  .parent-label { font-size: 13px; }
}

/* --- zadania --- */
.screen-tasks { gap: 8px; }
.task-top { flex: none; display: flex; align-items: center; gap: 10px; }
.task-top .icon-btn { width: 44px; height: 44px; }
.task-progress { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; }
.pdot { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--line); transition: all .2s; }
.pdot.now { background: var(--yellow); box-shadow: 0 0 0 4px #FFE9A8; transform: scale(1.15); }
.pdot.ok { background: var(--green); box-shadow: none; }
.pdot.miss { background: #FFB27A; box-shadow: none; }
.phase-tag { margin-left: 6px; padding: 3px 10px; border-radius: 999px; background: #FFE9A8; font-weight: 900; font-size: 13px; }

.task-body { flex: 1; min-height: 0; display: flex; gap: 12px; }
.task-card {
  flex: 1.25;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 12px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 5px 0 var(--line);
  transition: box-shadow .2s;
  overflow: hidden;
}
.task-card.ok { box-shadow: 0 0 0 4px var(--green), 0 5px 0 var(--green-d); }
.task-card.wrong-flash { animation: shake .4s; }
.task-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 46px; }
.task-mascot .mascot { width: 42px; height: auto; }
.bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 14px;
  background: #F1EDFF;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}
.bubble::before { content: ''; position: absolute; left: -7px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-left: 0; border-right-color: #F1EDFF; }
.bubble.happy { background: #D3F9E6; } .bubble.happy::before { border-right-color: #D3F9E6; }
.bubble.sad { background: #FFE8D6; } .bubble.sad::before { border-right-color: #FFE8D6; }
.task-subject { flex: none; font-size: 12px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.task-prompt { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.task-hint {
  flex: none;
  max-height: 45%;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: 16px;
  background: #FFF6DB;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  animation: pop-in .25s both;
}
.task-hint p { margin: 4px 0; }
.big-emoji { font-size: 40px; margin: 0; line-height: 1; }

.eq { font-size: clamp(38px, 9vmin + 6px, 76px); font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.q { display: inline-grid; place-items: center; min-width: 1.15em; padding: 0 .1em; border-radius: .2em; border: .06em dashed var(--primary); color: var(--primary); background: #F4F1FF; }
.count-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: clamp(30px, 6vmin + 8px, 50px); }
.count-row b { font-size: .8em; }
.seq { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seq-box { min-width: 64px; padding: 6px 10px; border-radius: 16px; background: #F4F1FF; font-size: clamp(26px, 5vmin + 8px, 42px); font-weight: 900; }
.seq-box.q { border-width: 3px; }
.seq-hint .seq-box { min-width: 44px; font-size: 22px; padding: 3px 8px; }
.seq-hint small { font-weight: 900; color: var(--green-d); }
/* Logika: wzory z obrazków */
.seq.pattern { gap: 4px; flex-wrap: nowrap; }
.seq.pattern .seq-box { min-width: 0; padding: 3px 4px; font-size: clamp(20px, 4vmin + 4px, 36px); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.seq.pattern .seq-box.q { min-width: 1.4em; border: 3px dashed var(--primary); color: var(--primary); }
.explain .seq.pattern .seq-box { font-size: 26px; }
/* Zegar i pieniądze */
.clock { width: clamp(120px, 34vmin, 200px); height: auto; }
.clock-face { fill: #fff; stroke: var(--primary); stroke-width: 4; }
.clock text { font: 900 10px/1 system-ui, sans-serif; fill: var(--ink); }
.clock-h { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.clock-m { stroke: #E8590C; stroke-width: 3; stroke-linecap: round; }
.clock-pin { fill: var(--ink); }
.count-row .clock { width: clamp(90px, 24vmin, 140px); }
.explain .clock { width: 110px; }
.wallet { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.money { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: #5C3D00; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.money.coin { flex-direction: column; width: 74px; height: 74px; border-radius: 50%; font-size: 30px; line-height: .9; background: radial-gradient(circle at 35% 30%, #FFF3BF, #FAB005); border: 3px solid #E8A200; }
.money.coin small { font-size: 13px; }
.money.coin.c1 { width: 64px; height: 64px; background: radial-gradient(circle at 35% 30%, #F1F3F5, #ADB5BD); border-color: #868E96; color: #343A40; }
.money.coin.c5 { width: 82px; height: 82px; background: radial-gradient(circle at 35% 30%, #FFF3BF, #FAB005); box-shadow: inset 0 0 0 7px #CED4DA, 0 3px 0 rgba(0, 0, 0, .18); }
.money.note { width: 120px; height: 64px; border-radius: 10px; font-size: 26px; border: 3px solid rgba(0, 0, 0, .15); }
.money.note.n10 { background: #FFD8A8; color: #873800; }
.money.note.n20 { background: #D0BFFF; color: #3B1F8C; }
.money.note.n50 { background: #A5D8FF; color: #0B4F8A; }

.dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; max-width: 420px; margin: 0 auto; }
.dots b { font-size: 22px; margin: 0 4px; }
.dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; position: relative; }
.dot.d1 { background: #FF6B6B; }
.dot.d2 { background: #3FA9F5; }
.dot.empty { background: none; box-shadow: inset 0 0 0 2.5px #3FA9F5; }
.dot.crossed { opacity: .35; }
.dot.crossed::after { content: ''; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; margin-top: -1.5px; background: var(--ink); transform: rotate(-45deg); border-radius: 2px; }

.big-pic { font-size: clamp(70px, 22vmin, 140px); line-height: 1; filter: drop-shadow(0 4px 0 rgba(42, 37, 80, .12)); }
.big-pic .pic-color { width: 1em; height: 1em; }
.pl-word { display: flex; gap: 6px; }
.letter { min-width: 46px; padding: 4px 6px; border-radius: 12px; background: #F4F1FF; font-size: clamp(28px, 5vmin + 10px, 44px); font-weight: 900; }
.letter.q { border: 3px dashed var(--primary); }
.pl-read { font-size: clamp(32px, 7vmin + 8px, 58px); font-weight: 900; letter-spacing: .08em; color: var(--primary); }
.pl-read.small { font-size: clamp(28px, 5vmin + 8px, 44px); letter-spacing: .02em; }
.pl-sentence { font-size: clamp(22px, 4vmin + 8px, 34px); font-weight: 800; line-height: 1.3; }
.gap { display: inline-block; min-width: 3em; border-bottom: 4px dashed var(--primary); color: var(--primary); }
.en-word { display: flex; align-items: center; gap: 10px; font-size: clamp(32px, 7vmin + 8px, 56px); font-weight: 900; color: var(--primary); }
.en-word.small { font-size: clamp(22px, 4vmin + 8px, 34px); }
.sub-prompt { font-size: 16px; font-weight: 800; color: var(--ink-soft); }
.say-btn { border: 0; background: #F4F1FF; border-radius: 50%; width: 44px; height: 44px; font-size: 22px; flex: none; box-shadow: 0 3px 0 var(--line); vertical-align: middle; }
.listen-btn { border: 0; width: 96px; height: 96px; border-radius: 50%; background: var(--primary); font-size: 44px; box-shadow: 0 6px 0 var(--primary-d); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.interlude { font-size: clamp(20px, 3vmin + 10px, 28px); font-weight: 900; }
.interlude p { margin: 4px 0; }

.pic { font-size: 1em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic-color { display: inline-block; width: 52px; height: 52px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .1); }
.pic-num { font-weight: 900; }

.task-answers { flex: 1; min-width: 0; min-height: 0; display: flex; gap: 10px; }
.task-answers.choice { flex-direction: column; justify-content: center; }
.ans {
  position: relative;
  flex: 1;
  max-height: 110px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 5px 0 var(--line);
  font-size: clamp(24px, 4vmin + 10px, 36px);
  font-weight: 900;
  color: var(--ink);
  transition: transform .08s, background .2s;
}
.ans .pic { font-size: clamp(54px, 15vmin, 96px); }
.ans .pic-color { width: clamp(48px, 13vmin, 80px); height: clamp(48px, 13vmin, 80px); }
.ans .pic-num { font-size: clamp(40px, 10vmin, 64px); }
.ans:has(.pic) { background: linear-gradient(#fff, #F6F3FF); }
.match-row .ans .pic { font-size: clamp(40px, 10vmin, 64px); }
.ans:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.ans.right { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-d); animation: pop-in .3s; }
.ans.wrong { background: #FFE3E3; color: #C92A2A; animation: shake .4s; opacity: .7; }
.ans.reveal { animation: pulse 1s infinite; box-shadow: 0 0 0 4px var(--yellow), 0 5px 0 var(--yellow-d); }
.ans.sel { box-shadow: 0 0 0 4px var(--primary), 0 5px 0 var(--primary-d); }
.ans.matched { background: #D3F9E6; color: var(--green-d); box-shadow: none; opacity: .75; }
.en-opt { font-size: .85em; }
.task-answers.choice .btn { align-self: center; }

.task-answers.order { flex-wrap: wrap; align-content: center; justify-content: center; }
.tile-btn {
  min-width: 56px;
  height: 56px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--yellow-d);
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
}
.order.sentence .tile-btn { font-size: 22px; height: 50px; }
.tile-btn.used { visibility: hidden; }
.tile-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--yellow-d); }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.slot {
  min-width: 48px;
  height: 52px;
  padding: 0 8px;
  border: 3px dashed #CFC6F5;
  border-radius: 14px;
  background: #FAF8FF;
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
}
.slots.sentence .slot { min-width: 64px; height: 46px; font-size: 20px; }
.slot.filled { border-style: solid; border-color: var(--primary); background: #fff; }
.slots.done .slot { border-color: var(--green); background: #D3F9E6; }

.task-answers.match { flex-direction: column; justify-content: center; }
.match-row { flex: 1; max-height: 110px; display: flex; gap: 8px; }
.match-row .ans { font-size: clamp(18px, 3vmin + 8px, 28px); max-height: none; }

@media (orientation: portrait) {
  .task-body { flex-direction: column; }
  .task-card { flex: 1.4; }
  .task-answers.choice { flex-direction: row; align-items: stretch; }
  .task-answers.choice .ans { max-height: 150px; }
  .task-answers { flex: 0 1 auto; min-height: 120px; }
  .task-answers.choice { align-items: center; }
}

/* --- nagroda i koniec poziomu --- */
.screen-reward { justify-content: center; align-items: center; }
.reward-wrap { display: flex; align-items: center; gap: 5vw; height: 88%; }
.reward-avatar { height: 100%; }
.reward-avatar .avatar { height: 100%; width: auto; }
.reward-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.reward-stars { display: flex; gap: 8px; }
.rstar svg { width: clamp(48px, 12vmin, 72px); height: auto; filter: grayscale(1) opacity(.3); }
.rstar.on svg { filter: none; animation: star-pop .5s var(--d) cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes star-pop { from { transform: scale(0) rotate(-90deg); } }
.reward-line { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 800; }
.reward-line svg { width: 30px; height: 30px; }
.reward-sub { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink-soft); }
.level-up { padding: 6px 14px; border-radius: 999px; background: #FFE9A8; font-weight: 900; font-size: 18px; animation: pop-in .4s .6s both; }
.reward-actions { display: flex; gap: 12px; align-items: center; }
@media (orientation: portrait) {
  .reward-wrap { flex-direction: column; height: auto; }
  .reward-avatar { height: 34vh; }
  .reward-info { align-items: center; text-align: center; }
}

/* --- gra zastępcza: balony --- */
.screen-play { padding: 0; background: linear-gradient(#8FD3FF, #DDF3FF 70%, #C8F0C0); overflow: hidden; }
.play-hud { position: absolute; z-index: 2; top: var(--pad-t); left: var(--pad-l); right: var(--pad-r); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.play-hud > * { pointer-events: auto; }
.play-title { margin-left: auto; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); font-size: 18px; }
.play-field { position: absolute; inset: 0; }
.balloon { position: absolute; left: 0; top: 0; border: 0; background: none; padding: 0; touch-action: none; will-change: transform; }
.balloon svg { width: 100%; height: auto; }
.balloon.pop { animation: balloon-pop .2s forwards; }
@keyframes balloon-pop { to { opacity: 0; scale: 1.6; } }
.play-note { position: absolute; bottom: var(--pad-b); left: 0; right: 0; text-align: center; font-weight: 800; color: #2B8A3E; font-size: 15px; pointer-events: none; }

/* --- wybór gracza --- */
.screen-profiles { align-items: center; justify-content: center; gap: 4vmin; }
.profile-grid { display: flex; gap: 16px; overflow-x: auto; max-width: 100%; padding: 6px 6px 12px; }
.profile-card {
  position: relative;
  flex: none;
  width: clamp(120px, 24vmin + 40px, 190px);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 6px 0 var(--line);
}
.profile-pick {
  width: 100%;
  border: 0;
  background: none;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 900;
}
.profile-pick .avatar { height: clamp(110px, 38vmin, 240px); width: auto; }
.profile-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: #F4F1FF;
  color: #B0A8D8;
  display: grid;
  place-items: center;
}
.profile-del svg { width: 18px; height: 18px; }
.profile-add {
  border: 4px dashed #D3CCF2;
  background: #ffffff90;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink-soft);
}
.profile-add .plus { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; }
.profile-add .plus svg { width: 34px; height: 34px; }
/* „Kto gra?”: na ekranie mieszczą się 3 karty, dalsze po przewinięciu (z przyciąganiem) */
.profile-grid {
  --card: clamp(120px, 24vmin + 40px, 190px);
  max-width: min(100%, calc(3 * var(--card) + 2 * 16px + 12px));
}
/* więcej niż 3: brzeg czwartej karty wystaje, żeby było widać, że można przewinąć */
.profile-grid:has(> :nth-child(4)) {
  max-width: min(100%, calc(3 * var(--card) + 3 * 16px + 12px + 40px));
  mask-image: linear-gradient(to right, #000 calc(100% - 60px), transparent);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.profile-grid::-webkit-scrollbar { display: none; }
.profile-card { scroll-snap-align: start; animation: profile-pop .45s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: calc(var(--i, 0) * .18s); }
@keyframes profile-pop { from { opacity: 0; transform: translateY(40px) scale(.85); } }
.profile-jump { display: block; transform-origin: 50% 100%; animation: profile-jump .9s cubic-bezier(.3, .7, .4, 1) both; animation-delay: calc(.1s + var(--i, 0) * .18s); }
@keyframes profile-jump {
  0% { transform: translateY(60%) scale(.6); opacity: 0; }
  40% { transform: translateY(-28%) rotate(-6deg); opacity: 1; }
  65% { transform: scale(1.08, .9); }
  80% { transform: translateY(-6%) scale(.97, 1.04); }
  100% { transform: none; }
}
.screen-profiles h1 { animation: hello-letter .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.profile-card:has(.profile-pick:hover), .profile-card:has(.profile-pick:focus-visible) { box-shadow: 0 0 0 4px var(--primary), 0 6px 0 var(--primary-d); transform: translateY(-3px); }
.profile-card { transition: transform .2s, box-shadow .2s, opacity .3s; }
/* po wyborze: wybrana postać rośnie i podskakuje, reszta znika */
.picking .profile-card:not(.chosen), .picking h1 { opacity: 0; transform: scale(.9); transition: opacity .3s, transform .3s; }
.picking .profile-card.chosen { animation: profile-chosen .65s ease forwards; z-index: 1; }
@keyframes profile-chosen { 30% { transform: scale(1.15) translateY(-12px); } 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .profile-card, .profile-jump, .screen-profiles h1, .picking .profile-card.chosen { animation: none; }
}

/* --- pasek instalacji --- */
.install-banner {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 6px) var(--pad-r) 6px var(--pad-l);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  z-index: 50;
}
.install-text { flex: 1; min-width: 0; }
.install-btn {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
}
.install-close { flex: none; border: 0; background: none; color: #fff; font-size: 14px; font-weight: 800; padding: 6px 4px; opacity: .75; }
@media (max-width: 560px) { .install-text { display: none; } .install-btn { margin-right: auto; } }

/* --- nakładka obrotu --- */
.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(160deg, #8B6CFF, var(--primary-d));
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}
.rotate-overlay p { margin: 0; }
.rotate-done { margin-top: 6px; }

/* --- nakładka "Trwa aktualizacja" (nad wszystkim, także nad nakładką obrotu) --- */
.update-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(160deg, #8B6CFF, var(--primary-d));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}
.update-overlay[hidden] { display: none; }
.update-overlay p { margin: 0; }
.update-overlay .update-sub { font-size: 18px; font-weight: 700; opacity: .9; }
.update-spinner { width: 64px; height: 64px; border: 8px solid rgba(255, 255, 255, .3); border-top-color: #FFC93C; border-radius: 50%; animation: update-spin 1s linear infinite; }
@keyframes update-spin { to { transform: rotate(360deg); } }

/* Tryb "Obróciłem": telefon ma zablokowany obrót, więc obracamy stronę o 90° w prawo
   (trzymasz telefon górą w lewo). Elementy fixed w body obracają się razem z nim. */
html.force-landscape { --vw: 1vh; --vh: 1vw; }
html.force-landscape body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vh;
  width: 100dvh;
  height: 100vw;
  transform-origin: 0 0;
  transform: translateX(100vw) rotate(90deg);
}
.rotate-phone { width: 160px; height: 160px; }
.rotate-phone-body { transform-origin: 60px 60px; animation: rotate-phone 2.2s ease-in-out infinite; }
@keyframes rotate-phone { 0%, 20% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* --- okno dialogowe --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(42, 37, 80, .45);
  animation: fade-in .18s ease both;
}
.modal-backdrop.closing { animation: fade-out .18s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.modal-card {
  width: min(460px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 22px;
  border-radius: 28px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 50px rgba(42, 37, 80, .3);
  animation: pop-in .25s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes pop-in { from { transform: scale(.85); } }
.modal-card h2 { margin: 0 0 10px; font-size: 22px; font-weight: 900; }
.modal-body p { margin: 6px 0; font-size: 18px; font-weight: 700; }
.modal-body .hint { font-size: 15px; color: var(--ink-soft); }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.gate-input {
  width: 140px;
  margin-top: 8px;
  font: inherit;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
  padding: 6px;
  border: 4px solid var(--line);
  border-radius: 18px;
  outline: none;
}
.gate-input:focus { border-color: var(--primary); }
.ios-steps { list-style: none; margin: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; font-size: 17px; font-weight: 700; }
.ios-steps li { display: flex; align-items: center; gap: 12px; }
.ios-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #F1F3F5; display: grid; place-items: center; font-size: 22px; color: var(--green-d); }
.ios-ico svg { width: 26px; height: 26px; }

/* --- konfetti --- */
.confetti {
  position: fixed;
  top: -16px;
  z-index: 950;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  pointer-events: none;
  animation: confetti-fall 2s ease-in forwards;
}
@keyframes confetti-fall {
  to { transform: translate(var(--dx), calc(105 * var(--vh))) rotate(var(--rot)); }
}

/* --- wyjaśnienie po 3 błędach --- */
.explain { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-height: 100%; overflow-y: auto; animation: pop-in .3s both; }
.explain p { margin: 2px 0; font-size: 17px; font-weight: 700; }
.explain-title { font-size: 18px; font-weight: 900; color: var(--primary); }
.explain .big-pic { font-size: clamp(56px, 16vmin, 100px); }
.eq-sol { font-size: clamp(32px, 7vmin + 6px, 60px); }
.sol { color: var(--green-d); background: #D3F9E6; border-radius: .2em; padding: 0 .15em; }
.letter.sol-letter { background: #D3F9E6; color: var(--green-d); box-shadow: inset 0 0 0 3px var(--green); }
.explain-answer { font-size: clamp(32px, 7vmin + 6px, 56px); font-weight: 900; color: var(--green-d); }
.explain-list { display: flex; flex-direction: column; gap: 6px; width: min(100%, 420px); }
.ex-row { display: grid; grid-template-columns: 64px 1fr 1fr; align-items: center; gap: 10px; padding: 4px 12px; border-radius: 16px; background: #F4F1FF; font-size: clamp(18px, 3vmin + 8px, 26px); text-align: left; }
.ex-row .pic { font-size: 44px; justify-self: center; }
.ex-row .pic-color { width: 40px; height: 40px; }
.ex-row b { color: var(--primary); }
.ex-row span { font-weight: 700; color: var(--ink-soft); }
.ex-row.ok { background: #D3F9E6; box-shadow: inset 0 0 0 3px var(--green); }
.bubble.calm { background: #E3F1FF; } .bubble.calm::before { border-right-color: #E3F1FF; }

/* --- Skate Runner --- */
.screen-skate { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.skate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.skate-progress { position: relative; flex: 1; max-width: 260px; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 2px rgba(80, 60, 160, .15); }
.skate-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FFB44D, #FF8A3D); }
.skate-progress em { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 900; font-size: 11px; color: var(--ink); }
/* wybór pojazdu */
.screen-vehicle { align-items: center; justify-content: center; gap: clamp(10px, 3vmin, 22px); text-align: center; background: linear-gradient(#8FD3FF, #DDF3FF); }
.screen-vehicle .top-bar { position: absolute; top: var(--pad-t); left: var(--pad-l); }
.screen-vehicle h1 { margin: 0; font-size: clamp(24px, 6vmin, 38px); }
.vehicle-cards { display: flex; gap: clamp(10px, calc(3 * var(--vw)), 28px); }
.vehicle-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: clamp(130px, calc(24 * var(--vw)), 200px); padding: clamp(10px, 3vmin, 20px) 10px;
  border: 0; border-radius: 26px; background: #fff; box-shadow: 0 6px 0 rgba(80, 60, 160, .18);
  font: inherit; color: var(--ink); cursor: pointer; transition: transform .15s;
}
.vehicle-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(80, 60, 160, .18); }
.vehicle-card.on { outline: 4px solid var(--yellow); }
.vehicle-pic { font-size: clamp(52px, 16vmin, 96px); line-height: 1.1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.vehicle-card b { font-size: clamp(18px, 4.5vmin, 24px); font-weight: 900; }
.vehicle-card small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.skate-progress span { position: absolute; right: -6px; top: 50%; transform: translateY(-55%); font-size: 20px; }
.skate-tip {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  padding: 14px 24px; border-radius: 22px; background: rgba(255, 255, 255, .92);
  font-weight: 900; font-size: clamp(20px, 5vmin, 30px); color: var(--ink); text-align: center;
  box-shadow: 0 6px 0 rgba(80, 60, 160, .15); pointer-events: none; transition: opacity .3s;
  animation: tipPulse 1.2s ease-in-out infinite;
}
.skate-tip small { display: block; font-size: .55em; font-weight: 800; color: var(--ink-soft); margin-top: 4px; }
.skate-tip.hide { opacity: 0; animation: none; }
.skate-tip .tip-news { display: block; font-size: .62em; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.skate-help { position: absolute; left: 0; right: 0; bottom: 8%; display: flex; justify-content: space-between; padding: 0 6%; pointer-events: none; transition: opacity .6s; }
.skate-help div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: 16px; background: rgba(255, 255, 255, .75); font-weight: 800; font-size: 14px; color: var(--ink-soft); }
.skate-help b { font-size: 26px; color: var(--ink); }
.skate-help.hide { opacity: 0; }
.skate-cheer {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.4);
  font-weight: 900; font-size: clamp(30px, 9vmin, 56px); color: #FFD43B; white-space: nowrap;
  -webkit-text-stroke: 2px #E8590C; text-shadow: 0 4px 0 rgba(130, 60, 0, .35);
  opacity: 0; pointer-events: none;
}
.skate-cheer.show { animation: cheerPop 1.2s ease-out forwards; }
@keyframes cheerPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-8deg); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
  35% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
@keyframes tipPulse { 50% { transform: translate(-50%, -50%) scale(1.05); } }
.time-chip.low { background: #FFF1C2; }
.time-chip.over { background: #FFE8D6; font-size: .85em; }
/* życia w grach ze zbiciami: serduszka, przy stracie chip podskakuje na czerwono */
.lives-chip { letter-spacing: -2px; font-size: .9em; }
.lives-chip.hurt { animation: livesHurt .6s ease; }
@keyframes livesHurt { 0%, 100% { transform: scale(1); background: #fff; } 30% { transform: scale(1.25); background: #FFC9C9; } }
.read-tools { flex: none; display: flex; gap: 6px; }
.read-tools .icon-btn { width: 44px; height: 44px; }
.slow-btn { font-size: 24px; opacity: .55; }
.slow-btn.on { opacity: 1; background: #D3F9E6; box-shadow: 0 4px 0 var(--green-d); }

/* --- wybór klasy --- */
.screen-grade { align-items: center; justify-content: center; gap: clamp(10px, 3vmin, 22px); text-align: center; }
.screen-childsetup { justify-content: flex-start; overflow-y: auto; padding-bottom: 24px; }
.screen-childsetup .pp-cs { width: min(560px, 100%); text-align: left; }
.screen-setup .pp-seg { justify-content: center; }
.grade-cards { display: flex; gap: clamp(12px, 3vw, 30px); }
@media (max-width: 560px) { .grade-cards { display: grid; grid-template-columns: repeat(2, auto); } } /* 4 karty: 2×2 na wąskim ekranie */
.grade-card {
  width: clamp(96px, 24vmin, 170px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 7px 0 rgba(42, 37, 80, .2);
  transition: transform .1s;
}
.grade-card b { font-size: clamp(48px, 13vmin, 92px); line-height: 1; font-weight: 900; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.grade-card span { font-size: clamp(16px, 3vmin + 6px, 24px); font-weight: 900; }
.grade-card.g1 { background: linear-gradient(160deg, #FFB44D, #FF8A3D); }
.grade-card.g2 { background: linear-gradient(160deg, #66D9E8, #22B8CF); }
.grade-card.g3 { background: linear-gradient(160deg, #B197FC, #845EF7); }
.grade-card.g4 { background: linear-gradient(160deg, #8CE99A, #40C057); }
.grade-card:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(42, 37, 80, .2); }
.grade-note { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink-soft); }
.tens { font-size: 22px; }
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.group { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 64px; padding: 5px; border-radius: 10px; background: #E3F1FF; }

/* --- panel rodzica --- */
.parent-btn { position: relative; overflow: visible; }
.topbar .parent-btn { width: auto; display: flex; gap: 6px; padding: 0 12px 0 10px; }
.parent-label { font-size: 15px; font-weight: 900; white-space: nowrap; }
.parent-btn::after {
  content: ""; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
  border: 4px solid var(--primary); clip-path: inset(0 100% 0 0); opacity: 0;
}
.parent-btn.holding::after { opacity: 1; animation: hold-fill 1.5s linear forwards; }
@keyframes hold-fill { to { clip-path: inset(0 0 0 0); } }
.parent-hint {
  position: absolute; top: 100%; right: 0; margin-top: 6px; padding: 4px 10px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; opacity: 0; pointer-events: none;
}
.parent-btn.hint .parent-hint { animation: hint-pop 1.6s ease; }
@keyframes hint-pop { 10%, 80% { opacity: 1; } }

.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 6px 0 14px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--primary); }
.pin-dots i.on { background: var(--primary); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; }
.pin-key {
  height: 56px; border: 0; border-radius: 16px; background: #F3F0FF; font-size: 24px; font-weight: 900;
  box-shadow: 0 4px 0 var(--line);
}
.pin-key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.pin-forgot { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--primary); font-weight: 800; text-decoration: underline; }
@media (max-height: 480px) {
  .pin-pad { grid-template-columns: repeat(6, 52px); }
  .pin-key { height: 46px; }
}

.screen-parent { background: #F7F5FF; gap: 10px; }
.pp-top { display: flex; align-items: center; gap: 12px; flex: none; }
.pp-top h1 { font-size: clamp(22px, 5vmin, 32px); }
.pp-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; gap: 12px; align-content: start; align-items: start; padding-bottom: 20px; user-select: text; -webkit-user-select: text; }
@media (min-width: 800px) { .pp-scroll { grid-template-columns: 1fr 1fr; } }
.pp-box { background: #fff; border-radius: 20px; padding: 14px 16px; box-shadow: 0 4px 0 var(--line); }
.pp-box h2 { margin: 0 0 8px; font-size: 19px; font-weight: 900; }
.pp-note { margin: 4px 0 10px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.pp-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-seg button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 800; }
.pp-seg button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pp-switch { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 0; }
.pp-switch input { width: 22px; height: 22px; accent-color: var(--primary); }
.pp-child + .pp-child { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.pp-child-head { display: flex; align-items: center; gap: 10px; }
.pp-child-head svg { width: 44px; height: 44px; }
.pp-child-head small { color: var(--ink-soft); font-weight: 700; }
.pp-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.pp-table th { text-align: left; color: var(--ink-soft); font-size: 13px; }
.pp-table td, .pp-table th { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.pp-about p { font-size: 15px; line-height: 1.45; margin: 6px 0; }
.pp-coffee { display: inline-flex; margin-top: 8px; text-decoration: none; flex: none; }
.pp-about { background: linear-gradient(135deg, #FFF6DA, #fff 60%); }
@media (min-width: 800px) { .pp-about { display: flex; align-items: center; gap: 20px; } }

/* --- gwiazdki za poziom --- */
.end-stars { display: flex; align-items: center; gap: 4px; font-size: 40px; line-height: 1; margin: 2px 0 6px; }
.end-star { color: #DEE2E6; transform: scale(0); animation: star-pop .45s cubic-bezier(.3,1.6,.5,1) forwards; animation-delay: calc(var(--i) * .25s); }
.end-star.on { color: #FCC419; text-shadow: 0 3px 0 #E8A100; }
.end-stars small { font-size: 14px; font-weight: 800; color: var(--ink-soft); margin-left: 8px; }
@keyframes star-pop { to { transform: scale(1); } }
.pp-wide { grid-column: 1 / -1; }
.pp-child-head select { margin-left: auto; font: inherit; font-weight: 800; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.pp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.pp-stat { background: #F3F0FF; border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; }
.pp-stat b { font-size: 22px; font-weight: 900; }
.pp-stat small { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.pp-sub { margin: 14px 0 0; font-size: 15px; font-weight: 900; color: var(--ink-soft); }
.pp-lvl-info { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.pp-lvl { white-space: nowrap; }
.pp-lvl b { display: inline-block; min-width: 3.2em; text-align: center; }
.pp-lvl button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-weight: 900; font-size: 18px; line-height: 1; color: var(--primary); }
.pp-lvl button:disabled { opacity: .3; }

/* --- pomoc w grach: przycisk „?” i okienko „jak grać” --- */
.help-btn { font-size: 26px; font-weight: 900; color: var(--primary); }
.help-overlay {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(30, 20, 70, .45); padding: 12px;
}
.help-card {
  background: #fff; border-radius: 24px; padding: 16px 24px 18px; width: min(620px, 100%); max-height: 100%; overflow: auto;
  box-shadow: 0 8px 0 rgba(80, 60, 160, .2); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.help-card h2 { margin: 0; font-size: clamp(20px, 2.4vmin + 12px, 28px); font-weight: 900; }
.help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.help-steps li { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 14px; background: #F3F0FF; font-weight: 800; font-size: clamp(15px, 1.4vmin + 10px, 19px); line-height: 1.25; }
.help-steps b { flex: none; min-width: 52px; text-align: center; font-size: 26px; }

/* --- Kolorowe karty (js/games/karty.js) --- */
.screen-karty { background: radial-gradient(ellipse at 50% 45%, #3DBF6E, #1E8449 70%, #176B3A); --kw: clamp(46px, calc(14 * var(--vh)), 96px); }
.screen-karty .play-title { font-size: 16px; }
.kk-table {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--pad-t) + 52px) var(--pad-r) calc(var(--pad-b, 0px) + 6px) var(--pad-l);
}
.kk-card {
  position: relative; flex: none; width: var(--kw); height: calc(var(--kw) * 1.48); padding: 0; border: calc(var(--kw) * .06) solid #fff;
  border-radius: calc(var(--kw) * .14); background: var(--cc, #222); color: #fff; font-family: inherit; font-weight: 900;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3); display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: transform .18s, filter .18s, box-shadow .18s;
}
.kk-wild { background: #222; }
.kk-oval {
  width: 78%; height: 66%; border-radius: 50%; background: #fff; transform: rotate(24deg);
  display: flex; align-items: center; justify-content: center;
}
.kk-oval b { transform: rotate(-24deg); color: var(--cc, #222); font-size: calc(var(--kw) * .46); line-height: 1; text-shadow: 1px 1px 0 rgba(0, 0, 0, .25); }
.kk-oval b.kk-under { text-decoration: underline; text-decoration-thickness: .08em; }
.kk-wild .kk-oval { background: conic-gradient(#F03E3E 0 25%, #1C7ED6 0 50%, #F5A800 0 75%, #2F9E44 0); }
.kk-wild .kk-oval b { color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.kk-rainbow { display: block; width: 100%; height: 100%; }
.kk-corner { position: absolute; left: 5%; top: 2%; font-size: calc(var(--kw) * .2); line-height: 1; text-shadow: 1px 1px 0 rgba(0, 0, 0, .35); }
.kk-corner2 { left: auto; top: auto; right: 5%; bottom: 2%; transform: rotate(180deg); }

/* przeciwnicy */
.kk-bots { display: flex; justify-content: center; gap: clamp(10px, calc(4 * var(--vw)), 48px); }
.kk-bot {
  position: relative; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  padding: 4px 12px 4px 6px; border-radius: 18px; background: rgba(255, 255, 255, .18); color: #fff; transition: background .2s, transform .2s;
}
.kk-bot.on { background: rgba(255, 255, 255, .42); transform: scale(1.06); box-shadow: 0 0 0 3px #FFE066; }
.kk-botface { grid-row: span 2; font-size: clamp(26px, calc(8 * var(--vh)), 44px); line-height: 1; }
.kk-botname { font-weight: 900; font-size: 15px; }
.kk-fan { position: relative; height: 26px; width: 60px; }
.kk-fan i {
  position: absolute; left: 50%; bottom: 0; width: 16px; height: 24px; margin-left: -8px; border-radius: 3px; border: 2px solid #fff;
  background: #2A2550; transform-origin: 50% 120%; transform: translateX(calc(var(--j) * 5px)) rotate(calc(var(--j) * 7deg));
}
.kk-botcount { position: absolute; right: -6px; top: -6px; min-width: 24px; height: 24px; border-radius: 12px; background: #FFE066; color: #2A2550; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.kk-bubble {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); white-space: nowrap; padding: 3px 10px; border-radius: 12px;
  background: #fff; color: var(--ink); font-weight: 900; font-size: 15px; opacity: 0; pointer-events: none; z-index: 3;
}
.kk-bubble.show { animation: kkBubble 1.6s ease-out; }
@keyframes kkBubble { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15%, 75% { opacity: 1; transform: translate(-50%, 4px) scale(1); } 100% { opacity: 0; } }

/* środek stołu */
.kk-middle { display: flex; align-items: center; justify-content: center; gap: clamp(12px, calc(4 * var(--vw)), 40px); min-height: 0; position: relative; }
.kk-deck { position: relative; width: var(--kw); height: calc(var(--kw) * 1.48); border: none; background: none; padding: 0; font-family: inherit; }
.kk-back {
  position: absolute; inset: 0; border-radius: calc(var(--kw) * .14); border: calc(var(--kw) * .06) solid #fff;
  background: repeating-linear-gradient(45deg, #2A2550 0 6px, #3B3470 6px 12px); box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}
.kk-back:nth-child(2) { transform: translate(-3px, -3px); }
.kk-back:nth-child(3) { transform: translate(-6px, -6px); }
.kk-deck em { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font-style: normal; font-weight: 900; color: #fff; font-size: 14px; }
.kk-deck.ok .kk-back:nth-child(3) { box-shadow: 0 0 0 4px #FFE066, 0 0 18px #FFE066; }
.kk-deck.ok { animation: kkPulse 1.2s ease-in-out infinite; }
@keyframes kkPulse { 50% { transform: scale(1.07); } }
.kk-pile { position: relative; width: calc(var(--kw) * 1.25); height: calc(var(--kw) * 1.55); }
.kk-pile .kk-card { position: absolute; left: 50%; top: 50%; margin: calc(var(--kw) * -.74) 0 0 calc(var(--kw) * -.5); }
.kk-pile .kk-under-card { transform: rotate(-12deg); opacity: .8; }
.kk-pile .kk-top { animation: kkLand .3s ease-out; transform: rotate(4deg); }
@keyframes kkLand { from { transform: translateY(-30px) scale(1.25) rotate(-10deg); } }
.kk-info { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kk-color {
  min-width: 96px; padding: 6px 12px; border-radius: 999px; background: var(--cc); color: #fff; font-weight: 900; font-size: 16px; text-align: center;
  border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
.kk-dir { font-size: 30px; color: #fff; font-weight: 900; line-height: 1; }
.kk-dir.hide { visibility: hidden; }
.kk-msg {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-weight: 900; font-size: clamp(16px, 4.2vh, 24px); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.kk-msg.pop { animation: kkMsg .35s ease-out; }
@keyframes kkMsg { from { transform: translateX(-50%) scale(1.3); } }

/* moja ręka */
.kk-me { display: flex; align-items: flex-end; gap: 10px; padding-top: calc(var(--kw) * .22); }
.kk-face { position: relative; flex: none; width: clamp(44px, calc(12 * var(--vh)), 70px); height: clamp(44px, calc(12 * var(--vh)), 70px); border-radius: 50%; background: rgba(255, 255, 255, .85); margin-bottom: 4px; }
.kk-face svg { width: 100%; height: 100%; border-radius: 50%; }
.kk-count { position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; border-radius: 12px; background: #FFE066; color: #2A2550; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.screen-karty.my-turn .kk-face { box-shadow: 0 0 0 4px #FFE066; }
.kk-hand { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: flex-end; }
.kk-hand .kk-card { --kw: clamp(52px, calc(17 * var(--vh)), 110px); }
.kk-hand .kk-card.ok { transform: translateY(-20%); box-shadow: 0 0 0 3px #FFE066, 0 6px 14px rgba(0, 0, 0, .35); z-index: 1; }
.kk-hand .kk-card.no { filter: brightness(.72) saturate(.7); }
.kk-hand .kk-card.drawn { animation: kkLand .35s ease-out; }
.kk-hand .kk-card.hint { animation: kkHint .5s ease-in-out 2; }
.kk-hand .kk-card.shake { animation: kkShake .35s; }
@keyframes kkHint { 50% { transform: translateY(-34%) scale(1.08); } }
@keyframes kkShake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }

/* wybór koloru i start */
.kk-picker {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(20, 20, 50, .55);
}
.kk-picker.hide { display: none; }
.kk-picker p { margin: 0; color: #fff; font-weight: 900; font-size: clamp(22px, calc(6 * var(--vh)), 34px); }
.kk-picker div { display: flex; gap: clamp(12px, calc(3 * var(--vw)), 28px); }
.kk-picker button { width: clamp(64px, calc(20 * var(--vh)), 110px); height: clamp(64px, calc(20 * var(--vh)), 110px); border-radius: 50%; border: 6px solid #fff; background: var(--cc); box-shadow: 0 5px 0 rgba(0, 0, 0, .25); }
.kk-picker button:active { transform: scale(.92); }
.kk-tip { pointer-events: auto; animation: none; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: clamp(16px, calc(4.4 * var(--vh)), 24px); max-width: min(640px, calc(90 * var(--vw))); }
.kk-tip.hide { display: none; }

/* Po kolei: jasne tło, więc ciemny tytuł poziomu */
.screen-liczby .play-title { color: #5F3DC4; text-shadow: none; }
.pp-ok { margin: 4px 0 8px; font-weight: 800; color: var(--green-d); }
.pp-steps { margin-top: 10px; font-size: 14px; }
.pp-steps summary { cursor: pointer; font-weight: 800; color: var(--primary); }
.pp-steps h3 { margin: 10px 0 2px; font-size: 14px; font-weight: 900; }
.pp-steps ol { margin: 0; padding-left: 20px; line-height: 1.5; }
.pp-facts { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.pp-facts li + li { margin-top: 4px; }
.pp-facts b { color: var(--ink); }

/* Powitanie przy starcie: postać wskakuje, „Cześć, <imię>!”, potem menu */
.screen-hello { flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; overflow: hidden; cursor: pointer; }
.screen-hello.leaving { animation: hello-out .28s ease-in forwards; }
@keyframes hello-out { to { opacity: 0; transform: scale(1.04); } }
.hello-stage { position: relative; height: min(46vh, 330px); aspect-ratio: 200 / 306; }
.hello-avatar { position: absolute; inset: 0; transform-origin: 50% 100%; animation: hello-pop .7s cubic-bezier(.3, .7, .4, 1) both, hello-bob 1.6s .7s ease-in-out infinite; will-change: transform; }
.hello-avatar .avatar { width: 100%; height: 100%; }
/* postać od razu widoczna: wyskok w miejscu z przysiadem, potem lekkie kołysanie */
@keyframes hello-pop {
  0% { transform: translateY(18vh) scale(.5); opacity: 0; }
  45% { transform: translateY(-5vh) scale(1.02); opacity: 1; }
  68% { transform: translateY(0) scale(1.08, .9); }
  84% { transform: translateY(-1.5vh) scale(.97, 1.04); }
  100% { transform: none; }
}
@keyframes hello-bob { 50% { transform: translateY(-1.2vh) rotate(-2deg); } }
/* skok z dołu ekranu łukiem, lądowanie z przysiadem i odbicie */
@keyframes hello-jump {
  0% { transform: translate(-40vw, 70vh) rotate(-20deg); }
  45% { transform: translate(-8vw, -22vh) rotate(8deg); }
  70% { transform: translate(0, 0) scale(1.08, .88) rotate(0); }
  82% { transform: translate(0, -4vh) scale(.96, 1.05); }
  92% { transform: translate(0, 0) scale(1.03, .97); }
  100% { transform: none; }
}
.hello-text { margin: 0; font-size: clamp(34px, 9vmin, 76px); font-weight: 900; color: var(--primary); text-align: center; text-shadow: 0 .06em 0 rgba(42, 37, 80, .15); }
.hello-text span { display: inline-block; animation: hello-letter .45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(.3s + var(--i) * .04s); }
@keyframes hello-letter { from { opacity: 0; transform: translateY(.6em) scale(.4); } }
.menu-enter .topbar, .menu-enter .game-tile { animation: menu-rise .38s cubic-bezier(.3, 1.3, .5, 1) both; }
.menu-enter .game-tile:nth-child(n) { animation-delay: calc(.05s + min(var(--n, 0), 8) * .025s); }
@keyframes menu-rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.screen-menu.menu-enter { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .screen-hello.leaving, .hello-avatar, .hello-text span, .menu-enter .topbar, .menu-enter .game-tile { animation: none; }
}

/* Dzienny limit gier minął: postać macha nad tekstem */
.screen-timeup { flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; padding: 16px; text-align: center; }
.timeup-avatar { height: min(40vh, 280px); aspect-ratio: 200 / 306; animation: hello-jump 1s cubic-bezier(.3, .7, .4, 1) both; transform-origin: 50% 100%; }
.timeup-avatar .avatar { width: 100%; height: 100%; }
.wave-arm { transform-box: view-box; transform-origin: 132px 152px; animation: wave-arm 1.1s ease-in-out infinite; }
@keyframes wave-arm { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(22deg); } }
.timeup-text { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: menu-rise .5s .5s cubic-bezier(.3, 1.3, .5, 1) both; }
.timeup-text h1 { margin: 0; font-size: clamp(26px, 6vmin, 44px); color: var(--primary); }
.timeup-text p { margin: 0; font-size: clamp(18px, 3.4vmin + 6px, 26px); font-weight: 800; line-height: 1.3; }
.timeup-learn { color: var(--ink-soft); }
.chip-dayover { background: #FFF3BF; }
.chip-test { background: #E6FCF5; }
@media (orientation: landscape) and (max-height: 520px) {
  .screen-timeup { flex-direction: row; gap: 4vw; }
  .timeup-avatar { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .wave-arm, .timeup-avatar, .timeup-text { animation: none; } }
.pp-voice { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); }
.pp-voice h3 { margin: 0 0 8px; font-size: 15px; font-weight: 900; }
.pp-bar { height: 12px; border-radius: 999px; background: #EEEAFB; overflow: hidden; }
.pp-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .4s; }
.pp-voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* Panel rodzica: zakładki i kawa w nagłówku */
.pp-coffee-top { margin: 0 0 0 auto; padding: 8px 16px; font-size: 15px; }
.pp-tabs { display: flex; gap: 8px; overflow-x: auto; flex: none; padding: 8px 0 6px; -webkit-overflow-scrolling: touch; }
.pp-tabs button { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 800; color: var(--ink); }
.pp-tabs button svg { width: 28px; height: 28px; }
.pp-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pp-tabs .pp-tab-add { border-style: dashed; color: var(--primary); }
.pp-grade { font: inherit; font-weight: 800; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.pp-del { margin-top: 14px; color: #D64545; }
.pp-resets { display: flex; flex-wrap: wrap; gap: 8px; }

/* Myszka w spiżarni: wybór „z komputerem / z drugą osobą” przed startem */
.myszka-mode {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  width: min(360px, 86%); padding: 18px 20px; border-radius: 22px;
  background: #fff; box-shadow: 0 10px 0 rgba(42, 37, 80, .12), 0 18px 40px rgba(42, 37, 80, .18);
  text-align: center;
}
.myszka-mode p { margin: 0 0 4px; font-size: 22px; font-weight: 900; color: var(--primary); }
.myszka-mode small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pp-version { margin: 4px 0 8px; text-align: center; font-size: 12px; color: #868E96; }
