/* ====== Ortografek — styl ====== */

:root {
  --bg-top: #fff8e8;
  --bg-bottom: #eaf6ef;
  --ink: #2e3a4e;
  --ink-soft: #6b7a92;
  --card: #ffffff;
  --coral: #ff8a5c;
  --sun: #ffd449;
  --sky: #5bb8f5;
  --lilac: #b893f0;
  --mint: #4fd1a5;
  --rose: #f56b8d;
  --shadow: 0 6px 0 rgba(46, 58, 78, 0.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ---- górny pasek ---- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.logo { font-weight: 800; font-size: 1.35rem; flex: 1; }
.stars, .streak {
  font-weight: 700;
  background: var(--card);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.gear {
  font-size: 1.4rem;
  background: var(--card);
  border: none;
  border-radius: 50%;
  width: 46px; height: 46px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.gear:hover { transform: rotate(30deg); }

/* ---- scena ---- */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 20px;
  text-align: center;
}
.hidden { display: none !important; }

.progress { margin: 0; color: var(--ink-soft); font-weight: 700; font-size: 1.1rem; }

/* ---- słowo z luką ---- */
.word-box {
  font-family: "Andika", "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 10vw, 4.6rem);
  letter-spacing: 2px;
  background: var(--card);
  border-radius: 28px;
  padding: 30px 40px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 92vw;
}

.gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  border-bottom: 6px dashed var(--sky);
  color: var(--sky);
  margin: 0 4px;
  transition: color 0.2s, border-color 0.2s;
}
.gap.good { color: #1f9d6f; border-bottom-style: solid; border-color: var(--mint); }
.gap.bad  { color: var(--rose); border-bottom-style: solid; border-color: var(--rose); text-decoration: line-through; }
.gap.fixed { color: #1f9d6f; border-bottom-style: solid; border-color: var(--mint); }

/* ---- wybór liter ---- */
.choices { display: flex; gap: 26px; }

.choice {
  font-family: "Andika", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  color: #fff;
  border: none;
  border-radius: 26px;
  min-width: 130px;
  padding: 20px 34px;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(46, 58, 78, 0.22);
  transition: transform 0.12s, box-shadow 0.12s;
  user-select: none;
}
.choice:hover { transform: translateY(-3px); }
.choice:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(46,58,78,0.22); }
.choice.a { background: var(--coral); }
.choice.b { background: var(--lilac); }
.choice.correct { background: var(--mint) !important; }
.choice.wrong { background: var(--rose) !important; animation: shake 0.35s; }
.choice:disabled { cursor: default; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---- informacja zwrotna ---- */
.feedback { min-height: 1.6em; margin: 0; font-weight: 800; font-size: 1.4rem; }
.feedback.good { color: #1f9d6f; }
.feedback.bad { color: var(--rose); }

/* ---- przyciski ---- */
.row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }

.pill-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: var(--sky);
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
  box-shadow: 0 5px 0 #3d92cc;
  transition: transform 0.1s, box-shadow 0.1s;
}
.pill-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #3d92cc; }
.pill-btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 rgba(46,58,78,0.18); }

.next-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  background: var(--coral);
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  cursor: pointer;
  box-shadow: 0 8px 0 #d96a3f;
  transition: transform 0.12s, box-shadow 0.12s;
}
.next-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #d96a3f; }

/* ---- podsumowanie ---- */
.summary {
  background: var(--card);
  border-radius: 28px;
  padding: 30px 40px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.summary h2 { margin: 0; font-size: 1.8rem; }
.summary p { margin: 0; font-size: 1.2rem; color: var(--ink-soft); }

/* ---- ustawienia ---- */
.settings {
  border: none;
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 16px 40px rgba(46,58,78,0.25);
  font-family: inherit;
  color: var(--ink);
  width: min(92vw, 380px);
}
.settings::backdrop { background: rgba(46,58,78,0.4); }
.settings h2 { margin: 0 0 8px; font-size: 1.5rem; }
.settings-sub { margin: 0 0 14px; color: var(--ink-soft); font-weight: 700; }
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Andika", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 12px;
  cursor: pointer;
}
.big-check { width: 26px; height: 26px; accent-color: var(--mint); }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 22px;
}
.setting-label { font-weight: 700; font-size: 1.05rem; }
#rate { width: 140px; accent-color: var(--coral); }
.close-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  width: 100%;
  color: #fff;
  background: var(--mint);
  border: none;
  border-radius: 999px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 5px 0 #3aa981;
}
.close-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #3aa981; }

/* ---- dostępność ---- */
button:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 480px) {
  .word-box { padding: 22px 20px; }
  .choice { min-width: 100px; padding: 16px 24px; }
}

/* ====== Logopedek — dodatki do bazowego stylu Ortografka ====== */
.pick-title { margin: 4px 0 0; font-size: 1.25rem; }
.sound-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  max-width: 560px; }
.sound-btn { font: inherit; font-weight: 800; font-size: 1.25rem;
  background: var(--card); border: none; border-radius: 16px;
  padding: 12px 18px; min-width: 62px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s; }
.sound-btn:hover { transform: translateY(-2px); }
.sound-btn.sel { background: var(--sun); }
.pos-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pos-btn { font: inherit; font-weight: 700; background: var(--card);
  border: none; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  box-shadow: var(--shadow); }
.pos-btn.sel { background: var(--mint); color: #fff; }
.big-btn { font: inherit; font-weight: 800; font-size: 1.3rem;
  background: var(--coral); color: #fff; border: none; border-radius: 20px;
  padding: 14px 34px; cursor: pointer; box-shadow: var(--shadow); }
.big-btn:disabled { opacity: .45; cursor: default; }
.syll-hint { color: var(--ink-soft); font-weight: 700; font-size: 1.4rem;
  margin: -10px 0 0; letter-spacing: 1px; }
.speak-btn { font: inherit; font-weight: 800; font-size: 1.15rem;
  background: var(--sky); color: #fff; border: none; border-radius: 999px;
  padding: 12px 26px; cursor: pointer; box-shadow: var(--shadow); }
.choice.ok { background: var(--mint); color: #fff; }
.choice.retry { background: var(--sun); }
.home-link { position: fixed; left: 12px; bottom: 12px; background: var(--card);
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); font-weight: 700; }
.burst { position: fixed; left: 50%; top: 40%; font-size: 3rem;
  transform: translate(-50%,-50%); animation: burst .8s ease-out forwards;
  pointer-events: none; z-index: 50; }
@keyframes burst { from { opacity: 1; transform: translate(-50%,-50%) scale(.6); }
  to { opacity: 0; transform: translate(-50%,-140%) scale(1.6); } }
dialog { border: none; border-radius: 22px; box-shadow: var(--shadow);
  font-family: inherit; padding: 24px 28px; }
dialog label { display: block; margin: 12px 0; font-weight: 700; }
dialog input[type=range] { width: 100%; }
