/* ═══════════════════════════════════════════
   ENGLISH COACH — Inferno Dark
   ═══════════════════════════════════════════ */

:root {
  --bg:        #000000;
  --surface:   #040406;
  --surface2:  #08080d;
  --surface3:  #0c0c14;
  --border:    #0f0c12;
  --border2:   #18141d;
  --border3:   #221d2a;
  --fire:      #e8291a;
  --fire2:     #ff3d2a;
  --fire3:     #ff6b55;
  --fire-glow: rgba(232,41,26,0.55);
  --fire-mid:  rgba(232,41,26,0.22);
  --fire-dim:  rgba(232,41,26,0.10);
  --fire-deep: rgba(232,41,26,0.04);
  --green:     #39ff14;
  --green-dim: rgba(57,255,20,0.18);
  --cyan:      #00e5ff;
  --gold:      #ffb627;
  --text:      #ede8e3;
  --text-soft: #b8b3ad;
  --text-dim:  #5a5560;
  --text-off:  #2a2530;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Vignette brûlante */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 45% at 50% 0%,    rgba(232,41,26,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 45% 80% at 0%   50%,  rgba(232,41,26,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 45% 80% at 100% 50%,  rgba(232,41,26,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 90% 45% at 50% 100%,  rgba(232,41,26,0.08) 0%, transparent 70%);
  z-index: 9998;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--fire); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fire2); }

/* ── Keyframes ─────────────────────────────────────────── */
@keyframes hellfire {
  0%,100% { box-shadow: 0 0 8px var(--fire-dim); }
  50%      { box-shadow: 0 0 28px var(--fire-mid), 0 0 0 1px rgba(232,41,26,0.07); }
}
@keyframes inferno-glitch {
  0%,90%,100% { text-shadow: 0 0 20px var(--fire-glow), 0 0 60px rgba(232,41,26,0.2); transform: none; filter: none; }
  91%  { transform: translate(-3px,0) skewX(-4deg); text-shadow: 4px 0 0 rgba(255,0,0,1),-4px 0 0 rgba(0,229,255,0.85); filter: brightness(1.4); }
  92%  { transform: translate(3px,1px) skewX(3deg);  text-shadow: -3px 0 0 rgba(255,0,0,1), 3px 0 0 rgba(0,229,255,0.85); filter: brightness(1.2); }
  93%  { transform: translate(-1px,0); text-shadow: 2px 0 0 rgba(232,41,26,.9),-2px 0 0 rgba(0,229,255,.6); }
  95%  { transform: none; text-shadow: 0 0 20px var(--fire-glow); filter: none; }
}
@keyframes scan-sweep { from { top: -100%; } to { top: 100%; } }
@keyframes pulse-fire { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes pulse-rec  { 0%,100% { box-shadow: 0 0 0 0 rgba(232,41,26,0.7); } 70% { box-shadow: 0 0 0 16px rgba(232,41,26,0); } }
@keyframes spinx      { to { transform: rotate(360deg); } }
@keyframes fadein     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slidein    { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes typing     { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes pulse-soft { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.4; } }

/* ── Layout ────────────────────────────────────────────── */
body {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px 48px;
}

/* ── Header ────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  position: relative;
  gap: 20px;
  flex-wrap: wrap;
}
.app-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(232,41,26,0.15) 8%,
    rgba(232,41,26,0.7) 25%, var(--fire) 50%,
    rgba(232,41,26,0.7) 75%, rgba(232,41,26,0.15) 92%, transparent 100%);
  box-shadow: 0 0 20px rgba(232,41,26,0.45);
}

.back-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--fire2);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(232,41,26,0.4);
  border-radius: 4px;
  background: var(--surface);
  transition: all 0.2s;
}
.back-btn:hover {
  background: rgba(232,41,26,0.12);
  border-color: var(--fire);
  box-shadow: 0 0 16px rgba(232,41,26,0.4);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-title-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(232,41,26,0.06) 100%);
  border: 1px solid rgba(232,41,26,0.55);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(232,41,26,0.3), inset 0 0 18px rgba(232,41,26,0.06);
  animation: hellfire 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 4px, 4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}
.app-title-icon::before {
  content: ''; position: absolute; inset: -50% 0;
  background: linear-gradient(transparent, rgba(232,41,26,0.16), transparent);
  animation: scan-sweep 3s linear infinite;
}
.app-title-main {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--fire2);
  letter-spacing: 3px;
  animation: inferno-glitch 9s infinite;
}
.app-title-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255,182,39,0.10), rgba(232,41,26,0.06));
  border: 1px solid rgba(255,182,39,0.4);
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: var(--gold);
  box-shadow: 0 0 12px rgba(255,182,39,0.18);
}
.streak-icon { filter: drop-shadow(0 0 4px rgba(255,182,39,0.8)); }

.btn-icon {
  width: 38px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.btn-icon:hover {
  border-color: var(--fire);
  background: rgba(232,41,26,0.08);
  box-shadow: 0 0 12px rgba(232,41,26,0.3);
}

/* ── Profile Switcher ──────────────────────────────────── */
.profile-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}
.profile-switcher:hover {
  border-color: var(--fire);
  box-shadow: 0 0 10px rgba(232,41,26,0.2);
}
.profile-switcher.active-2 {
  border-color: rgba(0,229,255,0.4);
  box-shadow: 0 0 10px rgba(0,229,255,0.15);
}
.profile-icon { font-size: 14px; line-height: 1; }
.profile-arrow { font-size: 9px; opacity: 0.5; }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.9), 0 0 0 1px rgba(232,41,26,0.08);
  z-index: 200;
}
.profile-drop-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-off);
  padding: 4px 12px 8px;
  text-transform: uppercase;
}
.profile-drop-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.profile-drop-item:hover { background: rgba(232,41,26,0.08); color: var(--text); }
.profile-drop-item.current { color: var(--fire2); font-weight: 600; }
.profile-drop-rename { font-size: 11px; color: var(--text-dim); }

/* ── Resume banner ─────────────────────────────────────── */
.resume-banner {
  margin: 16px 0;
  padding: 14px 20px;
  background: linear-gradient(90deg, rgba(232,41,26,0.10) 0%, rgba(232,41,26,0.02) 100%);
  border: 1px solid rgba(232,41,26,0.4);
  border-left: 3px solid var(--fire);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadein 0.3s;
}
.resume-info { display: flex; align-items: center; gap: 14px; }
.resume-pulse {
  width: 10px; height: 10px;
  background: var(--fire2);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--fire);
  animation: pulse-fire 1.6s infinite;
}
.resume-title { font-weight: 700; color: var(--fire2); letter-spacing: 0.5px; }
.resume-sub   { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.resume-actions { display: flex; gap: 8px; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 4px;
  margin: 24px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border2);
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 10px 18px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active {
  color: var(--fire2);
  background: var(--surface);
  border-color: var(--border3);
  border-bottom-color: transparent;
  box-shadow: 0 -2px 0 0 var(--fire), 0 -8px 16px -8px var(--fire-glow);
}

.tab-pane { display: none; animation: fadein 0.3s; }
.tab-pane.active { display: block; }

/* ── Section bar ───────────────────────────────────────── */
.section-bar {
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border2);
  position: relative;
}
.section-bar::after {
  content: ''; position: absolute; bottom: -1px; left: 0; width: 80px; height: 1px;
  background: linear-gradient(90deg, var(--fire), transparent);
  box-shadow: 0 0 8px var(--fire-glow);
}
.section-bar h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: normal;
}

/* ── HUB : stats grid ──────────────────────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.stat-card {
  position: relative;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-top: 2px solid rgba(232,41,26,0.4);
  border-radius: 6px;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: -50% 0;
  background: linear-gradient(transparent, rgba(232,41,26,0.04), transparent);
  animation: scan-sweep 6s linear infinite;
  pointer-events: none;
}
.stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 900;
  color: var(--fire2);
  margin-top: 4px;
  text-shadow: 0 0 16px rgba(232,41,26,0.4);
}
.stat-sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ── HUB : quick grid ──────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-top: 2px solid rgba(232,41,26,0.3);
  border-radius: 6px;
  padding: 22px 20px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.quick-card:hover {
  border-color: var(--fire);
  border-top-color: var(--fire2);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(232,41,26,0.06) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 20px var(--fire-dim);
}
.quick-card--alt { border-top-color: rgba(0,229,255,0.4); }
.quick-card--alt:hover { border-color: var(--cyan); border-top-color: var(--cyan); box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 20px rgba(0,229,255,0.15); }

.quick-icon { font-size: 26px; margin-bottom: 8px; }
.quick-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.quick-sub { font-size: 12px; color: var(--text-soft); line-height: 1.4; }

/* ── Sessions list ─────────────────────────────────────── */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.session-row {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.session-row:hover { border-color: var(--fire); background: var(--surface2); }
.session-row-icon { font-size: 20px; }
.session-row-main { flex: 1; }
.session-row-title { font-weight: 600; font-size: 14px; }
.session-row-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  margin-top: 2px;
}
.session-row-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-soft);
  font-family: 'Share Tech Mono', monospace;
}
.session-status-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
}
.session-status-active {
  background: rgba(57,255,20,0.10);
  color: var(--green);
  border: 1px solid rgba(57,255,20,0.4);
}
.session-status-ended {
  background: var(--surface3);
  color: var(--text-dim);
  border: 1px solid var(--border3);
}

/* ── Conversation ──────────────────────────────────────── */
.conv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.conv-meta { display: flex; align-items: center; gap: 10px; }
.conv-theme-pill {
  padding: 5px 14px;
  background: rgba(232,41,26,0.08);
  border: 1px solid rgba(232,41,26,0.4);
  border-radius: 20px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--fire2);
  text-transform: uppercase;
}
.conv-status {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.conv-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.chat-window {
  height: calc(100vh - 360px);
  min-height: 420px;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 8px;
  line-height: 1.5;
  font-size: 14.5px;
  animation: slidein 0.25s;
  position: relative;
}
.chat-msg-assistant {
  align-self: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-left: 3px solid var(--fire);
}
.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(232,41,26,0.18), rgba(232,41,26,0.06));
  border: 1px solid rgba(232,41,26,0.4);
  color: var(--text);
}
.chat-msg-meta {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.chat-msg-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}
.chat-msg-action {
  background: transparent;
  border: 1px solid var(--border3);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-msg-action:hover { color: var(--fire2); border-color: var(--fire); }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}
.typing-dot {
  width: 6px; height: 6px;
  background: var(--fire2);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.chat-input-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 4px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s;
}
.chat-input:focus {
  outline: none;
  border-color: var(--fire);
  box-shadow: 0 0 12px rgba(232,41,26,0.18);
}
.send-btn {
  background: linear-gradient(135deg, var(--fire), var(--fire2));
  color: white;
  border: none;
  padding: 0 22px;
  height: 46px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bold;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(232,41,26,0.35);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(232,41,26,0.6); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.mic-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--fire);
  color: var(--fire2);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn:hover { background: rgba(232,41,26,0.12); }
.mic-btn.recording {
  background: var(--fire);
  color: white;
  animation: pulse-rec 1.4s infinite;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--fire), var(--fire2));
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bold;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(232,41,26,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 24px rgba(232,41,26,0.55); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--fire2);
  border: 1px solid rgba(232,41,26,0.5);
  padding: 9px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(232,41,26,0.1); border-color: var(--fire); }
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border3);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-ghost.active { color: var(--fire2); border-color: var(--fire); }

.btn-record {
  background: var(--fire);
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bold;
  transition: all 0.2s;
  box-shadow: 0 0 18px rgba(232,41,26,0.5);
}
.btn-record:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-record.recording { animation: pulse-rec 1.4s infinite; }

/* ── Pronunciation ─────────────────────────────────────── */
.pron-header { margin-bottom: 18px; }
.pron-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  color: var(--fire2);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.pron-intro { color: var(--text-soft); font-size: 13px; }

.pron-card, .listen-card {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-top: 2px solid rgba(232,41,26,0.4);
  border-radius: 6px;
  padding: 36px 28px;
  margin-bottom: 18px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pron-empty {
  color: var(--text-dim);
  text-align: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
}
.pron-target {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--text);
  text-shadow: 0 0 18px rgba(232,41,26,0.15);
}
.pron-meta {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}
.pron-meta strong { color: var(--fire2); font-family: 'Share Tech Mono', monospace; }
.pron-tip {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255,182,39,0.06);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
}

.pron-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.pron-result {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-left: 3px solid var(--fire);
  border-radius: 6px;
  padding: 22px;
  animation: fadein 0.3s;
}
.pron-score-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}
.pron-score-circle {
  width: 78px; height: 78px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  font-weight: 900;
  color: white;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.pron-score-circle.score-excellent { background: linear-gradient(135deg, #00c853, var(--green)); box-shadow: 0 0 28px rgba(57,255,20,0.5); }
.pron-score-circle.score-good      { background: linear-gradient(135deg, var(--gold), #ff9100); }
.pron-score-circle.score-fair      { background: linear-gradient(135deg, #ff6b00, var(--fire2)); }
.pron-score-circle.score-poor      { background: linear-gradient(135deg, var(--fire), #b71c1c); }
.pron-score-info { flex: 1; }
.pron-verdict {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.pron-said { color: var(--text-soft); font-size: 13px; }
.pron-said em { color: var(--fire3); font-style: italic; }
.pron-feedback { color: var(--text); line-height: 1.6; font-size: 14px; }
.pron-words {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pron-word-pill {
  padding: 3px 10px;
  background: rgba(232,41,26,0.08);
  border: 1px solid rgba(232,41,26,0.4);
  border-radius: 3px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--fire3);
}

/* ── Listening ─────────────────────────────────────────── */
.listen-script {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}
.listen-script[hidden] { display: none; }
.listen-title {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  color: var(--fire2);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.listen-state {
  text-align: center;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.listen-state-icon { font-size: 20px; animation: pulse-fire 1.4s infinite; }

.listen-questions {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 22px;
  margin-bottom: 14px;
}
.listen-q-block {
  margin-bottom: 16px;
}
.listen-q-block:last-child { margin-bottom: 0; }
.listen-q-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.listen-q-text { color: var(--text); font-size: 14.5px; margin-bottom: 8px; }
.listen-q-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.listen-q-input:focus { outline: none; border-color: var(--fire); }

.listen-result {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 22px;
  animation: fadein 0.3s;
}
.listen-result-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border3);
}
.listen-result-item:last-child { border-bottom: none; }
.listen-result-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.listen-result-icon { font-size: 16px; }
.listen-result-q { color: var(--text); font-size: 14px; flex: 1; }
.listen-result-detail {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-left: 24px;
}
.listen-result-detail .given   { color: var(--fire3); }
.listen-result-detail .expect  { color: var(--green); }
.listen-result-comment {
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
  margin-left: 24px;
  margin-top: 2px;
}

/* ── Review ────────────────────────────────────────────── */
.review-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.rev-tab {
  background: var(--surface);
  border: 1px solid var(--border3);
  color: var(--text-dim);
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.rev-tab:hover { color: var(--text); }
.rev-tab.active { color: var(--fire2); border-color: var(--fire); box-shadow: 0 0 12px rgba(232,41,26,0.2); }

.review-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.review-info {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--text-soft);
}
.review-info span { color: var(--fire2); font-size: 18px; font-weight: bold; }

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.vocab-card {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-left: 3px solid var(--fire);
  border-radius: 4px;
  padding: 14px 16px;
  position: relative;
}
.vocab-word {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}
.vocab-translation { color: var(--fire3); font-size: 13px; margin-bottom: 8px; }
.vocab-example {
  font-size: 12px;
  color: var(--text-soft);
  font-style: italic;
  line-height: 1.5;
  border-top: 1px dashed var(--border3);
  padding-top: 8px;
  margin-top: 4px;
}
.vocab-srs-pip {
  position: absolute;
  top: 10px; right: 12px;
  display: flex; gap: 2px;
}
.vocab-srs-pip span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-off);
}
.vocab-srs-pip span.active { background: var(--fire2); box-shadow: 0 0 4px var(--fire-glow); }

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mistake-card {
  background: var(--surface);
  border: 1px solid var(--border3);
  border-radius: 6px;
  padding: 14px 18px;
}
.mistake-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mistake-original {
  text-decoration: line-through;
  color: var(--fire3);
  font-size: 14px;
  font-style: italic;
}
.mistake-arrow { color: var(--text-dim); }
.mistake-correction {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}
.mistake-cat {
  margin-left: auto;
  padding: 2px 10px;
  background: var(--surface3);
  border: 1px solid var(--border3);
  border-radius: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.mistake-explain {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

/* ── SRS card ──────────────────────────────────────────── */
.srs-card {
  text-align: center;
  padding: 30px 20px;
}
.srs-word {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  color: var(--fire2);
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  text-shadow: 0 0 20px rgba(232,41,26,0.25);
}
.srs-translation {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.srs-example {
  font-size: 14px;
  color: var(--text-soft);
  font-style: italic;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface2);
  border-radius: 4px;
}
.srs-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}
.srs-progress {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

/* ── Modals ────────────────────────────────────────────── */
/* Ensure hidden attribute always wins over display:flex */
[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadein 0.2s;
}
.modal-content {
  background: var(--surface);
  border: 1px solid rgba(232,41,26,0.5);
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(232,41,26,0.2), 0 20px 80px rgba(0,0,0,0.9);
}
.modal-content--small { max-width: 480px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border3);
}
.modal-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  color: var(--fire2);
  letter-spacing: 1.5px;
}
.modal-close {
  background: transparent;
  border: 1px solid var(--border3);
  color: var(--text-dim);
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--fire2); border-color: var(--fire); }
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.review-section { margin-bottom: 22px; }
.review-section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border3);
}
.review-summary {
  background: var(--surface2);
  border-left: 3px solid var(--fire);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 6px;
}
.review-pill-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.review-pill {
  padding: 6px 14px;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-soft);
}
.review-pill strong { color: var(--fire2); font-family: 'Share Tech Mono', monospace; }
.review-highlights {
  list-style: none;
}
.review-highlights li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-soft);
  border-bottom: 1px dashed var(--border3);
}
.review-highlights li::before { content: '✓ '; color: var(--green); }
.review-highlights li:last-child { border-bottom: none; }

/* ── Settings ──────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border3);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; color: var(--text); }
.settings-hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.settings-control {
  background: var(--surface2);
  border: 1px solid var(--border3);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
}
.settings-control:focus { outline: none; border-color: var(--fire); }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--fire);
  border-radius: 4px;
  padding: 10px 18px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--fire2);
  box-shadow: 0 0 20px rgba(232,41,26,0.5);
  z-index: 1000;
  animation: fadein 0.2s;
}
.toast.error { border-color: #ff5555; color: #ff5555; box-shadow: 0 0 20px rgba(255,85,85,0.5); }

/* ── Empty states ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 1px;
  font-size: 13px;
}

/* ── Recording indicator ───────────────────────────────── */
@keyframes wave-bar {
  0%,100% { transform: scaleY(0.2); }
  50%      { transform: scaleY(1); }
}
@keyframes rec-spin {
  to { transform: rotate(360deg); }
}

/* ── Tap-to-play (iOS autoplay workaround) ── */
.tap-to-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 8px 16px;
  padding: 12px;
  background: var(--fire-mid);
  border: 1px solid var(--fire);
  border-radius: 10px;
  color: var(--fire2);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  animation: tap-pulse 1.2s ease-in-out infinite;
}
@keyframes tap-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--fire-mid); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 6px transparent; }
}

/* ── Mode aveugle ── */
.chat-msg-body {
  transition: filter 0.25s ease;
}
.chat-msg-body.blinded {
  filter: blur(7px);
  cursor: pointer;
  user-select: none;
}
.chat-msg-body.blinded.revealed {
  filter: none;
}
.btn-ghost.active {
  color: var(--fire);
  border-color: var(--fire-mid);
  background: var(--fire-deep);
}

/* ── Recording bar ── */
.rec-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(232,41,26,0.10), rgba(232,41,26,0.04));
  border: 1px solid rgba(232,41,26,0.4);
  border-left: 3px solid var(--fire2);
  border-radius: 6px;
  animation: fadein 0.2s;
}

.rec-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  flex-shrink: 0;
}
.rec-wave-bar {
  display: block;
  width: 3px;
  height: 22px;
  background: var(--fire2);
  border-radius: 2px;
  transform-origin: center;
  animation: wave-bar 0.7s ease-in-out infinite;
  box-shadow: 0 0 4px var(--fire-glow);
}
.rec-wave-bar:nth-child(1) { animation-delay: 0.0s; }
.rec-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.rec-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.rec-wave-bar:nth-child(4) { animation-delay: 0.1s; }
.rec-wave-bar:nth-child(5) { animation-delay: 0.0s; }

.rec-bar-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--fire2);
  text-transform: uppercase;
  flex: 1;
}
.rec-bar-text--dim { color: var(--text-dim); }

.rec-bar-dot {
  width: 8px; height: 8px;
  background: var(--fire2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--fire);
  animation: pulse-fire 1s infinite;
  flex-shrink: 0;
}
.rec-bar-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border3);
  border-top-color: var(--fire2);
  border-radius: 50%;
  animation: rec-spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 720px) {
  body { padding: 0 14px 32px; }
  .app-title-main { font-size: 16px; }
  .app-title-icon { width: 44px; height: 44px; font-size: 22px; }
  .chat-msg { max-width: 92%; font-size: 14px; }
  .chat-window { padding: 14px; min-height: 360px; }
  .stat-value { font-size: 24px; }
  .pron-target { font-size: 18px; }
  .quick-grid { grid-template-columns: 1fr; }
}
