/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: #fff;
  background: #0a0418;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ===== CSS VARIABLES (看護 = deep lavender + healing rose + clinical white) ===== */
:root {
  --ocean-deep:  #0a0418;
  --ocean-mid:   #180830;
  --ocean-light: #2d1060;
  --ocean-surf:  #c084fc;
  --coral:       #f472b6;
  --gold:        #c084fc;
  --mint:        #e879f9;
  --white:       #ffffff;
  --glass:       rgba(192,132,252,0.06);
  --glass-border: rgba(192,132,252,0.18);
  --text-soft:   rgba(255,255,255,0.60);
  --radius:      16px;
  --radius-lg:   24px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --header-h:    56px;
  --bg1: #0a0418;
  --bg2: #180830;
  --accent: #c084fc;
}

/* ==============================
   TOPIC-BASED THEMES
============================== */
body[data-topic="Mind & Psychology"]  { --bg1:#0a0a2e; --bg2:#141460; --accent:#a78bfa; }
body[data-topic="Health & Nursing"]   { --bg1:#1a0416; --bg2:#2e0828; --accent:#f472b6; }
body[data-topic="Language & Comm"]    { --bg1:#1a100a; --bg2:#2e1c08; --accent:#fb923c; }
body[data-topic="Biology & Science"]  { --bg1:#021a08; --bg2:#043010; --accent:#4ade80; }
body[data-topic="Society & Ethics"]   { --bg1:#1a0c04; --bg2:#2e1808; --accent:#fbbf24; }
body[data-topic="Eco & Lifestyle"]    { --bg1:#041408; --bg2:#08280f; --accent:#34d399; }
body[data-topic="Education & Family"] { --bg1:#0a0a1a; --bg2:#14143a; --accent:#60a5fa; }

/* ===== ANIMATED BG ===== */
#ocean-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
}
.ocean-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 60%, #050010 100%);
  transition: background 1.5s ease;
}
/* Healing pulse grid lines */
.ocean-gradient::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(192,132,252,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192,132,252,0.035) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* ===== CREATURE LAYER ===== */
.creatures-layer {
  position: absolute; inset: 0;
  pointer-events: none;
}
.creature {
  position: absolute;
  font-size: 28px;
  animation: creatureSwim linear infinite;
  opacity: 0.30;
  filter: drop-shadow(0 0 10px rgba(192,132,252,0.5));
  transition: opacity 1s;
}
.creature.large { font-size: 44px; opacity: 0.20; }
.creature.small { font-size: 18px; opacity: 0.45; }
@keyframes creatureSwim {
  0%   { transform: translateX(-120px) scaleX(1); }
  49%  { transform: translateX(calc(100vw + 120px)) scaleX(1); opacity: 0.30; }
  50%  { transform: translateX(calc(100vw + 120px)) scaleX(-1); opacity: 0; }
  51%  { transform: translateX(calc(100vw + 120px)) scaleX(-1); opacity: 0.30; }
  100% { transform: translateX(-120px) scaleX(-1); }
}

/* ===== CORAL LAYER ===== */
.coral-layer {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 140px; pointer-events: none;
}
.coral {
  position: absolute; bottom: 0;
  font-size: 30px;
  animation: coralSway ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 4px 12px rgba(192,132,252,0.4));
  opacity: 0.45;
}
@keyframes coralSway {
  0%,100% { transform: rotate(-4deg) scale(1); }
  50%      { transform: rotate(4deg) scale(1.04); }
}

/* ===== PARTICLES (healing dust) ===== */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; width: 2px; height: 2px;
  border-radius: 50%; background: rgba(192,132,252,0.6);
  animation: particleDrift linear infinite;
  box-shadow: 0 0 4px rgba(192,132,252,0.8);
}
@keyframes particleDrift {
  0%   { transform: translate(0, 100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.2; }
  100% { transform: translate(20px, -100px) rotate(360deg); opacity: 0; }
}

/* ===== WAVES ===== */
.wave {
  position: absolute; bottom: -10px; left: 0; right: 0;
  height: 60px; border-radius: 50% 50% 0 0;
  opacity: 0.07; animation: waveMove linear infinite;
}
.wave1 { background: var(--accent, #c084fc); animation-duration: 9s; }
.wave2 { background: var(--coral); animation-duration: 13s; animation-delay: -4s; bottom: 0; }
.wave3 { background: var(--ocean-light); animation-duration: 17s; animation-delay: -7s; bottom: 5px; }
@keyframes waveMove {
  0%   { transform: translateX(-50%) scaleY(1); }
  50%  { transform: translateX(0%) scaleY(1.2); }
  100% { transform: translateX(-50%) scaleY(1); }
}

/* ===== BUBBLES ===== */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; border-radius: 50%;
  background: rgba(192,132,252,0.03);
  border: 1px solid rgba(192,132,252,0.15);
  animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
  0%   { transform: translateY(100vh) scale(0.5); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-100px) scale(1.1); opacity: 0; }
}

/* ===== SCREENS ===== */
.screen {
  position: relative; z-index: 10;
  display: none; flex-direction: column;
  min-height: 100vh; padding-top: var(--header-h);
  padding-bottom: 32px;
}
.screen.active { display: flex; animation: fadeInUp 0.35s ease; }

/* ===== HEADER ===== */
#app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(10,4,24,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(192,132,252,0.2);
}
.header-left { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 20px; }
.logo-text {
  font-family: 'Space Mono', monospace;
  font-weight: 700; font-size: 15px;
  color: var(--accent);
  letter-spacing: 2px;
}
.header-stats {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
}
.header-stats span { white-space: nowrap; }
.stat-sep { opacity: 0.35; }
#stat-explored { color: #e879f9; font-weight: 700; }
#stat-mastered { color: var(--accent); }
#stat-weak { color: #f472b6; }

/* ===== SCREEN HEADER ===== */
.screen-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 8px;
}
.screen-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: var(--white); flex: 1;
}
.back-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-soft); padding: 6px 14px;
  border-radius: 20px; font-size: 13px; cursor: pointer;
  flex-shrink: 0;
}
.back-btn:active { opacity: 0.7; }

/* ===== HOME HERO ===== */
.home-hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 8px;
}
.nurse-teacher { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 140px; }
.nurse-body { font-size: 52px; animation: nurseBob 3s ease-in-out infinite; }
@keyframes nurseBob {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.shark-bubble {
  background: rgba(192,132,252,0.1);
  border: 1px solid rgba(192,132,252,0.3);
  border-radius: 14px; padding: 8px 12px;
  font-size: 11px; color: #e879f9; line-height: 1.4;
  text-align: center; position: relative;
}
.shark-bubble::before {
  content: '▲'; position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%); color: rgba(192,132,252,0.3); font-size: 10px;
}
.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px; line-height: 1.1; color: var(--white);
  text-shadow: 0 0 30px rgba(192,132,252,0.4);
  flex: 1; text-align: right;
}
.app-sub {
  font-size: 11px; color: var(--text-soft);
  padding: 4px 24px 12px; text-align: right;
}

/* ===== DAY PROGRESS STRIP ===== */
.day-progress-strip {
  overflow-x: auto; overflow-y: hidden;
  padding: 10px 16px;
  scrollbar-width: none;
}
.day-progress-strip::-webkit-scrollbar { display: none; }
.day-scroll {
  display: flex; gap: 6px; min-width: max-content;
}
.day-chip {
  display: flex; flex-direction: column; align-items: center;
  min-width: 40px; padding: 6px 4px;
  background: rgba(192,132,252,0.05);
  border: 1px solid rgba(192,132,252,0.15);
  border-radius: 10px; cursor: pointer;
  transition: all 0.2s;
}
.day-chip.done   { border-color: rgba(192,132,252,0.6); background: rgba(192,132,252,0.12); }
.day-chip.today  { border-color: var(--accent); background: rgba(192,132,252,0.18); box-shadow: 0 0 12px rgba(192,132,252,0.3); }
.day-chip.locked { opacity: 0.35; cursor: default; }
.day-num { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft); }
.day-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(192,132,252,0.3); margin-top: 4px; }
.day-chip.done .day-dot  { background: var(--accent); }
.day-chip.today .day-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ===== HOME ACTIONS ===== */
.home-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 20px;
}
.btn-primary {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #c084fc, #f472b6);
  border: none; border-radius: var(--radius);
  padding: 16px 20px; color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 24px rgba(192,132,252,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 10px rgba(192,132,252,0.3); }
.btn-secondary {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1.5px solid var(--glass-border);
  border-radius: var(--radius); padding: 14px 20px;
  color: var(--white); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:active { opacity: 0.7; }
.btn-ghost {
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 1px solid rgba(192,132,252,0.2);
  border-radius: var(--radius); padding: 12px 20px;
  color: var(--text-soft); font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:active { opacity: 0.7; }
.btn-icon { font-size: 20px; }
.btn-text { flex: 1; text-align: left; }

/* ===== OVERALL PROGRESS ===== */
.overall-progress {
  margin: 8px 20px 0;
  display: flex; align-items: center; gap: 10px;
}
.prog-label { font-size: 11px; color: var(--text-soft); flex-shrink: 0; }
.prog-bar-wrap {
  flex: 1; height: 6px; background: rgba(192,132,252,0.1); border-radius: 3px; overflow: hidden;
}
.prog-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), #f472b6);
  border-radius: 3px; width: 0%;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(192,132,252,0.5);
}
.prog-pct { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--accent); flex-shrink: 0; }

/* ===== TOPIC GRID ===== */
.topic-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 12px 16px;
}
.topic-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 16px 14px;
  cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.02));
}
.topic-card:active { transform: scale(0.97); }
.topic-card.done { border-color: rgba(192,132,252,0.4); }
.topic-emoji { font-size: 28px; margin-bottom: 8px; display: block; }
.topic-name { font-size: 12px; font-weight: 700; color: var(--white); margin-bottom: 4px; line-height: 1.3; }
.topic-count { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft); margin-bottom: 8px; }
.topic-mini-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.topic-mini-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }

/* ===== TOPIC MODE MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: linear-gradient(135deg, #180830, #0a0418);
  border: 1.5px solid rgba(192,132,252,0.35);
  border-radius: var(--radius-lg); padding: 28px 22px;
  width: 100%; max-width: 340px;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(192,132,252,0.08);
}
.modal-topic-badge {
  display: inline-block; background: rgba(192,132,252,0.12);
  border: 1px solid rgba(192,132,252,0.3);
  border-radius: 20px; padding: 4px 14px;
  font-size: 12px; color: var(--accent); margin-bottom: 16px;
}
.modal-topic-creature { font-size: 44px; text-align: center; margin-bottom: 14px; }
.modal-title { font-size: 15px; color: var(--white); margin-bottom: 18px; font-weight: 700; text-align: center; }
.modal-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass); border: 1.5px solid var(--glass-border);
  border-radius: var(--radius); padding: 14px 16px;
  width: 100%; cursor: pointer; color: var(--white);
  margin-bottom: 10px; transition: all 0.2s; text-align: left;
}
.modal-btn:active { transform: scale(0.98); }
.modal-btn.mode-full  { border-color: rgba(192,132,252,0.4); }
.modal-btn.mode-step  { border-color: rgba(244,114,182,0.3); }
.modal-btn-icon { font-size: 24px; flex-shrink: 0; }
.modal-btn-content { flex: 1; }
.modal-btn-title { font-size: 14px; font-weight: 700; }
.modal-btn-sub   { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.modal-btn-count { font-family: 'Space Mono', monospace; font-size: 13px; color: var(--accent); flex-shrink: 0; }
.modal-cancel {
  width: 100%; background: transparent; border: none;
  color: var(--text-soft); font-size: 13px; padding: 12px;
  cursor: pointer; border-radius: var(--radius);
  margin-top: 4px;
}

/* ===== REVIEW SCREEN ===== */
.review-options { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
.review-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 16px 18px;
  color: var(--white); cursor: pointer; transition: all 0.2s;
}
.review-btn:active { transform: scale(0.98); }
.r-icon  { font-size: 22px; flex-shrink: 0; }
.r-label { flex: 1; font-size: 14px; font-weight: 600; text-align: left; }
.r-count { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--accent); flex-shrink: 0; }
.topic-review-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.topic-review-btn {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 16px;
  color: var(--white); cursor: pointer; text-align: left; transition: all 0.2s;
}
.topic-review-btn:active { opacity: 0.7; }
.trb-emoji { font-size: 18px; flex-shrink: 0; }
.trb-name  { flex: 1; font-size: 12px; font-weight: 600; }
.trb-count { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-soft); }

/* ===== FLASHCARD ===== */
.flashcard-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px 20px;
}
.flashcard {
  width: 100%; max-width: 380px;
  min-height: 300px;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 22px;
}
.card-front {
  background: linear-gradient(135deg, #180830, #2d1060);
  border: 1.5px solid rgba(192,132,252,0.3);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 40px rgba(192,132,252,0.08);
}
.card-back {
  background: linear-gradient(135deg, #1a0416, #2e0828);
  border: 1.5px solid rgba(244,114,182,0.3);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  transform: rotateY(180deg);
  justify-content: flex-start; align-items: flex-start;
  overflow-y: auto;
}
.card-pos {
  font-size: 12px; color: var(--text-soft); margin-bottom: 10px;
  font-style: italic; align-self: flex-start;
}
.card-word {
  font-family: 'Playfair Display', serif;
  font-size: 38px; color: var(--white);
  text-align: center; line-height: 1.2;
  text-shadow: 0 0 24px rgba(192,132,252,0.5);
  margin-bottom: 16px;
}
.card-hint { font-size: 12px; color: var(--text-soft); }
.card-meaning {
  font-size: 20px; font-weight: 700; color: var(--accent);
  margin-bottom: 14px; line-height: 1.3;
}
.card-example {
  font-size: 13px; color: var(--white); line-height: 1.6;
  margin-bottom: 8px; font-style: italic;
}
.card-translation { font-size: 12px; color: var(--text-soft); line-height: 1.6; margin-bottom: 12px; }
.card-etymology {
  font-size: 11px; color: rgba(192,132,252,0.7);
  background: rgba(192,132,252,0.06); border: 1px solid rgba(192,132,252,0.12);
  border-radius: 8px; padding: 8px 10px; width: 100%;
  margin-bottom: 8px; line-height: 1.5;
}
.card-derivatives {
  font-size: 11px; color: var(--coral);
  line-height: 1.6; width: 100%;
}

/* ===== FC ACTIONS ===== */
.fc-actions {
  display: flex; gap: 12px; padding: 0 20px 10px;
}
.fc-btn {
  flex: 1; padding: 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent; transition: all 0.15s;
}
.fc-skip { background: var(--glass); border-color: var(--glass-border); color: var(--text-soft); }
.fc-knew { background: linear-gradient(135deg, #c084fc, #f472b6); border: none; color: #fff; box-shadow: 0 4px 16px rgba(192,132,252,0.4); }
.fc-btn:active { transform: scale(0.97); }
.fc-nav { display: flex; gap: 10px; padding: 0 20px 12px; }
.fc-btn-sm {
  flex: 1; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-soft); padding: 10px; border-radius: var(--radius);
  font-size: 13px; cursor: pointer;
}
.fc-btn-next {
  flex: 2; background: rgba(192,132,252,0.12); border: 1px solid rgba(192,132,252,0.3);
  color: var(--accent); padding: 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.fc-progress-info {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--text-soft);
}
.topic-badge {
  font-size: 11px; background: rgba(192,132,252,0.1);
  border: 1px solid rgba(192,132,252,0.25);
  padding: 3px 10px; border-radius: 20px; color: var(--accent);
  white-space: nowrap;
}

/* ===== QUIZ ===== */
.quiz-timer-wrap {
  margin: 12px 20px 0;
  position: relative;
}
.quiz-timer-bar {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
.quiz-timer-bar::after {
  content: ''; display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), #f472b6);
  width: var(--timer-pct, 100%);
  transition: width 1s linear;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(192,132,252,0.4);
}
.quiz-timer-text {
  position: absolute; right: 0; top: -18px;
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--text-soft);
}
.quiz-question-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 24px 20px;
}
.quiz-word {
  font-family: 'Playfair Display', serif;
  font-size: 36px; color: var(--white); text-align: center;
  line-height: 1.2; margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(192,132,252,0.3);
}
.quiz-listen-btn button {
  background: var(--glass); border: 1px solid rgba(192,132,252,0.3);
  color: var(--accent); padding: 8px 20px;
  border-radius: 20px; font-size: 14px; cursor: pointer;
}
.quiz-choices {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 20px;
}
.choice-btn {
  background: var(--glass); border: 1.5px solid var(--glass-border);
  color: var(--white); border-radius: var(--radius);
  padding: 14px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: all 0.15s; display: flex; align-items: center; gap: 10px;
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn.correct {
  border-color: var(--accent); background: rgba(192,132,252,0.15); color: var(--accent);
  animation: correctPulse 0.4s ease;
  box-shadow: 0 0 16px rgba(192,132,252,0.3);
}
.choice-btn.wrong {
  border-color: #f472b6; background: rgba(244,114,182,0.15); color: #f472b6;
  animation: wrongShake 0.4s ease;
}
.choice-btn.disabled { cursor: default; }
.choice-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--text-soft);
  background: rgba(255,255,255,0.06); padding: 2px 8px;
  border-radius: 10px; flex-shrink: 0;
}
@keyframes correctPulse {
  0%  { transform: scale(1); }
  30% { transform: scale(1.03); }
  100%{ transform: scale(1); }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  75%  { transform: translateX(6px); }
}

/* ===== QUIZ FEEDBACK ===== */
.quiz-feedback {
  margin: 16px 20px 0;
  background: var(--glass); border: 1px solid rgba(192,132,252,0.18);
  border-radius: var(--radius); padding: 16px;
  animation: feedbackSlide 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes feedbackSlide {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.feedback-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.feedback-icon { font-size: 32px; flex-shrink: 0; }
.feedback-msg { font-size: 16px; font-weight: 700; color: var(--white); }
.feedback-correct { font-size: 14px; color: var(--accent); margin-bottom: 12px; font-weight: 600; }
.feedback-hint {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(192,132,252,0.12);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.hint-etymology { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.6; margin-bottom: 8px; }
.hint-derivatives { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.hint-example { font-size: 12px; color: var(--text-soft); line-height: 1.5; font-style: italic; }
.quiz-meta { display: flex; align-items: center; gap: 8px; }
#quiz-progress { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-soft); }
.mode-badge {
  font-size: 11px; background: rgba(192,132,252,0.12);
  border: 1px solid rgba(192,132,252,0.3);
  padding: 3px 10px; border-radius: 20px; color: var(--accent);
}

/* ===== CORRECT BURST OVERLAY ===== */
.correct-burst {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.burst-content {
  font-size: 80px;
  animation: burstPop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
  text-shadow: 0 0 30px rgba(192,132,252,0.9);
  filter: drop-shadow(0 0 20px rgba(192,132,252,0.7));
}
@keyframes burstPop {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.3); opacity: 1; }
  80%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ===== RESULTS SCREEN ===== */
.results-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
  position: relative; z-index: 10;
}
.results-icon { font-size: 56px; margin-bottom: 12px; animation: scaleFloat 3s ease-in-out infinite; }
@keyframes scaleFloat {
  0%,100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.05) translateY(-6px); }
}
.results-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; color: var(--white); margin-bottom: 12px;
}
.results-score {
  font-family: 'Space Mono', monospace;
  font-size: 48px; color: var(--accent); font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(192,132,252,0.5);
}
.results-comment { font-size: 15px; color: #e879f9; margin-bottom: 24px; }
.results-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%; max-width: 320px; margin-bottom: 28px;
}
.r-stat {
  background: var(--glass); border: 1px solid rgba(192,132,252,0.18);
  border-radius: var(--radius); padding: 12px;
}
.r-stat-num { font-family: 'Space Mono', monospace; font-size: 22px; color: var(--accent); }
.r-stat-label { font-size: 11px; color: var(--text-soft); margin-top: 4px; }
.results-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }

/* ===== CELEBRATION ===== */
.celebration {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  overflow: hidden;
}
.spark {
  position: absolute; width: 8px; height: 8px;
  border-radius: 50%; animation: sparkFly 1s ease-out forwards;
}
@keyframes sparkFly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
.fish-confetti {
  position: absolute; font-size: 20px;
  animation: fishFly 1.4s ease-out forwards;
}
@keyframes fishFly {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--dr,360deg)) scale(0.3); opacity: 0; }
}

/* ===== NURSE / SHARK OVERLAY ===== */
.shark-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.shark-msg-box {
  background: linear-gradient(135deg, #180830, #0a0418);
  border: 2px solid rgba(192,132,252,0.5); border-radius: var(--radius-lg);
  padding: 32px 28px; text-align: center;
  max-width: 300px; animation: fadeInUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(192,132,252,0.1);
}
.shark-big { font-size: 48px; display: block; margin-bottom: 16px; }
.shark-msg-box p { font-size: 16px; color: var(--white); margin-bottom: 20px; line-height: 1.6; }
.shark-msg-box button {
  background: linear-gradient(135deg, #c084fc, #f472b6);
  color: #0a0418; border: none; border-radius: 20px;
  padding: 10px 28px; font-size: 15px; font-weight: 700; cursor: pointer;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,132,252,0.2); border-radius: 2px; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
