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

/* ===== CSS VARIABLES (文学部 = dark parchment + gold + ink) ===== */
:root {
  --bg1:    #0a0806;
  --bg2:    #1a1208;
  --accent: #c9a84c;
  --gold2:  #e8c87a;
  --cream:  #f0e8d8;
  --ink:    #2d2010;
  --glass:       rgba(201,168,76,0.06);
  --glass-border: rgba(201,168,76,0.18);
  --text-soft:   rgba(255,255,255,0.55);
  --radius:      16px;
  --radius-lg:   24px;
  --shadow:      0 8px 32px rgba(0,0,0,0.6);
  --header-h:    56px;
}

/* Topic-based backgrounds */
body[data-topic="T1"] { --bg1:#0c0906; --bg2:#1e1508; --accent:#c9a84c; }
body[data-topic="T2"] { --bg1:#080c0a; --bg2:#0f1e14; --accent:#4ade80; }
body[data-topic="T3"] { --bg1:#0c0806; --bg2:#1e1008; --accent:#e8873a; }
body[data-topic="T4"] { --bg1:#06080c; --bg2:#0a1020; --accent:#4a9fd4; }
body[data-topic="T5"] { --bg1:#0a0614; --bg2:#180a28; --accent:#a78bfa; }
body[data-topic="T6"] { --bg1:#0c0606; --bg2:#200c0c; --accent:#f472b6; }
body[data-topic="T7"] { --bg1:#060a0c; --bg2:#0a1820; --accent:#22d3ee; }
body[data-topic="T9"] { --bg1:#0c0a06; --bg2:#201a08; --accent:#fbbf24; }

/* ===== BACKGROUND ===== */
#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%, #050302 100%);
  transition: background 1.5s ease;
}
.ocean-gradient::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.03) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* Creature layer (literary symbols floating) */
.creatures-layer { position: absolute; inset: 0; pointer-events: none; }
.creature {
  position: absolute; font-size: 26px;
  animation: creatureSwim linear infinite;
  opacity: 0.20; filter: drop-shadow(0 0 6px rgba(201,168,76,0.4));
}
.creature.large { font-size: 40px; opacity: 0.12; }
.creature.small { font-size: 16px; opacity: 0.35; }
@keyframes creatureSwim {
  0%   { transform: translateX(-100px) scaleX(1); }
  49%  { transform: translateX(calc(100vw + 100px)) scaleX(1); opacity: 0.20; }
  50%  { transform: translateX(calc(100vw + 100px)) scaleX(-1); opacity: 0; }
  51%  { transform: translateX(calc(100vw + 100px)) scaleX(-1); opacity: 0.20; }
  100% { transform: translateX(-100px) scaleX(-1); }
}

.coral-layer { position: absolute; bottom: 0; left: 0; right: 0; height: 120px; pointer-events: none; }
.coral {
  position: absolute; bottom: 0; font-size: 28px;
  animation: coralSway ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 4px 8px rgba(201,168,76,0.3));
  opacity: 0.40;
}
@keyframes coralSway {
  0%,100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(3deg) scale(1.03); }
}

.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; width: 2px; height: 2px;
  border-radius: 50%; background: rgba(201,168,76,0.5);
  animation: particleDrift linear infinite;
  box-shadow: 0 0 4px rgba(201,168,76,0.6);
}
@keyframes particleDrift {
  0%   { transform: translate(0, 100vh); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.2; }
  100% { transform: translate(15px, -100px); opacity: 0; }
}

.wave { position: absolute; bottom: -10px; left: 0; right: 0; height: 50px; border-radius: 50% 50% 0 0; opacity: 0.05; animation: waveMove linear infinite; }
.wave1 { background: var(--accent); animation-duration: 11s; }
.wave2 { background: var(--gold2); animation-duration: 15s; animation-delay: -5s; bottom: 0; }
.wave3 { background: #4a3010; animation-duration: 19s; animation-delay: -8s; bottom: 5px; }
@keyframes waveMove {
  0%   { transform: translateX(-50%) scaleY(1); }
  50%  { transform: translateX(0%) scaleY(1.2); }
  100% { transform: translateX(-50%) scaleY(1); }
}

.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; border-radius: 50%;
  background: rgba(201,168,76,0.02);
  border: 1px solid rgba(201,168,76,0.12);
  animation: bubbleRise linear infinite;
}
@keyframes bubbleRise {
  0%   { transform: translateY(100vh) scale(0.5); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.2; }
  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,8,6,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201,168,76,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: 14px;
  color: var(--accent); letter-spacing: 3px;
}
.header-stats {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
}
.stat-sep { opacity: 0.3; }
#stat-explored { color: var(--gold2); 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: 'Cormorant Garamond', serif;
  font-size: 22px; color: var(--cream); 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: flex-start; justify-content: space-between;
  padding: 20px 24px 8px;
}
.shark-teacher { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 150px; }
.shark-body { font-size: 48px; animation: heroFloat 3.5s ease-in-out infinite; }
@keyframes heroFloat {
  0%,100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.shark-bubble {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 14px; padding: 8px 10px;
  font-size: 10px; color: var(--gold2); line-height: 1.5;
  text-align: center;
}
.hero-title-block { text-align: right; }
.app-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700; line-height: 1.1;
  background: linear-gradient(135deg, var(--cream) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.app-sub { font-size: 10px; color: var(--text-soft); margin-top: 6px; line-height: 1.5; }

/* ===== DAY STRIP ===== */
.day-progress-strip { padding: 12px 0 0; overflow: hidden; }
.day-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 12px;
  scrollbar-width: none;
}
.day-scroll::-webkit-scrollbar { display: none; }
.day-pill {
  display: flex; flex-direction: column; align-items: center;
  min-width: 50px; background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 8px 6px;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.day-pill:active { transform: scale(0.95); }
.day-pill.today { border-color: var(--accent); background: rgba(201,168,76,0.12); }
.day-pill.clear  { border-color: #4ade80; background: rgba(74,222,128,0.08); }
.day-pill.partial{ border-color: rgba(201,168,76,0.35); }
.day-num { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft); }
.day-status { font-size: 14px; margin-top: 2px; }
.day-label { font-size: 9px; color: var(--text-soft); margin-top: 2px; text-align: center; max-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== HOME ACTIONS ===== */
.home-actions { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.btn-primary {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #c9a84c, #e8c87a);
  color: #0a0806; border: none; border-radius: var(--radius);
  padding: 16px 20px; font-size: 16px; font-weight: 700;
  cursor: pointer; width: 100%;
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
  transition: transform 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid rgba(201,168,76,0.25);
  color: var(--cream); border-radius: var(--radius);
  padding: 14px 20px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%; transition: transform 0.15s;
}
.btn-secondary:active { transform: scale(0.97); }
.btn-ghost {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1px dashed rgba(201,168,76,0.2);
  color: var(--text-soft); border-radius: var(--radius);
  padding: 12px 20px; font-size: 14px; cursor: pointer; width: 100%;
}
.btn-ghost:active { opacity: 0.7; }
.btn-icon { font-size: 20px; }

/* ===== PROGRESS BAR ===== */
.overall-progress {
  margin: 8px 20px 0;
  background: var(--glass); border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.prog-label { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.prog-bar-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.prog-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold2));
  border-radius: 4px; transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}
.prog-pct { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--accent); }

/* ===== TOPIC GRID ===== */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 20px; }
.topic-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 16px 12px;
  cursor: pointer; transition: transform 0.2s; text-align: center;
  position: relative; overflow: hidden;
}
.topic-card:active { transform: scale(0.95); }
.topic-emoji { font-size: 32px; margin-bottom: 8px; display: block; animation: topicFloat 3s ease-in-out infinite; }
@keyframes topicFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.topic-name { font-family: 'Cormorant Garamond', serif; font-size: 13px; font-weight: 700; color: var(--cream); margin-bottom: 2px; }
.topic-name-ja { font-size: 10px; color: var(--text-soft); margin-bottom: 6px; }
.topic-count { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--accent); }
.topic-mini-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.topic-mini-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s; }
.priority-dots { display: flex; gap: 3px; justify-content: center; margin-top: 6px; }
.pdot { width: 6px; height: 6px; border-radius: 50%; }
.pdot.A { background: var(--accent); }
.pdot.B { background: #4a7fa5; }
.pdot.C { background: #504840; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.82); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: linear-gradient(145deg, var(--bg2), var(--bg1));
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 28px; padding: 28px 24px;
  width: 100%; max-width: 360px;
  animation: modalPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 40px rgba(201,168,76,0.06);
}
@keyframes modalPop { from{transform:scale(0.8);opacity:0} to{transform:scale(1);opacity:1} }
.modal-topic-badge {
  display: inline-block;
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px; padding: 4px 14px;
  font-family: 'Space Mono', monospace; font-size: 11px; color: var(--accent);
  margin-bottom: 12px;
}
.modal-topic-creature { font-size: 56px; text-align: center; display: block; margin-bottom: 12px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: var(--cream); text-align: center; margin-bottom: 20px; }
.modal-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 18px; padding: 16px 18px; cursor: pointer;
  margin-bottom: 12px; transition: transform 0.15s, border-color 0.15s;
  color: var(--cream);
}
.modal-btn:active { transform: scale(0.97); }
.mode-full { background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(232,200,122,0.06)); border-color: rgba(201,168,76,0.35); }
.mode-step { background: linear-gradient(135deg, rgba(74,127,165,0.15), rgba(79,172,254,0.06)); border-color: rgba(74,127,165,0.3); }
.modal-btn-icon { font-size: 26px; flex-shrink: 0; }
.modal-btn-content { flex: 1; text-align: left; }
.modal-btn-title { font-size: 14px; font-weight: 700; color: var(--cream); margin-bottom: 2px; }
.modal-btn-sub { font-size: 11px; color: var(--text-soft); }
.modal-btn-count {
  font-family: 'Space Mono', monospace; font-size: 12px; color: var(--accent);
  background: rgba(201,168,76,0.1); border-radius: 10px;
  padding: 3px 10px; white-space: nowrap;
}
.modal-cancel { display: block; width: 100%; background: transparent; border: none; color: var(--text-soft); font-size: 14px; padding: 10px; cursor: pointer; text-align: center; }

/* ===== REVIEW ===== */
.review-options { padding: 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.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;
  cursor: pointer; width: 100%; transition: transform 0.15s; color: var(--cream);
}
.review-btn:active { transform: scale(0.97); }
.r-icon { font-size: 22px; }
.r-label { flex: 1; font-size: 14px; font-weight: 600; text-align: left; }
.r-count { font-size: 11px; color: var(--text-soft); }
.topic-review-list { display: flex; flex-direction: column; gap: 8px; }

/* ===== FLASHCARD ===== */
.flashcard-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px 20px; perspective: 1000px;
}
.flashcard {
  width: 100%; max-width: 400px; min-height: 320px;
  position: relative; transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.card-front, .card-back {
  position: absolute; inset: 0;
  background: rgba(201,168,76,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; box-shadow: var(--shadow), 0 0 30px rgba(201,168,76,0.04);
}
.card-back { transform: rotateY(180deg); justify-content: flex-start; overflow-y: auto; align-items: flex-start; }
.card-pos {
  font-family: 'Space Mono', monospace; font-size: 10px; color: var(--accent);
  background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3);
  padding: 3px 10px; border-radius: 20px; margin-bottom: 14px;
}
.card-word {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px; font-weight: 600; color: var(--cream);
  text-align: center; line-height: 1.2; margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(201,168,76,0.2);
}
.card-priority {
  font-family: 'Space Mono', monospace; font-size: 9px;
  padding: 2px 10px; border-radius: 20px; margin-bottom: 10px;
}
.card-priority.A { background: rgba(201,168,76,0.15); color: var(--accent); border: 1px solid rgba(201,168,76,0.3); }
.card-priority.B { background: rgba(74,127,165,0.15); color: #4a9fd4; border: 1px solid rgba(74,127,165,0.3); }
.card-priority.C { background: rgba(80,72,64,0.3); color: #8a7d6a; border: 1px solid rgba(80,72,64,.5); }
.card-hint { font-size: 11px; color: var(--text-soft); margin-top: 10px; }
.card-meaning-ja {
  font-family: 'Noto Sans JP', sans-serif; font-size: 22px; font-weight: 700;
  color: var(--gold2); text-align: center; margin-bottom: 14px; width: 100%;
  padding: 8px 0; border-bottom: 1px solid rgba(201,168,76,0.2);
  letter-spacing: 0.5px;
}
.card-def1 {
  font-family: 'Cormorant Garamond', serif; font-size: 16.5px;
  color: var(--cream); line-height: 1.75; margin-bottom: 12px; width: 100%;
  border-left: 2px solid var(--accent); padding-left: 12px;
}
.card-def2 { font-size: 12px; color: var(--text-soft); line-height: 1.7; margin-bottom: 10px; width: 100%; }
.card-def1-ja, .card-def2-ja {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px; color: var(--gold);
  line-height: 1.7; margin-bottom: 10px; width: 100%;
  padding: 5px 10px 5px 12px;
  background: rgba(201,168,76,0.06);
  border-radius: 6px;
  opacity: 0.9;
}
.card-example-ja {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px; color: rgba(232,200,122,0.75);
  line-height: 1.7; margin-bottom: 10px; width: 100%;
  padding-left: 4px;
}

.card-example {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 12px; color: rgba(232,200,122,0.7); line-height: 1.6;
  margin-bottom: 10px; width: 100%;
}
.card-trap {
  background: rgba(201,168,76,0.05); border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px; padding: 10px 12px; width: 100%;
  font-size: 11px; color: var(--text-soft); line-height: 1.7;
}
.trap-ng-sm { color: #e08878; text-decoration: line-through; font-size: 11px; }
.trap-ok-sm { color: #88c898; font-size: 11px; font-weight: 600; }

.fc-actions { display: flex; gap: 12px; padding: 0 20px 12px; }
.fc-btn {
  flex: 1; padding: 14px; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; cursor: pointer; border: none;
  transition: transform 0.15s;
}
.fc-btn:active { transform: scale(0.97); }
.fc-skip { background: var(--glass); color: var(--text-soft); border: 1px solid var(--glass-border); }
.fc-knew { background: linear-gradient(135deg, var(--accent), var(--gold2)); color: #0a0806; }
.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: linear-gradient(135deg, var(--accent), var(--gold2));
  color: #0a0806; padding: 10px 24px; border-radius: 20px;
  font-size: 14px; font-weight: 700; cursor: pointer; border: none;
  box-shadow: 0 4px 16px rgba(201,168,76,0.25);
}
.fc-progress-info { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-soft); }
.topic-badge {
  font-size: 10px; background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 3px 10px; border-radius: 20px; color: var(--accent); white-space: nowrap;
}

/* ===== QUIZ SCREEN ===== */
.quiz-timer-wrap { margin: 12px 20px 0; position: relative; }
.quiz-timer-bar { height: 5px; 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 6px rgba(201,168,76,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: stretch;
  padding: 16px 20px 12px;
}
.quiz-label {
  font-size: 11px; color: var(--text-soft);
  font-family: 'Space Mono', monospace; letter-spacing: 1px;
  margin-bottom: 10px; text-align: center;
}
.quiz-label strong { color: var(--gold2); }
.quiz-def-box {
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 4px;
}
.quiz-def-src { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--text-soft); margin-bottom: 8px; letter-spacing: 1px; }
.quiz-def-text { font-family: 'Cormorant Garamond', serif; font-size: 18px; color: var(--cream); line-height: 1.8; }
.quiz-listen-btn button {
  background: var(--glass); border: 1px solid rgba(201,168,76,0.3);
  color: var(--accent); padding: 8px 20px; border-radius: 20px; font-size: 14px; cursor: pointer;
}
.quiz-meta { display: flex; align-items: center; gap: 8px; }
#quiz-progress, #listen-progress { font-family: 'Space Mono', monospace; font-size: 12px; color: var(--text-soft); }
.mode-badge {
  font-size: 10px; background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  padding: 3px 10px; border-radius: 20px; color: var(--accent);
}

/* Choices */
.quiz-choices { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }
.choice-btn {
  background: var(--glass); border: 1.5px solid var(--glass-border);
  color: var(--cream); border-radius: var(--radius);
  padding: 14px 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: all 0.15s; display: flex; align-items: center; gap: 10px;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn.correct {
  border-color: var(--accent); background: rgba(201,168,76,0.15); color: var(--gold2);
  animation: correctPulse 0.4s ease;
  box-shadow: 0 0 16px rgba(201,168,76,0.25);
}
.choice-btn.wrong {
  border-color: #f472b6; background: rgba(244,114,182,0.12); color: #f472b6;
  animation: wrongShake 0.4s ease;
}
.choice-btn.disabled { cursor: default; }
.choice-num {
  font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-soft);
  background: rgba(255,255,255,0.06); padding: 2px 7px;
  border-radius: 10px; flex-shrink: 0; font-style: normal;
}
/* JP choices (non-italic) */
.choice-btn.jp-choice { font-family: 'Noto Sans JP', sans-serif; font-style: normal; font-size: 13px; }

@keyframes correctPulse { 0%{transform:scale(1)} 30%{transform:scale(1.02)} 100%{transform:scale(1)} }
@keyframes wrongShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* ===== QUIZ FEEDBACK ===== */
.quiz-feedback {
  margin: 12px 20px 0;
  background: var(--glass); border: 1px solid rgba(201,168,76,0.18);
  border-radius: var(--radius); padding: 14px;
  animation: feedbackSlide 0.3s 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: 10px; margin-bottom: 8px; }
.feedback-icon { font-size: 28px; flex-shrink: 0; }
.feedback-msg { font-size: 17px; font-weight: 700; color: var(--cream); }
.feedback-correct { font-family: 'Cormorant Garamond', serif; font-size: 14px; color: var(--accent); margin-bottom: 10px; font-weight: 600; }
.feedback-detail {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(201,168,76,0.12);
  border-radius: 10px; padding: 12px 14px; font-size: 12px;
}
.detail-def2 { color: var(--text-soft); line-height: 1.7; margin-bottom: 10px; }
.detail-trap { margin-top: 6px; }
.trap-label { font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 1px; color: #f472b6; margin-bottom: 6px; }
.trap-ng { color: #e08878; font-size: 12px; text-decoration: line-through; margin-bottom: 3px; }
.trap-arrow { font-size: 11px; color: var(--text-soft); margin-bottom: 3px; }
.trap-ok { color: #88c898; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.trap-ex { font-size: 11px; color: var(--text-soft); line-height: 1.7; }

/* ===== LISTENING SCREEN ===== */
.listen-word-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 14px;
}
.listen-word {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px,9vw,54px); font-weight: 600;
  color: var(--gold2); margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(201,168,76,0.2);
}
.listen-pos { font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text-soft); margin-bottom: 14px; }
.speak-btn-large {
  background: none; border: 1px solid var(--accent); color: var(--accent);
  padding: 9px 22px; border-radius: 20px; cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 1px;
  transition: all 0.2s; margin-bottom: 4px;
}
.speak-btn-large:hover { background: var(--accent); color: #0a0806; }
.speak-btn-large.playing { background: var(--accent); color: #0a0806; animation: spkPulse .8s infinite; }
@keyframes spkPulse { 0%,100%{opacity:1} 50%{opacity:.7} }

/* ===== RESULTS ===== */
.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: 52px; 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: 'Cormorant Garamond', serif; font-size: 26px; color: var(--cream); margin-bottom: 12px; }
.results-score {
  font-family: 'Space Mono', monospace; font-size: 46px;
  color: var(--accent); font-weight: 700; margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}
.results-comment { font-size: 14px; color: var(--gold2); margin-bottom: 24px; line-height: 1.7; }
.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(201,168,76,0.18); border-radius: var(--radius); padding: 12px; }
.r-stat-num { font-family: 'Space Mono', monospace; font-size: 20px; 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; }

/* ===== 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: 72px; animation: burstPop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; filter: drop-shadow(0 0 20px rgba(201,168,76,0.8)); }
@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} }

/* ===== 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: 18px; animation: fishFly 1.3s 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} }

/* ===== SHARK OVERLAY ===== */
.shark-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;
}
.shark-msg-box {
  background: linear-gradient(135deg, var(--bg2), var(--bg1));
  border: 2px solid rgba(201,168,76,0.4); 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(201,168,76,0.08);
}
.shark-big { font-size: 44px; display: block; margin-bottom: 14px; }
.shark-msg-box p { font-size: 15px; color: var(--cream); margin-bottom: 20px; line-height: 1.6; }
.shark-msg-box button {
  background: linear-gradient(135deg, var(--accent), var(--gold2));
  color: #0a0806; 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(201,168,76,0.2); border-radius: 2px; }

.hidden { display: none !important; }
