/* ==========================================================
   Lingaloop Game Hub — styles
   Brand colours live in :root. Change them here only.
   ========================================================== */
@font-face { font-family: "Jakarta"; src: url("../assets/fonts/PlusJakartaSans.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../assets/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../assets/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  /* Brand */
  --navy: #17213B;
  --teal: #4BA18B;
  --teal-deep: #2E7A67;
  --mist: #F4F6FA;
  --white: #FFFFFF;
  /* Supporting palette */
  --teal-soft: #E3F2EE;
  --sun: #FFC857;
  --sun-soft: #FFF3D6;
  --coral: #F2795B;
  --coral-soft: #FDE7E1;
  --sky: #6E8BF5;
  --sky-soft: #E6ECFE;
  --ink-2: #4A5470;
  --line: #E2E7F0;
  --good: #2E9E6B;
  --bad: #D9483B;
  /* Shape */
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(23,33,59,.06), 0 8px 24px rgba(23,33,59,.08);
  --shadow-press: 0 1px 2px rgba(23,33,59,.08);
  --font-latin: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-fa: "Vazirmatn", "Jakarta", system-ui, 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%; background: var(--mist); color: var(--navy); }
body { font-family: var(--font-latin); font-size: 16px; line-height: 1.45; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
html[lang="fa"] body { font-family: var(--font-fa); }
.en, [lang="en"] { font-family: var(--font-latin); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* soft background shapes */
.bg-deco { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-deco span { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.bg-deco span:nth-child(1) { width: 260px; height: 260px; background: var(--teal-soft); top: -90px; inset-inline-end: -80px; }
.bg-deco span:nth-child(2) { width: 180px; height: 180px; background: var(--sun-soft); bottom: 12%; inset-inline-start: -70px; }
.bg-deco span:nth-child(3) { width: 120px; height: 120px; background: var(--sky-soft); bottom: -40px; inset-inline-end: 18%; }

.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100%; height: 100dvh; display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 16px calc(12px + var(--safe-b)); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; }
.wordmark { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-radius: 12px; direction: ltr; }
.wordmark .mark { width: 34px; height: 26px; }
.wm-text { font-family: var(--font-latin); font-weight: 800; letter-spacing: -0.03em; font-size: 21px; color: var(--navy); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; background: var(--white); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-press); border: 1px solid var(--line); }
.lang-switch button { min-width: 40px; height: 36px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); font-family: var(--font-latin); }
.lang-switch button[lang="fa"] { font-family: var(--font-fa); font-size: 15px; }
.lang-switch button[aria-checked="true"] { background: var(--navy); color: var(--white); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow-press); }
.icon-btn svg { width: 22px; height: 22px; }

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; outline: none; }
.screen > .view { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- home ---------- */
.hero { padding: 18px 2px 14px; }
.hero h1 { text-wrap: balance; margin: 0; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
html[lang="fa"] .hero h1 { letter-spacing: 0; font-size: 25px; line-height: 1.5; }
.hero p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.game-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.game-card { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; text-align: start; width: 100%; padding: 16px; border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.game-card:active { transform: scale(.98); box-shadow: var(--shadow-press); }
.game-card::after { content: ""; position: absolute; inset-inline-end: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent-soft); opacity: .7; z-index: 0; }
.game-card > * { position: relative; z-index: 1; }
.game-card .gicon { width: 76px; height: 76px; border-radius: 20px; background: var(--accent-soft); display: grid; place-items: center; }
.game-card .gicon svg { width: 52px; height: 52px; }
.game-card h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.game-card p { margin: 3px 0 8px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.game-card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--mist); color: var(--ink-2); }
.chip.best { background: var(--accent-soft); color: var(--accent-ink); }
.c-rush { --accent: var(--teal); --accent-soft: var(--teal-soft); --accent-ink: var(--teal-deep); }
.c-fix { --accent: var(--coral); --accent-soft: var(--coral-soft); --accent-ink: #A63A22; }
.c-mem { --accent: var(--sky); --accent-soft: var(--sky-soft); --accent-ink: #2F4DB8; }
.footer-note { margin-top: auto; text-align: center; font-size: 12.5px; color: var(--ink-2); padding-top: 12px; }

/* ---------- shared game chrome ---------- */
.gbar { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; }
.back-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.back-btn svg { width: 22px; height: 22px; }
html[dir="rtl"] .back-btn svg { transform: scaleX(-1); }
.gtitle { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: flex; gap: 6px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; text-align: center; min-width: 56px; }
.stat b { direction: ltr; unicode-bidi: isolate; display: block; font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: 11px; color: var(--ink-2); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 24px; border-radius: 16px; font-weight: 800; font-size: 17px; background: var(--navy); color: var(--white); box-shadow: 0 4px 0 #0B1222; transition: transform .1s ease, box-shadow .1s ease; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0B1222; }
.btn.ghost { background: var(--white); color: var(--navy); border: 1.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 0 0 var(--line); }
.btn.teal { background: var(--teal-deep); box-shadow: 0 4px 0 #1D5547; }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 16px; border-radius: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* intro / result panels */
.panel { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 20px; text-align: center; margin: auto 0; }
.panel .big-icon { width: 96px; height: 96px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; background: var(--accent-soft, var(--teal-soft)); }
.panel .big-icon svg { width: 66px; height: 66px; }
.panel h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.panel p { margin: 0 auto 18px; color: var(--ink-2); max-width: 32ch; }
.panel .actions { display: flex; flex-direction: column; gap: 10px; }
.result-num { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; color: var(--navy); }
.result-sub { color: var(--ink-2); font-weight: 600; margin-bottom: 16px; }
.badge-new { display: inline-block; background: var(--sun); color: var(--navy); font-weight: 800; padding: 5px 14px; border-radius: 999px; margin-bottom: 10px; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.seg { display: flex; background: var(--mist); border-radius: 14px; padding: 4px; gap: 4px; margin: 0 0 12px; }
.seg button { flex: 1; min-height: 46px; border-radius: 11px; font-weight: 700; color: var(--ink-2); font-size: 15px; line-height: 1.2; }
.seg button small { display: block; font-size: 11.5px; font-weight: 600; opacity: .8; font-family: var(--font-latin); }
.seg button[aria-checked="true"] { background: var(--white); color: var(--navy); box-shadow: var(--shadow-press); }
.seg-label { text-align: start; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 4px 2px 6px; }

/* ---------- Word Rush ---------- */
.hearts { display: flex; gap: 2px; font-size: 18px; align-items: center; justify-content: center; height: 25px; }
.hearts .h { transition: transform .3s, opacity .3s, filter .3s; }
.hearts .h.lost { filter: grayscale(1); opacity: .3; transform: scale(.8); }
.timebar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 10px; }
.timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-deep)); border-radius: inherit; transform-origin: left; }
html[dir="rtl"] .timebar i { transform-origin: right; }
.field { position: relative; flex: 1; min-height: 220px; border-radius: var(--r-lg); background: linear-gradient(180deg, #FFFFFF 0%, #F9FBFD 70%, var(--teal-soft) 100%); border: 1px solid var(--line); overflow: hidden; }
.field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: repeating-linear-gradient(90deg, var(--teal) 0 14px, var(--teal-deep) 14px 28px); opacity: .35; }
.faller { position: absolute; left: 50%; top: 0; will-change: transform; padding: 12px 22px; border-radius: 18px; background: var(--navy); color: var(--white); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; white-space: nowrap; box-shadow: 0 10px 20px rgba(23,33,59,.18); direction: ltr; }
.faller.ok { background: var(--good); transition: background .15s; }
.faller.bad { background: var(--bad); }
.faller.pop { animation: fallerPop .45s ease forwards; }
@keyframes fallerPop { to { transform: var(--pos) scale(1.25); opacity: 0; } }
.combo-tag { position: absolute; top: 10px; inset-inline-end: 12px; background: var(--sun); color: var(--navy); font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; animation: pop .35s cubic-bezier(.3,1.6,.5,1) both; }
.float-pts { position: absolute; font-weight: 800; color: var(--good); font-size: 22px; pointer-events: none; animation: floatUp .8s ease forwards; direction: ltr; }
@keyframes floatUp { to { transform: translateY(-50px); opacity: 0; } }
.answer-note { position: absolute; left: 12px; right: 12px; bottom: 22px; text-align: center; font-weight: 700; color: var(--bad); font-size: 15px; animation: pop .3s ease both; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; }
.opt { min-height: 66px; padding: 8px 10px; border-radius: 16px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 700; font-size: 18px; line-height: 1.25; transition: transform .08s, box-shadow .08s, background .15s, border-color .15s; word-break: break-word; }
.opt.emoji { font-size: 34px; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt.ok { background: #E4F6EC; border-color: var(--good); box-shadow: 0 4px 0 var(--good); }
.opt.bad { background: #FCE6E3; border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); animation: shake .35s; }
.opt[disabled] { pointer-events: none; }

/* ---------- Fix the Sentence ---------- */
.progress-dots { display: flex; gap: 5px; justify-content: center; margin: 0 0 12px; }
.progress-dots i { width: 22px; height: 6px; border-radius: 999px; background: var(--line); transition: background .3s; }
.progress-dots i.done { background: var(--coral); }
.progress-dots i.now { background: var(--navy); }
.prompt { background: var(--white); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.prompt small { display: block; color: var(--ink-2); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.prompt .tr { font-size: 20px; font-weight: 700; line-height: 1.5; }
.slots { direction: ltr; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 128px; margin: 14px 0; padding: 14px; border-radius: var(--r-lg); border: 2px dashed #C9D2E2; background: rgba(255,255,255,.6); transition: border-color .2s, background .2s; }
.slots.over { border-color: var(--sky); background: var(--sky-soft); }
.slots.ok { border-style: solid; border-color: var(--good); background: #EAF7F0; }
.slots.bad { animation: shake .4s; border-color: var(--bad); }
.slots .placeholder { color: #9AA5BC; font-weight: 600; font-size: 14px; align-self: center; margin: auto; }
.pool { direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 4px 0; min-height: 60px; }
.tile { font-family: var(--font-latin); min-height: 50px; padding: 0 16px; border-radius: 14px; background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 700; font-size: 19px; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .1s, opacity .2s; }
.tile:active { transform: translateY(2px); }
.tile.placed { background: var(--navy); color: var(--white); border-color: var(--navy); box-shadow: 0 4px 0 #0B1222; }
.tile.wrong { background: var(--bad); border-color: var(--bad); box-shadow: 0 4px 0 #9E2C22; color: #fff; }
.tile.hinted { background: var(--sun); border-color: #E3A92B; box-shadow: 0 4px 0 #C98F14; color: var(--navy); }
.tile.ghost-src { opacity: .25; }
.tile.drag-ghost { position: fixed; z-index: 50; pointer-events: none; transform: rotate(-3deg) scale(1.08); box-shadow: 0 14px 28px rgba(23,33,59,.25); }
.tile.pulse { animation: pulse 1s ease-in-out 2; }
.fix-actions { display: flex; gap: 10px; justify-content: center; margin-top: auto; padding-top: 12px; }
.feedback { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--white); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow); margin-top: auto; animation: slideUp .3s ease both; }
.feedback .fb-text { font-weight: 800; font-size: 18px; }
.feedback .fb-stars { font-size: 22px; letter-spacing: 2px; direction: ltr; }
.feedback .fb-stars .off { filter: grayscale(1); opacity: .25; }
.feedback .fb-stars span { display: inline-block; animation: pop .4s cubic-bezier(.3,1.6,.5,1) both; }
.feedback .fb-stars span:nth-child(2) { animation-delay: .1s; }
.feedback .fb-stars span:nth-child(3) { animation-delay: .2s; }
.streak-tag { display: inline-block; font-size: 13px; font-weight: 800; color: #A63A22; background: var(--coral-soft); border-radius: 999px; padding: 2px 9px; margin-inline-start: 6px; vertical-align: middle; }

/* ---------- Memory ---------- */
.board { display: grid; gap: 8px; flex: 1; align-content: center; perspective: 900px; padding: 4px 0; }
.card { position: relative; aspect-ratio: 3 / 3.4; border-radius: 14px; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.4,.2,.2,1); }
.board.cols-4 .card { aspect-ratio: 3 / 3.6; }
.card.up, .card.done { transform: rotateY(180deg); }
.card .face { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; padding: 6px; text-align: center; }
.card .back { background: var(--navy); box-shadow: 0 4px 0 #0B1222; overflow: hidden; }
.card .back svg { width: 58%; height: auto; opacity: .95; }
.card .back::before { content: ""; position: absolute; inset: 6px; border-radius: 10px; border: 1.5px dashed rgba(255,255,255,.18); }
.card .front { transform: rotateY(180deg); background: var(--white); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 800; line-height: 1.2; word-break: break-word; hyphens: auto; }
.card .front.en { color: var(--navy); font-size: var(--fs, 17px); }
.card .front.mean { background: var(--sky-soft); border-color: #CBD6FB; box-shadow: 0 4px 0 #CBD6FB; color: #23367F; font-size: var(--fs, 17px); }
.card .front.emo { background: var(--sun-soft); border-color: #F6DFA6; box-shadow: 0 4px 0 #F6DFA6; font-size: 36px; }
.card.done .front { border-color: var(--good); box-shadow: 0 4px 0 var(--good); animation: matchPop .45s ease .2s both; }
.card.miss .front { border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
@keyframes matchPop { 50% { transform: rotateY(180deg) scale(1.08); } }

/* ---------- shared animations ---------- */
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.08); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: confetti 1.6s ease-in forwards; }
@keyframes confetti { to { transform: translateY(105vh) rotate(540deg); } }

@media (max-height: 700px) {
  .hero { padding: 8px 2px 10px; } .hero h1 { font-size: 23px; }
  .game-card { padding: 12px; } .game-card .gicon { width: 64px; height: 64px; }
  .opt { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ==========================================================
   Extra games (Spot the Mistake, Daily Word Puzzle, Quick Quiz Duel, Idiom Hangman)
   ========================================================== */
[hidden] { display: none !important; }
.c-spot { --accent: var(--sun); --accent-soft: var(--sun-soft); --accent-ink: #8A5A00; }
.c-puz { --accent: #2E9E6B; --accent-soft: #E2F5EB; --accent-ink: #1F7A50; }
.c-duel { --accent: #8B5CF6; --accent-soft: #EFE9FE; --accent-ink: #5B33C4; }
.c-hang { --accent: #E2557A; --accent-soft: #FCE6ED; --accent-ink: #A52A4F; }
.btn.accent { background: var(--accent-ink, var(--navy)); box-shadow: 0 4px 0 rgba(0,0,0,.28); }
.btn.accent:active { box-shadow: 0 1px 0 rgba(0,0,0,.28); }

/* home: 7 games, compact and scrollable */
.view.home { overflow-y: auto; margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.view.home::-webkit-scrollbar { display: none; }
.view.home .hero { padding: 12px 2px 12px; }
.view.home .game-list { gap: 10px; }
.view.home .game-card { grid-template-columns: 60px 1fr; gap: 12px; padding: 12px 14px; border-radius: 20px; }
.view.home .game-card .gicon { width: 60px; height: 60px; border-radius: 16px; }
.view.home .game-card .gicon svg { width: 42px; height: 42px; }
.view.home .game-card h2 { font-size: 16.5px; }
.view.home .game-card p { font-size: 13px; margin: 1px 0 6px; }
.view.home .game-card .meta { font-size: 12px; }
.view.home .footer-note { padding-bottom: 6px; }

/* shared */
.options.three { grid-template-columns: 1fr 1fr 1fr; }
.opt.en { font-family: var(--font-latin); }
.feedback .fb-body { min-width: 0; }
.fb-tip { font-size: 14px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.actions.row { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.toast { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-weight: 700; padding: 8px 16px; border-radius: 999px; z-index: 20; animation: pop .25s ease both; }
.view { position: relative; }

/* Spot the Mistake */
.sentence { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wtok { position: relative; font-family: var(--font-latin); font-weight: 700; font-size: 21px; min-height: 48px; padding: 0 12px; border-radius: 12px; background: var(--mist); border: 2px solid transparent; transition: background .15s, border-color .15s; }
.wtok:active { background: var(--sun-soft); }
.wtok.nope { animation: shake .35s; border-color: var(--line); color: var(--ink-2); }
.wtok.found { background: #FCE6E3; border-color: var(--bad); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2px; }
.wtok.fixed { background: #E4F6EC; border-color: var(--good); color: var(--good); animation: pop .35s ease both; }
.tok-note { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--navy); color: #fff; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; font-family: var(--font-fa); pointer-events: none; z-index: 5; }
#sOpts { padding-top: 16px; }
#sFb:empty { display: none; }

/* Daily Word Puzzle */
.wgrid { display: grid; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.wrow { display: grid; grid-template-columns: repeat(5, min(56px, 13.5vw)); gap: 6px; }
.wcell { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #D5DCE8; border-radius: 10px; background: var(--white); font-family: var(--font-latin); font-weight: 800; font-size: 26px; text-transform: uppercase; color: var(--navy); }
.wcell.filled { border-color: #8D99B3; animation: pop .12s ease; }
.wcell.correct { background: #2E9E6B; border-color: #2E9E6B; color: #fff; }
.wcell.present { background: #F2B53A; border-color: #F2B53A; color: #fff; }
.wcell.absent { background: #8D99B3; border-color: #8D99B3; color: #fff; }
.wcell.flip { animation: cellFlip .5s ease both; }
@keyframes cellFlip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.wrow.shake { animation: shake .4s; }
.wrow.bounce .wcell { animation: pop .4s cubic-bezier(.3,1.6,.5,1) both; }
.p-tools { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; margin-bottom: 6px; }
.p-meaning { background: var(--white); border-radius: 12px; padding: 8px 14px; font-weight: 700; box-shadow: var(--shadow-press); text-align: center; }
.kb { display: flex; flex-direction: column; gap: 6px; margin-top: auto; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key { flex: 1; max-width: 40px; height: 52px; border-radius: 9px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line); font-weight: 800; font-size: 17px; text-transform: uppercase; font-family: var(--font-latin); padding: 0; }
.key.wide { max-width: 64px; flex: 1.6; font-size: 13px; text-transform: none; }
html[lang="fa"] .key.wide { font-family: var(--font-fa); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key.correct { background: #2E9E6B; color: #fff; border-color: #2E9E6B; }
.key.present { background: #F2B53A; color: #fff; border-color: #F2B53A; }
.key.absent { background: #C2CADA; color: #fff; border-color: #C2CADA; }
.key[disabled] { pointer-events: none; }
#pBottom, #hBottom { margin-top: auto; }
.p-end { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; text-align: center; animation: slideUp .3s ease both; }
.p-end .fb-text { font-size: 20px; }
.p-word { margin: 6px 0; font-size: 16px; }
.p-word b { font-family: var(--font-latin); letter-spacing: .08em; }
.p-next { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 10px; font-weight: 600; }
.p-end .streak-tag { margin: 4px 0; }

/* Quick Quiz Duel */
.vs { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--white); border-radius: 16px; padding: 8px 12px; box-shadow: var(--shadow-press); font-weight: 700; font-size: 14px; direction: ltr; }
html[dir="rtl"] .vs .vs-p { font-family: var(--font-fa); }
.vs-p b { font-size: 22px; font-variant-numeric: tabular-nums; display: inline-block; min-width: 1ch; }
.vs-p i { font-style: normal; }
.vs-p.scored b { animation: pop .4s cubic-bezier(.3,1.6,.5,1) both; color: var(--good); }
.vs-q { color: var(--ink-2); font-size: 13px; }
.loopy { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 12px 0 4px; color: var(--ink-2); font-weight: 600; font-size: 14px; min-height: 28px; }
.loopy .bot { font-size: 22px; animation: pulse 1.4s ease-in-out infinite; }
.q-card { background: var(--white); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); text-align: center; margin-top: 8px; }
.q-card small { display: block; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.q-word { font-size: 30px; font-weight: 800; line-height: 1.3; margin-top: 2px; }
.q-word.emoji { font-size: 44px; }
.opt.bot-pick { outline: 3px dashed #8B5CF6; outline-offset: 2px; }
.duel-q { margin-top: auto; margin-bottom: auto; }
.duel-msg { text-align: center; font-weight: 800; font-size: 17px; margin-top: 10px; color: var(--accent-ink); animation: pop .3s ease both; }
.app:has(.duel-two) .topbar { display: none; }
.view.duel-two { gap: 6px; }
.duel-two .half { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding: 4px 0; }
.duel-two .half.p1 { transform: rotate(180deg); }
.duel-two .half .q-card { margin-top: 0; padding: 10px 14px; }
.duel-two .half .q-word { font-size: 26px; }
.duel-two .half .options { padding-top: 8px; gap: 8px; }
.duel-two .half .opt { min-height: 56px; }
.half-name { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.duel-exit { position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 36px; height: 36px; z-index: 5; font-size: 16px; display: none; }
.duel-two .duel-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--white); padding: 10px 18px; border-radius: 14px; box-shadow: var(--shadow); margin: 0; white-space: nowrap; z-index: 6; animation: none; }
.duel-two .vs { padding-inline-start: 48px; position: relative; }
.duel-two .duel-exit { display: grid; top: 50%; }

/* Idiom Hangman */
.balloons { display: flex; justify-content: center; gap: 4px; font-size: 30px; height: 50px; align-items: center; margin: 10px 0 2px; }
.balloons .bl { display: inline-block; width: 36px; text-align: center; animation: float 2.4s ease-in-out infinite; }
.balloons .bl:nth-child(2n) { animation-delay: .4s; } .balloons .bl:nth-child(3n) { animation-delay: .8s; }
.balloons .bl.pop { animation: popOut .4s ease forwards; }
@keyframes float { 50% { transform: translateY(-5px); } }
@keyframes popOut { 0% { transform: scale(1.3); } 100% { transform: scale(.6); opacity: .0; } }
.phrase { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 10px 0 8px; }
.pw { display: flex; gap: 4px; }
.pc { width: 26px; height: 36px; border-bottom: 3px solid var(--navy); display: grid; place-items: center; font-family: var(--font-latin); font-weight: 800; font-size: 22px; text-transform: uppercase; color: var(--navy); }
.pc.on { animation: pop .25s ease both; }
.pc.sym { border-bottom-color: transparent; width: 10px; }
.pc.miss { color: var(--bad); }
#hBottom .feedback { margin-top: 8px; }
