/* ═══════════════════════════════════════════════════════════════
   Entropy Breakers — Theme & Progress UI Library (v2)
   Safe to include everywhere; uses .eb-* prefix to avoid collisions.
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&display=swap');

:root {
  --eb-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --eb-bg: #ffffff;
  --eb-bg-soft: #faf8f3;
  --eb-bg-peach: #fff0e0;
  --eb-bg-peach-strong: #ffe0c4;
  --eb-ink: #1a1612;
  --eb-ink-2: #5a5248;
  --eb-ink-dim: #8a7d68;
  --eb-orange: #ff7a2e;
  --eb-orange-2: #d14a00;
  --eb-orange-dark: #a33a00;
  --eb-orange-soft: #fff0e0;
  --eb-green: #1d9e75;
  --eb-amber: #ba7517;
  --eb-track: rgba(26,22,18,0.06);
  --eb-track-strong: rgba(26,22,18,0.1);
  --eb-shadow-sm: 0 2px 6px rgba(26,22,18,0.04);
  --eb-shadow-md: 0 8px 20px rgba(26,22,18,0.08);
  --eb-shadow-lg: 0 12px 28px rgba(26,22,18,0.10);
  --eb-radius-sm: 12px;
  --eb-radius-md: 16px;
  --eb-radius-lg: 20px;
  --eb-radius-xl: 28px;
  --eb-radius-full: 9999px;
  --eb-font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --eb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --eb-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* STREAK CHIP */
.eb-streak {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px 7px 12px; border-radius: var(--eb-radius-full);
  background: #ffffff;
  color: var(--eb-ink);
  border: 1px solid var(--eb-track-strong);
  font-weight: 600; font-size: 13px; letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(209,74,0,0.16);
  transition: transform .2s var(--eb-ease-bounce);
}
.eb-streak .eb-streak-num { color: var(--eb-orange-2); font-weight: 800; }
.eb-streak:active { transform: scale(.97); }
.eb-streak.eb-streak-zero { background: #f5efe3; color: var(--eb-ink-dim); box-shadow: none; }
.eb-streak-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; }
.eb-streak-num { font-variant-numeric: tabular-nums; }
.eb-streak-label { font-weight: 500; opacity: .85; }
.eb-streak-dark {
  background: rgba(255,255,255,0.06); color: #ffe6cc;
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.12); box-shadow: none;
}
.eb-streak-dark.eb-streak-zero { color: rgba(255,255,255,.55); }

/* PROGRESS CHIP */
.eb-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 10px; border-radius: var(--eb-radius-full);
  background: #f5efe3; color: var(--eb-ink-2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1;
  min-width: 84px; transition: all .3s var(--eb-ease);
}
.eb-chip-bar { flex: 1; height: 4px; background: rgba(26,22,18,0.08); border-radius: 2px; overflow: hidden; min-width: 40px; }
.eb-chip-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--eb-orange) 0%, var(--eb-orange-2) 100%);
  border-radius: 2px; transition: width .9s var(--eb-ease);
  position: relative; overflow: hidden;
}
.eb-chip-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  transform: translateX(-100%); animation: eb-shimmer 2.4s ease-in-out infinite;
}
.eb-chip-pct { font-variant-numeric: tabular-nums; color: var(--eb-orange-2); font-weight: 700; }
.eb-chip.eb-chip-zero { opacity: .72; }
.eb-chip.eb-chip-zero .eb-chip-pct { color: var(--eb-ink-dim); }
.eb-chip.eb-chip-complete { background: #e3f5ee; color: var(--eb-green); }
.eb-chip.eb-chip-complete .eb-chip-fill { background: var(--eb-green); }
.eb-chip.eb-chip-complete .eb-chip-pct { color: var(--eb-green); }
.eb-chip-dark { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.eb-chip-dark .eb-chip-bar { background: rgba(255,255,255,0.14); }
.eb-chip-dark .eb-chip-pct { color: #ffb07a; }

@keyframes eb-shimmer {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* LARGE PROGRESS BAR */
.eb-bar { width: 100%; }
.eb-bar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.eb-bar-label { font-size: 13px; font-weight: 600; color: var(--eb-ink); letter-spacing: 0.01em; }
.eb-bar-pct { font-size: 13px; font-weight: 700; color: var(--eb-orange-2); font-variant-numeric: tabular-nums; }
.eb-bar-zero .eb-bar-pct { color: var(--eb-ink-dim); }
.eb-bar-track { height: 8px; background: var(--eb-track); border-radius: 4px; overflow: hidden; position: relative; }
.eb-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--eb-orange) 0%, var(--eb-orange-2) 100%);
  border-radius: 4px; transition: width 1.1s var(--eb-ease);
  position: relative; overflow: hidden;
}
.eb-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
  transform: translateX(-100%); animation: eb-shimmer 2.8s ease-in-out infinite;
}
.eb-bar-fill.eb-bar-fill-green { background: linear-gradient(90deg, #2fbf8f 0%, #1d9e75 100%); }
.eb-bar-fill.eb-bar-fill-amber { background: linear-gradient(90deg, #e39a2f 0%, #ba7517 100%); }

/* ═══════════════════════════════════════════════════════════════
   FLASHCARD — HU fehér/fekete, EN halvány barack + fehér-narancs
   ═══════════════════════════════════════════════════════════════ */
.eb-flashcard {
  position: relative; perspective: 1400px;
  width: 100%; max-width: 380px; margin: 0 auto;
  aspect-ratio: 3 / 4; cursor: pointer;
}
.eb-flashcard-inner {
  position: absolute; inset: 0;
  transition: transform .7s var(--eb-ease); transform-style: preserve-3d;
}
.eb-flashcard.is-flipped .eb-flashcard-inner { transform: rotateY(180deg); }
.eb-flashcard-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 36px 28px; border-radius: var(--eb-radius-xl); box-shadow: var(--eb-shadow-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
}
.eb-flashcard-face::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.08) 0%, transparent 65%);
  pointer-events: none;
}
.eb-flashcard-tag {
  position: absolute; top: 18px; left: 18px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 20px; line-height: 1; z-index: 2;
}

/* EN oldal — halvány barack + fehér szöveg narancs kontúrral */
.eb-flashcard-front {
  background: linear-gradient(135deg, #fff0e0 0%, #ffd9b3 55%, #ffc897 100%);
  color: #ffffff;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(30px, 6.5vw, 48px); font-weight: 700;
  text-align: center; letter-spacing: -0.015em; line-height: 1.15;
  -webkit-text-stroke: 1.5px var(--eb-orange-2);
  text-shadow: 0 2px 18px rgba(191,74,0,0.22);
}
.eb-flashcard-front .eb-flashcard-tag { background: rgba(255,255,255,0.8); color: var(--eb-orange-2); -webkit-text-stroke: 0; text-shadow: none; }
.eb-flashcard-front .eb-flashcard-hint {
  margin-top: 14px; font-size: 14px; font-weight: 500;
  color: var(--eb-orange-2); -webkit-text-stroke: 0; text-shadow: none;
  letter-spacing: 0.02em; opacity: .85;
}
.eb-flashcard-front .eb-flashcard-ipa {
  margin-top: 8px; font-size: 15px; font-weight: 400;
  color: var(--eb-orange-dark); -webkit-text-stroke: 0; text-shadow: none; opacity: .75;
}

/* HU oldal — fehér papír, fekete szöveg */
.eb-flashcard-back {
  background: #ffffff; color: #1a1612; transform: rotateY(180deg);
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(24px, 5.5vw, 36px); font-weight: 600;
  text-align: center; letter-spacing: -0.01em; line-height: 1.25;
  border: 1px solid rgba(26,22,18,0.06);
}
.eb-flashcard-back .eb-flashcard-tag { background: #1a1612; color: #faf8f3; }
.eb-flashcard-back .eb-flashcard-hint {
  margin-top: 14px; font-size: 14px; font-weight: 400;
  color: var(--eb-ink-2); letter-spacing: 0.02em; opacity: .85;
}

/* Speak button */
.eb-flashcard-speak {
  position: absolute; bottom: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 19px;
  transition: transform .2s var(--eb-ease-bounce), box-shadow .2s var(--eb-ease);
  z-index: 3;
}
.eb-flashcard-front .eb-flashcard-speak { background: rgba(255,255,255,0.92); color: var(--eb-orange-2); box-shadow: 0 4px 14px rgba(191,74,0,0.22); }
.eb-flashcard-back .eb-flashcard-speak { background: #1a1612; color: #faf8f3; box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.eb-flashcard-speak:hover { transform: scale(1.08); }
.eb-flashcard-speak:active { transform: scale(0.94); }
.eb-flashcard-speak.is-speaking { animation: eb-speak-pulse 1.4s ease-in-out infinite; }
@keyframes eb-speak-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* Flip hint */
.eb-flashcard-flip-hint {
  position: absolute; bottom: 22px; left: 22px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: .55; z-index: 3;
}
.eb-flashcard-front .eb-flashcard-flip-hint { color: var(--eb-orange-2); -webkit-text-stroke: 0; text-shadow: none; }
.eb-flashcard-back .eb-flashcard-flip-hint { color: var(--eb-ink-2); }

/* ═══════════════════════════════════════════════════════════════
   STREAK HEATMAP — 14 napos mini contribution graph
   ═══════════════════════════════════════════════════════════════ */
.eb-heatmap {
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--eb-radius-md);
  backdrop-filter: blur(6px);
}
.eb-heatmap.eb-heatmap-light,
.screen.white-bg .eb-heatmap {
  background: #faf8f3;
  border: 1px solid rgba(26,22,18,0.06);
  backdrop-filter: none;
}
.screen.white-bg .eb-heatmap-label { color: var(--eb-ink-dim); }
.screen.white-bg .eb-heatmap-stats { color: var(--eb-ink-2); }
.screen.white-bg .eb-heatmap-cell { background: rgba(26,22,18,0.05); }
.eb-heatmap-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.eb-heatmap-label { font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.eb-heatmap-light .eb-heatmap-label { color: var(--eb-ink-dim); }
.eb-heatmap-stats { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.72); }
.eb-heatmap-light .eb-heatmap-stats { color: var(--eb-ink-2); }
.eb-heatmap-stats strong { color: var(--eb-orange); font-weight: 700; font-variant-numeric: tabular-nums; }
.eb-heatmap-row { display: flex; align-items: flex-end; gap: 4px; flex-direction: row-reverse; }
.eb-heatmap-cell {
  flex: 1; height: 24px; border-radius: 4px;
  background: rgba(255,255,255,0.06); position: relative;
  transition: transform .25s var(--eb-ease-bounce);
}
.eb-heatmap-light .eb-heatmap-cell { background: rgba(26,22,18,0.05); }
.eb-heatmap-cell[data-level="1"],
.eb-heatmap-light .eb-heatmap-cell[data-level="1"],
.screen.white-bg .eb-heatmap-cell[data-level="1"] { background: rgba(255,122,46,0.40); }
.eb-heatmap-cell[data-level="2"],
.eb-heatmap-light .eb-heatmap-cell[data-level="2"],
.screen.white-bg .eb-heatmap-cell[data-level="2"] { background: rgba(255,122,46,0.70); }
.eb-heatmap-cell[data-level="3"],
.eb-heatmap-light .eb-heatmap-cell[data-level="3"],
.screen.white-bg .eb-heatmap-cell[data-level="3"] { background: var(--eb-orange); }
.eb-heatmap-cell[data-today="1"] {
  box-shadow: 0 0 0 2px var(--eb-orange), 0 0 18px rgba(255,122,46,0.55);
  height: 28px;
}
.eb-heatmap-cell:hover { transform: scaleY(1.15); }

/* Module chip — "utolsó alkalom" label */
.eb-module-lastseen {
  display: inline-block; margin-left: 8px;
  font-size: 10px; font-weight: 500;
  color: var(--eb-ink-dim); letter-spacing: 0.02em; vertical-align: middle;
}
.eb-module-lastseen.eb-module-lastseen-fresh { color: var(--eb-green); font-weight: 600; }
.eb-module-lastseen.eb-module-lastseen-cold { color: var(--eb-amber); }

/* Appear animations */
@keyframes eb-pop-in {
  0% { opacity: 0; transform: scale(.6); }
  70% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
.eb-animate-pop { animation: eb-pop-in .55s var(--eb-ease-bounce) both; }
@keyframes eb-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.eb-animate-up { animation: eb-fade-up .5s var(--eb-ease) both; }

/* WIDE variant — opt-in via body.eb-wide */
body.eb-wide { background: linear-gradient(180deg, #faf8f3 0%, #fff 40%, #fff 100%); }
body.eb-wide .app-shell {
  max-width: 1200px; display: grid; grid-template-columns: 320px 1fr;
  gap: 32px; padding: 24px; background: transparent; border: none !important;
}
@media (max-width: 900px) {
  body.eb-wide .app-shell { grid-template-columns: 1fr; padding: 0; }
}

/* Module row with chip */
.eb-module-progress {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   FLASHCARD OVERRIDE — .flip-front / .flip-back + theory class-ek
   .flip-front = HU oldal (fehér papír, fekete szöveg)
   .flip-back  = EN oldal (halvány barack, fekete szöveg, narancs példa)
   Vocab class-ek: .face-word, .face-example
   Theory class-ek: .face-explain-hu, .face-rule-en, .face-example, .face-example-hu
   ═══════════════════════════════════════════════════════════════ */

/* Nagyobb, szimmetrikus kártyák. Vocab oldalakon .flip-container-nek
   fix height:200px van, ezért azt is felül kell írni, különben a 440px
   magasságú .flip-inner kilóg a 200px-es konténerből a nav gombokra. */
.flip-container,
.flip-wrap {
  max-width: 520px !important;
}
.flip-container {
  height: 440px !important;
}
.flip-inner {
  min-height: 440px !important;
}
@media (max-width: 720px) {
  .flip-container,
  .flip-wrap {
    max-width: 100% !important;
  }
  .flip-container {
    height: 380px !important;
  }
  .flip-inner {
    min-height: 380px !important;
  }
}
.flip-face {
  padding: 40px 28px !important;
}

/* HU oldal — fehér papír, fekete szöveg */
.flip-front {
  background: #ffffff !important;
  border: 1px solid rgba(26,22,18,0.06) !important;
  box-shadow: 0 12px 28px rgba(26,22,18,0.10) !important;
}
.flip-front .face-word,
.flip-front .face-explain-hu {
  color: #1a1612 !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}
.flip-front .face-example {
  color: rgba(26,22,18,0.60) !important;
  font-style: italic;
}
.flip-front .face-label,
.flip-front .flip-hint {
  color: rgba(26,22,18,0.45) !important;
}

/* EN oldal — halvány barack, FEKETE szöveg, narancs példa.
   Nincs `position: relative` override → örökli a .flip-face position:absolute; inset:0
   szabályát, így a két oldal pontosan egyforma méretű marad. */
.flip-back {
  background: linear-gradient(135deg, #fff0e0 0%, #ffd9b3 55%, #ffc897 100%) !important;
  border: none !important;
  box-shadow: 0 12px 28px rgba(191,74,0,0.15) !important;
  overflow: hidden;
}
.flip-back::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.15) 0%, transparent 65%);
  pointer-events: none;
}
.flip-back .face-word,
.flip-back .face-rule-en {
  color: #1a1612 !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
  position: relative;
  z-index: 2;
}
.flip-back .face-example {
  color: #d14a00 !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
  font-style: italic;
  font-weight: 500;
  /* NINCS position override — a vocab .face-example eredeti
     `position:absolute; bottom:14px` pozíciója marad (elkülönülve a szótól),
     a theory normál flow-ban, margin-bottom:12px-rel. */
}
.flip-back .face-example-hu {
  color: rgba(26,22,18,0.55) !important;
  font-style: italic;
  font-weight: 400;
}
.flip-back .face-label,
.flip-back .flip-hint {
  color: rgba(26,22,18,0.50) !important;
  /* NINCS position override — a .flip-hint eredeti `position:absolute; bottom:12px`
     pozíciója érvényben marad, így az alján ül, nem a flex flow közepén. */
  z-index: 2;
}

/* Swipe-es oldalakon (theory/vocab/flashcards) mobilon eltűnnek a prev/next
   gombok, mert a gesztus átveszi a szerepüket. Desktopon megmaradnak. */
@media (max-width: 720px) {
  body.eb-swipe-active .nav-row {
    display: none !important;
  }
}

/* Egységes prev/next gomb: kör alakú 38×38px nyilas gomb (mint vocab-on).
   Theory oldalak eredeti pill-szerű text-gombját felülírja. */
.arrow-btn {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   MOTION LAYER — scroll-reveal + shared entrance utilities.
   Opt-in via [data-eb-reveal]; JS adds .eb-revealed when in view.
   ═══════════════════════════════════════════════════════════════ */
[data-eb-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--eb-ease), transform .6s var(--eb-ease);
  will-change: opacity, transform;
}
[data-eb-reveal].eb-revealed {
  opacity: 1;
  transform: none;
}
[data-eb-reveal="scale"] { transform: translateY(18px) scale(.97); }
[data-eb-reveal="scale"].eb-revealed { transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-eb-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .eb-animate-pop, .eb-animate-up { animation: none !important; }
}

/* ── Results — dashboard entry card (distinct from learning categories) ── */
.eb-results-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--eb-track-strong);
  border-radius: var(--eb-radius-lg);
  background: transparent;
  font-family: var(--eb-font); text-align: left; cursor: pointer;
  transition: border-color .2s var(--eb-ease), transform .22s var(--eb-ease),
              box-shadow .28s var(--eb-ease), background .2s var(--eb-ease);
}
.eb-results-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,122,46,0.5);
  background: var(--eb-bg);
  box-shadow: 0 14px 30px rgba(209,74,0,0.13);
}
.eb-results-card:active { transform: translateY(-1px); }
.eb-results-card-icon {
  width: 46px; height: 46px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--eb-radius-md);
  border: 1px solid var(--eb-track-strong);
  color: var(--eb-orange-2);
}
.eb-results-card-icon svg { width: 22px; height: 22px; }
.eb-results-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eb-results-card-name {
  font-family: var(--eb-font-display);
  font-size: 18px; font-weight: 500; color: var(--eb-ink); letter-spacing: -0.01em;
}
.eb-results-card-desc { font-size: 12.5px; color: var(--eb-ink-dim); }
.eb-results-card-arrow {
  font-size: 18px; color: var(--eb-ink-dim);
  transition: transform .2s var(--eb-ease), color .2s var(--eb-ease);
}
.eb-results-card:hover .eb-results-card-arrow { transform: translateX(3px); color: var(--eb-orange-2); }

.eb-results {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}

/* ── Results page — week-over-week charts ────────────────────── */
.eb-chart-card {
  padding: 18px 18px 14px;
  background: var(--eb-bg);
  border: 1px solid var(--eb-track);
  border-radius: var(--eb-radius-md);
  box-shadow: var(--eb-shadow-sm);
}
.eb-chart-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.eb-chart-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--eb-ink-dim);
}
.eb-chart-trend { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eb-chart-trend-up { color: var(--eb-green); }
.eb-chart-trend-down { color: var(--eb-orange-2); }
.eb-chart-trend-flat { color: var(--eb-ink-dim); }
.eb-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.eb-chart-grid { stroke: var(--eb-track-strong); stroke-width: 1; }
.eb-chart-axis { fill: var(--eb-ink-dim); font-size: 9px; font-family: var(--eb-font); }
.eb-chart-line {
  fill: none; stroke: var(--eb-orange-2); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.eb-chart-dot { fill: #fff; stroke: var(--eb-orange-2); stroke-width: 2; }
.eb-chart-note {
  margin-top: 8px; font-size: 11.5px; color: var(--eb-ink-dim); text-align: center;
}
.eb-results-subhead {
  margin-top: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--eb-ink-dim);
}

.eb-results-summary { display: flex; gap: 12px; margin-bottom: 4px; }
.eb-results-stat {
  flex: 1;
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px;
  background: var(--eb-bg-soft);
  border: 1px solid var(--eb-track);
  border-radius: var(--eb-radius-md);
}
.eb-results-num { font-size: 30px; font-weight: 700; color: var(--eb-ink); line-height: 1.05; }
.eb-results-cap {
  font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--eb-ink-dim);
}

/* ── Results page — per-test result item with repeat-attempt sparkline ── */
.eb-test {
  padding: 15px 17px 13px;
  background: var(--eb-bg);
  border: 1px solid var(--eb-track);
  border-radius: var(--eb-radius-md);
  box-shadow: var(--eb-shadow-sm);
}
.eb-test-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.eb-test-titles { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.eb-test-name {
  font-size: 15px; font-weight: 600; color: var(--eb-ink); letter-spacing: -0.01em;
}
.eb-test-meta {
  font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--eb-ink-dim);
}
.eb-test-score {
  flex: none; line-height: 1;
  font-size: 22px; font-weight: 800; color: var(--eb-orange-2);
  font-variant-numeric: tabular-nums;
}
.eb-test-score-hi { color: var(--eb-green); }
.eb-test-score-lo { color: var(--eb-amber); }
.eb-spark-svg { display: block; width: 100%; height: auto; margin: 10px 0 2px; overflow: visible; }
.eb-spark-line {
  fill: none; stroke: var(--eb-orange-2); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.eb-spark-dot { fill: #fff; stroke: var(--eb-orange); stroke-width: 2.6; }
.eb-spark-dot-last { fill: var(--eb-orange-2); stroke: #fff; stroke-width: 2.4; }
.eb-spark-val {
  fill: var(--eb-ink-dim); font-size: 11px; font-weight: 700;
  font-family: var(--eb-font);
}
.eb-test-foot {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px;
  font-size: 12px; color: var(--eb-ink-2);
}
.eb-test-foot strong { color: var(--eb-ink); font-weight: 700; }
.eb-test-foot-single { color: var(--eb-ink-dim); }
.eb-test-delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.eb-attempts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.eb-attempt {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px; border-radius: var(--eb-radius-full);
  background: var(--eb-bg-soft); border: 1px solid var(--eb-track);
  font-size: 11.5px;
}
.eb-attempt-date { color: var(--eb-ink-dim); }
.eb-attempt-score { color: var(--eb-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.eb-results-loading {
  padding: 32px 24px; text-align: center;
  color: var(--eb-ink-dim); font-size: 13px;
}
.eb-results-empty {
  padding: 30px 24px; text-align: center;
  background: var(--eb-bg-soft); border: 1px solid var(--eb-track);
  border-radius: var(--eb-radius-md);
  font-size: 14px; line-height: 1.65; color: var(--eb-ink-dim);
}

/* ── Pronunciation (text-to-speech) button ────────────────────── */
.eb-speak-btn {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 38px; height: 38px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--eb-radius-full);
  background: rgba(255,255,255,0.92);
  color: var(--eb-orange-2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--eb-ease-bounce), background .18s var(--eb-ease), color .18s var(--eb-ease);
}
.eb-speak-btn svg { width: 20px; height: 20px; }
.eb-speak-btn:hover { transform: scale(1.08); }
.eb-speak-btn.eb-speak-active {
  background: var(--eb-orange); color: #fff; transform: scale(1.14);
}
