/* =====================================================
   WAHE.WORLD — Immersions / Practice Engine Styles
   Full-screen overlay launched from within the reader.
   ===================================================== */

/* ── Immersions bar (shown in study detail view) ── */
.immersions-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0 8px;
  padding: 16px 18px;
  background: hsla(262, 60%, 6%, 0.7);
  border: 1px solid hsla(262, 70%, 55%, 0.18);
  border-radius: var(--radius-md);
}

.immersions-label {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--indigo);
  font-family: var(--font-body);
  margin-bottom: 2px;
}

.immersions-label span {
  font-size: 12px;
  margin-right: 6px;
}

.immersions-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.imm-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: hsla(262, 60%, 9%, 0.8);
  border: 1px solid hsla(262, 70%, 55%, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.imm-btn:hover {
  background: hsla(262, 60%, 14%, 0.9);
  border-color: hsla(262, 70%, 65%, 0.45);
  color: var(--text-primary);
}

.imm-btn .imm-icon { font-size: 15px; line-height: 1; }

.imm-btn.insight-btn {
  border-color: hsla(38, 100%, 53%, 0.25);
  background: hsla(38, 80%, 6%, 0.8);
  color: var(--text-gold);
}
.imm-btn.insight-btn:hover {
  background: hsla(38, 80%, 10%, 0.9);
  border-color: hsla(38, 100%, 53%, 0.5);
}

/* ── Full-screen overlay ── */
.practice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: hsl(245, 24%, 3%);  /* fully opaque — nothing bleeds through */
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pOverlayIn 0.22s ease;
}

@keyframes pOverlayIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.practice-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-gold);
  flex-shrink: 0;
}

.practice-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.practice-close:hover { border-color: var(--border-gold); color: var(--gold); }

/* Script toggle pill — Gurmukhi / Roman (compact icon-only) */
.prac-script-toggle {
  display: flex;
  align-items: center;
  background: hsla(245, 30%, 6%, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.prac-script-btn {
  width: 34px;
  height: 28px;
  padding: 0;
  border-radius: 14px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.prac-script-btn[data-script="g"] { font-family: var(--font-gurmukhi); font-size: 13px; }
.prac-script-btn[data-script="r"] { font-family: var(--font-body); font-weight: 600; letter-spacing: -0.5px; }
.prac-script-btn:hover { color: var(--text-secondary); }
.prac-script-btn.active {
  background: hsla(262, 60%, 22%, 0.9);
  border: 1px solid hsla(262, 70%, 55%, 0.4);
  color: var(--text-primary);
}

/* Override Gurmukhi font in game chips when roman mode is on */
.scramble-area[data-roman="1"] .word-chip,
.scramble-answer-zone[data-roman="1"] .word-chip,
.fillblank-options[data-roman="1"] .fillblank-btn,
.firstletter-grid[data-roman="1"] .fl-chip {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.3px;
}

.practice-mode-name {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--indigo);
  font-family: var(--font-body);
}

.practice-pauri-name {
  font-size: 13px;
  color: var(--text-gold);
  font-style: italic;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice-xp-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--gold-bright);
  font-family: var(--font-body);
  flex-shrink: 0;
}

/* Progress bar */
.practice-progress-wrap {
  height: 3px;
  background: var(--border-subtle);
  flex-shrink: 0;
}
.practice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--gold));
  transition: width 0.4s ease;
}

/* Body */
.practice-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* Line counter */
.practice-line-counter {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

/* Prompt block */
.practice-prompt {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.practice-prompt-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.practice-prompt-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.practice-prompt-gurmukhi {
  font-family: var(--font-gurmukhi);
  font-size: clamp(16px, 2.5vw, 22px);
  line-height: 2;
  color: var(--text-gurmukhi);
  letter-spacing: 0.3px;
}

.practice-prompt-roman {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.5vw, 22px);
  line-height: 2;
  color: var(--text-gurmukhi);
  letter-spacing: 0.3px;
}

/* ── Scramble mode ── */
.scramble-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  align-content: flex-start;
}

.scramble-answer-zone {
  min-height: 56px;
  padding: 10px 12px;
  background: hsla(245, 30%, 5%, 0.8);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-content: flex-start;
}

.scramble-answer-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 4px;
  font-family: var(--font-body);
  width: 100%;
}

.word-chip {
  padding: 8px 14px;
  background: hsla(245, 30%, 9%, 0.9);
  border: 1px solid hsla(245, 40%, 30%, 0.5);
  border-radius: 20px;
  color: var(--text-gurmukhi);
  font-family: var(--font-gurmukhi);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  animation: chipIn 0.18s ease;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.word-chip:hover  { border-color: var(--indigo); background: hsla(262, 40%, 13%, 0.9); }
.word-chip.placed { opacity: 0.35; pointer-events: none; }
.word-chip.correct {
  background: hsla(150, 60%, 8%, 0.9);
  border-color: hsla(150, 55%, 45%, 0.6);
  color: hsl(150, 60%, 72%);
  pointer-events: none;
}
.word-chip.wrong {
  animation: shakeChip 0.35s ease;
  border-color: hsla(0, 70%, 50%, 0.6);
  color: hsl(0, 70%, 70%);
}

@keyframes shakeChip {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-5px); }
  60%     { transform: translateX(5px); }
}

/* ── Fill-blank mode ── */
.fillblank-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fillblank-btn {
  padding: 16px 14px;
  background: hsla(245, 30%, 7%, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-gurmukhi);
  font-family: var(--font-gurmukhi);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  animation: chipIn 0.18s ease;
}
.fillblank-btn:hover { border-color: var(--indigo); background: hsla(262, 40%, 11%, 0.9); }
.fillblank-btn.correct {
  background: hsla(150, 60%, 8%, 0.9);
  border-color: hsl(150, 55%, 45%);
  color: hsl(150, 60%, 72%);
}
.fillblank-btn.wrong {
  background: hsla(0, 60%, 8%, 0.9);
  border-color: hsl(0, 60%, 40%);
  color: hsl(0, 60%, 65%);
  animation: shakeChip 0.35s ease;
}

/* ── First-letter mode ── */
.firstletter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fl-chip {
  padding: 8px 14px;
  background: hsla(245, 30%, 9%, 0.9);
  border: 1px solid hsla(245, 40%, 28%, 0.5);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-gurmukhi);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
}
.fl-chip:hover  { border-color: var(--indigo); color: var(--text-secondary); }
.fl-chip.revealed {
  background: hsla(262, 40%, 11%, 0.9);
  border-color: hsla(262, 60%, 45%, 0.5);
  color: var(--text-gurmukhi);
  cursor: default;
}

.fl-self-declare {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.fl-btn-know {
  flex: 1;
  padding: 13px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold-hi);
  border-radius: var(--radius-sm);
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.fl-btn-know:hover { background: hsla(38, 100%, 53%, 0.2); }

.fl-btn-hint {
  padding: 13px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.fl-btn-hint:hover { border-color: var(--border-gold); color: var(--text-secondary); }

/* ── Insight mode ── */
.insight-image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.insight-image-wrap img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.insight-image-wrap img.loaded { opacity: 1; }

.insight-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.insight-section-heading {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 8px;
  font-family: var(--font-body);
}

.insight-teaching-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.insight-concept-chip {
  margin-bottom: 10px;
  padding: 12px 14px;
  background: hsla(245, 25%, 6%, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.insight-concept-chip:hover { border-color: var(--border-gold); }

.concept-term-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.concept-g { font-family: var(--font-gurmukhi); font-size: 18px; color: var(--text-gurmukhi); }
.concept-term { font-size: 13px; color: var(--text-gold); font-style: italic; }
.concept-meaning { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.concept-etym { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ── Feedback ── */
.practice-feedback {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  text-align: center;
  display: none;
}
.practice-feedback.success {
  display: block;
  background: hsla(150, 60%, 8%, 0.9);
  border: 1px solid hsl(150, 55%, 35%);
  color: hsl(150, 60%, 72%);
}
.practice-feedback.error {
  display: block;
  background: hsla(0, 60%, 8%, 0.9);
  border: 1px solid hsl(0, 55%, 35%);
  color: hsl(0, 60%, 70%);
}

/* ── Footer / action row ── */
.practice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Script switch label — makes the Gurmukhi/Roman toggle discoverable now that
   it lives at the bottom of the modal instead of crammed into the header. */
.prac-script-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-body);
  padding: 0 4px 0 8px;
}

.practice-next-btn {
  padding: 12px 36px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold-hi);
  border-radius: var(--radius-sm);
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: none;
}
.practice-next-btn.visible { display: block; }
.practice-next-btn:hover { background: hsla(38, 100%, 53%, 0.22); }

/* ── Completion screen ── */
.practice-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 20px;
  flex: 1;
}

.complete-glyph { font-size: 52px; line-height: 1; }

.complete-title {
  font-family: var(--font-gurmukhi);
  font-size: 22px;
  color: var(--text-gurmukhi);
}

.complete-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.complete-mastered {
  font-size: 13px;
  letter-spacing: 1px;
  color: hsl(150, 60%, 72%);
  background: hsla(150, 60%, 8%, 0.9);
  border: 1px solid hsl(150, 55%, 35%);
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-family: var(--font-body);
}

.complete-xp {
  font-size: 28px;
  color: var(--gold-bright);
  font-family: var(--font-body);
}

.complete-xp small { font-size: 13px; color: var(--gold-dim); display: block; margin-top: 2px; }

.complete-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.complete-btn {
  padding: 11px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.complete-btn:hover { border-color: var(--border-gold); color: var(--gold); }
.complete-btn.primary {
  background: var(--gold-glow);
  border-color: var(--border-gold-hi);
  color: var(--gold-bright);
}

/* ── Toast ── */
.practice-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: hsla(245, 30%, 10%, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 10px 22px;
  color: var(--text-gold);
  font-size: 13px;
  font-family: var(--font-body);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.practice-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Celebration burst ── */
@keyframes burst {
  0%   { transform: scale(1); opacity: 1; }
  60%  { transform: scale(1.5); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}
.burst-ring {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  border: 2px solid var(--gold);
  width: 60px; height: 60px;
  z-index: 1050;
  animation: burst 0.55s ease forwards;
}

/* ── Combo meter (header) ───────────────────────────── */
.practice-combo {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: hsla(38, 90%, 50%, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.practice-combo.show { display: inline-flex; animation: comboPop 0.25s ease; }
.practice-combo.hot {
  background: hsla(38, 100%, 53%, 0.22);
  border-color: var(--border-gold-hi);
  box-shadow: 0 0 14px var(--gold-glow);
}
@keyframes comboPop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── Recall Race ────────────────────────────
   Rebuild the verse word-by-word from scrambled Gurmukhi letters, on a clock. */
.recall-rush {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.recall-rush-hint {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  text-align: center;
}
.recall-clue {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--text-gold);
  text-align: center;
  line-height: 1.5;
}

/* The verse, rebuilt as rows of letter-slots grouped into words. */
.recall-verse {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}
.recall-word {
  display: inline-flex;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 10px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.recall-word.active { background: hsla(38, 80%, 10%, 0.55); box-shadow: 0 0 0 1px var(--border-gold-hi); }

.recall-let {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 36px;
  padding: 0 2px;
  border-bottom: 2px solid hsla(245, 40%, 42%, 0.5);
  font-family: var(--font-gurmukhi);
  font-size: 25px;
  color: var(--gold-bright);
  transition: all 0.15s ease;
}
.recall-verse[data-roman="1"] .recall-let {
  font-family: var(--font-body);
  font-size: 19px;
  min-width: 12px;
  height: 30px;
}
.recall-let.cur { border-bottom-color: var(--gold); box-shadow: 0 3px 12px var(--gold-glow); }
@keyframes letterPop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.25); filter: brightness(1.6); text-shadow: 0 0 8px var(--gold-glow); }
  100% { transform: scale(1); }
}
.recall-let.filled {
  border-bottom-color: hsla(150, 55%, 45%, 0.7);
  animation: letterPop 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.recall-word.solved .recall-let { color: hsl(150, 50%, 70%); border-bottom-color: transparent; }
.recall-let.revealed { color: hsl(0, 55%, 70%); }

/* Countdown clock. */
.recall-timer-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.recall-timer {
  flex: 1;
  height: 7px;
  background: hsla(245, 40%, 20%, 0.5);
  border-radius: 4px;
  overflow: hidden;
}
.recall-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00f5d4, #00db8b);
  transition: width 0.05s linear, background 0.2s ease;
}
.recall-points-val {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  min-width: 38px;
  text-align: right;
  transition: color 0.2s ease;
}

/* Floating points animation */
@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-28px) scale(1.15);
    opacity: 0;
  }
}
.floating-points {
  position: absolute;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  pointer-events: none;
  z-index: 2000;
  animation: floatUp 0.6s ease-out forwards;
}

/* Score bar container and details */
.recall-score-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  background: hsla(245, 30%, 5%, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 4px;
}
.recall-score-progress-track {
  height: 5px;
  background: hsla(245, 40%, 15%, 0.7);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}
.recall-score-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00db8b, #00f5d4);
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}
.recall-score-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 1px;
}
.score-label {
  color: var(--text-muted);
}
.score-numbers {
  display: inline-flex;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}
.score-numbers .earned {
  color: #00f5d4;
  text-shadow: 0 0 6px rgba(0, 245, 212, 0.3);
}
.score-numbers .slash {
  color: var(--text-muted);
  margin: 0 2px;
}
.score-numbers .total {
  color: var(--text-secondary);
}

/* Animations for score and overlay */
@keyframes scoreBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); color: var(--gold-bright); filter: brightness(1.3); }
}
.score-numbers.bounce {
  animation: scoreBounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.practice-overlay.error-flash {
  box-shadow: inset 0 0 45px rgba(239, 71, 111, 0.45);
  transition: box-shadow 0.1s ease;
}

/* Staggered spawn for tiles */
@keyframes tileSpawn {
  from { transform: translateY(12px) scale(0.85); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* The scrambled-letter bank. */
.recall-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.recall-tile {
  min-width: 46px;
  height: 50px;
  padding: 0 8px;
  background: hsla(245, 30%, 9%, 0.9);
  border: 1px solid hsla(245, 40%, 30%, 0.6);
  border-radius: 12px;
  color: var(--text-gurmukhi);
  font-family: var(--font-gurmukhi);
  font-size: 25px;
  cursor: pointer;
  animation: tileSpawn 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.recall-bank[data-roman="1"] .recall-tile { font-family: var(--font-body); font-size: 19px; }
.recall-tile:hover { border-color: var(--gold); transform: translateY(-1px); }
.recall-tile.used { opacity: 0.2; pointer-events: none; transform: scale(0.82); }
.recall-tile.wrong {
  animation: shakeChip 0.32s ease;
  border-color: hsla(0, 70%, 50%, 0.7);
  color: hsl(0, 70%, 70%);
}

/* ── Listen & Find (audio-recognition race) ─────────────
   Hear a word, then tap it among the scattered words before the clock runs out. */
.listen-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}
.listen-cue { display: flex; align-items: center; gap: 14px; }
.listen-replay {
  width: 54px; height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 24px;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold-hi);
  color: var(--gold-bright);
  cursor: pointer;
  transition: var(--transition);
}
.listen-replay:hover { background: hsla(38, 100%, 53%, 0.22); transform: scale(1.05); }
.listen-prompt { font-family: var(--font-body); font-size: 15px; color: var(--text-primary); }
.listen-hint {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.listen-timer {
  width: 100%;
  max-width: 320px;
  height: 7px;
  background: hsla(245, 40%, 20%, 0.5);
  border-radius: 4px;
  overflow: hidden;
}
.listen-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.09s linear;
}
.listen-timer-fill.low { background: hsl(0, 72%, 55%); }

.listen-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.listen-chip {
  padding: 12px 18px;
  background: hsla(245, 30%, 9%, 0.9);
  border: 1px solid hsla(245, 40%, 30%, 0.6);
  border-radius: 14px;
  color: var(--text-gurmukhi);
  font-family: var(--font-gurmukhi);
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.listen-pool[data-roman="1"] .listen-chip { font-family: var(--font-body); font-size: 18px; }
.listen-chip:disabled { cursor: default; }
.listen-chip:not(:disabled):hover { border-color: var(--gold); transform: translateY(-1px); }
.listen-chip.found {
  opacity: 0.3;
  border-color: hsla(150, 55%, 45%, 0.6);
  color: hsl(150, 55%, 70%);
  transform: scale(0.9);
}
.listen-chip.wrong {
  animation: shakeChip 0.32s ease;
  border-color: hsla(0, 70%, 50%, 0.7);
  color: hsl(0, 70%, 70%);
}
.listen-chip.missed {
  animation: listenMiss 0.6s ease;
  border-color: hsla(0, 70%, 55%, 0.7);
  color: hsl(0, 60%, 70%);
  opacity: 0.45;
}
@keyframes listenMiss {
  0%   { box-shadow: 0 0 0 3px hsla(0, 80%, 55%, 0.6); }
  100% { box-shadow: none; }
}

.listen-count {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 38px;
  color: var(--gold);
  min-height: 44px;
  transition: opacity 0.3s ease;
}
.listen-count.hide { opacity: 0; }

/* ── Narrow / portrait phones ───────────────────────────
   Header now holds only close · mode · combo · XP (the script toggle moved to
   the footer), so the score has room. Just tighten spacing, drop the long
   italic section note, and pad for the status-bar safe area on notches. */
@media (max-width: 480px) {
  .practice-header {
    gap: 8px;
    padding: 12px 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .practice-pauri-name { display: none; }
  .practice-mode-name  { font-size: 10px; letter-spacing: 1px; }
  .practice-combo    { padding: 5px 9px; font-size: 11px; white-space: nowrap; }
  .practice-xp-badge { padding: 5px 10px; font-size: 11px; }
}
