/* ============================================
   SpeakUp! — style.css  v5
============================================ */

/* ── TEMA DEĞİŞKENLERİ ── */
:root {
  --primary:       #6C63FF;
  --primary-light: #a89cff;
  --primary-dark:  #4f46e5;
  --glow:          rgba(108,99,255,0.28);
  --bg-from:       #f0f0ff;
  --bg-to:         #e8e8ff;
  --card:          #ffffff;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --radius:        20px;
  --radius-sm:     14px;
  --tr:            0.25s cubic-bezier(0.4,0,0.2,1);
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --safe-left:     env(safe-area-inset-left,  0px);
  --safe-right:    env(safe-area-inset-right, 0px);
}
body.level-a1 { --primary:#FF8C42; --primary-light:#FFB380; --primary-dark:#d96d18; --glow:rgba(255,140,66,.30); --bg-from:#fff8f0; --bg-to:#fff0e0; }
body.level-a2 { --primary:#4ECDC4; --primary-light:#7ee8e2; --primary-dark:#2eafa6; --glow:rgba(78,205,196,.30);  --bg-from:#f0fff8; --bg-to:#ddfff5; }
body.level-b1 { --primary:#6C63FF; --primary-light:#a89cff; --primary-dark:#4f46e5; --glow:rgba(108,99,255,.28); --bg-from:#f0f0ff; --bg-to:#e8e8ff; }
body.level-b2 { --primary:#3730a3; --primary-light:#6366f1; --primary-dark:#1e1b5e; --glow:rgba(55,48,163,.28);  --bg-from:#f1f0fa; --bg-to:#e7e6f5; }

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg-from), var(--bg-to));
  transition: background 0.4s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

button {
  cursor: pointer; font-family: inherit; border: none; background: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
input { font-family: inherit; -webkit-tap-highlight-color: transparent; }

/* ── PARTICLES ── */
.particles { position:fixed; inset:0; pointer-events:none; z-index:0; overflow:hidden; }
.particle  { position:absolute; border-radius:50%; background:var(--primary-light); opacity:0.10; animation:floatUp linear infinite; }
@keyframes floatUp {
  0%   { transform:translateY(110vh); opacity:0; }
  10%  { opacity:0.12; }
  90%  { opacity:0.08; }
  100% { transform:translateY(-10vh); opacity:0; }
}

/* ── SCREENS ── */
.screen {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  z-index: 10; opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  padding-top:    var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left:   var(--safe-left);
  padding-right:  var(--safe-right);
}
.screen.active { display:flex; opacity:1; transform:translateY(0); }

/* ── TOP BAR ── */
.top-bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; height: 54px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  z-index: 50;
}
.logo-small { font-size:1.15rem; font-weight:900; color:var(--primary); display:flex; align-items:center; gap:0.3rem; }
.logo-small span { color:var(--text); }
.powered-badge { display:flex; align-items:center; gap:0.35rem; font-size:0.72rem; font-weight:700; color:var(--text-muted); background:#f3f4f6; padding:0.28rem 0.7rem; border-radius:20px; }
.powered-badge i { color:var(--primary); }

/* ── SCREEN BODY ── */
.screen-body { flex:1; min-height:0; overflow:hidden; }
.screen-body.scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 1.25rem 1rem 1.5rem;
}

/* ── HERO ── */
.hero-section {
  text-align: center;
  padding: 1.5rem 0.5rem 1rem;
  animation: fadeInDown 0.5s ease;
}

/* ── JUNIOR LAB ETİKETİ ── */
.hero-icon-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-bottom: 0.6rem;
}

.jl-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Quicksand', 'Nunito', sans-serif !important;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  /* Koyu turkuaz — level temasından BAĞIMSIZ */
  color: #0e7490 !important;
  -webkit-animation: jlGlow 2.4s ease-in-out infinite;
  animation:         jlGlow 2.4s ease-in-out infinite;
  margin-bottom: 0.6rem;
  /* iOS'ta will-change animasyonu iyileştirir */
  will-change: color, text-shadow;
  -webkit-font-smoothing: antialiased;
}

.jl-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #0e7490 !important;
  -webkit-animation: dotPulse 2.4s ease-in-out infinite;
  animation:         dotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
  will-change: background, box-shadow;
}

@-webkit-keyframes jlGlow {
  0%, 100% {
    color: #0e7490 !important;
    text-shadow: 0 0 4px rgba(14,116,144,0.35);
  }
  50% {
    color: #22d3ee !important;
    text-shadow: 0 0 10px rgba(34,211,238,0.90),
                 0 0 22px rgba(14,116,144,0.65),
                 0 0 38px rgba(6,182,212,0.35);
  }
}
@keyframes jlGlow {
  0%, 100% {
    color: #0e7490 !important;
    text-shadow: 0 0 4px rgba(14,116,144,0.35);
  }
  50% {
    color: #22d3ee !important;
    text-shadow: 0 0 10px rgba(34,211,238,0.90),
                 0 0 22px rgba(14,116,144,0.65),
                 0 0 38px rgba(6,182,212,0.35);
  }
}

@-webkit-keyframes dotPulse {
  0%, 100% { background: #0e7490 !important; box-shadow: 0 0 3px rgba(14,116,144,0.5); }
  50%       { background: #22d3ee !important; box-shadow: 0 0 10px rgba(34,211,238,0.90), 0 0 20px rgba(14,116,144,0.55); }
}
@keyframes dotPulse {
  0%, 100% { background: #0e7490 !important; box-shadow: 0 0 3px rgba(14,116,144,0.5); }
  50%       { background: #22d3ee !important; box-shadow: 0 0 10px rgba(34,211,238,0.90), 0 0 20px rgba(14,116,144,0.55); }
}

.hero-icon {
  font-size: 4rem;
  display: block;
  filter: drop-shadow(0 6px 20px var(--glow));
  -webkit-animation: heroBounce 3s ease-in-out infinite;
  animation:         heroBounce 3s ease-in-out infinite;
  line-height: 1;
}
@-webkit-keyframes heroBounce {
  0%,100% { -webkit-transform:translateY(0) rotate(-2deg); }
  50%     { -webkit-transform:translateY(-10px) rotate(2deg); }
}
@keyframes heroBounce {
  0%,100% { transform:translateY(0) rotate(-2deg); }
  50%     { transform:translateY(-10px) rotate(2deg); }
}

.hero-title { font-size:clamp(1.6rem,5vw,2.4rem); font-weight:900; color:var(--text); letter-spacing:-0.5px; margin-bottom:0.4rem; }
.hero-title span { color:var(--primary); }
.hero-sub { color:var(--text-muted); font-size:0.9rem; font-weight:600; line-height:1.5; max-width:380px; margin:0 auto; }

/* ── SECTION HEADER ── */
.section-header { text-align:center; margin-bottom:1.25rem; }
.section-emoji  { font-size:2rem; margin-bottom:0.4rem; }
.section-header h2 { font-size:1.5rem; font-weight:900; color:var(--text); margin-bottom:0.25rem; }
.section-header p  { color:var(--text-muted); font-size:0.88rem; font-weight:600; }

/* ── LEVEL GRID ── */
.level-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.85rem; margin-bottom:1.25rem; }

.level-card {
  position:relative; overflow:hidden;
  background:var(--card);
  border:2.5px solid transparent; border-radius:var(--radius);
  padding:1.25rem 0.75rem;
  text-align:center; cursor:pointer;
  transition:all var(--tr);
  box-shadow:0 4px 18px rgba(0,0,0,0.07);
  display:flex; flex-direction:column; align-items:center; gap:0.4rem;
  -webkit-tap-highlight-color:transparent;
}
.level-card:active { -webkit-transform:scale(0.96); transform:scale(0.96); }

.lc-glow { position:absolute; inset:0; opacity:0; transition:opacity var(--tr); border-radius:inherit; pointer-events:none; }
.level-card[data-level="A1"] .lc-glow { background:linear-gradient(135deg,rgba(255,140,66,.08),rgba(255,107,107,.08)); }
.level-card[data-level="A2"] .lc-glow { background:linear-gradient(135deg,rgba(78,205,196,.08),rgba(68,207,108,.08)); }
.level-card[data-level="B1"] .lc-glow { background:linear-gradient(135deg,rgba(108,99,255,.08),rgba(255,101,132,.08)); }
.level-card[data-level="B2"] .lc-glow { background:linear-gradient(135deg,rgba(55,48,163,.08),rgba(225,29,72,.08)); }
.level-card:active .lc-glow { opacity:1; }
.level-card[data-level="A1"]:active { border-color:#FF8C42; }
.level-card[data-level="A2"]:active { border-color:#4ECDC4; }
.level-card[data-level="B1"]:active { border-color:#6C63FF; }
.level-card[data-level="B2"]:active { border-color:#3730a3; }

.level-emoji { font-size:2.2rem; position:relative; z-index:1; }
.level-badge { font-size:1.1rem; font-weight:900; padding:0.2rem 0.75rem; border-radius:8px; color:#fff; position:relative; z-index:1; }
.level-badge.a1 { background:linear-gradient(135deg,#FF8C42,#FF6B6B); }
.level-badge.a2 { background:linear-gradient(135deg,#4ECDC4,#44CF6C); }
.level-badge.b1 { background:linear-gradient(135deg,#6C63FF,#FF6584); }
.level-badge.b2 { background:linear-gradient(135deg,#3730a3,#6366f1); }
.level-label { font-size:0.92rem; font-weight:800; color:var(--text); position:relative; z-index:1; }
.level-age   { font-size:0.72rem; font-weight:700; color:var(--text-muted); background:#f3f4f6; padding:0.18rem 0.55rem; border-radius:20px; display:flex; align-items:center; gap:0.25rem; position:relative; z-index:1; }
.level-desc  { font-size:0.75rem; color:var(--text-muted); font-weight:600; line-height:1.3; position:relative; z-index:1; }

/* ── FEATURES STRIP ── */
.features-strip {
  display:flex; align-items:center; justify-content:center;
  gap:0.6rem; flex-wrap:wrap;
  background:rgba(255,255,255,0.72);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border-radius:var(--radius); padding:0.85rem 1rem;
  box-shadow:0 2px 12px rgba(0,0,0,0.05);
}
.feature-item { display:flex; align-items:center; gap:0.35rem; font-size:0.78rem; font-weight:700; color:var(--text-muted); }
.feature-item i { color:var(--primary); }
.feature-dot { width:4px; height:4px; border-radius:50%; background:var(--border); }

/* ── LEVEL BADGE SM ── */
.level-badge-sm { font-size:0.78rem; font-weight:900; padding:0.25rem 0.75rem; border-radius:20px; color:#fff; background:var(--primary); }

/* ── TOPIC GRID ── */
.topic-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:0.75rem; padding-bottom:0.5rem; }
.topic-card {
  position:relative; background:var(--card); border-radius:var(--radius);
  padding:1.1rem 0.75rem 1rem; text-align:center; cursor:pointer;
  transition:all var(--tr); box-shadow:0 3px 14px rgba(0,0,0,0.07);
  display:flex; flex-direction:column; align-items:center; gap:0.35rem;
  border:2px solid transparent; overflow:hidden;
  -webkit-tap-highlight-color:transparent;
}
.topic-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background:var(--topic-color,var(--primary)); border-radius:2px 2px 0 0; }
.topic-card:active { -webkit-transform:scale(0.95); transform:scale(0.95); border-color:var(--topic-color,var(--primary)); }
.topic-emoji { font-size:1.9rem; }
.topic-name  { font-size:0.85rem; font-weight:800; color:var(--text); line-height:1.3; }
.topic-desc  { font-size:0.70rem; color:var(--text-muted); font-weight:600; }

/* ── BUTTONS ── */
.btn-primary {
  display:inline-flex; align-items:center; justify-content:center; gap:0.5rem;
  padding:0.85rem 1.75rem;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#fff; border-radius:var(--radius-sm);
  font-size:0.95rem; font-weight:800;
  box-shadow:0 4px 18px var(--glow);
  transition:all var(--tr); -webkit-tap-highlight-color:transparent;
}
.btn-primary:active { -webkit-transform:scale(0.96); transform:scale(0.96); }

.btn-secondary {
  display:inline-flex; align-items:center; justify-content:center; gap:0.5rem;
  padding:0.8rem 1.5rem;
  background:transparent; color:var(--primary);
  border:2.5px solid var(--primary); border-radius:var(--radius-sm);
  font-size:0.92rem; font-weight:800;
  transition:all var(--tr); -webkit-tap-highlight-color:transparent;
}
.btn-secondary:active { background:var(--primary); color:#fff; }

.btn-ghost {
  color:var(--text-muted); font-size:0.88rem; font-weight:700;
  display:flex; align-items:center; gap:0.35rem;
  padding:0.45rem 0.75rem; border-radius:10px;
  transition:all var(--tr); min-width:44px; min-height:44px; justify-content:center;
}
.btn-ghost:active { background:rgba(0,0,0,0.06); color:var(--primary); }

.btn-ghost-dark {
  display:inline-flex; align-items:center; justify-content:center; gap:0.45rem;
  padding:0.75rem 1.25rem; background:#f3f4f6; color:var(--text-muted);
  border-radius:var(--radius-sm); font-size:0.88rem; font-weight:700;
  transition:all var(--tr);
}
.btn-ghost-dark:active { background:#e5e7eb; color:var(--text); }

.btn-end {
  display:inline-flex; align-items:center; gap:0.35rem;
  padding:0.45rem 0.85rem; background:#fee2e2; color:#dc2626;
  border-radius:10px; font-size:0.82rem; font-weight:800;
  transition:all var(--tr); min-height:36px;
}
.btn-end:active { background:#fca5a5; }

/* ── CHAT HEADER ── */
.chat-header-info { display:flex; align-items:center; gap:0.4rem; overflow:hidden; }
.chat-topic-tag { font-size:0.78rem; font-weight:700; padding:0.25rem 0.65rem; background:#f3f4f6; border-radius:20px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px; }
.chat-level-tag { font-size:0.72rem; font-weight:900; padding:0.25rem 0.65rem; background:var(--primary); border-radius:20px; color:#fff; white-space:nowrap; }

/* ── CHAT MESSAGES ── */
.chat-messages {
  flex:1; min-height:0;
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior-y:contain;
  padding:1rem 1rem 0.75rem;
  display:flex; flex-direction:column; gap:0.85rem;
  scroll-behavior:smooth;
}
.chat-welcome { text-align:center; padding:2rem 1rem; color:var(--text-muted); animation:fadeIn 0.4s ease; }
.ai-avatar-big { font-size:3.5rem; margin-bottom:0.6rem; animation:heroBounce 2.5s ease-in-out infinite; }
.chat-welcome h3 { font-size:1.05rem; font-weight:800; color:var(--text); margin-bottom:0.25rem; }
.chat-welcome p  { font-size:0.85rem; font-weight:600; margin-bottom:0.85rem; }
.welcome-dots { display:flex; align-items:center; justify-content:center; gap:5px; }

.msg-row { display:flex; align-items:flex-end; gap:0.5rem; animation:msgIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.msg-row.user { flex-direction:row-reverse; }
@keyframes msgIn { from{opacity:0;transform:translateY(10px) scale(0.97)} to{opacity:1;transform:translateY(0) scale(1)} }

.msg-avatar { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; background:#f3f4f6; }
.msg-row.ai .msg-avatar { background:linear-gradient(135deg,var(--primary-light),var(--primary)); }

.msg-bubble { max-width:72%; padding:0.75rem 1rem; border-radius:18px; font-size:0.93rem; font-weight:600; line-height:1.55; }
.msg-row.ai   .msg-bubble { background:#fff; border-bottom-left-radius:4px; box-shadow:0 2px 10px rgba(0,0,0,0.07); color:var(--text); }
.msg-row.user .msg-bubble { background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; border-bottom-right-radius:4px; box-shadow:0 3px 14px var(--glow); }

/* AI mesaj içerik wrapper */
.ai-msg-content   { display:flex; flex-direction:column; align-items:flex-start; }
.user-msg-content { display:flex; flex-direction:column; align-items:flex-end; }

.msg-meta { display:flex; align-items:center; gap:0.4rem; margin-top:0.3rem; flex-wrap:wrap; }
.msg-time { font-size:0.68rem; color:var(--text-muted); }
.msg-row.user .msg-meta { flex-direction:row-reverse; }

.btn-play-tts {
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: rgba(108,99,255,0.06);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 80px;
  justify-content: center;
}
.btn-play-tts:active {
  -webkit-transform: scale(0.94);
  transform: scale(0.94);
}
.btn-play-tts:disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* "Hazır" durumu — blob indirildi, tıklanabilir */
.btn-play-tts.ready {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 3px 14px var(--glow);
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  animation: listenPulse 1.8s ease-in-out infinite;
}

/* "Çalıyor" durumu */
.btn-play-tts.playing {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(16,185,129,0.4);
  animation: none;
}

/* iOS ipucu: hafif nabız */
.btn-play-tts.pulse-hint {
  animation: listenPulse 1s ease-in-out 3;
}

@keyframes listenPulse {
  0%, 100% { box-shadow: 0 3px 14px var(--glow); transform: scale(1); }
  50%       { box-shadow: 0 5px 22px var(--glow), 0 0 0 5px rgba(108,99,255,0.15); transform: scale(1.04); }
}

/* Listen butonu metni */
.listen-text { white-space: nowrap; }
.msg-feedback { font-size:0.75rem; margin-top:0.4rem; padding:0.4rem 0.7rem; border-radius:8px; background:rgba(67,217,173,0.12); color:#059669; font-weight:700; border-left:3px solid #43D9AD; max-width:72%; }

/* ══════════════════════════════════════════════════════════
   AI BUBBLE — Flip Kart (ön: İngilizce, arka: Türkçe)
   Öğrenci sorunun Türkçesini görmek isterse dokun.
══════════════════════════════════════════════════════════ */
/* Balon altindaki kucuk Turkce ozet */
.ai-bubble-tr-sub {
  display: flex;
  align-items: flex-start;
  gap: 0.28rem;
  margin-top: 0.28rem;
  margin-left: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #0e7490;
  line-height: 1.45;
  max-width: 72%;
  opacity: 0.90;
  font-style: italic;
}
.ai-bubble-tr-sub .tr-flag {
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
  font-style: normal;
}

/* ── SEÇENEK İPUÇLARI — statik (tıklanamaz) ── */
.choice-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.6rem;
  max-width: 88%;
}
.choice-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.05rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.choice-speak-hint {
  font-size: 0.67rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245,158,11,0.10);
  border-radius: 6px;
  padding: 0.18rem 0.45rem;
  margin-bottom: 0.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  letter-spacing: 0.01em;
}

/* Seçenek kartı — statik, tıklanamaz */
.choice-card {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(135deg, rgba(108,99,255,0.07), rgba(108,99,255,0.02));
  border: 1.5px dashed rgba(108,99,255,0.28);
  border-radius: 10px;
  pointer-events: none;
  user-select: none;
}
.choice-num {
  font-size: 0.59rem;
  font-weight: 800;
  color: var(--primary);
  opacity: 0.60;
}
.choice-en {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.choice-tr {
  font-size: 0.72rem;
  font-weight: 500;
  color: #0e7490;
  font-style: italic;
  line-height: 1.3;
  opacity: 0.85;
}

/* A1/A2 için biraz daha büyük */
body.level-a1 .choice-card,
body.level-a2 .choice-card {
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
}
body.level-a1 .choice-en,
body.level-a2 .choice-en { font-size: 0.88rem; }
body.level-a1 .choice-tr,
body.level-a2 .choice-tr { font-size: 0.76rem; }

/* AI bubble min-height */
.msg-bubble.ai-bubble {
  min-height: 2.5rem;
}

/* Typing */
.typing-row { display:flex; align-items:flex-end; gap:0.5rem; animation:fadeIn 0.25s ease; }
.speaking-indicator { display:flex; align-items:center; gap:5px; padding:0.75rem 1rem; background:#fff; border-radius:18px; border-bottom-left-radius:4px; box-shadow:0 2px 10px rgba(0,0,0,0.07); }
.speaking-dot { width:7px; height:7px; background:var(--primary); border-radius:50%; animation:speakPulse 1.2s ease-in-out infinite; }
.speaking-dot:nth-child(2) { animation-delay:0.2s; }
.speaking-dot:nth-child(3) { animation-delay:0.4s; }
@keyframes speakPulse { 0%,60%,100%{transform:translateY(0);opacity:0.3} 30%{transform:translateY(-6px);opacity:1} }

/* ── CHAT INPUT AREA ── */
.chat-input-area {
  flex-shrink:0;
  background:rgba(255,255,255,0.96);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border-top:1px solid rgba(0,0,0,0.07);
  padding:0.75rem 1rem;
  display:flex; flex-direction:column; gap:0.6rem;
  box-shadow:0 -3px 16px rgba(0,0,0,0.05);
}
.transcript-preview {
  background:linear-gradient(135deg,#f0f0ff,#e8f4ff);
  border:1.5px solid var(--primary-light); border-radius:var(--radius-sm);
  padding:0.55rem 0.85rem; font-size:0.85rem; color:var(--text);
  font-weight:600; font-style:italic; animation:fadeIn 0.2s ease;
}
.mic-row { display:flex; align-items:center; justify-content:center; gap:1rem; }
.mic-side { flex:1; text-align:center; }
.mic-side.right { display:flex; justify-content:center; align-items:center; }
.mic-status { font-size:0.78rem; color:var(--text-muted); font-weight:700; line-height:1.3; }
.mic-status.listening { color:#dc2626; animation:blink 0.9s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

.btn-mic {
  width:66px; height:66px; border-radius:50%;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#fff; font-size:1.5rem;
  display:flex; align-items:center; justify-content:center;
  position:relative; overflow:visible;
  transition:all 0.2s ease;
  box-shadow:0 5px 22px var(--glow);
  -webkit-tap-highlight-color:transparent; flex-shrink:0;
}
.btn-mic:active { -webkit-transform:scale(0.94); transform:scale(0.94); }
.btn-mic.listening { background:linear-gradient(135deg,#ef4444,#dc2626); box-shadow:0 0 0 12px rgba(239,68,68,0.14),0 5px 22px rgba(220,38,38,.4); animation:micPop 1s ease-in-out infinite; }
@keyframes micPop {
  0%,100% { box-shadow:0 0 0 8px rgba(239,68,68,0.12),0 5px 22px rgba(220,38,38,.4); }
  50%     { box-shadow:0 0 0 18px rgba(239,68,68,0.06),0 5px 22px rgba(220,38,38,.4); }
}
.btn-mic:disabled { opacity:0.4; pointer-events:none; }
/* Whisper processing durumu */
.btn-mic.processing {
  background: linear-gradient(135deg,#f59e0b,#d97706);
  box-shadow: 0 0 0 10px rgba(245,158,11,0.12), 0 5px 22px rgba(217,119,6,.4);
  animation: micPop 0.6s ease-in-out infinite;
  pointer-events: none;
}
.mic-ripple { position:absolute; inset:-5px; border-radius:50%; border:2px solid var(--primary-light); opacity:0; animation:rippleOut 2.2s ease-in-out infinite; pointer-events:none; }
@keyframes rippleOut { 0%{transform:scale(1);opacity:0.55} 100%{transform:scale(1.55);opacity:0} }

.tts-btn { width:42px; height:42px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:#f3f4f6; color:var(--text-muted); font-size:1rem; cursor:pointer; transition:all 0.2s ease; -webkit-tap-highlight-color:transparent; }
.tts-btn.active { background:var(--primary); color:#fff; box-shadow:0 2px 10px var(--glow); }
.tts-btn:active { -webkit-transform:scale(0.92); transform:scale(0.92); }

.or-divider { display:flex; align-items:center; gap:0.6rem; color:var(--text-muted); font-size:0.72rem; font-weight:700; }
.or-divider::before,.or-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.text-row { display:flex; gap:0.45rem; }
.text-row input {
  flex:1; padding:0.7rem 0.95rem;
  border:2px solid var(--border); border-radius:var(--radius-sm);
  font-size:16px; /* 16px altı → iOS zoom yapar */
  font-weight:600; outline:none;
  transition:border-color 0.2s ease;
  background:#f9fafb; color:var(--text);
}
.text-row input:focus { border-color:var(--primary); background:#fff; box-shadow:0 0 0 3px var(--glow); }
.text-row input::placeholder { color:#9ca3af; }

.btn-send { width:46px; height:46px; border-radius:var(--radius-sm); background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; font-size:0.95rem; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 10px var(--glow); flex-shrink:0; transition:all 0.2s ease; -webkit-tap-highlight-color:transparent; }
.btn-send:active { -webkit-transform:scale(0.94); transform:scale(0.94); }

/* ── SUMMARY ── */
.summary-content { display:flex; flex-direction:column; align-items:center; gap:1.4rem; text-align:center; padding-bottom:2rem; }
.confetti-area { position:fixed; inset:0; pointer-events:none; z-index:200; overflow:hidden; }
.confetti-piece { position:absolute; top:-12px; animation:confettiFall linear forwards; }
@keyframes confettiFall { 0%{transform:translateY(0) rotate(0deg);opacity:1} 100%{transform:translateY(110vh) rotate(720deg);opacity:0} }
.summary-trophy { font-size:5rem; animation:trophyIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both; filter:drop-shadow(0 6px 16px rgba(255,200,0,0.35)); }
@keyframes trophyIn { from{transform:scale(0.2) rotate(-20deg);opacity:0} to{transform:scale(1) rotate(0);opacity:1} }
.summary-title { font-size:1.8rem; font-weight:900; color:var(--text); }
.summary-sub   { color:var(--text-muted); font-size:0.9rem; font-weight:700; margin-top:-0.75rem; }
.summary-stats { display:flex; gap:0.75rem; flex-wrap:wrap; justify-content:center; }
.stat-box { background:var(--card); border-radius:var(--radius); padding:1rem 1.25rem; box-shadow:0 4px 18px rgba(0,0,0,0.07); min-width:90px; text-align:center; animation:fadeInUp 0.4s ease both; }
.stat-box:nth-child(1){animation-delay:.1s} .stat-box:nth-child(2){animation-delay:.2s} .stat-box:nth-child(3){animation-delay:.3s}
.stat-icon { font-size:1.3rem; margin-bottom:0.2rem; }
.stat-num  { font-size:1.8rem; font-weight:900; color:var(--primary); }
.stat-label{ font-size:0.7rem; color:var(--text-muted); font-weight:700; margin-top:0.15rem; }
.summary-section { width:100%; max-width:520px; text-align:left; }
.summary-section-title { display:flex; align-items:center; gap:0.4rem; font-size:0.78rem; font-weight:900; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:0.6rem; }
.summary-section-title i { color:var(--primary); }
.summary-feedback { background:var(--card); border-radius:var(--radius); padding:1.25rem; box-shadow:0 4px 18px rgba(0,0,0,0.07); font-size:0.9rem; line-height:1.7; font-weight:600; color:var(--text); border-left:4px solid var(--primary); }
.feedback-loader { text-align:center; color:var(--text-muted); padding:0.5rem; }
.summary-history { display:flex; flex-direction:column; gap:0.5rem; }
.history-item { background:#f9fafb; border-radius:var(--radius-sm); padding:0.65rem 0.9rem; font-size:0.84rem; border-left:4px solid var(--primary-light); }
.history-label { font-weight:900; color:var(--primary); font-size:0.68rem; text-transform:uppercase; letter-spacing:0.4px; margin-bottom:0.15rem; }
.summary-actions { display:flex; flex-direction:column; gap:0.65rem; width:100%; max-width:320px; }
.summary-actions .btn-primary,
.summary-actions .btn-secondary,
.summary-actions .btn-ghost-dark { width:100%; justify-content:center; padding:0.88rem 1rem; }

/* ══════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════ */
.login-body {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: calc(var(--safe-top) + 1.5rem) 1.25rem calc(var(--safe-bottom) + 1.5rem);
  gap: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Logo area */
.login-logo-wrap {
  text-align: center;
  animation: fadeInDown 0.5s ease;
}
.login-icon {
  font-size: 4.5rem;
  display: block;
  filter: drop-shadow(0 6px 24px rgba(124,58,237,0.35));
  -webkit-animation: heroBounce 3s ease-in-out infinite;
  animation: heroBounce 3s ease-in-out infinite;
  line-height: 1;
  margin: 0.3rem 0 0.25rem;
}
.login-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}
.login-sub {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Card */
.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 24px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 8px 40px rgba(108,99,255,0.14), 0 2px 12px rgba(0,0,0,0.06);
  animation: fadeInUp 0.45s ease 0.1s both;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6C63FF;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 0.75rem;
  margin-bottom: -0.1rem;
}

/* ── Geri dönen öğrenci kartı ── */
.returning-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, #f0f0ff, #e8e8ff);
  border: 2px solid rgba(108,99,255,0.25);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  animation: fadeInUp 0.35s ease both;
}
.returning-card.hidden { display: none; }
.returning-avatar {
  font-size: 2rem;
  flex-shrink: 0;
}
.returning-info {
  flex: 1;
  min-width: 0;
}
.returning-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #6C63FF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.returning-name {
  font-size: 1rem;
  font-weight: 900;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.returning-streak {
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 600;
  margin-top: 0.1rem;
}
.btn-continue {
  flex-shrink: 0;
  background: linear-gradient(135deg, #6C63FF, #5854d6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 3px 12px rgba(108,99,255,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-continue:active { transform: scale(0.96); }

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 600;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.login-divider.hidden { display: none; }

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.login-field label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.login-field label i { color: #6C63FF; }

.login-field input {
  width: 100%;
  padding: 0.82rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #1a1a2e;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.login-field input:focus {
  border-color: #6C63FF;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.login-field input::placeholder { color: #9ca3af; font-weight: 600; }

.login-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #dc2626;
  animation: fadeIn 0.2s ease;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #6C63FF, #4f46e5);
  color: #fff;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 900;
  font-family: inherit;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(108,99,255,0.35);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-login:active { transform: scale(0.97); }

.login-teacher-link {
  text-align: center;
}
.login-teacher-link a {
  color: #6C63FF;
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  border: 2px solid rgba(108,99,255,0.30);
  background: rgba(108,99,255,0.06);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.login-teacher-link a:hover {
  color: #fff;
  background: linear-gradient(135deg, #6C63FF, #4f46e5);
  border-color: #6C63FF;
  box-shadow: 0 4px 14px rgba(108,99,255,0.35);
  transform: translateY(-1px);
}

/* Login features strip */
.login-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #9ca3af;
  animation: fadeIn 0.5s ease 0.3s both;
}
.lf-item { display:flex; align-items:center; gap:0.3rem; font-weight:700; }
.lf-item i { color: rgba(108,99,255,0.7); }
.lf-dot { width:3px; height:3px; border-radius:50%; background:#d1d5db; }

/* Top bar: öğrenci adı */
.topbar-student {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(108,99,255,0.08);
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
  max-width: 130px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Logout button */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: none;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #6b7280;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-logout:active { background: #f3f4f6; transform: scale(0.97); }

/* ── UTILITY ── */
.hidden { display:none !important; }
::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--primary-light); border-radius:4px; }

/* ── ANIMATIONS ── */
@keyframes fadeInUp   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInDown { from{opacity:0;transform:translateY(-14px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn     { from{opacity:0} to{opacity:1} }

/* ── BÜYÜK EKRAN ── */
@media (min-width:600px) {
  .screen { max-width:480px; left:50%; transform:translateX(-50%); box-shadow:0 0 60px rgba(0,0,0,0.15); }
  .screen.active { transform:translateX(-50%) translateY(0); }
  .level-grid { grid-template-columns:1fr 1fr; }
  .topic-grid { grid-template-columns:repeat(auto-fill,minmax(135px,1fr)); }
  .hero-icon  { font-size:4.5rem; }
}
@media (min-width:900px) { .screen { max-width:430px; } }

/* ── LANDSCAPE ── */
@media (max-height:500px) and (orientation:landscape) {
  .hero-section { padding:0.5rem 0; }
  .hero-icon    { font-size:2.5rem; }
  .hero-title   { font-size:1.4rem; }
  .hero-sub     { display:none; }
  .level-grid   { grid-template-columns:repeat(4,1fr); gap:0.5rem; }
  .level-card   { padding:0.75rem 0.5rem; }
  .btn-mic      { width:54px; height:54px; font-size:1.3rem; }
  .chat-input-area { padding:0.5rem 0.85rem; gap:0.4rem; }
}

/* ── ÇOK KÜÇÜK EKRAN ── */
@media (max-width:360px) {
  .level-card  { padding:1rem 0.5rem; }
  .level-emoji { font-size:1.8rem; }
  .level-badge { font-size:0.95rem; }
  .msg-bubble  { max-width:80%; font-size:0.88rem; }
}
