/* Word Merge — cukierkowy styl */
:root {
  --ink: #3b2a4a;
  --ink-soft: #6b5a7b;
  --pink: #ff5fa2;
  --pink-d: #d6246e;
  --green: #4fcf5f;
  --green-d: #23883a;
  --yellow: #ffd23f;
  --purple: #7c4dff;
  /* Titan One i Nunito mają pełny polski alfabet (ą ć ę ł ń ó ś ź ż).
     Lilita One NIE ma ć/ś/ę… — używamy jej tylko do angielskich liter i cyfr (bańki, kafelki, wyniki). */
  --font-display: 'Titan One', 'Baloo 2', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-letters: 'Lilita One', 'Titan One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 182, 219, 0.7), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(182, 224, 255, 0.75), transparent 40%),
    radial-gradient(circle at 80% 88%, rgba(196, 255, 176, 0.7), transparent 42%),
    radial-gradient(circle at 15% 85%, rgba(255, 236, 160, 0.8), transparent 40%),
    #fff4fa;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid #7c4dff; outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #76d455;
  isolation: isolate;
}
@media (min-width: 600px) and (min-height: 620px) {
  #game {
    /* najpierw vh — zapas dla przeglądarek bez dvh (iOS < 15.4, Chrome < 108) */
    height: min(calc(100vh - 40px), 940px);
    height: min(calc(100dvh - 40px), 940px);
    width: min(480px, calc((100vh - 40px) * 0.56));
    width: min(480px, calc((100dvh - 40px) * 0.56));
    border-radius: 34px;
    box-shadow: 0 0 0 8px #fff, 0 0 0 11px rgba(255, 95, 162, 0.25), 0 30px 70px rgba(90, 40, 120, 0.35);
  }
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 0; }

/* ---------- tło desktop ---------- */
#bgDecor { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
@media (max-width: 700px) { #bgDecor { display: none; } }
#bgDecor .ball { position: absolute; animation: floaty 7s ease-in-out infinite; opacity: 0.85; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- bańki (DOM) ---------- */
.ball {
  --sz: 48px; --fs: 0.52;
  --l: #ffc2cf; --m: #ff6384; --d: #e8214b; --s: #9c0d30;
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: var(--sz); height: var(--sz);
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 32% 28%, #fff 0 12%, rgba(238, 249, 255, 0.96) 45%, rgba(198, 226, 247, 0.96) 100%);
  box-shadow: 0 3px 7px rgba(90, 45, 10, 0.25);
  vertical-align: middle;
}
.ball::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 2;
  border: calc(var(--sz) * 0.075) solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(70, 20, 50, 0.3);
}
/* color-mix: iOS 16.2+, Chrome 111+. Deklaracja z var() przechodzi parser także tam, gdzie color-mix nie działa,
   i kasuje zwykły kolor powyżej (cień znika) — dlatego osobno, tylko pod @supports. */
@supports (color: color-mix(in srgb, red 40%, transparent)) {
  .ball::before { box-shadow: 0 0 0 1px color-mix(in srgb, var(--s) 40%, transparent); } /* bsfun-ignore-compat: zapas wyżej, poza @supports */
}
.ball::after {
  content: ''; position: absolute; z-index: 2;
  left: 15%; top: 18%; width: 30%; height: 15%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); transform: rotate(-40deg);
}
.ball-liquid {
  position: absolute; left: 0; right: 0; bottom: 0; top: 45%;
  background: linear-gradient(180deg, var(--l), var(--m) 30%, var(--d));
  box-shadow: inset 0 calc(var(--sz) * 0.05) 0 rgba(255, 255, 255, 0.55);
}
.ball-txt {
  position: relative; z-index: 3;
  font-family: var(--font-letters);
  font-size: calc(var(--sz) * var(--fs));
  line-height: 1; color: #fff; letter-spacing: 0.01em;
  padding-top: 0.06em;
  text-shadow:
    0 2px 0 var(--s), 2px 0 0 var(--s), -2px 0 0 var(--s), 0 -2px 0 var(--s),
    1.5px 1.5px 0 var(--s), -1.5px 1.5px 0 var(--s), 1.5px -1.5px 0 var(--s), -1.5px -1.5px 0 var(--s),
    0 3px 0 var(--s);
}
.ball-l1 { --l: #ffc2cf; --m: #ff6384; --d: #e8214b; --s: #9c0d30; }
.ball-l2 { --l: #ffe0b8; --m: #ffab4a; --d: #f76b07; --s: #a44400; }
.ball-l3 { --l: #fff6b8; --m: #ffe14d; --d: #f7b500; --s: #9a6400; }
.ball-l4 { --l: #d3f9d8; --m: #69db7c; --d: #2f9e44; --s: #17602a; }
.ball-l5 { --l: #cfe8ff; --m: #5cb8ff; --d: #1c7ed6; --s: #0b4a8f; }
.ball-l6 { --l: #e9e1ff; --m: #b197fc; --d: #7048e8; --s: #3f1fa3; }
.ball-l7 { --l: #ffe3ef; --m: #f783ac; --d: #d6336c; --s: #8a1446; }
.ball-l7 .ball-liquid { background: linear-gradient(120deg, #ff6b6b, #ffa94d, #ffe066, #69db7c, #4dabf7, #b197fc, #f783ac); }
.ball-sm { --sz: 50px; }
.ball-xs { --sz: 38px; }
.ball.ripe { overflow: visible; }
.ball.ripe .ball-liquid { border-radius: 0 0 999px 999px; overflow: hidden; }
.ball.ripe { box-shadow: 0 0 0 3px #ffd43b, 0 0 16px 4px rgba(255, 212, 59, 0.8); }

/* ---------- HUD ---------- */
#hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: calc(var(--safe-t) + 10px) 12px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  transition: opacity 0.35s, transform 0.35s;
}
#bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 10px 10px calc(var(--safe-b) + 12px);
  display: flex; align-items: flex-end; justify-content: center; gap: 10px;
  transition: opacity 0.35s, transform 0.35s;
}
.ui-off { opacity: 0; pointer-events: none; }
#hud.ui-off { transform: translateY(-20px); }
#bar.ui-off { transform: translateY(20px); }

.pill {
  display: flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #fff0f7);
  border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(214, 36, 110, 0.28), 0 8px 16px rgba(60, 20, 60, 0.18);
  font-family: var(--font-letters); font-size: 22px; color: var(--ink);
  min-width: 96px;
}
.pill-ico {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 20px; color: #fff;
}
.star-ico { background: linear-gradient(180deg, #ffe066, #fab005); text-shadow: 0 1px 0 #c77c00; box-shadow: inset 0 -2px 0 #e08e00; }
.clock-ico { background: linear-gradient(180deg, #8fd3ff, #339af0); color: #1864ab; box-shadow: inset 0 -2px 0 #1c7ed6; }
.clock-ico svg { width: 22px; height: 22px; }
#score { min-width: 2ch; display: inline-block; }
#score.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: #f76707; } 100% { transform: scale(1); } }
.timer-pill { font-size: 26px; min-width: 112px; justify-content: flex-start; }
.timer-pill .paused-dot { display: none; margin-left: auto; font-size: 13px; color: #fff; background: #adb5bd; border-radius: 8px; padding: 2px 5px; letter-spacing: 1px; }
.timer-pill.paused { filter: saturate(0.4); }
.timer-pill.paused .paused-dot { display: inline-block; }
.timer-pill.low { color: #e03131; animation: lowPulse 0.9s ease-in-out infinite; }
.timer-pill.low .clock-ico { background: linear-gradient(180deg, #ff8787, #fa5252); color: #c92a2a; box-shadow: inset 0 -2px 0 #e03131; }
@keyframes lowPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.icon-btn {
  width: 46px; height: 46px; border-radius: 16px; border: 3px solid #fff;
  background: linear-gradient(180deg, #c3a6ff, #8f5cff);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 0 #5f3dc4, 0 8px 16px rgba(60, 20, 90, 0.25);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5f3dc4; }

/* ---------- dolny pasek ---------- */
.booster, .next-slot {
  position: relative;
  width: 64px; height: 64px; border-radius: 20px;
  border: 3px solid #fff;
  background: linear-gradient(180deg, #fffaf0, #ffe6bf);
  box-shadow: 0 5px 0 #d99a4e, 0 9px 16px rgba(80, 40, 10, 0.25);
  display: grid; place-items: center;
  padding: 0;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.2s;
}
.booster:active, .next-slot:active { transform: translateY(4px); box-shadow: 0 1px 0 #d99a4e, 0 3px 6px rgba(80, 40, 10, 0.2); }
.b-ico { font-size: 30px; line-height: 1; transform: translateY(-4px); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.15)); }
.b-name {
  position: absolute; bottom: 3px; left: 0; right: 0; text-align: center;
  font-size: 9.5px; font-weight: 800; color: #a0612a; letter-spacing: -0.01em; white-space: nowrap;
}
.b-count {
  position: absolute; right: -8px; top: -8px;
  min-width: 26px; height: 26px; border-radius: 13px; padding: 0 5px;
  background: linear-gradient(180deg, #ff7eb6, #f03e8a);
  border: 2px solid #fff; color: #fff;
  font-family: var(--font-letters); font-size: 15px;
  display: grid; place-items: center;
  box-shadow: 0 2px 0 #b3175a;
}
.booster.empty { filter: grayscale(0.9); opacity: 0.6; }
.booster.active { transform: translateY(2px) scale(1.06); box-shadow: 0 3px 0 #d99a4e, 0 0 0 4px #ffd43b, 0 0 22px rgba(255, 212, 59, 0.9); animation: wiggle 0.5s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.next-slot { width: 78px; background: linear-gradient(180deg, #f3ecff, #dcd0ff); box-shadow: 0 5px 0 #9775fa, 0 9px 16px rgba(60, 20, 90, 0.25); }
.next-slot:active { box-shadow: 0 1px 0 #9775fa; }
.next-label {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: #7c4dff; color: #fff; font-family: var(--font-letters);
  font-size: 12px; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 8px; border: 2px solid #fff;
}
.swap-ico {
  position: absolute; right: -7px; bottom: -7px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: #7c4dff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 2px 0 #b197fc;
}
#nextBall.pop { animation: popIn 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popIn { 0% { transform: scale(0.2); } 100% { transform: scale(1); } }

/* ---------- toast / baner młotka / tutorial ---------- */
#toast {
  position: absolute; z-index: 9; left: 50%; top: 60%;
  transform: translate(-50%, calc(-100% + 12px)); opacity: 0;
  width: max-content; max-width: calc(100% - 28px);
  background: #fff; color: var(--ink);
  border: 3px solid #ffd43b; border-radius: 18px;
  padding: 9px 14px; font-weight: 600; font-size: 15px; line-height: 1.3; text-align: center;
  box-shadow: 0 6px 0 rgba(250, 176, 5, 0.45), 0 10px 22px rgba(0, 0, 0, 0.18);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(.3, 1.5, .5, 1);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, -100%); }
#toast.tip-green { border-color: #51cf66; box-shadow: 0 6px 0 rgba(47, 158, 68, 0.4), 0 10px 22px rgba(0, 0, 0, 0.18); }
#toast.tip-red { border-color: #ff6b81; box-shadow: 0 6px 0 rgba(214, 36, 70, 0.4), 0 10px 22px rgba(0, 0, 0, 0.18); }
#hammerBanner {
  position: absolute; z-index: 9; left: 50%; top: calc(var(--safe-t) + 66px); transform: translateX(-50%);
  background: linear-gradient(180deg, #ffb35c, #ff8a1f); color: #fff;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.01em;
  padding: 8px 8px 8px 16px; border-radius: 18px; border: 3px solid #fff;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  box-shadow: 0 5px 0 #c25e00, 0 10px 20px rgba(0, 0, 0, 0.2);
  text-shadow: 0 2px 0 #b35500;
  animation: dropIn 0.35s cubic-bezier(.3, 1.6, .5, 1);
}
#hammerBanner button { border: 0; border-radius: 12px; background: #fff; color: #d9480f; font-family: var(--font-display); font-size: 14px; padding: 6px 10px; }
@keyframes dropIn { 0% { transform: translate(-50%, -30px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }

#tutHand {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: calc(var(--safe-b) + 170px);
  display: flex; flex-direction: column-reverse; align-items: center; pointer-events: none;
}
.tut-hand { font-size: 46px; animation: handMove 2.2s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25)); }
@keyframes handMove {
  0% { transform: translate(-70px, 10px); }
  35% { transform: translate(70px, 10px); }
  60% { transform: translate(0, 10px); }
  75% { transform: translate(0, -8px) scale(0.9); }
  100% { transform: translate(-70px, 10px); }
}
.tut-text {
  margin-bottom: 4px; background: rgba(59, 42, 74, 0.85); color: #fff;
  padding: 7px 14px; border-radius: 14px; font-weight: 600; font-size: 15px;
}

/* ---------- ekrany ---------- */
.screen {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 240, 250, 0.9), rgba(236, 248, 255, 0.9));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn 0.35s ease;
}
.screen-dim { background: rgba(40, 20, 60, 0.45); align-items: center; justify-content: center; }
.screen.leaving { animation: fadeOut 0.3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: scale(1.04); } }
.screen-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 24px);
  overscroll-behavior: contain;
}
.start-inner, .summary-inner {
  max-width: 420px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* logo */
.logo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.logo-row { display: flex; gap: 4px; }
.logo .ball { --sz: 56px; --fs: 0.56; animation: logoBounce 2.4s ease-in-out infinite; }
.logo .logo-row:nth-child(2) .ball { --sz: 62px; }
@keyframes logoBounce {
  0%, 70%, 100% { transform: translateY(0) scale(1); }
  78% { transform: translateY(-12px) scale(1.05, 0.95); }
  86% { transform: translateY(0) scale(1.08, 0.92); }
  92% { transform: translateY(-3px) scale(0.98, 1.02); }
}
.tagline {
  margin: 0; font-family: var(--font-display); font-size: 18px; color: #7c4dff;
  text-align: center; letter-spacing: 0.01em;
}
.start-bee { position: relative; display: flex; align-items: center; gap: 6px; margin: -2px 0; }
.speech-mini {
  background: #fff; border: 3px solid #ffd43b; border-radius: 18px; padding: 8px 14px;
  font-family: var(--font-letters); font-size: 18px; color: var(--ink);
  position: relative; box-shadow: 0 4px 0 rgba(250, 176, 5, 0.4);
  animation: tilt 3s ease-in-out infinite;
}
.speech-mini { cursor: pointer; }
.speech-mini .hi-ico { font-size: 15px; margin-left: 2px; display: inline-block; }
.speech-mini.talking .hi-ico { animation: breathe 0.5s ease-in-out infinite; }
.speech-mini::before {
  content: ''; position: absolute; left: -12px; top: 50%; margin-top: -8px;
  border: 8px solid transparent; border-right-color: #ffd43b; border-left: 0;
}
@keyframes tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.btn-play { font-size: 31px; padding: 16px 64px; border-radius: 28px; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.best-line { font-weight: 600; color: var(--ink-soft); font-size: 15px; }
.best-line b { color: #f76707; font-family: var(--font-letters); font-size: 18px; font-weight: 400; }

.howto {
  width: 100%; background: #fff; border-radius: 24px; padding: 14px 14px 10px;
  box-shadow: 0 6px 0 rgba(151, 117, 250, 0.3), 0 12px 26px rgba(90, 40, 120, 0.12);
  border: 3px solid #fff;
}
.howto-title { font-family: var(--font-display); font-size: 18px; color: #7c4dff; text-align: center; margin-bottom: 6px; }
.step { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 2px dashed #f1e9ff; font-size: 15px; line-height: 1.35; }
.step:first-of-type { border-top: 0; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, #ff8cc0, #f03e8a); color: #fff;
  font-family: var(--font-letters); font-size: 16px; display: grid; place-items: center;
  box-shadow: 0 2px 0 #b3175a;
}
.step.warn .step-num { background: linear-gradient(180deg, #ffd43b, #fab005); box-shadow: 0 2px 0 #c77c00; }
.step small { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.demo { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; }
.demo .ball-l1 { --sz: 36px; }
.demo .ball-l2 { --sz: 42px; --fs: 0.4; }
.demo .ball-l3 { --sz: 50px; --fs: 0.32; }
.demo-op { font-family: var(--font-letters); font-size: 20px; color: #b197fc; }
.brand-line { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.brand-line b { color: #f59f00; }

/* ---------- przyciski ---------- */
.btn {
  --c1: #82e38a; --c2: #3cbf52; --c3: #23883a;
  position: relative; border: 0; border-radius: 22px; padding: 14px 26px;
  font-family: var(--font-display); font-size: 20px; letter-spacing: 0.01em; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 46%), linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 6px 0 var(--c3), 0 11px 20px rgba(0, 0, 0, 0.18), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 2px 0 var(--c3), 1px 0 0 var(--c3), -1px 0 0 var(--c3), 0 -1px 0 var(--c3);
  transition: transform 0.08s, box-shadow 0.08s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c3), 0 4px 8px rgba(0, 0, 0, 0.18), inset 0 3px 0 rgba(255, 255, 255, 0.45); }
.btn-blue { --c1: #74d2ff; --c2: #2f9bea; --c3: #1c6fb0; }
.btn-yellow { --c1: #ffe56e; --c2: #ffbf1f; --c3: #cf8600; color: #5a3300; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-white { --c1: #ffffff; --c2: #f3ecff; --c3: #c6b3f2; color: #5f3dc4; text-shadow: none; }

/* ---------- pauza ---------- */
.card {
  background: #fff; border-radius: 30px; padding: 24px 22px;
  box-shadow: 0 8px 0 rgba(151, 117, 250, 0.4), 0 20px 50px rgba(40, 10, 60, 0.35);
  border: 4px solid #fff;
}
.pause-card { width: min(300px, 86%); display: flex; flex-direction: column; gap: 14px; animation: popCard 0.4s cubic-bezier(.3, 1.5, .5, 1); }
.btn-voice { font-size: 16px; padding: 12px 16px; }
.voice-status { min-height: 18px; margin-top: -6px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.card-title { font-family: var(--font-display); font-size: 30px; color: #7c4dff; text-align: center; }
@keyframes popCard { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- odliczanie / baner ---------- */
#countdown, #banner {
  position: absolute; inset: 0; z-index: 25; pointer-events: none;
  display: grid; place-items: center;
}
.cd-num, .banner-text {
  font-family: var(--font-display); color: #fff; text-align: center; line-height: 1;
  text-shadow:
    0 5px 0 #d6246e, 4px 0 0 #d6246e, -4px 0 0 #d6246e, 0 -4px 0 #d6246e,
    3px 3px 0 #d6246e, -3px 3px 0 #d6246e, 3px -3px 0 #d6246e, -3px -3px 0 #d6246e,
    0 9px 0 #9c1452, 0 14px 24px rgba(0, 0, 0, 0.3);
}
.cd-num { font-size: 120px; animation: cdPop 0.62s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.cd-num.go { font-size: 92px; color: #fff3a0; }
@keyframes cdPop {
  0% { transform: scale(2.2); opacity: 0; }
  30% { transform: scale(0.9); opacity: 1; }
  45% { transform: scale(1.05); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}
#banner { background: radial-gradient(circle, rgba(60, 20, 80, 0.35), rgba(60, 20, 80, 0) 70%); }
#banner:empty, #countdown:empty { display: none; }
.banner-text { font-size: 46px; padding: 0 20px; animation: bannerIn 0.7s cubic-bezier(.2, 1.5, .4, 1) both; }
.banner-sub { display: block; font-size: 19px; margin-top: 14px; color: #fff3a0; text-shadow: 0 3px 0 #7048e8, 2px 0 0 #7048e8, -2px 0 0 #7048e8, 0 -2px 0 #7048e8; }
@keyframes bannerIn { 0% { transform: translateY(-60px) scale(0.4) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- dymek ze słowem ---------- */
.modal { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(50, 20, 70, 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn 0.3s ease; }
.bubble-wrap {
  position: relative; width: min(360px, 100%);
  animation: bubbleIn 0.55s cubic-bezier(.25, 1.45, .45, 1) both;
  margin-bottom: 40px;
}
@keyframes bubbleIn {
  0% { transform: translate(var(--fx, 0), var(--fy, 0)) scale(0.15); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.modal.closing .bubble-wrap { animation: bubbleOut 0.28s ease-in forwards; }
.modal.closing .modal-backdrop { animation: fadeOut 0.28s ease forwards; }
@keyframes bubbleOut { to { transform: scale(0.7) translateY(30px); opacity: 0; } }
.bubble-card {
  position: relative; z-index: 2;
  background: #fff; border-radius: 34px; padding: 18px 18px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 4px solid #fff;
  box-shadow: 0 8px 0 rgba(151, 117, 250, 0.45), 0 22px 50px rgba(40, 10, 60, 0.4);
  background-image: radial-gradient(circle at 50% 0%, #fff4fb, #fff 60%);
}
.bubble-tail {
  position: absolute; z-index: 1; left: 58px; bottom: -22px;
  width: 44px; height: 44px; background: #fff; transform: rotate(45deg); border-radius: 6px;
  box-shadow: 8px 8px 0 rgba(151, 117, 250, 0.3);
}
.bee-modal { position: absolute; z-index: 3; left: -6px; bottom: -64px; width: 78px; height: 78px; animation: beeBob 1.6s ease-in-out infinite; }
.bubble-top { display: flex; align-items: center; gap: 10px; }
.praise {
  font-family: var(--font-letters); font-size: 30px; color: #ff5fa2;
  text-shadow: 0 3px 0 #ffd6e8;
}
.pts-badge {
  font-family: var(--font-letters); font-size: 20px; color: #fff;
  background: linear-gradient(180deg, #ffd43b, #f59f00); border-radius: 14px; padding: 3px 10px;
  box-shadow: 0 3px 0 #c77c00; text-shadow: 0 2px 0 #c77c00;
  animation: popIn 0.45s 0.25s cubic-bezier(.3, 1.8, .5, 1) both;
}
.tiles { --tw: 48px; display: flex; flex-wrap: nowrap; justify-content: center; gap: 5px; padding: 4px 0 2px; }
.tile {
  --t1: #ff8cc0; --t2: #f03e8a; --t3: #a3185a;
  width: var(--tw); height: calc(var(--tw) * 1.17); border-radius: calc(var(--tw) * 0.33); flex: none;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--t1), var(--t2));
  box-shadow: 0 5px 0 var(--t3), inset 0 3px 0 rgba(255, 255, 255, 0.5);
  font-family: var(--font-letters); font-size: calc(var(--tw) * 0.7); color: #fff;
  text-shadow: 0 2px 0 var(--t3), 2px 0 0 var(--t3), -2px 0 0 var(--t3), 0 -2px 0 var(--t3);
  position: relative;
  animation: tileDrop 0.5s cubic-bezier(.3, 1.6, .5, 1) both;
}
.tile::after { content: ''; position: absolute; left: 14%; top: 10%; width: 30%; height: 14%; border-radius: 50%; background: rgba(255, 255, 255, 0.7); transform: rotate(-25deg); }
.tile.speaking { animation: tileWave 0.5s ease both; }
.tile.c1 { --t1: #ff8cc0; --t2: #f03e8a; --t3: #a3185a; }
.tile.c2 { --t1: #ffc078; --t2: #ff8a1f; --t3: #b35500; }
.tile.c3 { --t1: #ffe66d; --t2: #fcc419; --t3: #b07800; }
.tile.c4 { --t1: #8ce99a; --t2: #40c057; --t3: #227a35; }
.tile.c5 { --t1: #74c0fc; --t2: #339af0; --t3: #1257a0; }
.tile.c6 { --t1: #c5b0ff; --t2: #8f6bff; --t3: #5130c4; }
@keyframes tileDrop { 0% { transform: translateY(-40px) scale(0.3) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes tileWave { 0% { transform: none; } 40% { transform: translateY(-9px) scale(1.08); } 100% { transform: none; } }
.translation {
  display: flex; align-items: center; gap: 8px;
  font-size: 19px; font-weight: 600; color: var(--ink);
  background: #f8f3ff; border-radius: 14px; padding: 6px 14px;
  text-align: center;
}
.lvl {
  flex: none; font-family: var(--font-letters); font-size: 13px; letter-spacing: 0.04em; color: #fff;
  padding: 2px 7px; border-radius: 8px; line-height: 1.3; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.lvl-A1 { background: #40c057; } .lvl-A2 { background: #12b886; } .lvl-B1 { background: #339af0; }
.lvl-B2 { background: #7950f2; } .lvl-C1 { background: #e64980; }
.word-chip .lvl { font-size: 10px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
.flag-pl { width: 22px; height: 15px; border-radius: 3px; flex: none; background: linear-gradient(#fff 50%, #dc143c 50%); box-shadow: 0 0 0 1px #e2d7f5; }
.actions { display: flex; gap: 18px; margin-top: 4px; }
.act {
  border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.act-ico {
  position: relative;
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  border: 4px solid #fff;
  transition: transform 0.1s;
}
.act-ico svg { width: 36px; height: 36px; position: relative; z-index: 2; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2)); }
.act-listen .act-ico { background: linear-gradient(180deg, #74d2ff, #2f9bea); box-shadow: 0 5px 0 #1c6fb0, 0 10px 18px rgba(28, 111, 176, 0.35); }
.act-speak .act-ico { background: linear-gradient(180deg, #ff8cc0, #f03e8a); box-shadow: 0 5px 0 #a3185a, 0 10px 18px rgba(163, 24, 90, 0.35); }
.act:active .act-ico { transform: translateY(3px) scale(0.97); }
.act.playing .act-ico { animation: breathe 0.7s ease-in-out infinite; }
.act.listening .act-ico { background: linear-gradient(180deg, #ff6b6b, #e03131); box-shadow: 0 5px 0 #a51d1d, 0 0 0 6px rgba(255, 107, 107, 0.25); }
.mic-rings { position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; }
.act.listening .mic-rings::before, .act.listening .mic-rings::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(255, 107, 107, 0.7);
  animation: ring 1.2s ease-out infinite;
}
.act.listening .mic-rings::after { animation-delay: 0.6s; }
@keyframes ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.act.disabled .act-ico { filter: grayscale(1); opacity: 0.5; }
.slow-toggle {
  border: 2px solid #e5dbff; background: #fff; color: #7048e8; border-radius: 999px;
  padding: 4px 12px; font-weight: 600; font-size: 13px;
}
.slow-toggle[aria-pressed="true"] { background: #7048e8; color: #fff; border-color: #7048e8; }
.feedback { min-height: 22px; text-align: center; font-size: 15px; line-height: 1.35; width: 100%; }
.feedback:empty { display: none; }
.fb-stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 2px; }
.fb-star { font-size: 36px; color: #e9ecef; text-shadow: 0 3px 0 #ced4da; line-height: 1; }
.fb-star.on { color: #ffd43b; text-shadow: 0 3px 0 #f08c00, 0 0 12px rgba(255, 212, 59, 0.8); animation: starPop 0.5s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes starPop { 0% { transform: scale(0) rotate(-90deg); } 100% { transform: none; } }
.fb-pct { font-family: var(--font-letters); font-size: 22px; color: #2f9e44; }
.fb-pct.mid { color: #f59f00; }
.fb-pct.low { color: #e03131; }
.fb-heard { color: var(--ink-soft); font-size: 14px; }
.fb-msg { font-weight: 600; }
.fb-bonus { display: inline-block; margin-top: 4px; font-family: var(--font-display); font-size: 15px; color: #fff; background: #40c057; padding: 2px 10px; border-radius: 10px; box-shadow: 0 3px 0 #2b8a3e; animation: popIn 0.4s cubic-bezier(.3, 1.8, .5, 1) both; }
.fb-err { color: #c92a2a; font-weight: 700; }
.fb-diag { margin-top: 4px; font-size: 11px; color: #adb5bd; }
.copy-link { margin-top: 6px; border: 2px solid #e5dbff; background: #fff; color: #5f3dc4; border-radius: 12px; padding: 5px 12px; font-weight: 700; font-size: 13px; }
.fb-listen { color: #e03131; font-family: var(--font-display); font-size: 15px; animation: breathe 0.8s ease-in-out infinite; }
.btn-continue { width: 100%; margin-top: 2px; }
.paused-note { font-size: 12px; color: var(--ink-soft); }
@keyframes beeBob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }

/* ---------- pszczoła ---------- */
.bee { width: 84px; height: 84px; flex: none; }
.bee svg { width: 100%; height: 100%; overflow: visible; }
.bee .wing { transform-box: fill-box; transform-origin: 50% 100%; animation: flap 0.18s ease-in-out infinite alternate; }
.bee .wing.r { animation-delay: 0.09s; }
@keyframes flap { from { transform: rotate(-6deg) scaleY(1); } to { transform: rotate(8deg) scaleY(0.82); } }
.bee-float { animation: beeBob 2s ease-in-out infinite; }

/* ---------- podsumowanie ---------- */
.sum-reason {
  font-family: var(--font-display); font-size: 14px; color: #fff; letter-spacing: 0.03em;
  background: #7c4dff; padding: 4px 14px; border-radius: 999px; box-shadow: 0 3px 0 #5130c4;
  margin-top: 4px;
}
.sum-title { font-family: var(--font-display); font-size: 31px; color: #ff5fa2; text-shadow: 0 3px 0 #ffd6e8; text-align: center; line-height: 1.05; }
.sum-score-card {
  position: relative; width: 100%;
  background: linear-gradient(180deg, #fff, #fff6d6); border-radius: 28px; padding: 14px 10px 16px;
  text-align: center; border: 4px solid #fff;
  box-shadow: 0 7px 0 rgba(250, 176, 5, 0.45), 0 14px 30px rgba(90, 40, 20, 0.15);
}
.sum-score {
  font-family: var(--font-letters); font-size: 68px; line-height: 1; color: #fff;
  text-shadow:
    0 4px 0 #f08c00, 3px 0 0 #f08c00, -3px 0 0 #f08c00, 0 -3px 0 #f08c00,
    2px 2px 0 #f08c00, -2px 2px 0 #f08c00, 2px -2px 0 #f08c00, -2px -2px 0 #f08c00, 0 8px 0 #c26700;
}
.sum-score-label { font-weight: 600; color: #b07800; margin-top: 6px; }
.record-badge {
  position: absolute; top: -14px; right: -6px; transform: rotate(8deg);
  background: linear-gradient(180deg, #ff8cc0, #f03e8a); color: #fff; font-family: var(--font-display);
  font-size: 15px; padding: 5px 10px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 3px 0 #a3185a;
  animation: popIn 0.5s 0.8s cubic-bezier(.3, 1.8, .5, 1) both;
}
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.stat { background: #fff; border-radius: 20px; padding: 10px 6px; text-align: center; border: 3px solid #fff; min-width: 0; }
.stat-pink { box-shadow: 0 5px 0 #ffb3d2; }
.stat-blue { box-shadow: 0 5px 0 #a5d8ff; }
.stat-green { box-shadow: 0 5px 0 #b2f2bb; }
.stat-v { font-family: var(--font-letters); font-size: 30px; line-height: 1.1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-v.stat-word { font-size: 20px; line-height: 1.65; }
.stat-l { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sum-words-wrap { width: 100%; }
.sum-sub { font-family: var(--font-display); font-size: 16px; color: #7c4dff; margin: 2px 0 8px; }
.sum-sub small { font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); }
.sum-words { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  border: 0; background: #fff; border-radius: 16px; padding: 6px 10px 6px 6px;
  display: flex; align-items: center; gap: 8px; text-align: left;
  box-shadow: 0 4px 0 #e5dbff; animation: popIn 0.4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.word-chip:active { transform: translateY(2px); box-shadow: 0 2px 0 #e5dbff; }
.word-chip .wc-word { font-family: var(--font-letters); font-size: 17px; color: var(--ink); line-height: 1.1; }
.word-chip .wc-tr { font-size: 12px; color: var(--ink-soft); line-height: 1.1; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-chip .wc-meta { font-size: 11px; color: #f59f00; font-weight: 600; }
.word-chip .wc-ico { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(180deg, #74d2ff, #2f9bea); color: #fff; }
.word-chip .wc-ico svg { width: 16px; height: 16px; }
.more-chip { font-family: var(--font-display); font-size: 14px; color: #7c4dff; padding: 10px 14px; }
.sum-empty { font-size: 14px; color: var(--ink-soft); background: #fff; border-radius: 16px; padding: 10px 14px; }

.cta-card {
  position: relative; overflow: hidden; width: 100%;
  border-radius: 30px; padding: 18px 16px 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'%3E%3Cpath d='M14 1 L28 1 L35 12 L28 24 L14 24 L7 12 Z M42 24 L56 24 L63 36 L56 48 L42 48 L35 36 Z M-14 24 L0 24 L7 36 L0 48 L-14 48 L-21 36 Z' fill='none' stroke='%23ffffff' stroke-opacity='0.35' stroke-width='2'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #ffe066, #ffc21a 55%, #ffa94d);
  border: 4px solid #fff;
  box-shadow: 0 8px 0 #d18a00, 0 18px 36px rgba(160, 90, 0, 0.3);
  display: flex; flex-direction: column; gap: 12px;
}
.cta-glow { position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: radial-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); pointer-events: none; }
.cta-head { position: relative; display: flex; gap: 10px; align-items: center; }
.bee-cta { width: 74px; height: 74px; animation: beeBob 1.8s ease-in-out infinite; }
.cta-title { font-family: var(--font-display); font-size: 20px; color: #4a2800; line-height: 1.1; }
.cta-text { font-size: 15px; color: #5c3a00; line-height: 1.35; margin-top: 4px; }
.cta-points { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: #5c3a00; }
.cta-points li { background: rgba(255, 255, 255, 0.55); border-radius: 12px; padding: 5px 10px; }
.cta-main { --c1: #5b3cc4; --c2: #3b1f9e; --c3: #22106a; color: #fff; text-shadow: 0 2px 0 #22106a; font-size: 19px; animation: breathe 1.8s ease-in-out infinite; }
.stores { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.store-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #111; color: #fff; text-decoration: none;
  border-radius: 14px; padding: 8px 10px; border: 2px solid #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  font-weight: 600; font-size: 16px; line-height: 1.05;
}
.store-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn small { display: block; font-size: 10px; font-weight: 500; opacity: 0.85; }
.store-btn.preferred { outline: 3px solid #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 6px rgba(124, 77, 255, 0.45); }
.sum-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.sum-actions .btn { width: 100%; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(720deg); opacity: 0.9; }
}

/* ---------- obrót telefonu ---------- */
#rotateHint { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  #rotateHint {
    position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #ffe3f1, #e3f4ff); font-family: var(--font-display); color: #7c4dff; font-size: 22px;
  }
  #rotateHint div { font-size: 54px; }
}

@media (max-height: 700px) {
  .logo .ball { --sz: 46px; }
  .logo .logo-row:nth-child(2) .ball { --sz: 50px; }
  .btn-play { font-size: 30px; padding: 12px 56px; }
  .act-ico { width: 66px; height: 66px; }
  .bubble-card { gap: 8px; padding: 14px 14px 12px; }
}
@media (max-width: 360px) {
  .booster { width: 56px; height: 56px; }
  .next-slot { width: 68px; height: 56px; }
  #bar { gap: 8px; }
  .pill { min-width: 84px; font-size: 20px; }
  .timer-pill { font-size: 22px; min-width: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
