/* Mistrz Klawiatury — „Klawiatolandia nocą”.
   Kraina pogrążona w mroku; każde uwolnione literki ją rozświetlają.
   Złoto = nagroda i światło, zorza = magia palców, kamień = klawisze-runy. */
:root {
  --night: #0d1034;
  --night-2: #1a1a4d;
  --panel: rgba(24, 24, 74, .84);
  --panel-2: rgba(40, 38, 104, .7);
  --line: rgba(255, 198, 92, .3);
  --gold: #ffc65c;
  --gold-2: #ff9f43;
  --aurora: #5fe3c8;
  --rose: #ff6fa5;
  --text: #eef0ff;
  --text-soft: #aeb3e6;
  --display: 'Grenze Gotisch', Georgia, serif;
  --ui: Lexend, system-ui, sans-serif;
  /* strefy palców — kamienie szlachetne */
  --f-lp: #ff6b8b; --f-lr: #b48cff; --f-lm: #5eaeff; --f-li: #4fe0a0;
  --f-ri: #ffd166; --f-rm: #ff9f5a; --f-rr: #5fe3e0; --f-rp: #ff8fd0; --f-th: #c8ccf0;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--text);
  background: var(--night);
  overflow-x: hidden;
  line-height: 1.45;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--aurora); outline-offset: 3px; }

.night {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 36%, #ffffffaa 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 44%, #ffffffcc 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 64%, #ffffff99 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 78%, #ffffff88 50%, transparent 51%),
    radial-gradient(900px 500px at 80% -10%, #3b2f86 0%, transparent 70%),
    radial-gradient(700px 500px at 0% 110%, #1f4a5c 0%, transparent 70%),
    linear-gradient(180deg, #0d1034 0%, #1a1850 60%, #2a1f55 100%);
  background-size: 300px 300px, 420px 420px, 260px 260px, 380px 380px, 340px 340px, 460px 460px, auto, auto, auto;
}

/* tło ćwiczenia: krajobraz krainy */
.ex-backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .8s; overflow: hidden; }
.ex-backdrop > svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45; }
body[data-screen='screen-exercise'] .ex-backdrop { opacity: 1; }
.distractor { position: absolute; left: -160px; animation: distract 9s linear forwards; opacity: .75; }
.distractor.rtl { left: auto; right: -160px; animation-name: distract-rtl; }
@keyframes distract { 0% { transform: translate(0, 0); } 25% { transform: translate(28vw, -30px); } 50% { transform: translate(56vw, 20px); } 75% { transform: translate(84vw, -20px); } 100% { transform: translate(115vw, 0); } }
@keyframes distract-rtl { 0% { transform: translate(0, 0); } 50% { transform: translate(-56vw, 30px); } 100% { transform: translate(-115vw, -10px); } }

/* ---------- przyciski ---------- */
.btn {
  border: 1.5px solid rgba(255, 214, 140, .45); border-radius: 14px; padding: .7em 1.4em; font-size: 1.15rem; font-weight: 600;
  background: rgba(255, 255, 255, .04); color: var(--text); transition: transform .1s, box-shadow .2s, background .2s;
}
.btn:hover { background: rgba(255, 214, 140, .1); }
.btn:active { transform: translateY(2px); }
.btn.primary {
  border: 0; color: #2a1640;
  background: linear-gradient(180deg, #ffe09a, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 4px 0 #a8591c, 0 0 26px rgba(255, 190, 90, .35);
}
.btn.primary:hover { box-shadow: 0 4px 0 #a8591c, 0 0 36px rgba(255, 190, 90, .55); }
.btn.primary:active { box-shadow: 0 1px 0 #a8591c; transform: translateY(3px); }
.btn.small { font-size: 1rem; padding: .45em .9em; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .35em .9em; font-size: 1.05rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .35em;
}
.chip.icon { padding: .35em .6em; }
.star-chip { color: var(--gold); }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(6px);
}

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.logo-small { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--gold); text-shadow: 0 0 18px rgba(255, 198, 92, .35); }
.topbar-right { display: flex; gap: 8px; }

.screen { padding: 8px 16px 32px; max-width: 1140px; margin: 0 auto; }

/* ---------- start ---------- */
#screen-start { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.hero { text-align: center; }
.title {
  font-family: var(--display); font-weight: 800; font-size: clamp(3.2rem, 11vw, 7rem); line-height: .9; margin: .05em 0 .1em;
  background: linear-gradient(180deg, #fff3cf 10%, var(--gold) 55%, #d9782f 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 198, 92, .35)) drop-shadow(0 4px 0 #3b1f55);
  animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
.subtitle { font-size: clamp(1.05rem, 2.6vw, 1.35rem); color: var(--text-soft); margin: 0; letter-spacing: .03em; animation: rise 1.2s .25s both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
.start-panel { width: min(620px, 100%); padding: 24px clamp(16px, 4vw, 36px); text-align: center; animation: rise 1s .45s both; }
h2 { margin: .3em 0 .6em; font-weight: 600; }
.profiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 14px; }
.profile {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 18px; padding: 12px 18px; min-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.1rem; font-weight: 600; transition: transform .15s, box-shadow .2s;
}
.save-tools { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: center; margin-top: 18px; font-size: .9rem; color: var(--text-soft); }
.link-btn { border: 0; background: none; color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; padding: 2px; }
.link-btn:hover { color: var(--text); }
.profile-card { position: relative; }
/* „Od nowa” — mała ikonka w rogu karty gracza, wyraźna dopiero po najechaniu. */
.profile-card .reset {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid transparent; background: none; color: var(--text-soft); font-size: 1rem; border-radius: 50%; opacity: .45; transition: opacity .2s, background .2s;
}
.profile-card:hover .reset, .profile-card .reset:focus-visible { opacity: .9; }
.profile-card .reset:hover { opacity: 1; background: rgba(255, 255, 255, .08); border-color: var(--line); }
.confirm-card { width: min(460px, 100%); padding: 24px; text-align: center; }
.confirm-card h2 { margin: .2em 0 .3em; }
.confirm-card p { color: var(--text-soft); margin: 0 0 16px; }
.confirm-icon { font-size: 2.6rem; }
.confirm-card.danger #confirm-ok { background: linear-gradient(180deg, #ff8fa8, #e0506f); color: #fff; box-shadow: 0 4px 0 #a8324d; }
.profile:hover { transform: translateY(-3px); box-shadow: 0 0 24px rgba(95, 227, 200, .25); }
.profile .av { font-size: 2.6rem; }
.profile .st { color: var(--gold); font-size: .95rem; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 1.1rem; font-weight: 600; margin: 8px 0 16px; }
.field input {
  font: inherit; font-size: 1.45rem; text-align: center; padding: .45em; border-radius: 14px; border: 1.5px solid var(--line);
  background: rgba(10, 10, 40, .5); color: var(--text); outline: none;
}
.field input::placeholder { color: #6f73a8; }
.field input:focus { border-color: var(--aurora); box-shadow: 0 0 0 4px rgba(95, 227, 200, .18); }
.field small { font-weight: 400; color: var(--text-soft); font-size: .92rem; }
.avatars { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.avatar {
  border: 1.5px solid var(--line); font-size: 2.2rem; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #34347e, #1a1a4d); transition: transform .15s, box-shadow .2s;
}
.avatar:hover { transform: scale(1.08); }
.avatar.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 198, 92, .35), 0 0 24px rgba(255, 198, 92, .45); transform: scale(1.12); }

/* ---------- maskotka ---------- */
.stukus { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 0 14px rgba(124, 200, 255, .45)); }
.stukus.big { width: 124px; height: 124px; margin: 0 auto; }
.stukus-svg { width: 100%; height: 100%; overflow: visible; }
.stukus-svg > ellipse { opacity: .25 !important; }
.stukus-body { transform-origin: 60px 100px; animation: breathe 2.6s ease-in-out infinite; }
.stukus-eyes { transform-origin: 60px 50px; animation: blink 4s infinite; }
.stukus-wing-l { transform-origin: 26px 60px; }
.stukus-wing-r { transform-origin: 94px 60px; }
.stukus.happy .stukus-body { animation: hop .6s ease 2, breathe 2.6s ease-in-out 1.2s infinite; }
.stukus.cheer .stukus-body { animation: hop .45s ease 3, breathe 2.6s ease-in-out 1.4s infinite; }
.stukus.cheer .stukus-wing-l { animation: flapL .15s ease-in-out 8 alternate; }
.stukus.cheer .stukus-wing-r { animation: flapR .15s ease-in-out 8 alternate; }
.stukus.think .stukus-body { animation: tilt .6s ease; }
@keyframes breathe { 50% { transform: scale(1.03, .97); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-16px) scale(.96, 1.05); } 70% { transform: translateY(0) scale(1.06, .94); } }
@keyframes flapL { to { transform: rotate(-30deg); } }
@keyframes flapR { to { transform: rotate(30deg); } }
@keyframes tilt { 30% { transform: rotate(-8deg); } 70% { transform: rotate(6deg); } }

.bubble {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px;
  font-size: 1.1rem; max-width: 360px;
}

/* ---------- mapa ---------- */
.land-title {
  font-family: var(--display); font-weight: 700; text-align: center; font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 10px;
  color: var(--gold); text-shadow: 0 0 24px rgba(255, 198, 92, .35);
}
.map-wrap { border-radius: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px var(--line); overflow: hidden; }
.map { position: relative; width: 100%; aspect-ratio: 1000 / 625; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.twinkle { fill: #fff; animation: twinkle 3s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.fog-far { animation: fogpulse 7s ease-in-out infinite; }
@keyframes fogpulse { 50% { opacity: .75; transform: translateX(-10px); } }
#trail-lit { transition: stroke-dashoffset 2s cubic-bezier(.4, 0, .2, 1) .3s; }
.fog-label {
  position: absolute; right: 3%; top: 6%; text-align: center; font-family: var(--display); font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.7rem); color: #3a3a7a; line-height: 1;
}
.fog-label small { display: block; font-family: var(--ui); font-weight: 500; font-size: .5em; margin-top: 4px; }

.flake { fill: #fff; opacity: .8; animation: snowfall 12s linear infinite; }
@keyframes snowfall { to { transform: translate(-40px, 700px); } }

.mill-blades { transform-box: fill-box; transform-origin: center; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.river { animation: dash 3s linear infinite; }
.wave { animation: wave 4s ease-in-out infinite alternate; }
@keyframes wave { to { transform: translateX(-40px); } }
.beam { transform-origin: 0 -161px; animation: beam 5s ease-in-out infinite alternate; }
@keyframes beam { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
.flag { transform-box: fill-box; transform-origin: left center; animation: flag 1.2s ease-in-out infinite alternate; }
@keyframes flag { to { transform: scaleX(.75) skewY(6deg); } }
.flame { transform-box: fill-box; transform-origin: bottom center; animation: flame .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px #ffc65c); }
@keyframes flame { to { transform: scale(.85, 1.1) rotate(3deg); } }
.bat { animation: batfly 2.4s ease-in-out infinite; }
@keyframes batfly { 50% { transform: translate(30px, -16px) scaleX(.8); } }
.cave-crystal { filter: drop-shadow(0 0 12px var(--cc)); animation: crystalglow 3s ease-in-out infinite alternate; }
@keyframes crystalglow { to { opacity: .6; } }
.beacon-light { filter: drop-shadow(0 0 10px #ffc65c); }
.clock-hand { transform-origin: 0 -240px; }
.clock-hand.long { animation: spin 12s linear infinite; }
.clock-hand.short { animation: spin 90s linear infinite; }

/* latające księgi */
.book-sky { width: 100%; height: 100%; opacity: .75; transition: opacity .6s; }
body[data-screen='screen-exercise'] .book-sky, body[data-screen='screen-parent'] .book-sky { opacity: 0; }
.book-glow { fill: var(--bc); opacity: .18; filter: blur(8px); }
.book-lines { fill: none; stroke: #fff; stroke-width: 1.5; opacity: .6; }
.book-wing { transform-box: view-box; transform-origin: 0 7px; }
.book-wing.l { animation: bookflapL .55s ease-in-out infinite alternate; }
.book-wing.r { animation: bookflapR .55s ease-in-out infinite alternate; }
@keyframes bookflapL { from { transform: rotate(-38deg) scaleY(.7); } to { transform: rotate(14deg); } }
@keyframes bookflapR { from { transform: rotate(38deg) scaleY(.7); } to { transform: rotate(-14deg); } }

/* domki wioski */
.house .win { fill: #14123a; transition: fill .6s; }
.house .win-letter { font: 700 20px var(--display); fill: #6b3d0a; opacity: 0; transition: opacity .6s; }
.house.lit .win, .village.lit .win { fill: var(--gold); filter: drop-shadow(0 0 8px #ffb347); }
.house.lit .win-letter { opacity: 1; }
.lantern-light { fill: #2d2766; transition: fill .6s; }
.village.lit .lantern-light { fill: #ffe09a; filter: drop-shadow(0 0 10px #ffc65c); }
.village.fresh .win, .village.fresh .lantern-light { animation: ignite 1.4s 1s both; }
@keyframes ignite { 0%, 40% { fill: #14123a; } 60% { fill: #fff6d0; } 100% { fill: var(--gold); } }

.station {
  position: absolute; transform: translate(-50%, -58%); border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; z-index: 2;
}
.crystal {
  width: clamp(44px, 7vw, 74px); height: clamp(44px, 7vw, 74px); transform: rotate(45deg); border-radius: 14px;
  background: linear-gradient(135deg, #3b3a8f, #1e1d57); border: 2px solid rgba(174, 179, 230, .35);
  display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: transform .2s, box-shadow .3s;
}
.glyph { transform: rotate(-45deg); font-weight: 700; font-size: clamp(.75rem, 1.8vw, 1.2rem); letter-spacing: .02em; color: var(--text-soft); white-space: nowrap; }
.station:not(:disabled):hover .crystal { transform: rotate(45deg) scale(1.1); }
.station.next .crystal {
  border-color: var(--aurora); background: linear-gradient(135deg, #2f6f86, #1d2c68);
  box-shadow: 0 0 0 0 rgba(95, 227, 200, .6), 0 0 36px rgba(95, 227, 200, .55); animation: beacon 1.8s ease-out infinite;
}
.station.next .glyph { color: #eafff9; }
.station.next::before {
  content: ''; position: absolute; bottom: 60%; width: 6px; height: 140px; border-radius: 3px; pointer-events: none;
  background: linear-gradient(0deg, rgba(95, 227, 200, .55), transparent); filter: blur(2px);
}
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(95, 227, 200, .55), 0 0 36px rgba(95, 227, 200, .5); } 100% { box-shadow: 0 0 0 22px rgba(95, 227, 200, 0), 0 0 36px rgba(95, 227, 200, .5); } }
.station.done .crystal {
  border-color: #fff0c2; background: linear-gradient(135deg, #ffe7a8, var(--gold) 50%, #e08a2f);
  box-shadow: 0 0 34px rgba(255, 198, 92, .6);
}
.station.done .glyph { color: #3a1d08; }
.st-name {
  margin-top: 14px; background: rgba(13, 16, 52, .8); border: 1px solid var(--line); border-radius: 10px; padding: 2px 10px;
  font-weight: 600; font-size: clamp(.68rem, 1.6vw, 1rem); white-space: nowrap;
}
.st-stars { font-size: clamp(.8rem, 1.9vw, 1.2rem); letter-spacing: 2px; color: rgba(174, 179, 230, .3); }
.st-stars .on { color: var(--gold); text-shadow: 0 0 10px rgba(255, 198, 92, .7); }
.st-fog {
  position: absolute; inset: -40% -60%; display: none; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(217, 220, 255, .75), rgba(217, 220, 255, .35) 55%, transparent);
  filter: blur(6px);
}
.station.locked { cursor: not-allowed; }
.station.locked .st-fog { display: block; animation: fogfloat 5s ease-in-out infinite; }
.station.locked .crystal, .station.locked .st-name { opacity: .45; }
.station.locked .st-stars { opacity: 0; }
.station.unfog .st-fog { display: block; animation: unfog 1.6s ease forwards; }
@keyframes fogfloat { 50% { transform: translateX(8px) scale(1.05); } }
@keyframes unfog { to { opacity: 0; transform: scale(2) translateY(-30px); } }

.deco { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.firefly {
  position: absolute; font: 700 clamp(.9rem, 2.2vw, 1.5rem) var(--display); color: #fff0c2;
  text-shadow: 0 0 8px var(--gold), 0 0 18px var(--gold-2); animation: firefly 7s ease-in-out infinite;
}
@keyframes firefly {
  0%, 100% { transform: translate(0, 0); opacity: .9; }
  25% { transform: translate(12px, -14px); opacity: .5; }
  50% { transform: translate(-6px, -24px); opacity: 1; }
  75% { transform: translate(-14px, -8px); opacity: .6; }
}

.walker { position: absolute; transform: translate(-175%, -20%); z-index: 3; pointer-events: none; display: flex; flex-direction: column; align-items: center; }
.walker-av {
  font-size: clamp(1.5rem, 3.6vw, 2.4rem); width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #3b3a8f, #1a1a4d); border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(255, 198, 92, .55);
}
.walker.flip .walker-av { transform: scaleX(-1); }
.walker.walking .walker-av { animation: waddle .3s ease-in-out infinite; }
.walker-shadow { width: 60%; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, .35); margin-top: 3px; }
@keyframes waddle { 0%, 100% { translate: 0 0; rotate: -6deg; } 50% { translate: 0 -8px; rotate: 6deg; } }

.map-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.guide-corner { display: flex; align-items: center; gap: 14px; }
.lands-bar { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.lands { position: relative; display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; scroll-behavior: smooth; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.lands::-webkit-scrollbar { display: none; }
.lands-arrow {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel);
  font-size: 1.9rem; line-height: 1; color: var(--gold); display: grid; place-items: center; transition: opacity .2s, box-shadow .2s;
}
.lands-arrow:hover:not(:disabled) { box-shadow: 0 0 20px rgba(255, 198, 92, .4); }
.lands-arrow:disabled { opacity: .25; cursor: default; }
.land {
  flex: none; min-width: 124px; background: var(--panel); border: 1px solid rgba(174, 179, 230, .15); border-radius: 16px;
  padding: 10px 14px; text-align: center; font-weight: 600; font-size: .95rem; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.land span { font-size: 1.8rem; }
button.land { color: var(--text); font-family: inherit; }
button.land:not(:disabled):hover { border-color: var(--aurora); box-shadow: 0 0 22px rgba(95, 227, 200, .3); }
button.land:disabled { cursor: default; }
.land.current { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 198, 92, .25); }
.land.fogged { opacity: .45; }
.land.fogged span { filter: blur(3px) grayscale(.6); }
.land small { font-weight: 400; color: var(--text-soft); }

/* ---------- ćwiczenie ---------- */
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ex-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.5rem); margin: 0; text-align: center; color: var(--gold); }
.ex-tools { display: flex; gap: 8px; align-items: center; }
.timer {
  font-size: 1.4rem; font-weight: 700; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px;
  min-width: 104px; text-align: center; font-variant-numeric: tabular-nums;
}
.progress-wrap { position: relative; margin: 14px 0 22px; }
.progress-wrap .progress { margin: 0; }
.pb-ghost { position: absolute; top: -9px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; transition: left .1s linear; pointer-events: none; opacity: .85; }
.pb-ghost span { font-size: 1.3rem; filter: drop-shadow(0 0 6px #aeb3e6); }
.pb-ghost small { font-size: .7rem; color: var(--text-soft); margin-top: -4px; }
.st-crown { position: absolute; top: -34px; z-index: 3; filter: drop-shadow(0 0 8px rgba(255, 198, 92, .6)); animation: crownbob 2.4s ease-in-out infinite; }
.walker-crown { margin-bottom: -10px; z-index: 1; filter: drop-shadow(0 0 8px rgba(255, 198, 92, .6)); }
@keyframes crownbob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.ranking li.gap { display: block; text-align: center; color: var(--text-soft); background: none !important; padding: 0; }
.ranking .pl svg { display: block; margin: 0 auto; }
.progress { height: 10px; background: rgba(255, 255, 255, .07); border-radius: 999px; margin: 14px 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--aurora), var(--gold)); border-radius: 999px; transition: width .2s; box-shadow: 0 0 14px rgba(95, 227, 200, .6); }

.ex-stage { display: flex; align-items: center; gap: 20px; min-height: 190px; }
.ex-mascot { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; width: 290px; }
.ex-target { flex: 1; display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 170px; }
.ex-target.wobble { animation: wobble .3s; }
@keyframes wobble { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.big-letter {
  width: 160px; height: 160px; border-radius: 28px; display: grid; place-items: center;
  font-size: 6.4rem; font-weight: 700; color: #fff3cf;
  background: linear-gradient(160deg, #34348a, #1a1a4d); border: 2px solid rgba(255, 214, 140, .55);
  text-shadow: 0 0 24px rgba(255, 198, 92, .8); box-shadow: 0 0 50px rgba(255, 198, 92, .25), inset 0 2px 0 rgba(255, 255, 255, .08);
}
.pop-in { animation: popin .25s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes popin { from { transform: scale(.6); opacity: .3; } }
.queue { display: flex; gap: 10px; }
.queue span {
  width: 54px; height: 54px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(174, 179, 230, .2);
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 600; color: var(--text-soft);
}
.queue span:nth-child(n+3) { opacity: .55; }
.queue span:nth-child(4) { opacity: .3; }

.mode-text { flex-wrap: wrap; gap: 3px; padding: 22px; justify-content: flex-start; align-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.ch { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 600; min-width: .8em; text-align: center; border-radius: 8px; padding: 0 2px; color: #5d6199; transition: background .15s, color .15s; }
.ch.sp { color: #3a3d72; }
.ch.enter { font-size: clamp(1.4rem, 3.4vw, 2.2rem); }
.mode-text .br { flex-basis: 100%; height: 0; }
.mode-text .word { display: inline-flex; white-space: nowrap; gap: 3px; }
.mode-text .word:empty { display: none; }
.ch.ok { color: var(--aurora); text-shadow: 0 0 12px rgba(95, 227, 200, .5); }
.ch.bad { color: var(--rose); background: rgba(255, 111, 165, .12); text-decoration: underline wavy rgba(255, 111, 165, .5); }
.ch.cur { color: #2a1640; background: var(--gold); box-shadow: 0 0 20px rgba(255, 198, 92, .6); animation: curpulse 1s ease-in-out infinite; }
@keyframes curpulse { 50% { box-shadow: 0 0 34px rgba(255, 198, 92, .9); } }

.mode-memory { flex-direction: column; gap: 10px; }
.password-card {
  min-width: 260px; padding: 26px 40px; border-radius: 22px; text-align: center; font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 700;
  color: #fff3cf; background: linear-gradient(160deg, #34348a, #1a1a4d); border: 2px solid rgba(255, 214, 140, .55);
  text-shadow: 0 0 24px rgba(255, 198, 92, .8); box-shadow: 0 0 50px rgba(255, 198, 92, .25);
}
.password-card.ready { font-size: 2rem; color: var(--text-soft); text-shadow: none; }
.password-card.hidden-card { color: rgba(174, 179, 230, .3); text-shadow: none; }
.password-count { color: var(--text-soft); font-weight: 600; }
.masked .ch:not(.ok):not(.bad):not(.sp) { color: #7b80c4; }

.finger-hint { text-align: center; font-size: 1.25rem; min-height: 2em; margin: 10px 0 6px; color: var(--text-soft); }
.finger-hint b { color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.tag { border-radius: 999px; padding: 2px 12px; font-weight: 600; color: #1a1030; }

/* ---------- klawiatura: kamienne runy ---------- */
/* Tryb „bez patrzenia”: klawiatura i dłonie ukryte, po pomyłce na chwilę się pokazują. */
.kb-area.blind > * { opacity: 0; transition: opacity .6s; }
.kb-area.blind.peek > * { opacity: .85; transition: opacity .15s; }
.kb-area.blind { position: relative; }
.kb-area.blind::before { content: '🙈 Piszesz bez patrzenia — palce same znają drogę'; position: absolute; top: 18%; left: 0; right: 0; text-align: center; color: var(--text-soft); font-size: 1.1rem; }
#btn-blind[aria-pressed="true"] { border-color: var(--aurora); box-shadow: 0 0 14px rgba(95, 227, 200, .35); }
.kb-area { display: flex; flex-direction: column; align-items: center; padding-bottom: clamp(90px, 13vw, 150px); }
.vkb {
  position: relative; width: min(900px, 100%); padding: 12px; border-radius: 20px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, #1c1d52, #121338); border: 1px solid rgba(174, 179, 230, .18);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.vkb-row { display: flex; gap: 6px; }
.vkb-key {
  --c: var(--f-th);
  flex: 1 1 0; min-width: 0; height: clamp(32px, 5vw, 52px); border-radius: 10px; display: grid; place-items: center; position: relative;
  font-size: clamp(.7rem, 1.8vw, 1.2rem); font-weight: 600; text-transform: uppercase; color: var(--c);
  background: linear-gradient(180deg, #2c2e72, #1f205a); border-bottom: 3px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); transition: transform .1s, background .15s, opacity .3s;
}
.vkb-key.mod { font-size: clamp(.55rem, 1.2vw, .85rem); color: color-mix(in srgb, var(--c) 70%, #8a8fc4); }
.vkb-key.bump::after { content: ''; position: absolute; bottom: 16%; width: 28%; height: 3px; border-radius: 3px; background: currentColor; }
.vkb-key.next {
  background: var(--c); color: #1a1030; transform: translateY(-3px); z-index: 1;
  box-shadow: 0 0 0 2px #fff, 0 0 28px var(--c); animation: nextpulse 1s ease-in-out infinite;
}
@keyframes nextpulse { 50% { box-shadow: 0 0 0 2px #fff, 0 0 44px var(--c); } }
.vkb-key.hit { animation: hit .25s; }
.vkb-key.miss { animation: miss .3s; }
@keyframes hit { 50% { transform: translateY(3px) scale(.94); filter: brightness(1.6); } }
@keyframes miss { 50% { filter: saturate(.2); } }
.vkb-key.spot { background: var(--c); color: #1a1030; box-shadow: 0 0 30px var(--c); z-index: 1; }
.vkb-key.zone { background: color-mix(in srgb, var(--c) 45%, #1f205a); color: #fff; box-shadow: 0 0 18px var(--c); opacity: 1 !important; }
.vkb.dim-others .vkb-key:not(.spot):not(.zone) { opacity: .3; }

.f-lp { --c: var(--f-lp); } .f-lr { --c: var(--f-lr); } .f-lm { --c: var(--f-lm); } .f-li { --c: var(--f-li); }
.f-ri { --c: var(--f-ri); } .f-rm { --c: var(--f-rm); } .f-rr { --c: var(--f-rr); } .f-rp { --c: var(--f-rp); } .f-th { --c: var(--f-th); }
.tag.f-lp, .tag.f-lr, .tag.f-lm, .tag.f-li, .tag.f-ri, .tag.f-rm, .tag.f-rr, .tag.f-rp, .tag.f-th { background: var(--c); }

/* świetliste dłonie */
.hands-svg { position: absolute; left: 0; top: 0; width: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.finger-active { fill: var(--gold); opacity: .42; filter: drop-shadow(0 0 6px var(--gold)); }
.pad { fill: var(--c); opacity: .5; }
.pad.on { opacity: .95; }
.acc-scales { opacity: .55; }
.acc-bracelet { fill: none; stroke: #ffc65c; stroke-width: 4px; stroke-linecap: round; filter: drop-shadow(0 0 5px #ffc65c); }
.acc-bead { fill: #fff4cc; filter: drop-shadow(0 0 4px #ffc65c); }
.acc-ring .band { fill: #ffc65c; filter: drop-shadow(0 0 4px #ffb347); }
.acc-ring .gem { fill: #ff6b8b; }
.tip-ring { fill: none; stroke: var(--gold); stroke-width: 4px; transition: opacity .2s; filter: drop-shadow(0 0 6px var(--gold)); }

/* ---------- wynik ---------- */
#screen-result { display: grid; place-items: center; min-height: calc(100vh - 70px); }
.result-card { width: min(680px, 100%); padding: 26px clamp(16px, 4vw, 36px); text-align: center; }
.result-card h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--gold); margin: .2em 0; line-height: 1.05; }
.stars { display: flex; justify-content: center; gap: 12px; margin: 6px 0; }
.stars .star { font-size: clamp(3.2rem, 10vw, 4.6rem); color: rgba(174, 179, 230, .18); transition: transform .3s; }
.stars .star.on { color: var(--gold); animation: starpop .5s cubic-bezier(.3, 1.8, .5, 1); text-shadow: 0 0 30px rgba(255, 198, 92, .9), 0 4px 0 #a8591c; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } }
.headline { font-size: clamp(1.25rem, 3.4vw, 1.7rem); font-weight: 700; margin: 8px 0; animation: popin .5s .8s both; }
.headline.tone-record { color: var(--gold); text-shadow: 0 0 18px rgba(255, 198, 92, .5); }
.headline.tone-better { color: var(--aurora); }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge { background: rgba(95, 227, 200, .12); border: 1px solid rgba(95, 227, 200, .4); border-radius: 999px; padding: 5px 14px; font-weight: 600; animation: popin .5s .9s both; }
.badge.gold { background: rgba(255, 198, 92, .15); border-color: var(--gold); color: #ffe7a8; }
.praise { list-style: none; padding: 0; margin: 8px 0; font-size: 1.05rem; color: var(--text-soft); }
.praise li::before { content: '✦ '; color: var(--gold); }
.goal { display: inline-block; border: 1.5px dashed rgba(255, 198, 92, .6); border-radius: 12px; padding: 8px 16px; font-weight: 600; margin: 6px 0; color: #ffe7a8; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 8px; }
.stat { background: rgba(255, 255, 255, .04); border: 1px solid rgba(174, 179, 230, .15); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; }
.stat b { font-size: 1.45rem; }
.stat span { font-size: .85rem; color: var(--text-soft); }
.stat.main { border-color: var(--line); }
.stat.main b { color: var(--gold); }
.history h3, .result-card h3 { margin: 16px 0 6px; font-weight: 600; }
.history small { color: var(--text-soft); }
.bars { display: flex; gap: 10px; justify-content: center; align-items: flex-end; height: 120px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 56px; }
.bar i { display: block; width: 32px; border-radius: 8px 8px 3px 3px; background: rgba(174, 179, 230, .3); transition: height .6s; }
.bar.now i { background: linear-gradient(180deg, #ffe7a8, var(--gold-2)); box-shadow: 0 0 18px rgba(255, 198, 92, .6); }
.bar.best span::after { content: ' 🏅'; }
.bar span { font-size: .78rem; margin-top: 4px; white-space: nowrap; color: var(--text-soft); }
.ranking { list-style: none; padding: 0; margin: 0; text-align: left; }
.ranking li { display: grid; grid-template-columns: 2.4em 2em 1fr auto 3.6em; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; font-size: 1.08rem; }
.ranking li:nth-child(odd) { background: rgba(255, 255, 255, .04); }
.ranking li.me { background: rgba(255, 198, 92, .16); font-weight: 600; }
.ranking .pl { font-size: 1.25rem; text-align: center; }
.ranking .av { font-size: 1.4rem; }
.ranking .nk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .tm { font-variant-numeric: tabular-nums; }
.ranking .sr { color: var(--gold); text-align: right; }

/* punkty */
.points { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0; }
.points span { border-radius: 12px; padding: 6px 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(174, 179, 230, .2); }
.points .plus b { color: var(--aurora); }
.points .minus b { color: var(--text-soft); }
.points .total { border-color: var(--gold); }
.points .total b { color: var(--gold); font-size: 1.2em; }
.points-box small { color: var(--text-soft); }

.pick-title { margin: 16px 0 8px; font-weight: 600; }
.companions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.companion { border: 1.5px solid rgba(174, 179, 230, .25); background: rgba(255, 255, 255, .04); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .9rem; font-weight: 600; min-width: 110px; }
.companion .stukus { width: 64px; height: 64px; }
.companion:hover { border-color: var(--aurora); }
.companion.selected { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 198, 92, .35); }
.stukus { position: relative; }
.companion-crown { position: absolute; top: -26%; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 52%; z-index: 2; filter: drop-shadow(0 0 8px rgba(255, 198, 92, .7)); }
.companion-crown svg { width: 100%; height: auto; }
.map-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-card.training .rk-title, .result-card.training #result-ranking { display: none; }
.wardrobe-card { width: min(760px, 100%); padding: 24px; text-align: center; max-height: 92vh; overflow: auto; }
.wardrobe-card p { color: var(--text-soft); }
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.skin { border: 1.5px solid rgba(174, 179, 230, .25); background: rgba(255, 255, 255, .04); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.skin:not(:disabled):hover { border-color: var(--aurora); box-shadow: 0 0 20px rgba(95, 227, 200, .25); }
.skin.selected { border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 198, 92, .35); }
.skin.locked { opacity: .45; cursor: not-allowed; }
.skin.locked svg { filter: grayscale(.8) blur(1px); }
.skin-name { font-weight: 600; }
.skin-need { font-size: .85rem; color: var(--text-soft); }
.skin.selected .skin-need { color: var(--gold); }

.account-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; color: var(--text-soft); font-size: .95rem; }
.account-card, .rankings-card { width: min(560px, 100%); padding: 24px; text-align: center; max-height: 92vh; overflow: auto; }
.account-card form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.account-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.account-card input[type=email], .account-card input[type=password] {
  font: inherit; font-size: 1.1rem; padding: .5em .7em; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(10, 10, 40, .6); color: var(--text);
}
.account-card input:focus { outline: none; border-color: var(--aurora); }
.account-card .consent { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; font-size: .92rem; color: var(--text-soft); }
.account-card .consent input { margin-top: 4px; width: 18px; height: 18px; }
.account-card a { color: var(--aurora); }
.account-card .note { color: var(--text-soft); font-size: .9rem; }
.account-card .acc-intro { color: var(--text-soft); margin: 0 0 12px; }
.account-card .acc-notice { background: rgba(95, 227, 200, .12); border: 1px solid rgba(95, 227, 200, .4); border-radius: 12px; padding: 8px 12px; margin: 0 0 12px; }
.acc-tabs button { padding: .5em 1.3em; }
.pass-wrap { position: relative; display: flex; }
.pass-wrap input { flex: 1; padding-right: 44px !important; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 1.1rem; opacity: .55; cursor: pointer; padding: 4px; }
.pass-eye.on, .pass-eye:hover { opacity: 1; }
.account-card .hint { font-weight: 400; color: var(--text-soft); }
.account-card #acc-submit { margin-top: 6px; }
.linkish { background: none; border: 0; color: var(--aurora); font: inherit; font-size: .92rem; cursor: pointer; padding: 4px; align-self: center; }
.linkish:hover { text-decoration: underline; }
.acc-who { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; text-align: left; }
.acc-danger { margin-top: 18px; text-align: left; color: var(--text-soft); font-size: .92rem; }
.acc-danger summary { cursor: pointer; }
.acc-danger .btn { border-color: var(--rose); color: var(--rose); }
#btn-parent.attention { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 16px rgba(255, 198, 92, .35); }
.account-error { color: var(--rose); min-height: 1.2em; margin: 8px 0 0; }
.account-profiles { list-style: none; padding: 0; margin: 10px 0; text-align: left; }
.account-profiles li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); margin-bottom: 6px; }
.account-profiles .av { font-size: 1.6rem; }
.account-profiles .nk { flex: 1; font-weight: 600; }
.account-profiles .ok { color: var(--aurora); font-size: .9rem; }
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { border: 1.5px solid rgba(174, 179, 230, .3); background: none; border-radius: 999px; padding: .4em 1em; font-weight: 600; }
.tabs button.on { border-color: var(--gold); color: var(--gold); }
.rk-note { color: var(--text-soft); font-size: .9rem; min-height: 1.2em; }
.rk-scope { color: var(--text-soft); font-weight: 400; font-size: .8rem; }

/* przerwa */
.break-card { width: min(560px, 100%); padding: 24px; text-align: center; }
.break-stage { position: relative; width: 180px; height: 180px; margin: 8px auto; display: grid; place-items: center; }
.break-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.break-ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(174, 179, 230, .15); }
.ring-fg { stroke: var(--aurora); stroke-linecap: round; stroke-dasharray: 339.3; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 8px rgba(95, 227, 200, .6)); }
.break-icon { font-size: 5rem; line-height: 1; }
.break-count { position: absolute; bottom: -6px; right: -6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-weight: 700; color: var(--gold); }
.break-text { font-size: 1.2rem; line-height: 1.45; min-height: 3.5em; }
.break-dots { justify-content: center; margin: 6px 0; }
.anim-look { animation: b-look 3s ease-in-out infinite; }
.anim-rub { animation: b-rub .25s ease-in-out infinite alternate; }
.anim-spread { animation: b-spread 1.6s ease-in-out infinite; }
.anim-wave { animation: b-wave 1.4s ease-in-out infinite; }
.anim-nod { animation: b-nod 2s ease-in-out infinite; }
.anim-tilt { animation: b-tilt 3s ease-in-out infinite; }
.anim-shrug { animation: b-shrug 1.4s ease-in-out infinite; }
.anim-jump { animation: b-jump .7s ease-in-out infinite; }
.anim-cross { animation: b-cross 1s ease-in-out infinite; }
.anim-shake { animation: b-shake .18s linear infinite; }
.anim-reach { animation: b-reach 2.4s ease-in-out infinite; }
@keyframes b-look { 50% { transform: scale(.7) translateY(-10px); } }
@keyframes b-rub { to { transform: translateX(6px) rotate(4deg); } }
@keyframes b-spread { 50% { transform: scale(1.25); } }
@keyframes b-wave { 50% { transform: rotate(-25deg); } }
@keyframes b-nod { 50% { transform: translateY(8px) scaleY(.92); } }
@keyframes b-tilt { 25% { transform: rotate(-20deg); } 75% { transform: rotate(20deg); } }
@keyframes b-shrug { 50% { transform: translateY(-14px); } }
@keyframes b-jump { 50% { transform: translateY(-28px) scale(1.1); } }
@keyframes b-cross { 50% { transform: rotate(45deg) scale(1.1); } }
@keyframes b-shake { 25% { transform: translateX(-6px) rotate(-6deg); } 75% { transform: translateX(6px) rotate(6deg); } }
@keyframes b-reach { 50% { transform: translateY(-24px) scaleY(1.2); } }
.profile .tm { font-size: .8rem; color: var(--text-soft); font-weight: 400; }
.playtime-list { list-style: none; padding: 0; margin: 6px 0 12px; text-align: left; font-size: .95rem; }
.playtime-list li { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); margin-bottom: 4px; }
.playtime-list small { color: var(--text-soft); }

/* panel rodzica */
.parent-tabs { justify-content: flex-start; margin: 14px 0 4px; }
.parent-tabs button { font-size: 1rem; padding: .55em 1.3em; }
#parent-account { display: flex; justify-content: center; margin-top: 14px; }
#parent-account .account-card { max-height: none; }
#parent-account.hidden { display: none; }
.parent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.parent-head h2 { font-family: var(--display); color: var(--gold); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.parent-filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.parent-filters .tabs { justify-content: flex-start; margin: 0; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ptile { background: var(--panel); border: 1px solid rgba(174, 179, 230, .18); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.ptile .pl { color: var(--text-soft); font-size: .88rem; }
.ptile b { font-size: 1.6rem; font-weight: 600; }
.ptile .pd { color: var(--text-soft); font-size: .82rem; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.pcard { background: var(--panel); border: 1px solid rgba(174, 179, 230, .18); border-radius: 18px; padding: 16px; margin-top: 12px; }
.pgrid .pcard { margin-top: 0; }
.pcard h3 { margin: 0 0 10px; font-weight: 600; }
.insights ul { margin: 0; padding-left: 1.1em; line-height: 1.6; }
.pchart { width: 100%; height: auto; display: block; }
.pchart .grid { stroke: rgba(174, 179, 230, .14); stroke-width: 1; }
.pchart .tick { fill: var(--text-soft); font: 11px var(--ui); }
.pchart .val { fill: var(--text); font: 600 12px var(--ui); }
.pchart .bar { fill: var(--aurora); }
.pchart .hit:hover .bar, .pchart .hit:focus .bar { fill: #9ff5e2; }
.pchart .line { fill: none; stroke: var(--aurora); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pchart .area { fill: var(--aurora); opacity: .1; }
.pchart .dot { fill: var(--aurora); stroke: #18184a; stroke-width: 2; }
.pchart .hit:focus { outline: none; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; align-items: center; gap: 10px; font-size: .92rem; }
.hbar .ht { height: 12px; background: rgba(174, 179, 230, .12); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .ht i { display: block; height: 100%; background: var(--aurora); border-radius: 0 4px 4px 0; }
.hbar:hover .ht i, .hbar:focus .ht i { background: #9ff5e2; }
.hbar .hv { color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar kbd { font: 600 1rem var(--ui); background: rgba(255, 255, 255, .08); border: 1px solid rgba(174, 179, 230, .3); border-radius: 6px; padding: 1px 8px; }
.ptable { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ptable th { text-align: left; color: var(--text-soft); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid rgba(174, 179, 230, .2); }
.ptable td { padding: 7px 8px; border-bottom: 1px solid rgba(174, 179, 230, .08); }
.ptable .srow { cursor: pointer; }
.ptable .srow:hover, .ptable .srow:focus { background: rgba(255, 255, 255, .04); outline: none; }
.ptable .sdetail td { background: rgba(0, 0, 0, .15); }
.chipline { display: inline-block; margin: 3px 8px 3px 0; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.pcard details { margin-top: 8px; color: var(--text-soft); }
.pcard .note, .pcard .empty, #parent-body > .empty { color: var(--text-soft); }
.ptip { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); background: #0b0d2c; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .ptable.sessions th:nth-child(n+6), .ptable.sessions td:nth-child(n+6) { display: none; } }

/* ---------- Tor Wyścigowy ---------- */
.race { position: relative; display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px; padding: 8px 10px; border-radius: 16px; background: rgba(12, 10, 44, .72); border: 1px solid var(--line); }
.lane { display: grid; grid-template-columns: minmax(80px, 150px) 1fr; align-items: center; gap: 8px; }
.lane-name { font-size: .8rem; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane.me .lane-name { color: var(--gold); font-weight: 700; }
.lane.ghost { opacity: .7; }
.lane-road {
  position: relative; height: 30px; border-radius: 8px; background: #221d5a;
  background-image: repeating-linear-gradient(90deg, rgba(255, 198, 92, .35) 0 18px, transparent 18px 40px);
  background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 50%;
}
.lane.me .lane-road { box-shadow: inset 0 0 0 1.5px rgba(255, 198, 92, .55); }
.finish { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; border-radius: 0 8px 8px 0;
  background: conic-gradient(#f5f3ff 25%, #1a1440 0 50%, #f5f3ff 0 75%, #1a1440 0) 0 0 / 6px 6px; }
.car { position: absolute; top: 50%; left: calc(var(--p) * (100% - 44px)); transform: translateY(-50%) scaleX(-1); font-size: 1.5rem; line-height: 1; will-change: left; }
.car.nitro::before { content: ''; position: absolute; left: 100%; top: 30%; width: 34px; height: 40%; border-radius: 50%;
  background: linear-gradient(90deg, #ffc65c, #ff6b8b 60%, transparent); filter: blur(2px); animation: nitro 1.2s ease-out forwards; }
.car.bump { animation: bump .35s; }
@keyframes nitro { from { opacity: 1; transform: scaleX(1.2); } to { opacity: 0; transform: scaleX(.3); } }
@keyframes bump { 30% { transform: translateY(-80%) scaleX(-1) rotate(6deg); } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4rem); color: var(--gold); text-shadow: 0 0 24px rgba(255, 198, 92, .7); background: rgba(8, 6, 30, .55); border-radius: 16px; }
.countdown.tick { animation: tick .6s ease-out; }
@keyframes tick { from { transform: scale(1.6); opacity: 0; } }
@media (max-width: 640px) { .lane { grid-template-columns: 64px 1fr; } .lane-name { font-size: .7rem; } }
/* cutscenka toru */
.race-car text { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.race-go .race-car { animation: drive 3.2s cubic-bezier(.5, 0, .3, 1) forwards; }
.race-go .race-car.c1 { animation-duration: 2.8s; }
.race-go .race-car.c3 { animation-duration: 3.6s; }
@keyframes drive { from { transform: translateX(var(--x)); } to { transform: translateX(calc(var(--x) + 640px)); } }
.flag rect { transition: opacity .3s; }

/* ---------- Deszcz Słów ---------- */
.rain-field { position: relative; height: clamp(260px, 42vh, 460px); margin: 10px 0 6px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(95, 227, 200, .12), transparent 60%), linear-gradient(180deg, #120f3c, #1c1852); }
.rain-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: linear-gradient(180deg, transparent, rgba(95, 227, 200, .25)); border-top: 1px dashed rgba(95, 227, 200, .4); }
.drop { position: absolute; left: 0; top: 0; padding: 6px 12px; border-radius: 14px; background: rgba(38, 32, 104, .92); border: 1.5px solid rgba(174, 179, 230, .35);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 700; letter-spacing: .06em; white-space: nowrap; will-change: translate; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.drop::before { content: '💧'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .8rem; opacity: .7; }
.drop span.ok { color: var(--aurora); text-shadow: 0 0 10px rgba(95, 227, 200, .7); }
.drop.locked { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 198, 92, .45); }
.drop.shake { animation: wobble .3s; }
.drop.pop { animation: drop-pop .45s ease-out forwards; }
.drop.splash { animation: drop-splash .45s ease-out forwards; }
@keyframes drop-pop { to { opacity: 0; filter: blur(4px); scale: 1.5; } }
@keyframes drop-splash { to { opacity: 0; scale: 1.3 .4; } }
.rain-hearts i { font-style: normal; font-size: 1.3rem; color: rgba(174, 179, 230, .25); margin-left: 2px; }
.rain-hearts i.on { color: var(--rose); text-shadow: 0 0 10px rgba(255, 111, 165, .6); }
.rain-over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 6, 30, .6); padding: 12px; }
.rain-card { padding: 20px 24px; text-align: center; width: min(440px, 100%); }
.rain-card h2 { font-family: var(--display); color: var(--gold); margin: 0 0 6px; }

/* wersja gry i lista zmian */
.site-foot { position: fixed; right: 10px; bottom: 6px; z-index: 60; display: flex; gap: 4px; align-items: center; font-size: .75rem; }
.site-foot a { color: var(--text-soft); opacity: .55; text-decoration: none; padding: 4px 6px; }
.site-foot a:hover { opacity: 1; color: var(--gold); }
body[data-screen="screen-exercise"] .site-foot, body[data-screen="screen-parent"] .site-foot { display: none; }
.version-tag { font: inherit; font-size: .75rem; color: var(--text-soft); background: none; border: 0; padding: 4px 6px; opacity: .55; cursor: pointer; }
.version-tag:hover, .version-tag:focus-visible { opacity: 1; color: var(--gold); }
.changelog-card { width: min(620px, 100%); padding: 24px; max-height: 88vh; overflow: auto; }
.changelog-card h2 { font-family: var(--display); color: var(--gold); margin: 0 0 8px; text-align: center; }
.changelog-list section { border-top: 1px solid rgba(174, 179, 230, .18); padding: 10px 0; }
.changelog-list h3 { margin: 0 0 4px; font-size: 1.05rem; }
.changelog-list h3 small { color: var(--text-soft); font-weight: 400; margin-left: 6px; }
.changelog-list ul { margin: 0; padding-left: 1.2em; color: var(--text-soft); }
.changelog-list section:first-child h3 { color: var(--aurora); }

/* dialog „Twój tekst” */
.dialog { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 26, .7); backdrop-filter: blur(4px); }
.custom-card { width: min(620px, 100%); padding: 24px; }
.custom-card p { color: var(--text-soft); }
.custom-card textarea {
  width: 100%; font: inherit; font-size: 1.2rem; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line);
  background: rgba(10, 10, 40, .6); color: var(--text); resize: vertical;
}
.custom-card textarea:focus { outline: none; border-color: var(--aurora); }

/* ---------- kino (cutscenki) ---------- */
.cinema {
  position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto 1fr auto auto;
  background: radial-gradient(ellipse at 50% 40%, #1d1d58, #07081f 75%); opacity: 0; transition: opacity .35s;
}
.cinema.open { opacity: 1; }
.cinema-bar { background: #04051a; height: 0; transition: height .6s cubic-bezier(.2, .8, .2, 1); overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.cinema.open .cinema-bar { height: 64px; }
.cinema-title { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--gold); opacity: .85; }
.cinema-stage { position: relative; display: grid; place-items: center; padding: 12px 16px; min-height: 0; overflow: hidden; }
.cinema-svg, .cinema-keys { grid-area: 1 / 1; width: 100%; display: none; justify-content: center; align-items: center; height: 100%; }
.cinema-svg.show, .cinema-keys.show { display: flex; animation: fadein .5s both; }
.cinema-keys { padding-bottom: 150px; }
.cinema-keys .vkb { width: min(880px, 96%); }
@keyframes fadein { from { opacity: 0; } }
.scene-svg { width: min(1000px, 100%); max-height: 100%; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.cinema-caption { display: flex; align-items: center; gap: 18px; max-width: 900px; margin: 0 auto; padding: 8px 20px 16px; width: 100%; }
.cinema-text { font-size: clamp(1.2rem, 2.8vw, 1.6rem); line-height: 1.4; margin: 0; }
.cinema-text.in { animation: textin .6s both; }
@keyframes textin { from { opacity: 0; transform: translateY(8px); } }
.cinema-dots { display: flex; gap: 6px; }
.cinema-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(174, 179, 230, .25); }
.cinema-dots i.on { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.cinema-buttons { display: flex; gap: 10px; }
.cinema.interactive .cinema-next { opacity: .4; }
.cinema.success .cinema-keys .vkb { box-shadow: 0 0 80px rgba(95, 227, 200, .5); transition: box-shadow .4s; }

/* scena: wioska nocą */
.village-scene .flying-letters text { font: 700 44px var(--display); fill: #fff0c2; opacity: 0; filter: drop-shadow(0 0 10px #ffc65c); transform-box: fill-box; transform-origin: center; }
.village-scene.letters-fly .flying-letters text { animation: blowaway 1.8s cubic-bezier(.3, .1, .6, 1) forwards; animation-delay: calc(var(--i) * .09s); }
.village-scene.letters-return .flying-letters text { animation: blowaway 1.8s cubic-bezier(.3, .1, .6, 1) reverse both; animation-delay: calc(var(--i) * .12s); }
@keyframes blowaway {
  0% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translate(-700px, -320px) rotate(-540deg) scale(.4); }
}
.village-scene.lights-out .house .win { fill: #14123a; filter: none; }
.village-scene.lights-out .house .win-letter { opacity: 0; }
.village-scene.letters-return .house .win { transition-delay: 1.4s; }
.village-scene.letters-return .house .win-letter { transition-delay: 1.6s; }
.balaganek { transition: transform 1.4s cubic-bezier(.3, 1.3, .5, 1); }
.bg-body { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
.bg-enter .balaganek { transform: translateX(-330px); }
.bg-wind, .bg-blow { opacity: 0; transition: opacity .3s; }
.bg-blowing .bg-wind, .bg-blowing .bg-blow { opacity: 1; }
.bg-blowing .bg-grin { opacity: 0; }
.bg-blowing .bg-wind { animation: wind .35s linear infinite; }
.bg-blowing .bg-cheek { transform: scale(1.4); transform-box: fill-box; transform-origin: center; }
@keyframes wind { to { transform: translateX(-24px); opacity: .5; } }
.bg-leave .balaganek { transform: translate(-80px, -420px) scale(.6); transition-duration: 2.2s; }
.bg-leave .bg-wind { opacity: 0; }
.bg-escape .balaganek { transform: translate(-260px, -210px) scale(.45); transition-duration: 3s; }
.cinema.stukus-big .cinema-stukus { width: 120px; height: 120px; }

/* scena: postawa */
.posture-scene .upper { transform-box: view-box; transform-origin: 250px 275px; transition: transform 1s cubic-bezier(.3, 1.4, .5, 1); }
.posture-scene.slouch .upper { transform: rotate(16deg); transition-duration: .2s; }
.posture-scene .arm { transform-box: view-box; transform-origin: 262px 172px; transition: transform 1.2s cubic-bezier(.3, 1.4, .5, 1); }
.posture-scene .forearm { transform-box: view-box; transform-origin: 272px 248px; transition: transform 1.2s; }
.posture-scene.stretch .arm { transform: rotate(-165deg); }
.posture-scene.stretch .forearm { transform: rotate(-80deg); }
.posture-scene .note { opacity: 0; transform: translateY(8px); transition: opacity .6s, transform .6s; }
.posture-scene .note circle { fill: var(--aurora); }
.posture-scene .note path { fill: none; stroke: #0d1034; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.posture-scene .note.n5 path { stroke: var(--gold); }
.posture-scene .note text, .curved-scene text { font: 600 20px var(--ui); fill: var(--text); }
.posture-scene .screen-text { font: 700 28px var(--display); fill: var(--gold); }
.posture-scene.show-n1 .n1, .posture-scene.show-n2 .n2, .posture-scene.show-n3 .n3, .posture-scene.show-n4 .n4, .posture-scene.show-n5 .n5 { opacity: 1; transform: none; }
.posture-scene .sight { opacity: 0; transition: opacity .8s; }
.posture-scene.show-sight .sight { opacity: .9; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }

/* scena: dłoń z boku */
.curved-scene .side-key { fill: #4b4ba0; }
.curved-scene .side-key.target { fill: #5eaeff; }
.curved-scene .side-finger { transform-box: view-box; transform-origin: 424px 222px; }
.curved-scene.tapping .side-finger:not(.back) { animation: sidetap .9s ease-in-out infinite; }
.curved-scene.tapping .side-key.target { animation: keydown .9s ease-in-out infinite; }
@keyframes sidetap { 0%, 60%, 100% { transform: rotate(-6deg); } 30% { transform: rotate(2deg); } }
@keyframes keydown { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(4px); } }
.curved-scene .gap-note, .curved-scene .paw-note { opacity: 0; transition: opacity .6s; }
.curved-scene.show-gap .gap-note, .curved-scene.show-paw .paw-note { opacity: 1; }
.curved-scene text { fill: var(--gold); }

/* ---------- efekty ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti {
  position: absolute; top: -20px; width: 8px; height: 14px; background: var(--c); border-radius: 2px;
  animation: fall 3s cubic-bezier(.2, .6, .4, 1) forwards; box-shadow: 0 0 8px var(--c);
}
.confetti.star { background: none; color: var(--c); font-size: 1.5rem; width: auto; height: auto; box-shadow: none; text-shadow: 0 0 10px var(--c); }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
.burst { position: fixed; transform: translate(-50%, -50%); font-size: 2rem; pointer-events: none; z-index: 40; animation: burst .8s ease-out forwards; }
@keyframes burst { to { transform: translate(-50%, -140%) scale(1.6); opacity: 0; } }

/* ---------- małe ekrany ---------- */
@media (max-width: 760px) {
  .ex-stage { flex-direction: column; }
  .ex-mascot { width: 100%; justify-content: center; }
  .ex-mascot .stukus { width: 56px; height: 56px; }
  .big-letter { width: 120px; height: 120px; font-size: 4.6rem; }
  .queue span { width: 40px; height: 40px; font-size: 1.3rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .logo-small { display: none; }
  .cinema-caption .stukus { width: 56px; height: 56px; }
  .cinema.open .cinema-bar { height: 52px; }
  .cinema-title { font-size: 1.2rem; }
}

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