/* Word Practice (sight words), redesigned to match the language word games:
   gold progress meter, a big word card with a gold edge, star pips for correct
   checks, tactile Correct / Incorrect / Skip buttons with instant feedback, and the
   language games as big tiles underneath. Shared confetti for finished screens.
   Language-specific type for the word games (Spanish, French, English, Farsi). */

/* Summary: "3 of 40 words completed  [meter]  4 / 12" */
.word-practice .wp-summary { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 600; }
.word-practice .wp-summary .hw-meter { max-width: none; }
.word-practice .wp-count { flex: none; font-variant-numeric: tabular-nums; opacity: .9; }

/* The word card */
.word-practice .wp-card { position: relative; border: 3px solid #f0d9a8; border-radius: 28px; background: linear-gradient(135deg, #f4e9fb 0%, #fffaf0 55%, #fff0cf 100%); box-shadow: 0 12px 0 #b88fc955, 0 24px 48px #1d0b2e45; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.word-practice .wp-card .practice-prompt { color: #6a4a7c; font-size: 16px; }
.word-practice .practice-word { color: #4b2462; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; hyphens: none; align-self: stretch; text-align: center; overflow: hidden; padding: 0 12px; }
.word-practice .wp-pop { animation: wp-pop .4s cubic-bezier(.3, 1.4, .5, 1) both; }
.word-practice .practice-mastery { display: flex; justify-content: center; }

/* Correct checks as stars: filled gold for each check, soft lilac still to earn. */
.wp-pips { display: inline-flex; gap: 8px; }
.wp-pips i { width: 26px; height: 26px; background: #e4d3ee; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background .3s, transform .3s; }
.wp-pips i.is-on { background: linear-gradient(160deg, #ffe08a, #f1a92f); }
.wp-card.wp-right .wp-pips i:not(.is-on):first-of-type, .wp-card.wp-right .wp-pips i.is-on + i:not(.is-on) { background: linear-gradient(160deg, #ffe08a, #f1a92f); transform: scale(1.25); }

/* Feedback mark (top left; the speaker sits top right) */
.wp-card-mark { position: absolute; top: 14px; left: 14px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.wp-card-mark svg { width: 26px; height: 26px; }
.wp-card.wp-right { border-color: #5fae6e; box-shadow: 0 0 0 5px #9ee0a9aa, 0 12px 0 #b88fc955, 0 24px 48px #1d0b2e45; }
.wp-card.wp-right .wp-card-mark { opacity: 1; transform: scale(1); background: #3f9a57; }
.wp-card.wp-right .practice-word { animation: wp-cheer .55s ease; color: #2f7a46; }
.wp-card.wp-wrong { border-color: #e07b7b; animation: hw-shake .45s ease; }
.wp-card.wp-wrong .wp-card-mark { opacity: 1; transform: scale(1); background: #d25c5c; }
.wp-card.wp-skip .practice-word { animation: wp-skip .35s ease forwards; }
/* Sparkles on a right answer */
.wp-card::before, .wp-card::after { content: ''; position: absolute; width: 14px; height: 14px; background: #ffd45e; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; pointer-events: none; }
.wp-card::before { top: 30%; left: 18%; }
.wp-card::after { top: 26%; right: 20%; width: 20px; height: 20px; }
.wp-card.wp-right::before { animation: wp-sparkle .7s ease-out; }
.wp-card.wp-right::after { animation: wp-sparkle .7s .12s ease-out; }

/* Tactile rating buttons */
.word-practice .word-practice-ratings { gap: 14px; }
.word-practice .practice-rating { min-height: 84px; border-width: 3px; border-radius: 22px; font-size: 16px; font-weight: 700; gap: 6px; box-shadow: 0 7px 0 #b88fc966, 0 14px 26px #1d0b2e33; transition: transform .12s ease, box-shadow .12s ease, filter .2s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.word-practice .practice-rating svg { width: 32px; height: 32px; }
.word-practice .practice-rating:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.03); }
.word-practice .practice-rating:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 #b88fc966, 0 6px 14px #1d0b2e33; }
.word-practice .practice-rating:focus-visible { outline: 4px solid #ffe7a8; outline-offset: 3px; }
.word-practice .practice-easy { box-shadow: 0 7px 0 #5fae6e88, 0 14px 26px #1d0b2e33; }
.word-practice .practice-difficult { box-shadow: 0 7px 0 #e07b7b77, 0 14px 26px #1d0b2e33; }
.word-practice .practice-skip { background: #fff9eb; }
.word-practice .practice-rating:disabled { opacity: .7; cursor: default; }

/* Finished and empty */
.word-practice .practice-finished, .word-practice .wp-empty { padding: 36px 24px; text-align: center; }
.word-practice .practice-finished h2 { color: #4b2462; }
.word-practice .practice-finished p { color: #6a4a7c; }
.word-practice .practice-finished .word-practice-seal { animation: wp-pop .5s cubic-bezier(.3, 1.4, .5, 1) both; }

/* Confetti (Word Practice finished card and the language games' finished screen) */
.wp-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.wp-confetti i { position: absolute; top: -14px; left: calc(var(--i) * 5.5% + 2%); width: 10px; height: 14px; border-radius: 3px; background: #f3c56d; opacity: 0; animation: wp-confetti 2.4s calc(var(--i) * 70ms) ease-in both; }
.wp-confetti i:nth-child(4n+1) { background: #b07fd6; width: 8px; height: 8px; border-radius: 50%; }
.wp-confetti i:nth-child(4n+2) { background: #7fcf98; }
.wp-confetti i:nth-child(4n+3) { background: #f49ab4; height: 10px; }
.wp-confetti i:nth-child(3n) { animation-duration: 2.9s; }
.hw-game .hw-finished { position: relative; overflow: hidden; }

/* More word games: big tiles under the practice card */
.wp-more { margin-top: 26px; padding-top: 26px; border-top: 1px solid #ffffff26; }
.wp-more header { display: grid; gap: 6px; }
.wp-more header .tiny { margin: 0; color: #ffe0a3; }
.wp-more h2 { margin: 0; color: #fff8e5; font: 800 clamp(24px, 3.4vw, 34px)/1.1 ui-rounded, 'Trebuchet MS', system-ui, sans-serif; letter-spacing: -.02em; }
.wp-more header p:last-child { margin: 0; color: #eadcf5; font-size: 16px; }
.wp-more .games-hub-grid { margin-top: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wp-more .games-hub-grid > :only-child { grid-column: 1 / -1; max-width: 540px; }
@media (max-width: 700px) { .wp-more .games-hub-grid { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .word-practice .wp-summary { gap: 10px; font-size: 14px; flex-wrap: wrap; }
  .word-practice .wp-summary .hw-meter { order: 3; flex-basis: 100%; }
  .word-practice .wp-count { margin-left: auto; }
  .word-practice .practice-rating { min-height: 72px; font-size: 15px; }
  .wp-pips i { width: 22px; height: 22px; }
  .wp-card-mark { width: 38px; height: 38px; top: 10px; left: 10px; }
}

@keyframes wp-pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes wp-cheer { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-2deg); } 70% { transform: scale(.98) rotate(1deg); } }
@keyframes wp-skip { to { transform: translateX(-40px); opacity: 0; } }
@keyframes wp-sparkle { 0% { opacity: 0; transform: scale(.2) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(40deg); } 100% { opacity: 0; transform: scale(.6) rotate(90deg) translateY(-18px); } }
@keyframes wp-confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) {
  .wp-pop, .wp-card.wp-right .practice-word, .wp-card.wp-wrong, .wp-card.wp-skip .practice-word, .wp-card::before, .wp-card::after, .wp-confetti i, .practice-finished .word-practice-seal { animation: none !important; }
  .wp-confetti { display: none; }
}

/* ---- Language word games: type for each script ---- */
.hw-game:not([data-lang="he"]) .hw-hebrew, .hw-game:not([data-lang="he"]) .hw-finished-he,
.hw-tile-art:not([data-lang="he"]) .hw-tile-word b, .hw-tile-art:not([data-lang="he"]) .hw-tile-letter {
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif; letter-spacing: -.01em;
}
.hw-game[data-lang="fa"] .hw-hebrew, .hw-game[data-lang="fa"] .hw-finished-he,
.hw-tile-art[data-lang="fa"] .hw-tile-word b, .hw-tile-art[data-lang="fa"] .hw-tile-letter, .hw-admin-hebrew[lang="fa"] {
  font-family: "Geeza Pro", "Vazirmatn", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, sans-serif; letter-spacing: 0;
}
.hw-game:not([data-lang="he"]):not([data-lang="fa"]) .hw-hebrew { line-height: 1.25; padding-block: 10px 6px; }
.hw-tile-art:not([data-lang="he"]) .hw-tile-word b { font-size: 10.5cqw; line-height: 1.35; }
.hw-tile-art[data-lang="fa"] .hw-tile-word b { font-size: 12cqw; line-height: 1.6; }
.hw-admin-form .hw-admin-hebrew[dir="ltr"] { font-family: inherit; font-size: 18px; text-align: left; }
.hw-admin-word--single { grid-template-columns: 210px minmax(140px, 1fr) auto auto; }
@media (max-width: 860px) { .hw-admin-word--single { grid-template-columns: 1fr 1fr; } }

/* Counting pictures are drawn on a transparent background; keep them crisp. */
.hw-card-art img[src$=".svg"], .hw-tile-card img[src$=".svg"] { mix-blend-mode: normal; }

/* Language admin: switch between the five word games */
.hw-admin-languages { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.hw-admin-languages .ui-button[aria-current="page"] { background: #4b2462; color: #fff8e5; border-color: #4b2462; }
/* Room for the card's 3D edge above the buttons */
.word-practice .wp-card + .word-practice-ratings { margin-top: 10px; }
@media (max-width: 600px) { body[data-child-page=open] .word-practice .wp-card { min-height: clamp(230px, 36vh, 360px); } }

/* Games page: the Educational Games section under the fun games */
.games-hub .wp-more { margin-top: 34px; padding-top: 30px; }
.games-hub .wp-more .games-hub-grid { margin-top: 20px; }
.wp-more header p.games-edu-note { color: #ffe0a3; font-size: 15px; font-weight: 600; }

/* Word game tiles: the stage keeps a 2:1 shape (never shorter than 240px) and the word card,
   pictures and gaps are sized to fit inside it, so nothing is cut off at the top or bottom. */
/* width/max-width stop Safari from turning the 240px minimum height into a 480px minimum
   width through the aspect ratio (which pushed the stage off the right edge on iPhone). */
.game-preview-tile .hw-tile-art { flex: 1 0 auto; min-height: 240px; aspect-ratio: 2 / 1; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.hw-tile-stage { gap: 4cqw; padding: 3cqw 4cqw; }
.hw-tile-word { padding: .8cqw 6cqw; }
.hw-tile-art[data-lang="he"] .hw-tile-word b { font-size: 11.5cqw; }
.hw-tile-cards { grid-template-columns: repeat(4, 17cqw); }

/* ---- Counting to 20: count along, in order ---- */
.hw-count-back { align-self: flex-start; }
.hw-count-stage { display: grid; grid-template-columns: auto minmax(0, 560px) auto; justify-content: center; align-items: center; gap: 18px; }
.hw-game .hw-count-card { position: relative; margin: 0; min-height: 0 !important; padding: 22px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 3px solid #f0d9a8; border-radius: 28px; background: linear-gradient(135deg, #f4e9fb 0%, #fffaf0 55%, #fff0cf 100%); box-shadow: 0 12px 0 #b88fc955, 0 24px 48px #1d0b2e45; }
.hw-count-card.hw-count-in { animation: hw-count-in .35s cubic-bezier(.3, 1.3, .5, 1) both; }
.hw-count-card .hw-hear { position: absolute; top: 12px; right: 12px; margin: 0; color: #77508f; }
.hw-count-numeral { font: 900 clamp(64px, 9vw, 104px)/1 ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif; color: #b0731f; text-shadow: 0 4px 0 #f6dfae; letter-spacing: -.03em; }
.hw-count-picture { width: clamp(150px, 22vw, 210px); aspect-ratio: 1; display: grid; place-items: center; }
.hw-count-picture img { width: 100%; height: 100%; object-fit: contain; }
.hw-game .hw-count-word { align-self: stretch; width: 100%; text-align: center; font-size: clamp(44px, 6.5vw, 72px); padding: 0 8px; }
.hw-count-say { margin: 2px 0 0; font-size: 18px; color: #6a4a7c; }
.hw-count-say b { color: #4b2462; font-size: 22px; }
.hw-count-english { margin: 4px 0 0; padding: 3px 14px; border-radius: 99px; background: #efe3f7; color: #6a4a7c; font-size: 15px; font-weight: 700; }
.hw-count-nav { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #f0d9a8; background: #fffaf0; color: #4b2462; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 0 #b88fc966, 0 12px 24px #1d0b2e40; transition: transform .12s, box-shadow .12s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hw-count-nav svg { width: 30px; height: 30px; }
.hw-count-nav:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #b88fc966, 0 6px 14px #1d0b2e40; }
.hw-count-nav:disabled { opacity: .35; cursor: default; }
.hw-count-nav--next { background: linear-gradient(160deg, #fff3c4, #f3c56d); border-color: #fff1c5; }
.hw-count-nav:focus-visible, .hw-count-dot:focus-visible { outline: 4px solid #ffe7a8; outline-offset: 3px; }
.hw-count-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 720px; margin: 4px auto 0; }
.hw-count-dot { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ffffff40; background: #2a1a3d66; color: #f3e6ff; font: 800 15px/1 ui-rounded, "Trebuchet MS", system-ui, sans-serif; cursor: pointer; transition: transform .15s, background .2s; }
.hw-count-dot.is-done { background: linear-gradient(160deg, #ffe08a, #f1a92f); border-color: #fff1c5; color: #4b2462; }
.hw-count-dot.is-now { background: #fffaf0; border-color: #ffe7a8; color: #4b2462; transform: scale(1.18); box-shadow: 0 0 0 4px #ffe7a866; }
.hw-count-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hw-count-next svg { width: 20px; height: 20px; }
@keyframes hw-count-in { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .hw-count-stage { grid-template-columns: 1fr; }
  .hw-count-nav { display: none; }
  .hw-count-dot { width: 34px; height: 34px; font-size: 13px; }
  .hw-game .hw-count-card { padding: 16px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) { .hw-count-card.hw-count-in { animation: none; } }
.hw-count-top { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 32px); }
.hw-count-top .hw-count-numeral { min-width: 1.3em; text-align: center; }
.hw-count-picture { width: clamp(130px, 17vw, 180px); }

/* ---- Learn a Language: one tile that cycles languages, and the language picker ---- */
.hw-tile-lang { position: relative; margin-bottom: -2.4cqw; z-index: 1; padding: .6cqw 3cqw; border-radius: 99px; background: #4b2462; color: #fff8e5; font: 800 3.2cqw/1.3 ui-rounded, "Trebuchet MS", system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 1cqw 2cqw #1d0b2e33; }
.lang-pick-page .practice-heading { margin-bottom: 18px; }
.lang-pick-copy { margin: 6px 0 0; color: #eadcf5; font-size: 17px; }
.lang-pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 1000px; }
.lang-pick { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: stretch; width: 100%; padding: 0; border: 3px solid #f0d9a8; border-radius: 28px; overflow: hidden; background: #fff8e8; color: #4b2462; text-align: left; cursor: pointer; box-shadow: 0 10px 0 #b88fc955, 0 22px 44px #1d0b2e45; transition: transform .15s ease, box-shadow .15s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; font: inherit; }
.lang-pick:hover { transform: translateY(-3px); }
.lang-pick:active { transform: translateY(4px); box-shadow: 0 4px 0 #b88fc955, 0 10px 22px #1d0b2e45; }
.lang-pick:focus-visible { outline: 4px solid #ffe7a8; outline-offset: 4px; }
.lang-pick .game-tile-badge { position: absolute; top: 14px; left: 14px; z-index: 2; }
.lang-pick-art { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 170px; padding: 24px; background: radial-gradient(ellipse at 50% 25%, #fff6dd, #f1def8 55%, #d6b8ea); }
.lang-pick-word { display: grid; place-items: center; padding: 6px 22px; border: 2px solid #f0d9a8; border-radius: 20px; background: linear-gradient(135deg, #fffaf0, #fff0c9); box-shadow: 0 6px 0 #b88fc966, 0 14px 24px #4d2e6533; }
.lang-pick-word b { font: 800 clamp(30px, 4vw, 44px)/1.35 ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif; white-space: nowrap; color: #4b2462; }
.lang-pick[data-lang="he"] .lang-pick-word b { font-family: "SF Hebrew", "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif; font-weight: 700; line-height: 1.45; }
.lang-pick-pic { width: 96px; height: 96px; padding: 8px; border: 2px solid #f0d9a8; border-radius: 20px; background: #fffaf0; box-shadow: 0 6px 0 #b88fc955; }
.lang-pick-pic img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.lang-pick-copy-row { display: grid; gap: 4px; padding: 18px 22px 6px; }
.lang-pick-copy-row strong { font: 800 26px/1.15 ui-rounded, "Trebuchet MS", system-ui, sans-serif; }
.lang-pick-copy-row span { color: #6a4a7c; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-pick .game-play-label { justify-self: start; margin: 10px 22px 22px; display: inline-flex; align-items: center; gap: 6px; }
.lang-pick .game-play-label .ui-icon, .lang-pick .game-play-label svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .lang-pick-grid { grid-template-columns: 1fr; } .lang-pick-art { min-height: 140px; } .lang-pick-pic { width: 76px; height: 76px; } }
.lang-pick-page .lang-pick-grid { margin-top: 22px; }

/* v201 fixes: readable section copy on purple, round number dots, bigger "new games" line */
.wp-more header p { color: #eadcf5 !important; }
.wp-more header p.games-edu-note { color: #ffe0a3 !important; }
.hw-count-dot { flex: none; box-sizing: border-box; width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; max-height: 44px; padding: 0 !important; border-radius: 50% !important; display: grid; place-items: center; line-height: 1; }
@media (max-width: 600px) { .hw-count-dot { width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; max-height: 36px; font-size: 13px; } }
.games-hub .games-weekly { font: 800 clamp(24px, 3.2vw, 36px)/1.25 ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif; letter-spacing: -.01em; margin-top: 30px; }

/* iPad Safari: buttons don't stretch flex children, so the picker card is a grid and its
   picture band always spans the full card. */
.lang-pick-art, .lang-pick-copy-row { width: 100%; box-sizing: border-box; }
