/* מדברים עברית עם לולי – צבעי מים רכים */
@font-face {
  font-family: 'HeeboPrint';
  src: url('../fonts/Heebo.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'RubikUI';
  src: url('../fonts/Rubik.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FredokaTitle';
  src: url('../fonts/Fredoka.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DanaYad';
  src: url('../fonts/DanaYad.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #FFF8F0;
  --peach: #FFD6C0;
  --lavender: #E8D5F5;
  --sage: #C9E2D4;
  --mint: #C8F0E0;
  --coral: #FF8A7A;
  --aqua: #A8E6E0;
  --sky: #B8D4F0;
  --gold: #FFD54F;
  --soft-pink: #FFC8D8;
  --green: #7BC67E;
  --text: #4A3F55;
  --text-soft: #6B5F78;
  --card: #FFFFFF;
  --shadow: 0 8px 28px rgba(90, 70, 110, 0.12);
  --shadow-sm: 0 4px 14px rgba(90, 70, 110, 0.1);
  --radius: 24px;
  --radius-sm: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'HeeboPrint', 'RubikUI', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 10% 0%, var(--lavender) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 10%, var(--peach) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, var(--sage) 0%, transparent 50%),
    var(--cream);
}

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.35s ease;
}
.screen.active { display: flex; }
#screen-home {
  padding-top: calc(76px + var(--safe-top));
}
@media (max-width: 540px) and (min-height: 700px) {
  #screen-home {
    padding-top: calc(88px + var(--safe-top));
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.font-print {
  font-family: 'HeeboPrint', 'RubikUI', sans-serif !important;
  font-weight: 700;
}

h1, h2 {
  font-weight: 700;
}

.btn {
  font-family: 'HeeboPrint', 'RubikUI', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  min-height: 52px;
  min-width: 48px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(135deg, var(--coral), #FF6B8A);
  color: #fff;
  font-size: 1.3rem;
  padding: 16px 32px;
}
.btn-secondary {
  background: var(--lavender);
  color: var(--text);
}
.btn-ghost {
  background: rgba(255,255,255,0.75);
  box-shadow: none;
  border: 2px solid var(--peach);
}

.btn-listen, .btn-speak {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 18px 16px;
  font-size: 1.35rem;
  line-height: 1.3;
}
.btn-listen {
  background: linear-gradient(135deg, var(--sky), var(--aqua));
  color: var(--text);
  min-height: 88px;
  margin-top: 12px;
}
.btn-speak {
  background: linear-gradient(135deg, var(--soft-pink), var(--lavender));
  color: var(--text);
  min-height: 110px;
  font-size: 1.5rem;
}
.btn-speak.listening {
  background: linear-gradient(135deg, #FF8A9A, #E8A0F0);
  color: #fff;
  animation: pulseMic 1.2s ease infinite;
}
.btn-emoji { font-size: 2rem; line-height: 1; }

@keyframes pulseMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(255, 107, 138, 0); }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.logo-wrap { text-align: center; margin-bottom: 8px; }
.logo-wrap img {
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}
.logo-sm img { width: 72px; height: 72px; }
.char-giraffe {
  display: flex;
  justify-content: center;
  margin: 0 0 8px;
}
.char-giraffe img {
  width: 84px;
  height: auto;
  object-fit: contain;
  background: transparent;
  filter: none;
  mask-image: none;
  -webkit-mask-image: none;
  user-select: none;
  -webkit-user-drag: none;
}

#screen-home h1,
.big-question,
.prize-title {
  text-align: center;
  font-size: clamp(1.7rem, 5.5vw, 2.5rem);
  color: #6B4C9A;
  line-height: 1.45;
  margin-bottom: 6px;
}
.subtitle {
  text-align: center;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--coral);
  margin-bottom: 12px;
  line-height: 1.5;
}
.intro-text {
  text-align: center;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 1.2rem;
  margin: 0 auto 8px;
  max-width: 34rem;
}
#btn-start { align-self: center; margin-top: 8px; }

.giraffe-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.giraffe-wrap img,
.giraffe-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: none;
  mask-image: none;
  -webkit-mask-image: none;
}
.home-group { width: min(440px, 94vw); height: auto; }
.giraffe-sm img { width: 70px; height: 90px; }
.giraffe-end { width: min(280px, 72vw); height: auto; }
.giraffe-wrap.happy { animation: bounceHappy 0.6s ease; }
@keyframes bounceHappy {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
  70% { transform: translateY(-4px); }
}

.coach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.coach-bubble {
  flex: 1;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  color: #6B4C9A;
  font-size: 1.35rem;
  line-height: 1.45;
}

.choice-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
@media (min-width: 560px) {
  .choice-row { flex-direction: row; }
}
.choice-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  border-radius: var(--radius);
  border: 3px solid transparent;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  color: var(--text);
  font-family: inherit;
}
.choice-btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.choice-btn.selected {
  border-color: var(--gold);
  background: linear-gradient(180deg, #FFF9E8, #fff);
}
.choice-img {
  width: min(180px, 40vw);
  height: auto;
  max-height: 260px;
  object-fit: contain;
  object-position: center bottom;
  background: transparent;
  filter: none;
  user-select: none;
  -webkit-user-drag: none;
}
.choice-btn { min-height: 220px; }

.q-count {
  text-align: center;
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--peach);
  background: #fff;
  font-family: 'HeeboPrint', 'RubikUI', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
}
.dot.current {
  border-color: #6B4C9A;
  background: var(--gold);
}
.dot.st-correct { background: var(--sage); }
.dot.st-partial { background: var(--peach); }
.dot.current.st-correct,
.dot.current.st-partial { background: var(--gold); }
.dot:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.question-text {
  text-align: center;
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1.45;
  color: #4A3568;
  min-height: 1.4em;
}

.mic-block { margin-bottom: 8px; }
.mic-status {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-soft);
  min-height: 1.4em;
  margin-top: 8px;
}
.fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.fallback-note {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-soft);
  text-align: center;
}
.fallback input {
  font-size: 1.35rem;
  padding: 12px 16px;
  border: 2px solid var(--peach);
  border-radius: 999px;
  text-align: center;
  background: #fff;
  color: var(--text);
  outline: none;
}
.fallback input:focus { border-color: var(--coral); }

.feedback {
  text-align: center;
  min-height: 1.2em;
  margin: 8px 0 12px;
  border-radius: var(--radius-sm);
  padding: 8px;
}
.feedback.ok { background: rgba(201, 226, 212, 0.85); }
.feedback.partial { background: rgba(255, 213, 79, 0.35); }
.feedback.unclear { background: rgba(232, 213, 245, 0.7); }
.fb-line {
  font-size: 1.35rem;
  line-height: 1.55;
  margin: 2px 0;
}
.fb-frame {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: #6B4C9A;
  margin: 6px 0;
}
.fb-hint {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-top: 4px;
}
.fb-heard {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
  padding-top: 8px;
}
.nav-row .btn { flex: 1 1 40%; }

.end-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.end-line {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.end-label {
  color: #6B4C9A;
  font-size: 1rem;
}
.end-sentence {
  font-size: 1.35rem;
  line-height: 1.5;
}
.end-sentence.empty {
  color: var(--text-soft);
  font-size: 1.05rem;
  font-weight: 600;
}
.end-play {
  align-self: flex-start;
}
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.end-actions .btn { width: 100%; max-width: 360px; }
