/* ============================================================
   alphabet.css — A-Z Alphabet module styles
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────── */
.abc-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(168,85,247,.08));
  border-left: 4px solid #3B82F6;
}
.abc-hero-icon {
  font-size: 3rem;
  flex-shrink: 0;
}
.abc-hero-text h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.abc-hero-text p {
  margin: 0;
  color: var(--text2);
  font-size: .95rem;
}

/* ── Stats bar ────────────────────────────────────────── */
.abc-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.abc-stat {
  flex: 1;
  min-width: 120px;
}
.abc-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #3B82F6;
  line-height: 1;
}
.abc-stat-total {
  font-size: 1rem;
  color: var(--text2);
  font-weight: 500;
}
.abc-stat-label {
  font-size: .8rem;
  color: var(--text2);
  margin-top: 4px;
}
.abc-progress-bar {
  margin-top: 8px;
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.abc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #A855F7);
  transition: width .4s;
}
.abc-quiz-btn {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.abc-quiz-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,.3);
}

/* ── Grid of 26 letters ───────────────────────────────── */
.abc-grid {
  padding: 24px;
}
.abc-grid h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}
.abc-letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.abc-tile {
  position: relative;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.abc-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.abc-vowel {
  background: linear-gradient(135deg, rgba(245,158,11,.12), rgba(239,68,68,.08));
  border-color: rgba(245,158,11,.4);
}
.abc-vowel:hover {
  border-color: #F59E0B;
}
.abc-consonant:hover {
  border-color: #3B82F6;
}
.abc-learned {
  border-color: #22C55E !important;
  background: linear-gradient(135deg, rgba(34,197,94,.1), rgba(34,197,94,.04));
}
.abc-tile-upper {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.abc-tile-lower {
  font-size: 1.05rem;
  color: var(--text2);
  margin-top: 2px;
  line-height: 1;
}
.abc-tile-thai {
  margin-top: 6px;
  font-size: .78rem;
  color: var(--text2);
}
.abc-tile-check {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #22C55E;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.abc-tile-speak {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: .62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease-out;
  padding: 0;
  z-index: 10;
}
.abc-tile-speak:hover {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  transform: scale(1.18);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.abc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .82rem;
  color: var(--text2);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.abc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.abc-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--surface2);
  border: 2px solid var(--border);
}
.abc-vowel-dot {
  background: rgba(245,158,11,.3);
  border-color: #F59E0B;
}
.abc-consonant-dot {
  background: var(--surface2);
  border-color: #3B82F6;
}
.abc-learned-dot {
  background: #22C55E;
  border-color: #22C55E;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
  line-height: 12px;
}

/* ── Letter detail view ──────────────────────────────── */
.abc-detail-head {
  padding: 14px 24px;
  margin-bottom: 12px;
}
.abc-back {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.abc-back:hover {
  background: var(--bg3);
}

.abc-letter-hero {
  display: flex;
  gap: 30px;
  align-items: center;
  padding: 36px 30px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(168,85,247,.08));
}
.abc-vowel-hero {
  background: linear-gradient(135deg, rgba(245,158,11,.1), rgba(239,68,68,.06));
}
.abc-letter-big {
  text-align: center;
  flex-shrink: 0;
}
.abc-big-upper {
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.abc-big-lower {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text2);
  line-height: 1;
  margin-top: 4px;
}
.abc-letter-info {
  flex: 1;
}
.abc-letter-thai {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.abc-letter-ipa {
  font-size: 1.2rem;
  color: var(--text2);
  font-family: 'Times New Roman', serif;
  margin-bottom: 12px;
}
.abc-speak-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  transition: transform .15s;
}
.abc-speak-big:hover {
  transform: translateY(-1px);
}
.abc-letter-type {
  font-size: .85rem;
  color: var(--text2);
}

/* ── Tip ──────────────────────────────────────────── */
.abc-tip {
  padding: 20px 24px;
  margin-bottom: 16px;
  background: rgba(59,130,246,.06);
  border-left: 4px solid #3B82F6;
}
.abc-tip h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.abc-tip p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

/* ── Examples ──────────────────────────────────────── */
.abc-examples {
  padding: 24px;
  margin-bottom: 16px;
}
.abc-examples h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}
.abc-example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.abc-example {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.abc-example-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.abc-example-en {
  flex: 1;
  font-size: 1.2rem;
  color: var(--text);
}
.abc-example-ipa {
  margin-top: 4px;
  font-size: .85rem;
  color: var(--text3);
  font-family: 'Times New Roman', serif;
}
.abc-example-phon {
  margin-top: 4px;
  font-size: .92rem;
  color: var(--accent);
  font-weight: 600;
}
.abc-example-th {
  margin-top: 6px;
  font-size: .9rem;
  color: var(--text2);
}

/* ── Action row ───────────────────────────────────── */
.abc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.abc-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all .15s;
}
.abc-nav-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
}
.abc-learned-btn {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.abc-learned-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,.3);
}

/* ── Quiz ─────────────────────────────────────────── */
.abc-quiz-head {
  padding: 18px 24px;
  margin-bottom: 14px;
}
.abc-quiz-progress {
  margin: 10px 0;
  color: var(--text);
  font-size: .92rem;
}
.abc-quiz-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.abc-quiz-fill {
  height: 100%;
  background: var(--brand-grad);
  transition: width .3s;
}

.abc-quiz-card {
  padding: 28px 24px;
}
.abc-quiz-prompt {
  margin: 0 0 22px;
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.5;
  text-align: center;
}
.abc-play-sound {
  display: block;
  margin: 0 auto 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.abc-play-sound:hover {
  background: var(--bg3);
}
.abc-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.abc-choice {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 16px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.abc-choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-1px);
}
.abc-choice:disabled {
  cursor: not-allowed;
  opacity: .8;
}
.abc-choice.abc-correct {
  background: rgba(34,197,94,.15);
  border-color: #22C55E;
  color: #22C55E;
}
.abc-choice.abc-wrong {
  background: rgba(239,68,68,.15);
  border-color: #EF4444;
  color: #EF4444;
}

.abc-feedback {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: .95rem;
}
.abc-feedback-ok {
  background: rgba(34,197,94,.1);
  color: #22C55E;
}
.abc-feedback-no {
  background: rgba(239,68,68,.1);
  color: #EF4444;
}

/* ── Quiz result ──────────────────────────────────── */
.abc-result {
  text-align: center;
  padding: 40px 24px;
}
.abc-result-emoji {
  font-size: 4rem;
  margin-bottom: 14px;
}
.abc-result-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}
.abc-result-pct {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 6px;
}
.abc-result-msg {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--text);
}
.abc-result-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.abc-retry-btn, .abc-back-grid-btn {
  padding: 12px 24px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 0;
  transition: transform .15s;
}
.abc-retry-btn {
  background: var(--brand-grad);
  color: #fff;
}
.abc-back-grid-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.abc-retry-btn:hover, .abc-back-grid-btn:hover {
  transform: translateY(-1px);
}

/* ── Mobile ───────────────────────────────────────── */
@media (max-width: 640px) {
  .abc-hero {
    flex-direction: column;
    text-align: center;
  }
  .abc-stats {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .abc-letters {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
  }
  .abc-tile-upper {
    font-size: 1.3rem;
  }
  .abc-letter-hero {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    padding: 24px 18px;
  }
  .abc-big-upper {
    font-size: 4.5rem;
  }
  .abc-actions {
    flex-direction: column;
  }
  .abc-actions > * {
    width: 100%;
  }
  .abc-choices {
    grid-template-columns: 1fr;
  }
}
