/* ===== 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: #0d0818;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ===== CSS VARIABLES（看護・ヘルスケアテーマ） ===== */
:root {
  --bg1: #0d0818;
  --bg2: #1a0f2e;
  --accent: #e879a0;        /* 桜ピンク */
  --accent2: #a78bfa;       /* ラベンダー */
  --ocean-deep: #0d0818;
  --ocean-mid: #1a0f2e;
  --ocean-light: #2d1b4e;
  --coral: #ff6b6b;
  --gold: #fcd34d;
  --mint: #6ee7d4;
  --cyan: #e879a0;          /* ピンクをメインに */
  --white: #ffffff;
  --glass: rgba(232,121,160,0.06);
  --glass-border: rgba(232,121,160,0.18);
  --text-soft: rgba(255,255,255,0.55);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --header-h: 56px;
}

/* ==============================
   TOPIC-BASED THEMES（看護版）
============================== */
body[data-topic="Clinical Care"]      { --bg1:#0d0818; --bg2:#1a0f2e; --accent:#e879a0; --glass:rgba(232,121,160,0.07); --glass-border:rgba(232,121,160,0.22); }
body[data-topic="Disease & Symptoms"] { --bg1:#0f0808; --bg2:#1e1010; --accent:#f87171; --glass:rgba(248,113,113,0.07); --glass-border:rgba(248,113,113,0.22); }
body[data-topic="Biology & Anatomy"]  { --bg1:#050e14; --bg2:#0a1e2c; --accent:#34d399; --glass:rgba(52,211,153,0.07); --glass-border:rgba(52,211,153,0.22); }
body[data-topic="Society & Welfare"]  { --bg1:#080e18; --bg2:#101c30; --accent:#60a5fa; --glass:rgba(96,165,250,0.07); --glass-border:rgba(96,165,250,0.22); }
body[data-topic="Mind & Behavior"]    { --bg1:#0e0818; --bg2:#1c1030; --accent:#a78bfa; --glass:rgba(167,139,250,0.07); --glass-border:rgba(167,139,250,0.22); }

/* ===== BACKGROUND ===== */
#ocean-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.ocean-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 60%, #000 100%);
  transition: background 1.5s ease;
}
.grid-layer {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232,121,160,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,121,160,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
  transition: opacity 1s;
}
/* 桜の花びら形状オーバーレイ */
.grid-layer::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(232,121,160,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ===== CREATURE LAYER（看護・医療アイコン） ===== */
.creatures-layer { position: absolute; inset: 0; pointer-events: none; }
.creature {
  position: absolute; font-size: 24px;
  animation: creatureFloat linear infinite;
  opacity: 0.32;
  filter: drop-shadow(0 0 10px var(--accent));
}
.creature.large { font-size: 36px; opacity: 0.22; }
.creature.small { font-size: 15px; opacity: 0.42; }
@keyframes creatureFloat {
  0%   { transform: translateX(-120px) translateY(0); }
  25%  { transform: translateX(calc(25vw)) translateY(-12px); }
  50%  { transform: translateX(calc(50vw)) translateY(0); }
  75%  { transform: translateX(calc(75vw)) translateY(10px); }
  99%  { transform: translateX(calc(100vw + 120px)) translateY(0); opacity: 0.32; }
  100% { transform: translateX(-120px) translateY(0); opacity: 0; }
}

/* ===== CORAL / PETAL LAYER ===== */
.coral-layer { position: absolute; bottom: 0; left: 0; right: 0; height: 120px; pointer-events: none; }
.coral {
  position: absolute; bottom: 0;
  animation: coralSway ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 4px 10px var(--accent));
  opacity: 0.40;
}
@keyframes coralSway {
  0%,100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(3deg) scale(1.05); }
}

/* ===== PARTICLES（桜花びら） ===== */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; font-size: 10px;
  animation: particleDrift linear infinite;
  color: var(--accent);
}
@keyframes particleDrift {
  0%   { transform: translate(0, 100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.15; }
  100% { transform: translate(30px, -20px) rotate(360deg); opacity: 0; }
}

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

/* ===== BUBBLES ===== */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; border-radius: 50%;
  background: rgba(232,121,160,0.03);
  border: 1px solid rgba(232,121,160,0.10);
  animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
  0%   { transform: translateY(100vh) scale(0.5); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.15; }
  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 16px;
  background: rgba(13,8,24,0.93);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(232,121,160,0.15);
}
.header-left { display: flex; align-items: center; gap: 8px; }
.logo-mark { font-size: 20px; animation: petalSpin 8s ease-in-out infinite; }
@keyframes petalSpin {
  0%,100% { transform: rotate(0deg) scale(1); filter: hue-rotate(0deg); }
  50%     { transform: rotate(15deg) scale(1.1); filter: hue-rotate(30deg); }
}
.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700; font-size: 16px;
  color: var(--accent);
  letter-spacing: 4px;
  text-shadow: 0 0 14px var(--accent);
}
.header-center {
  font-size: 11px; color: rgba(232,121,160,0.65);
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}
.header-univ { white-space: nowrap; }
.header-stats {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--text-soft);
  display: flex; align-items: center; gap: 5px;
}
.header-stats span { white-space: nowrap; }
.stat-sep { opacity: 0.3; }
#stat-explored { color: var(--accent); font-weight: 700; text-shadow: 0 0 8px var(--accent); }
#stat-mastered { color: var(--gold); }
#stat-weak     { color: var(--coral); }

/* ===== SCREEN HEADER ===== */
.screen-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.screen-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700; color: var(--white); flex: 1;
  text-shadow: 0 0 16px var(--accent);
  letter-spacing: 2px;
}
.back-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-soft); padding: 7px 14px;
  border-radius: 20px; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.back-btn:active { transform: scale(0.96); }

/* ===== HOME SCREEN ===== */
.home-hero {
  padding: 24px 20px 16px;
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.nurse-teacher {
  position: relative; margin-bottom: 10px;
  display: flex; flex-direction: column; align-items: center;
}
.nurse-body { font-size: 52px; animation: nurseFloat 4s ease-in-out infinite; }
@keyframes nurseFloat {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
.nurse-bubble {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 18px; padding: 8px 16px;
  font-size: 12px; color: var(--accent); max-width: 240px;
  text-align: center; line-height: 1.4; margin-top: 8px;
  animation: fadeInUp 0.5s ease;
  box-shadow: 0 0 20px rgba(232,121,160,0.1);
}
.app-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 700;
  color: var(--white); text-align: center; line-height: 1.2;
  text-shadow: 0 0 30px var(--accent);
  margin-top: 12px; letter-spacing: 3px;
}
.app-sub {
  font-size: 12px; color: var(--text-soft);
  text-align: center; margin-top: 8px; line-height: 1.5;
}

/* ===== DAY PROGRESS ===== */
.day-progress-strip { padding: 12px 0 4px; overflow-x: auto; }
.day-scroll { display: flex; gap: 8px; padding: 0 20px; }
.day-pill {
  flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 8px 12px; min-width: 60px;
  text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.day-pill:active { transform: scale(0.95); }
.day-pill.today  { border-color: var(--accent); background: rgba(232,121,160,0.12); box-shadow: 0 0 12px rgba(232,121,160,0.2); }
.day-pill.clear  { border-color: rgba(110,231,212,0.4); background: rgba(110,231,212,0.08); }
.day-pill.partial{ border-color: rgba(252,211,77,0.4);  background: rgba(252,211,77,0.06); }
.day-num   { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft); display: block; }
.day-status{ font-size: 14px; display: block; margin-top: 2px; }

/* ===== HOME ACTIONS ===== */
.home-actions { display: flex; flex-direction: column; gap: 10px; padding: 12px 20px; }
.btn-primary {
  background: linear-gradient(135deg, #9d174d, #e879a0);
  color: #fff; border: none; border-radius: var(--radius);
  padding: 16px 20px; font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 20px rgba(232,121,160,0.35);
  transition: all 0.2s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: var(--glass); border: 1.5px solid var(--glass-border);
  color: var(--white); border-radius: var(--radius);
  padding: 14px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: all 0.2s;
}
.btn-secondary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-soft); border-radius: var(--radius);
  padding: 12px 20px; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  transition: all 0.2s;
}
.btn-ghost:active { transform: scale(0.98); }
.btn-icon { font-size: 20px; }
.btn-text { flex: 1; text-align: left; }

/* ===== OVERALL PROGRESS ===== */
.overall-progress { padding: 12px 20px 0; }
.prog-label { font-size: 11px; color: var(--text-soft); margin-bottom: 6px; font-family: 'Space Mono', monospace; }
.prog-bar-wrap {
  background: rgba(255,255,255,0.08); border-radius: 4px;
  height: 6px; overflow: hidden; margin-bottom: 4px;
}
.prog-bar {
  height: 100%;
  background: linear-gradient(90deg, #9d174d, #e879a0, #fca5c0);
  border-radius: 4px; transition: width 1s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px rgba(232,121,160,0.5);
  width: 0%;
}
.prog-pct { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--accent); text-align: right; }

/* ===== TOPICS SCREEN ===== */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; }
.topic-card {
  background: var(--glass); border: 1.5px solid var(--glass-border);
  border-radius: var(--radius); padding: 16px 14px;
  cursor: pointer; transition: all 0.2s;
  background-color: var(--card-accent, rgba(232,121,160,0.04));
}
.topic-card:active { transform: scale(0.97); }
.topic-emoji { font-size: 32px; margin-bottom: 8px; }
.topic-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; color: var(--white); font-weight: 700;
  margin-bottom: 3px; line-height: 1.3; letter-spacing: 1px;
}
.topic-name-jp { font-size: 11px; color: var(--text-soft); margin-bottom: 8px; }
.topic-count { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft); margin-bottom: 6px; }
.topic-mini-bar { background: rgba(255,255,255,0.08); border-radius: 3px; height: 4px; overflow: hidden; }
.topic-mini-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; min-width: 0; }

/* ===== TOPIC MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: linear-gradient(135deg, #1a0f2e, #0d0818);
  border: 2px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 28px 24px; max-width: 320px; width: 90%;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(232,121,160,0.1);
}
.modal-topic-badge {
  font-family: 'Cormorant Garamond', serif; font-size: 13px; font-weight: 700;
  color: var(--accent); border: 1px solid var(--glass-border);
  background: var(--glass); border-radius: 20px; padding: 4px 14px;
  display: inline-block; margin-bottom: 12px; letter-spacing: 1px;
}
.modal-topic-creature { font-size: 48px; text-align: center; margin-bottom: 12px; }
.modal-title { font-size: 16px; color: var(--white); text-align: center; margin-bottom: 18px; }
.modal-btn {
  width: 100%; background: var(--glass); border: 1.5px solid var(--glass-border);
  color: var(--white); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: all 0.2s; text-align: left;
}
.modal-btn:active { transform: scale(0.98); }
.mode-full { border-color: rgba(232,121,160,0.35); }
.mode-step { border-color: rgba(252,211,77,0.35); }
.modal-btn-icon { font-size: 24px; }
.modal-btn-content { flex: 1; }
.modal-btn-title { font-weight: 700; font-size: 14px; }
.modal-btn-sub { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.modal-btn-count { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--accent); }
.modal-cancel {
  width: 100%; background: transparent; border: none;
  color: var(--text-soft); padding: 10px; cursor: pointer;
  font-size: 14px; margin-top: 4px;
}

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

/* ===== FLASHCARD SCREEN ===== */
.flashcard-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px 20px;
  perspective: 1200px;
}
.flashcard {
  width: 100%; max-width: 400px; min-height: 360px;
  position: relative; cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(232,121,160,0.08), rgba(13,8,24,0.92));
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow), 0 0 30px rgba(232,121,160,0.07);
}
.card-back { transform: rotateY(180deg); overflow-y: auto; }
.card-pos {
  font-family: 'Space Mono', monospace; font-size: 12px;
  color: var(--accent); background: rgba(232,121,160,0.10);
  border: 1px solid rgba(232,121,160,0.2);
  padding: 3px 12px; border-radius: 20px; display: inline-block;
  margin-bottom: 16px; align-self: flex-start;
}
.card-word {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700; color: var(--white);
  text-shadow: 0 0 24px var(--accent);
  flex: 1; display: flex; align-items: center;
  letter-spacing: 1px; line-height: 1.2;
}
.card-univ {
  font-family: 'Space Mono', monospace; font-size: 10px;
  color: var(--accent); opacity: 0.7; margin-bottom: 4px;
}
.card-hint { font-size: 12px; color: var(--text-soft); text-align: center; margin-top: 12px; }
.card-meaning {
  font-size: 22px; font-weight: 700; color: var(--white);
  margin-bottom: 14px; line-height: 1.4;
}
.card-example {
  font-size: 13px; color: var(--text-soft); line-height: 1.7;
  margin-bottom: 8px; font-style: italic;
}
.card-translation { font-size: 12px; color: rgba(255,255,255,0.42); line-height: 1.6; margin-bottom: 10px; }
.card-etymology    { font-size: 11px; color: var(--accent); margin-bottom: 8px; line-height: 1.5; }
.card-derivatives  { font-size: 11px; color: var(--accent2); line-height: 1.5; }
.fc-actions { display: flex; gap: 10px; padding: 0 20px 10px; }
.fc-btn {
  flex: 1; padding: 13px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--glass-border);
  transition: all 0.2s;
}
.fc-btn:active { transform: scale(0.97); }
.fc-skip { background: var(--glass); color: var(--text-soft); }
.fc-knew {
  background: linear-gradient(135deg, #9d174d, #e879a0);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(232,121,160,0.3);
}
.fc-nav { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 16px; }
.fc-btn-sm {
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-soft); padding: 8px 16px;
  border-radius: 20px; font-size: 13px; cursor: pointer;
}
.fc-btn-next {
  background: var(--accent); color: #fff;
  padding: 10px 24px; border-radius: 20px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; border: none;
  box-shadow: 0 4px 16px rgba(232,121,160,0.4);
}
.fc-progress-info {
  font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-soft);
}
.topic-badge {
  font-size: 10px;
  background: rgba(232,121,160,0.1);
  border: 1px solid rgba(232,121,160,0.25);
  padding: 3px 10px; border-radius: 20px;
  color: var(--accent);
  font-family: 'Cormorant Garamond', serif;
  white-space: nowrap; font-weight: 700; letter-spacing: 0.5px;
}

/* ===== QUIZ ===== */
.quiz-timer-wrap { margin: 12px 20px 0; position: relative; }
.quiz-timer-bar { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.quiz-timer-bar::after {
  content: ''; display: block; height: 100%;
  background: linear-gradient(90deg, #9d174d, #e879a0, #fca5c0);
  width: var(--timer-pct, 100%);
  transition: width 1s linear; border-radius: 3px;
  box-shadow: 0 0 8px var(--accent);
}
.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: 26px 24px 18px; }
.quiz-word {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px; font-weight: 700; color: var(--white);
  text-align: center; line-height: 1.25; margin-bottom: 10px;
  text-shadow: 0 0 20px var(--accent); letter-spacing: 1px;
}
.quiz-listen-btn button {
  background: var(--glass); border: 1px solid var(--glass-border);
  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(232,121,160,0.15); color: #fca5c0;
  animation: correctPulse 0.4s ease;
  box-shadow: 0 0 16px rgba(232,121,160,0.3);
}
.choice-btn.wrong {
  border-color: var(--coral); background: rgba(255,107,107,0.18); color: #ff8a80;
  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.08);
  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: 14px 20px 0;
  background: var(--glass); border: 1px solid var(--glass-border);
  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: 30px; flex-shrink: 0; }
.feedback-msg   { font-size: 15px; font-weight: 700; color: var(--white); }
.feedback-correct { font-size: 14px; color: var(--gold); margin-bottom: 10px; font-weight: 600; }
.feedback-hint {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.hint-etymology    { font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 7px; }
.hint-derivatives  { font-size: 12px; color: var(--accent2); margin-bottom: 7px; }
.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: 10px; background: rgba(232,121,160,0.12);
  border: 1px solid rgba(232,121,160,0.25);
  padding: 3px 10px; border-radius: 20px; color: var(--accent);
  font-family: 'Cormorant Garamond', serif; font-weight: 700; letter-spacing: 0.5px;
}

/* ===== CORRECT BURST ===== */
.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;
  filter: drop-shadow(0 0 30px var(--accent));
}
@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-mascot { font-size: 56px; margin-bottom: 12px; animation: nurseFloat 3s ease-in-out infinite; }
.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700; color: var(--white); margin-bottom: 12px;
  text-shadow: 0 0 20px var(--accent); letter-spacing: 2px;
}
.results-score   { font-family: 'Space Mono', monospace; font-size: 48px; color: var(--gold); font-weight: 700; margin-bottom: 12px; }
.results-comment { font-size: 15px; color: var(--accent); margin-bottom: 24px; text-shadow: 0 0 8px var(--accent); }
.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 var(--glass-border);
  border-radius: var(--radius); padding: 12px;
}
.r-stat-num   { font-family: 'Space Mono', monospace; font-size: 22px; color: var(--gold); }
.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; 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; }
}

/* ===== MASCOT OVERLAY ===== */
.nurse-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.nurse-msg-box {
  background: linear-gradient(135deg, #1a0f2e, #0d0818);
  border: 2px solid var(--accent); 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(232,121,160,0.15);
}
.nurse-big { font-size: 48px; display: block; margin-bottom: 16px; }
.nurse-msg-box p { font-size: 16px; color: var(--white); margin-bottom: 20px; line-height: 1.6; }
.nurse-msg-box button {
  background: linear-gradient(135deg, #9d174d, #e879a0);
  color: #fff; border: none; border-radius: 20px;
  padding: 10px 28px; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(232,121,160,0.35);
}

/* ===== 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(232,121,160,0.25); border-radius: 2px; }
