/* ============================================================
   STYLE.CSS — Russian Space Academy
   Space theme, kid-friendly design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0e27;
  --bg2:       #111535;
  --card:      rgba(255,255,255,0.07);
  --card-hov:  rgba(255,255,255,0.13);
  --border:    rgba(255,255,255,0.12);
  --cyan:      #00d4ff;
  --cyan2:     #0099bb;
  --gold:      #ffd700;
  --green:     #00e676;
  --red:       #ff5252;
  --purple:    #b39ddb;
  --text:      #e8eaf6;
  --text-dim:  rgba(232,234,246,0.55);
  --radius:    18px;
  --shadow:    0 8px 32px rgba(0,0,0,0.45);
}

html, body {
  height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

/* ── Starfield ── */
#stars-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── App wrapper ── */
#app {
  position: fixed; inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
#topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(10,14,39,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
#topbar-user { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
#topbar-user .avatar { font-size: 1.4rem; }
#topbar-stars { font-size: 1rem; font-weight: 700; color: var(--gold); }
#btn-logout {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 12px; padding: 5px 14px;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
#btn-logout:hover { background: var(--card-hov); color: var(--text); }

/* ── Screens ── */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  padding-bottom: 80px;
}
.screen.active { display: flex; flex-direction: column; }

/* ── Bottom Nav ── */
#bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10,14,39,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  padding: 6px 0 8px;
  z-index: 10;
}
#bottom-nav button {
  flex: 1; background: none; border: none; color: var(--text-dim);
  font-family: 'Nunito', sans-serif; font-size: 0.7rem; font-weight: 700;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: color .2s;
}
#bottom-nav button .nav-icon { font-size: 1.3rem; }
#bottom-nav button:hover, #bottom-nav button.active { color: var(--cyan); }

/* ── Typography ── */
.screen-title {
  font-size: 1.6rem; font-weight: 900; text-align: center;
  margin-bottom: 6px; line-height: 1.2;
}
.screen-sub {
  font-size: 0.95rem; color: var(--text-dim); text-align: center;
  margin-bottom: 20px;
}
.section-label {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--cyan); margin-bottom: 10px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius); border: none;
  font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800;
  cursor: pointer; transition: all .2s; text-align: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  color: #000; box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,212,255,0.45); }
.btn-secondary {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
}
.btn-secondary:hover { background: var(--card-hov); }
.btn-sm { padding: 9px 18px; font-size: 0.88rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #ffa500);
  color: #000; box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}
.btn-gold:hover { transform: translateY(-2px); }

/* ── Card ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: background .2s;
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { background: var(--card-hov); transform: translateY(-2px); }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════ */
#screen-login {
  align-items: center; justify-content: center; gap: 24px; min-height: 100%;
}
.login-logo { font-size: 4rem; text-align: center; animation: float 3s ease-in-out infinite; }
.login-title {
  font-size: 2rem; font-weight: 900; text-align: center;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sub { font-size: 0.95rem; color: var(--text-dim); text-align: center; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; width: 100%; max-width: 500px; }
.user-tile {
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; cursor: pointer;
  transition: all .2s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.user-tile:hover { background: var(--card-hov); border-color: var(--cyan); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,212,255,0.2); }
.user-tile .tile-avatar { font-size: 2.8rem; }
.user-tile .tile-name { font-weight: 800; font-size: 0.95rem; }
.user-tile .tile-stars { font-size: 0.8rem; color: var(--gold); }
.user-tile.add-tile { border-style: dashed; color: var(--text-dim); }
.user-tile.add-tile:hover { color: var(--cyan); border-color: var(--cyan); }
.user-tile.add-tile .tile-avatar { font-size: 2rem; }

/* ═══════════════════════════════════════════════
   NEW PROFILE SCREEN
═══════════════════════════════════════════════ */
#screen-new-profile { align-items: center; gap: 20px; }
.avatar-picker {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  max-width: 340px; width: 100%;
}
.avatar-option {
  font-size: 2rem; text-align: center; padding: 8px; border-radius: 12px;
  cursor: pointer; border: 2px solid transparent; transition: all .15s;
  background: var(--card);
}
.avatar-option:hover { border-color: var(--cyan); background: var(--card-hov); }
.avatar-option.selected { border-color: var(--gold); background: rgba(255,215,0,0.1); }
.form-group { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }
.form-group label { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); }
.form-input {
  background: var(--card); border: 1.5px solid var(--border); color: var(--text);
  border-radius: 14px; padding: 14px 16px; font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 700; outline: none; transition: border .2s;
}
.form-input:focus { border-color: var(--cyan); }
.age-btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.age-btn {
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-dim); font-family: 'Nunito', sans-serif;
  font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all .2s;
}
.age-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.age-btn.selected { border-color: var(--gold); background: rgba(255,215,0,0.1); color: var(--gold); }

/* ═══════════════════════════════════════════════
   HOME SCREEN
═══════════════════════════════════════════════ */
.home-greeting { text-align: center; margin-bottom: 20px; }
.home-greeting .greeting-avatar { font-size: 3rem; }
.home-greeting h1 { font-size: 1.5rem; font-weight: 900; }
.home-greeting .level-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,215,0,0.15); border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px; padding: 5px 14px; font-size: 0.85rem; font-weight: 700; color: var(--gold);
  margin-top: 8px;
}
.xp-bar { height: 6px; background: var(--border); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 10px; transition: width .6s ease; }
.home-modules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.module-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; gap: 8px;
}
.module-card:hover { background: var(--card-hov); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.module-icon { font-size: 2rem; }
.module-name { font-weight: 800; font-size: 1rem; }
.module-desc { font-size: 0.78rem; color: var(--text-dim); }
.module-stars { font-size: 0.8rem; color: var(--gold); }
.module-card.cyan  { border-color: rgba(0,212,255,0.3);  }
.module-card.gold  { border-color: rgba(255,215,0,0.3);  }
.module-card.green { border-color: rgba(0,230,118,0.3);  }
.module-card.purple{ border-color: rgba(179,157,219,0.3);}
.module-card.pink  { border-color: rgba(253,121,168,0.3);}

/* ═══════════════════════════════════════════════
   LEARN MENU
═══════════════════════════════════════════════ */
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.learn-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 16px; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.learn-card:hover { background: var(--card-hov); transform: translateY(-2px); }
.learn-card .lc-icon { font-size: 2.5rem; }
.learn-card .lc-name { font-weight: 800; font-size: 1rem; }
.learn-card .lc-count { font-size: 0.78rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════
   ALPHABET SCREEN
═══════════════════════════════════════════════ */
.alphabet-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px;
}
.letter-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 8px; cursor: pointer; transition: all .2s; text-align: center;
}
.letter-card:hover { background: var(--card-hov); border-color: var(--cyan); }
.letter-card .lc-big { font-size: 2.2rem; font-weight: 900; color: var(--cyan); line-height: 1; }
.letter-card .lc-small { font-size: 1.2rem; color: var(--text-dim); }
.letter-card .lc-emoji { font-size: 1.4rem; }
.letter-card .lc-word { font-size: 0.7rem; color: var(--text-dim); font-weight: 600; }

/* Letter detail panel */
.letter-detail {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(10,14,39,0.95); backdrop-filter: blur(10px);
  align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  padding: 24px;
}
.letter-detail.open { display: flex; }
.ld-letter { font-size: 6rem; font-weight: 900; color: var(--cyan); line-height: 1; }
.ld-sound { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.ld-like { font-size: 1rem; color: var(--text-dim); text-align: center; }
.ld-word { font-size: 1.8rem; font-weight: 800; }
.ld-emoji { font-size: 3.5rem; }
.ld-close {
  position: absolute; top: 20px; right: 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: 50%;
  width: 44px; height: 44px; font-size: 1.2rem; color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.ld-close:hover { background: var(--card-hov); }

/* ═══════════════════════════════════════════════
   NUMBERS SCREEN
═══════════════════════════════════════════════ */
.numbers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.number-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; display: flex; align-items: center; gap: 14px; transition: all .2s;
}
.number-card:hover { background: var(--card-hov); }
.num-digit { font-size: 2rem; font-weight: 900; color: var(--cyan); min-width: 48px; text-align: center; }
.num-ru { font-size: 1rem; font-weight: 800; }
.num-en { font-size: 0.8rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════
   VOCABULARY SCREEN
═══════════════════════════════════════════════ */
.tab-bar {
  display: flex; gap: 6px; margin-bottom: 16px;
  background: var(--bg2); border-radius: 14px; padding: 4px;
}
.tab-btn {
  flex: 1; padding: 9px; border-radius: 10px; border: none;
  background: none; color: var(--text-dim);
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tab-btn.active { background: var(--card-hov); color: var(--cyan); }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.vocab-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 10px; text-align: center; transition: all .2s;
}
.vocab-card:hover { background: var(--card-hov); }
.vc-emoji { font-size: 2.2rem; }
.vc-color { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto; }
.vc-ru { font-size: 0.95rem; font-weight: 800; margin-top: 6px; }
.vc-en { font-size: 0.75rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════
   PHRASES SCREEN
═══════════════════════════════════════════════ */
.phrase-list { display: flex; flex-direction: column; gap: 10px; }
.phrase-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.phrase-ru { font-size: 1.2rem; font-weight: 800; color: var(--cyan); }
.phrase-en { font-size: 1rem; font-weight: 600; }
.phrase-phonetic { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }

/* ═══════════════════════════════════════════════
   QUIZ SELECT SCREEN
═══════════════════════════════════════════════ */
.quiz-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-cat-card {
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px 14px; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.quiz-cat-card:hover { background: var(--card-hov); border-color: var(--cyan); transform: translateY(-2px); }
.qcc-icon { font-size: 2.5rem; }
.qcc-name { font-weight: 800; font-size: 1rem; }
.qcc-best { font-size: 0.78rem; color: var(--gold); }

/* ═══════════════════════════════════════════════
   QUIZ SCREEN
═══════════════════════════════════════════════ */
.quiz-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-shrink: 0; }
.quiz-progress-text { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.quiz-progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 10px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold)); border-radius: 10px; transition: width .4s ease; }
.quiz-score-inline { font-size: 0.85rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.quiz-question-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; margin-bottom: 16px;
}
.qq-display { font-size: 3rem; margin-bottom: 8px; }
.qq-question { font-size: 1.15rem; font-weight: 800; line-height: 1.3; }
.qq-subtext { font-size: 0.85rem; color: var(--text-dim); margin-top: 6px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-btn {
  background: var(--card); border: 2px solid var(--border); border-radius: 16px;
  padding: 16px 10px; font-family: 'Nunito', sans-serif; font-size: 1rem; font-weight: 800;
  color: var(--text); cursor: pointer; transition: all .2s; text-align: center;
}
.option-btn:hover:not(:disabled) { border-color: var(--cyan); background: var(--card-hov); }
.option-btn.correct { border-color: var(--green) !important; background: rgba(0,230,118,0.15) !important; color: var(--green) !important; }
.option-btn.wrong   { border-color: var(--red)   !important; background: rgba(255,82,82,0.15)   !important; color: var(--red)   !important; }
.option-btn:disabled { cursor: default; }
.quiz-feedback {
  text-align: center; padding: 12px; border-radius: 14px; font-weight: 800; font-size: 1rem;
  margin-top: 8px; min-height: 52px; display: flex; align-items: center; justify-content: center;
  transition: all .3s;
}
.quiz-feedback.correct { background: rgba(0,230,118,0.1); color: var(--green); }
.quiz-feedback.wrong   { background: rgba(255,82,82,0.1);   color: var(--red);   }

/* ═══════════════════════════════════════════════
   QUIZ RESULT SCREEN
═══════════════════════════════════════════════ */
#screen-quiz-result { align-items: center; justify-content: center; text-align: center; gap: 20px; }
.result-emoji { font-size: 5rem; animation: bounceIn .6s ease; }
.result-score { font-size: 3rem; font-weight: 900; }
.result-stars { font-size: 2.5rem; letter-spacing: 4px; }
.result-label { font-size: 1.2rem; font-weight: 700; color: var(--text-dim); }
.result-detail { font-size: 0.9rem; color: var(--text-dim); }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 340px; }

/* ═══════════════════════════════════════════════
   READING LIST SCREEN
═══════════════════════════════════════════════ */
.reading-list { display: flex; flex-direction: column; gap: 12px; }
.reading-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: all .2s; display: flex; gap: 14px; align-items: center;
}
.reading-item:hover { background: var(--card-hov); transform: translateY(-2px); }
.ri-emoji { font-size: 2.2rem; flex-shrink: 0; }
.ri-info { flex: 1; }
.ri-title { font-size: 1rem; font-weight: 800; }
.ri-title-en { font-size: 0.82rem; color: var(--text-dim); }
.ri-level { font-size: 0.78rem; color: var(--cyan); margin-top: 4px; }

/* ═══════════════════════════════════════════════
   READING SCREEN
═══════════════════════════════════════════════ */
.reading-meta { text-align: center; margin-bottom: 16px; }
.reading-meta .rm-emoji { font-size: 2.5rem; }
.reading-meta .rm-title { font-size: 1.4rem; font-weight: 900; margin-top: 6px; }
.reading-meta .rm-level { font-size: 0.85rem; color: var(--cyan); }
.reading-passage {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; font-size: 1.15rem; line-height: 2; margin-bottom: 12px;
}
.reading-passage .r-word {
  display: inline; cursor: pointer; border-radius: 4px; padding: 1px 2px;
  transition: background .15s;
}
.reading-passage .r-word:hover { background: rgba(0,212,255,0.15); color: var(--cyan); }
.reading-passage .r-word.highlighted { background: rgba(255,215,0,0.2); color: var(--gold); }
.translation-box {
  background: rgba(0,212,255,0.07); border: 1px solid rgba(0,212,255,0.2);
  border-radius: 14px; padding: 14px 18px; font-size: 0.92rem; color: var(--text-dim);
  font-style: italic; margin-bottom: 12px;
}
.word-tooltip {
  display: none; position: fixed; z-index: 100;
  background: #1a2a6c; border: 1px solid var(--cyan); border-radius: 12px;
  padding: 8px 14px; font-size: 0.9rem; font-weight: 700; color: var(--cyan);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
}
.vocab-list { display: flex; flex-direction: column; gap: 6px; }
.vocab-row {
  display: flex; gap: 12px; align-items: baseline; padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.vr-ru { font-weight: 800; color: var(--cyan); min-width: 140px; }
.vr-en { color: var(--text-dim); font-size: 0.9rem; }

/* ═══════════════════════════════════════════════
   PROGRESS SCREEN
═══════════════════════════════════════════════ */
.progress-header {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; margin-bottom: 16px;
}
.ph-avatar { font-size: 3rem; }
.ph-name { font-size: 1.5rem; font-weight: 900; }
.ph-level { font-size: 1rem; color: var(--gold); font-weight: 700; }
.ph-stars { font-size: 1.4rem; color: var(--gold); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px; text-align: center;
}
.stat-num { font-size: 1.8rem; font-weight: 900; color: var(--cyan); }
.stat-label { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; }
.category-progress { margin-bottom: 16px; }
.cp-row { margin-bottom: 10px; }
.cp-row-top { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.cp-bar-bg { height: 10px; background: var(--border); border-radius: 10px; overflow: hidden; }
.cp-bar-fill { height: 100%; border-radius: 10px; transition: width .6s ease; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.hi-icon { font-size: 1.4rem; }
.hi-info { flex: 1; }
.hi-category { font-weight: 700; font-size: 0.9rem; }
.hi-date { font-size: 0.75rem; color: var(--text-dim); }
.hi-score { font-weight: 800; font-size: 1rem; color: var(--gold); }

/* ═══════════════════════════════════════════════
   CELEBRATION OVERLAY
═══════════════════════════════════════════════ */
#celebration {
  display: none; position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center; pointer-events: none;
}
#celebration.show { display: flex; }
.confetti-emoji {
  position: absolute; font-size: 2rem;
  animation: confettiFall 1.2s ease-out forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-60px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.1); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Scrollbar ── */
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── Back row ── */
.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.btn-back {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 14px; font-family: 'Nunito', sans-serif; font-size: 0.9rem;
  font-weight: 700; color: var(--text-dim); cursor: pointer; transition: all .2s;
}
.btn-back:hover { background: var(--card-hov); color: var(--text); }
.back-row h2 { font-size: 1.2rem; font-weight: 900; }

/* ── Empty / error states ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Hebrew RTL support ── */
[dir="rtl"] { text-align: right; }
.phrase-card [dir="rtl"],
.qq-question[dir="rtl"],
.qq-subtext[dir="rtl"],
.translation-box[dir="rtl"] { text-align: right; font-family: 'Nunito', 'Arial Hebrew', Arial, sans-serif; }
.vr-en[dir="rtl"] { font-family: 'Arial Hebrew', Arial, sans-serif; }

/* ── Responsive tweaks ── */
@media (max-width: 380px) {
  .quiz-options { grid-template-columns: 1fr; }
  .grid-2, .home-modules, .learn-grid, .quiz-cat-grid { grid-template-columns: 1fr; }
  .alphabet-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}
