/* Flashcard Quiz - Simple Style */
:root {
  --fc-success: #34d399;
  --fc-error: #f87171;
  --fc-accent: var(--accent, #6366f1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg, #f5f5f5);
}

/* Header */
.game-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e5e5e5);
}

.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-muted, #f0f0f0);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text, #333);
}

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.progress-dots {
  display: flex;
  gap: 4px;
}

.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border, #ddd);
  transition: all 0.2s;
}

.progress-dots .dot.done { background: var(--fc-success); }
.progress-dots .dot.current { background: var(--fc-accent); transform: scale(1.2); }
.progress-dots .dot.wrong { background: var(--fc-error); }

.round-label {
  font-size: 12px;
  color: var(--text-muted, #888);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-accent);
}

/* Quiz Page */
.quiz-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
}

.progress-bar {
  text-align: center;
  margin-bottom: 12px;
}

#progress-text {
  font-size: 14px;
  color: var(--text-muted, #888);
}

/* Card Container */
.card-container {
  flex: 1;
  position: relative;
  perspective: 1000px;
  min-height: 400px;
}

.quiz-card, .feedback-card {
  position: absolute;
  inset: 0;
  background: var(--surface, #fff);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  transition: transform 0.4s, opacity 0.4s;
}

.quiz-card {
  z-index: 2;
}

.feedback-card {
  z-index: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: scale(0.95);
}

.feedback-card.active {
  z-index: 3;
  opacity: 1;
  transform: scale(1);
}

.question {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 20px;
  text-align: center;
}

.choices {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  text-align: left;
  background: var(--bg-muted, #f5f5f5);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--fc-accent);
  background: rgba(99, 102, 241, 0.05);
}

.choice-btn.correct {
  border-color: var(--fc-success);
  background: rgba(52, 211, 153, 0.15);
  animation: pulse-correct 0.3s;
}

.choice-btn.wrong {
  border-color: var(--fc-error);
  background: rgba(248, 113, 113, 0.15);
  animation: shake 0.3s;
}

.choice-btn:disabled { cursor: default; opacity: 0.7; }

@keyframes pulse-correct {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Feedback Card */
.feedback-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.feedback-card.correct .feedback-icon {
  background: rgba(52, 211, 153, 0.15);
  color: var(--fc-success);
}

.feedback-card.wrong .feedback-icon {
  background: rgba(248, 113, 113, 0.15);
  color: var(--fc-error);
}

.feedback-term {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.feedback-def {
  font-size: 16px;
  color: var(--text-secondary, #666);
  margin: 0 0 8px;
}

.feedback-example {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted, #888);
  margin: 0;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 16px;
  background: var(--surface, #fff);
  border-radius: 12px;
  margin-top: 16px;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-bottom: 2px;
}

.stat strong {
  font-size: 20px;
  font-weight: 700;
}

.correct-stat strong { color: var(--fc-success); }
.wrong-stat strong { color: var(--fc-error); }
.points-stat strong { color: var(--fc-accent); }

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border, #e5e5e5);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface, #fff);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.result-emoji {
  font-size: 48px;
  margin: 0 0 12px;
}

.modal h2 {
  font-size: 24px;
  margin: 0 0 8px;
}

.result-mastery {
  font-size: 48px;
  font-weight: 700;
  color: var(--fc-accent);
  margin: 0 0 8px;
}

#result-text {
  color: var(--text-muted, #888);
  margin: 0 0 24px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal h3 {
  font-size: 20px;
  margin: 0 0 12px;
}

.modal ul {
  text-align: left;
  padding-left: 20px;
  margin: 12px 0 20px;
}

.modal li {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary, #666);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.9; }

.btn-primary {
  background: var(--fc-accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border, #e5e5e5);
  color: var(--text, #333);
}

.btn-block { width: 100%; }

/* Loading State */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted, #888);
}
