:root {
  --ink: #213547;
  --teal: #58c9c5;
  --teal-dark: #147f83;
  --coral: #ff8a7a;
  --yellow: #ffd861;
  --blue: #8dc7f7;
  --cream: #fff9ef;
  --white: #fff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(255,216,97,.55) 0 8%, transparent 8.5%),
    radial-gradient(circle at 90% 82%, rgba(88,201,197,.35) 0 10%, transparent 10.5%),
    var(--cream);
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
}

button, a { font: inherit; }
.game-header {
  min-height: 88px;
  padding: 10px clamp(18px,5vw,64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand img { display: block; border-radius: 18px; box-shadow: 0 8px 22px rgba(33,53,71,.12); }
.back-link { color: var(--teal-dark); font-weight: 800; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

main { padding: 12px 18px 54px; }
.game-shell { width: min(920px,100%); margin: 0 auto; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-weight: 900; letter-spacing: .14em; direction: ltr; }
h1 { margin: 0; font-size: clamp(2rem,6vw,4.15rem); line-height: 1.05; }
h1 span { color: var(--coral); }
.intro-copy > p:last-child { margin: 14px 0 22px; font-size: 1.08rem; color: #5f6d78; }

.progress-wrap { width: min(680px,100%); margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; direction: ltr; }
.progress-track { flex: 1; height: 13px; overflow: hidden; border-radius: 999px; background: #e4e8e8; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),var(--yellow),var(--coral)); transition: width .35s ease; }
.progress-wrap strong { min-width: 44px; color: var(--teal-dark); }

.round-card, .finish-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px,4vw,38px);
  border: 3px solid var(--ink);
  border-radius: 34px;
  background: rgba(255,255,255,.96);
  box-shadow: 10px 12px 0 rgba(33,53,71,.12);
}
.round-card::before, .round-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: .28;
  pointer-events: none;
}
.round-card::before { top: -45px; right: -35px; background: var(--yellow); }
.round-card::after { bottom: -55px; left: -30px; background: var(--teal); }
.prompt { margin: 0; direction: ltr; color: #6a7882; font-size: 1rem; font-weight: 800; }
.word-row { display: flex; align-items: center; justify-content: center; gap: 12px; direction: ltr; }
#targetWord { margin: 2px 0 5px; color: var(--teal-dark); font-size: clamp(2.7rem,8vw,5rem); line-height: 1; }
.sound-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  box-shadow: 0 5px 0 #d6aa26;
}
.sound-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #d6aa26; }
.instruction { margin: 6px 0 18px; color: #6a7882; }

.choices { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; direction: ltr; }
.choice {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 24px;
  background: var(--card-color,var(--blue));
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
  box-shadow: 0 7px 0 rgba(33,53,71,.22);
}
.choice:hover, .choice:focus-visible { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 11px 0 rgba(33,53,71,.18); outline: 4px solid rgba(88,201,197,.25); }
.choice .emoji { font-size: clamp(3.5rem,9vw,5.4rem); filter: drop-shadow(0 7px 4px rgba(33,53,71,.13)); }
.robot-figure { position: relative; width: 72px; height: 105px; display: block; filter: drop-shadow(0 7px 4px rgba(33,53,71,.16)); }
.robot-antenna { position: absolute; top: 0; left: 34px; width: 5px; height: 14px; border-radius: 5px; background: var(--ink); }
.robot-antenna::before { content: ""; position: absolute; top: -5px; left: -4px; width: 13px; height: 13px; border: 3px solid var(--ink); border-radius: 50%; background: var(--coral); }
.robot-head { position: absolute; top: 14px; left: 13px; width: 48px; height: 33px; display: flex; align-items: center; justify-content: space-evenly; border: 3px solid var(--ink); border-radius: 10px; background: #8bd8f7; }
.robot-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); box-shadow: inset 2px 2px 0 white; }
.robot-body { position: absolute; top: 51px; left: 17px; width: 40px; height: 37px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 3px solid var(--ink); border-radius: 8px; background: var(--yellow); }
.robot-body b { width: 6px; height: 6px; border: 1px solid var(--ink); border-radius: 50%; background: var(--coral); }
.robot-body b:nth-child(2) { background: var(--teal); }
.robot-body b:nth-child(3) { background: #8dc7f7; }
.robot-arm { position: absolute; top: 56px; width: 12px; height: 32px; border: 3px solid var(--ink); border-radius: 8px; background: #8bd8f7; }
.robot-arm.left { left: 2px; transform: rotate(12deg); }
.robot-arm.right { right: 0; transform: rotate(-12deg); }
.robot-leg { position: absolute; top: 85px; width: 13px; height: 20px; border: 3px solid var(--ink); border-radius: 0 0 7px 7px; background: var(--coral); }
.robot-leg.left { left: 20px; }
.robot-leg.right { right: 18px; }
.choice.correct { background: #9be6bd; animation: pop .42s ease; }
.choice.wrong { animation: shake .35s ease; background: #ffb2a7; }
.feedback { min-height: 28px; margin: 18px 0 0; font-size: 1.18rem; font-weight: 900; color: var(--teal-dark); }

.finish-card { padding-block: clamp(40px,8vw,78px); background: linear-gradient(145deg,#fff 55%,#eaf9f8); }
.celebration { font-size: clamp(2.5rem,7vw,5rem); }
.finish-card h2 { margin: 8px 0; color: var(--coral); font-size: clamp(2.5rem,7vw,4.8rem); }
.finish-card p { font-size: 1.15rem; }
.word-confetti { margin: 24px auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; direction: ltr; }
.word-confetti span { padding: 8px 14px; border-radius: 999px; font-weight: 900; background: var(--yellow); }
.word-confetti span:nth-child(2n) { background: var(--teal); }
.word-confetti span:nth-child(3n) { background: var(--coral); }
.play-again { border: 0; border-radius: 999px; padding: 14px 26px; background: var(--teal-dark); color: white; font-weight: 900; cursor: pointer; box-shadow: 0 7px 0 #0c5d60; }
.play-again:active { transform: translateY(4px); box-shadow: 0 3px 0 #0c5d60; }
footer { padding: 0 18px 28px; text-align: center; color: #6a7882; font-size: .9rem; }

@keyframes pop { 50% { transform: scale(1.08) rotate(2deg); } }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@media (max-width: 620px) {
  .game-header { min-height: 76px; padding: 8px 14px; }
  .brand img { width: 60px; height: 60px; }
  .back-link { font-size: .93rem; }
  main { padding: 6px 12px 38px; }
  .round-card, .finish-card { border-radius: 25px; box-shadow: 6px 8px 0 rgba(33,53,71,.12); }
  .choices { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .choice { min-height: 112px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
