/* ====== LOOKING AROUND - Class 4 EVS App ====== */
:root {
  --primary: #FF6B35;
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --purple: #9B5DE5;
  --green: #00BB77;
  --blue: #4895EF;
  --pink: #F72585;
  --bg: #FFF9F0;
  --card-bg: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 20px;
  --font: 'Nunito', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SPLASH / LOADING ===== */
#splash {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #FF6B35, #FFE66D, #4ECDC4);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; z-index: 9999;
  transition: opacity 0.5s;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-book {
  font-size: 80px; animation: bounce 1s infinite alternate;
}
.splash-title {
  font-size: 2.5rem; font-weight: 900; color: white;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  margin: 20px 0 10px;
}
.splash-sub {
  font-size: 1.2rem; color: rgba(255,255,255,0.9); font-weight: 700;
}
.splash-loader {
  margin-top: 30px;
  width: 200px; height: 8px;
  background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden;
}
.splash-loader-bar {
  height: 100%; background: white; border-radius: 4px;
  animation: loading 2s ease-in-out forwards;
}
@keyframes loading { from { width: 0 } to { width: 100% } }
@keyframes bounce { from { transform: translateY(0) rotate(-5deg); } to { transform: translateY(-20px) rotate(5deg); } }

/* ===== WELCOME BACK BANNER ===== */
#resume-banner {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  color: white; padding: 12px 20px;
  align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#resume-banner.show { display: flex; }
.resume-text { font-size: 1rem; font-weight: 700; }
.resume-text span { font-size: 1.1rem; display: block; }
.resume-btn {
  background: white; color: var(--purple);
  border: none; padding: 8px 20px; border-radius: 20px;
  font-weight: 800; font-family: var(--font); cursor: pointer;
  font-size: 0.95rem; transition: transform 0.2s;
}
.resume-btn:hover { transform: scale(1.05); }
.resume-close {
  background: none; border: none; color: white;
  font-size: 1.4rem; cursor: pointer; padding: 0 10px;
}

/* ===== MAIN NAV ===== */
#main-nav {
  position: sticky; top: 0; z-index: 500;
  background: white; box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
}
.nav-logo {
  font-size: 1.6rem; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  cursor: pointer;
}
.nav-breadcrumb {
  font-size: 0.9rem; color: var(--text-light);
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-breadcrumb span { color: var(--primary); font-weight: 700; }
.nav-back-btn {
  background: var(--primary); color: white; border: none;
  padding: 8px 16px; border-radius: 15px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  display: none; align-items: center; gap: 6px; transition: all 0.2s;
}
.nav-back-btn:hover { background: #e55a2b; transform: translateX(-2px); }
.nav-back-btn.show { display: flex; }
.nav-settings-btn {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; padding: 5px; color: var(--text-light);
  transition: transform 0.3s;
}
.nav-settings-btn:hover { transform: rotate(90deg); color: var(--primary); }

/* ===== HOME / INDEX PAGE ===== */
#home-page { padding: 20px; max-width: 1200px; margin: 0 auto; }

.home-hero {
  background: linear-gradient(135deg, #FF6B35 0%, #FFE66D 50%, #4ECDC4 100%);
  border-radius: 30px; padding: 40px; margin-bottom: 30px;
  text-align: center; position: relative; overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}
.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 900;
  color: white; text-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  position: relative;
}
.home-hero p {
  font-size: 1.1rem; color: rgba(255,255,255,0.9);
  margin-top: 10px; font-weight: 600; position: relative;
}
.hero-emojis {
  font-size: 2.5rem; margin-bottom: 15px; position: relative;
  display: flex; justify-content: center; gap: 15px; flex-wrap: wrap;
}
.hero-emoji { animation: float 3s ease-in-out infinite; }
.hero-emoji:nth-child(2) { animation-delay: 0.5s; }
.hero-emoji:nth-child(3) { animation-delay: 1s; }
.hero-emoji:nth-child(4) { animation-delay: 1.5s; }
.hero-emoji:nth-child(5) { animation-delay: 2s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.chapters-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.chapters-header h2 {
  font-size: 1.5rem; font-weight: 900; color: var(--text);
}
.chapters-count {
  background: var(--accent); color: var(--text);
  padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 0.9rem;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.chapter-card {
  background: white; border-radius: var(--radius);
  padding: 20px; cursor: pointer;
  box-shadow: var(--shadow); transition: all 0.3s;
  border: 3px solid transparent; position: relative; overflow: hidden;
}
.chapter-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.chapter-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--card-accent, var(--primary));
}
.chapter-num {
  font-size: 0.8rem; font-weight: 800; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
}
.chapter-emoji { font-size: 2.5rem; margin: 8px 0; }
.chapter-title {
  font-size: 1rem; font-weight: 800; color: var(--text); margin: 4px 0;
  line-height: 1.3;
}
.chapter-meta {
  font-size: 0.8rem; color: var(--text-light); margin-top: 8px;
}
.chapter-progress {
  margin-top: 10px; height: 6px;
  background: #f0f0f0; border-radius: 3px; overflow: hidden;
}
.chapter-progress-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s;
}
.chapter-badge {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.badge-done { background: var(--green); color: white; }
.badge-in-progress { background: var(--accent); color: var(--text); }

/* ===== CHAPTER READING PAGE ===== */
#chapter-page { display: none; }
#chapter-page.show { display: block; }
#home-page.hide { display: none; }

.chapter-header {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  padding: 25px 20px; text-align: center; color: white;
}
.chapter-header-num {
  font-size: 0.9rem; font-weight: 700;
  opacity: 0.8; text-transform: uppercase; letter-spacing: 2px;
}
.chapter-header-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900;
  margin: 5px 0; text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}
.chapter-header-pages {
  font-size: 0.9rem; opacity: 0.8;
}

/* ===== AUDIO CONTROLS (STICKY) ===== */
#audio-controls {
  position: sticky; top: 60px; z-index: 400;
  background: white; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.audio-play-btn {
  background: linear-gradient(135deg, var(--primary), #ff8c42);
  color: white; border: none; border-radius: 50px;
  padding: 10px 20px; font-family: var(--font); font-weight: 800;
  font-size: 1rem; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.audio-play-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(255,107,53,0.4); }
.audio-play-btn.playing {
  background: linear-gradient(135deg, var(--pink), #c01d77);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(247,37,133,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(247,37,133,0); }
}
.audio-status {
  flex: 1; font-size: 0.85rem; color: var(--text-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.audio-status.active { color: var(--primary); font-weight: 700; }
.audio-voice-btn {
  background: var(--secondary); color: white; border: none;
  border-radius: 30px; padding: 8px 14px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.8rem;
  transition: all 0.2s; white-space: nowrap;
}
.audio-voice-btn:hover { background: #3ab5ac; }
.audio-speed-btn {
  background: var(--accent); color: var(--text); border: none;
  border-radius: 30px; padding: 8px 14px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.8rem;
  transition: all 0.2s;
}
.audio-speed-btn:hover { background: #f0d800; }

/* Page progress bar */
.page-progress-wrap {
  width: 100%; height: 6px; background: #f0f0f0;
  border-radius: 3px; overflow: hidden;
}
.page-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px; transition: width 0.4s;
}

/* ===== PAGE NAVIGATION ===== */
.page-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; background: white;
  border-top: 2px solid #f5f5f5; border-bottom: 2px solid #f5f5f5;
  position: sticky; top: 120px; z-index: 390;
}
.page-nav-btn {
  background: var(--primary); color: white; border: none;
  padding: 8px 18px; border-radius: 20px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  transition: all 0.2s; display: flex; align-items: center; gap: 6px;
}
.page-nav-btn:hover { background: #e55a2b; transform: translateX(0) scale(1.05); }
.page-nav-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.page-num-display {
  font-size: 1rem; font-weight: 800; color: var(--text);
}
.page-dots { display: flex; gap: 5px; align-items: center; }
.page-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e0e0e0; cursor: pointer; transition: all 0.2s;
  border: none;
}
.page-dot.active { background: var(--primary); transform: scale(1.3); }
.page-dot.completed { background: var(--green); }

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 25px 20px; max-width: 900px; margin: 0 auto;
  min-height: 60vh;
}

.page-images {
  display: flex; flex-wrap: wrap; gap: 15px;
  margin-bottom: 20px; justify-content: center;
}
.page-image-wrap {
  border-radius: 15px; overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 100%; cursor: pointer; transition: transform 0.2s;
}
.page-image-wrap:hover { transform: scale(1.02); }
.page-image-wrap img {
  max-width: 100%; max-height: 350px;
  object-fit: contain; display: block;
}

.page-text-block {
  background: white; border-radius: 20px; padding: 25px;
  box-shadow: var(--shadow); margin-bottom: 20px;
  line-height: 1.8; font-size: 1.15rem;
}

/* Sentence highlighting */
.sentence {
  cursor: pointer; border-radius: 6px; padding: 2px 4px;
  transition: background 0.2s; display: inline;
}
.sentence:hover { background: #FFF3E0; }
.sentence.speaking { background: #FFE082; font-weight: 700; }
.sentence.highlighted { background: #E3F2FD; }

/* Activity / Question blocks */
.question-block {
  background: linear-gradient(135deg, #E3F2FD, #F3E5F5);
  border-radius: 20px; padding: 20px; margin: 20px 0;
  border-left: 5px solid var(--blue);
  box-shadow: var(--shadow);
}
.question-block.try-these {
  background: linear-gradient(135deg, #FFF3E0, #FBE9E7);
  border-left-color: var(--primary);
}
.question-block.find-out {
  background: linear-gradient(135deg, #E8F5E9, #E0F7FA);
  border-left-color: var(--green);
}
.question-label {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-light); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.question-text { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 15px; }
.question-explain-btn {
  background: var(--secondary); color: white; border: none;
  padding: 7px 16px; border-radius: 20px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.85rem;
  margin-bottom: 12px; transition: all 0.2s;
}
.question-explain-btn:hover { background: #3ab5ac; transform: scale(1.05); }

.answer-area { margin-top: 12px; }
.answer-input {
  width: 100%; min-height: 80px; padding: 12px 15px;
  border: 2px solid #e0e0e0; border-radius: 15px;
  font-family: var(--font); font-size: 1rem; resize: vertical;
  transition: border-color 0.2s; background: white;
}
.answer-input:focus { outline: none; border-color: var(--blue); }
.answer-actions {
  display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.answer-submit-btn {
  background: linear-gradient(135deg, var(--green), #00a86b);
  color: white; border: none; padding: 10px 20px; border-radius: 20px;
  cursor: pointer; font-family: var(--font); font-weight: 800; font-size: 0.95rem;
  transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.answer-submit-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0,187,119,0.4); }
.answer-mic-btn {
  background: linear-gradient(135deg, var(--pink), #c01d77);
  color: white; border: none; padding: 10px 18px; border-radius: 20px;
  cursor: pointer; font-family: var(--font); font-weight: 800; font-size: 0.95rem;
  transition: all 0.2s;
}
.answer-mic-btn:hover { transform: scale(1.05); }
.answer-mic-btn.recording {
  animation: pulse 1s infinite;
  background: red;
}
.answer-clear-btn {
  background: #f0f0f0; color: var(--text-light); border: none;
  padding: 10px 18px; border-radius: 20px;
  cursor: pointer; font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  transition: all 0.2s;
}
.answer-clear-btn:hover { background: #e0e0e0; }

/* Feedback Panel */
.feedback-panel {
  margin-top: 12px; padding: 15px; border-radius: 15px;
  display: none; font-size: 0.95rem; line-height: 1.6;
}
.feedback-panel.show { display: block; }
.feedback-panel.correct {
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  border: 2px solid var(--green);
}
.feedback-panel.wrong {
  background: linear-gradient(135deg, #FFF3E0, #FFEBEE);
  border: 2px solid var(--primary);
}
.feedback-panel.loading {
  background: #F3E5F5; border: 2px solid var(--purple);
  text-align: center;
}
.feedback-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.feedback-text { font-weight: 700; font-size: 1rem; }
.feedback-speak-btn {
  background: var(--purple); color: white; border: none;
  padding: 6px 14px; border-radius: 15px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.8rem;
  margin-top: 8px; transition: all 0.2s;
}
.feedback-speak-btn:hover { background: #7a47c1; }

/* ===== SETTINGS MODAL ===== */
#settings-modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
  padding: 20px;
}
#settings-modal.show { display: flex; }
.settings-box {
  background: white; border-radius: 25px; padding: 30px;
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 25px;
}
.settings-header h2 { font-size: 1.5rem; font-weight: 900; }
.settings-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-light); transition: color 0.2s;
}
.settings-close:hover { color: var(--primary); }
.settings-section { margin-bottom: 25px; }
.settings-section h3 {
  font-size: 1rem; font-weight: 800; color: var(--purple);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px;
  padding-bottom: 8px; border-bottom: 2px solid #f0f0f0;
}
.api-key-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 10px; align-items: center; margin-bottom: 12px;
}
.api-key-row input, .api-key-row select {
  padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: 12px;
  font-family: var(--font); font-size: 0.9rem; transition: border-color 0.2s;
  width: 100%;
}
.api-key-row input:focus, .api-key-row select:focus {
  outline: none; border-color: var(--purple);
}
.api-key-row-label {
  font-size: 0.85rem; font-weight: 700; color: var(--text-light); text-align: center;
}
.api-key-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 5px; }
.settings-save-btn {
  background: linear-gradient(135deg, var(--primary), #ff8c42);
  color: white; border: none; padding: 12px 30px; border-radius: 20px;
  font-family: var(--font); font-weight: 800; font-size: 1rem;
  cursor: pointer; width: 100%; transition: all 0.2s; margin-top: 10px;
}
.settings-save-btn:hover { transform: scale(1.02); box-shadow: 0 4px 15px rgba(255,107,53,0.4); }
.settings-status {
  text-align: center; margin-top: 10px; font-size: 0.9rem;
  font-weight: 700; color: var(--green); display: none;
}
.settings-status.show { display: block; }

/* ===== CELEBRATION OVERLAY ===== */
#celebration {
  position: fixed; inset: 0; z-index: 3000;
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
#celebration.show { display: flex; }
.celebration-content {
  text-align: center; animation: zoomIn 0.5s ease;
}
.celebration-emoji { font-size: 5rem; animation: bounce 0.5s infinite alternate; }
.celebration-text {
  font-size: 2rem; font-weight: 900; color: var(--primary);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
  background: white; padding: 10px 25px; border-radius: 20px;
  box-shadow: var(--shadow); margin-top: 10px;
}
.confetti {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: hidden;
}
.confetti-piece {
  position: absolute; width: 12px; height: 12px; border-radius: 2px;
  animation: confetti-fall linear forwards;
  top: -20px;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); }
}
@keyframes zoomIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== IMAGE LIGHTBOX ===== */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
#lightbox.show { display: flex; }
#lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 15px; right: 15px;
  background: white; border: none; width: 35px; height: 35px;
  border-radius: 50%; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; transition: transform 0.2s;
}
.lightbox-close:hover { transform: rotate(90deg); }

/* ===== INLINE EXPLANATION POPUP ===== */
.explain-popup {
  position: fixed; z-index: 2500;
  background: white; border-radius: 20px; padding: 18px;
  max-width: 350px; width: calc(100vw - 40px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  border: 3px solid var(--secondary);
  display: none;
  font-size: 0.95rem; line-height: 1.6;
}
.explain-popup.show { display: block; }
.explain-popup-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.explain-popup-title {
  font-size: 0.85rem; font-weight: 800; color: var(--secondary);
  text-transform: uppercase; letter-spacing: 1px;
}
.explain-popup-close {
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-light);
}
.explain-popup-text { color: var(--text); font-weight: 600; }
.explain-popup-loading { text-align: center; color: var(--text-light); }
.explain-popup-speak {
  background: var(--secondary); color: white; border: none;
  padding: 6px 14px; border-radius: 15px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.8rem;
  margin-top: 10px; transition: all 0.2s;
}
.explain-popup-speak:hover { background: #3ab5ac; }

/* ===== VOICE STATUS BAR ===== */
.voice-indicator {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--primary); font-weight: 700;
  padding: 6px 14px; background: #FFF3E0; border-radius: 20px;
}
.voice-dots {
  display: flex; gap: 3px;
}
.voice-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  animation: voice-bounce 0.6s ease infinite;
}
.voice-dot:nth-child(2) { animation-delay: 0.2s; }
.voice-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes voice-bounce {
  0%,100% { transform: scaleY(1); }
  50% { transform: scaleY(2.5); }
}

/* ===== FOOTER ===== */
.chapter-footer {
  background: white; padding: 20px; text-align: center;
  border-top: 2px solid #f5f5f5; margin-top: 20px;
}
.chapter-complete-btn {
  background: linear-gradient(135deg, var(--green), #00a86b);
  color: white; border: none; padding: 14px 35px; border-radius: 25px;
  font-family: var(--font); font-weight: 800; font-size: 1.1rem;
  cursor: pointer; transition: all 0.2s; display: inline-flex;
  align-items: center; gap: 10px;
}
.chapter-complete-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,187,119,0.4); }

/* ===== TOOLTIPS ===== */
.tooltip-btn {
  position: relative; display: inline-flex;
}
.tooltip-text {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: white; padding: 5px 10px;
  border-radius: 8px; font-size: 0.75rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.tooltip-btn:hover .tooltip-text { opacity: 1; }

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%; border-top-color: white;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .chapters-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .chapter-card { padding: 14px; }
  .chapter-emoji { font-size: 2rem; }
  .chapter-title { font-size: 0.9rem; }
  .audio-controls { padding: 8px 12px; }
  .page-content { padding: 15px 12px; }
  .api-key-row { grid-template-columns: 1fr; }
  .api-key-row-label { display: none; }
}

@media (max-width: 400px) {
  .chapters-grid { grid-template-columns: 1fr; }
}

/* Print / accessibility */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
