/* ======== HISTORY QUEST STYLES ======== */
/* Gold/amber time-travel theme */

/* ---- HOME ---- */
.hist-home {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: var(--space-8);
}

.hist-header {
  margin-bottom: var(--space-4);
}

.hist-home h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin: var(--space-2) 0 var(--space-1);
}

.hist-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* Stats bar */
.hist-stats-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.hist-stat-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-full, 50px);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ---- ERA CARDS (Learn section) ---- */
.hist-tier-group {
  margin-bottom: var(--space-4);
}

.hist-tier-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.hist-era-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.hist-era-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  flex: 1;
  min-width: 140px;
}

.hist-era-btn:hover {
  border-color: #b45309;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.15);
}

.hist-era-btn.locked {
  opacity: 0.5;
  cursor: default;
  background: var(--color-surface-2);
}

.hist-era-btn.locked:hover {
  transform: none;
  border-color: var(--color-border);
  box-shadow: none;
}

.hist-era-emoji { font-size: 1.5rem; }
.hist-era-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hist-era-name { font-weight: 700; font-size: var(--text-sm); }
.hist-era-score { font-size: 0.75rem; color: var(--color-success, #16a34a); font-weight: 600; }
.hist-era-btn.completed { border-color: var(--color-success, #16a34a); background: #f0fdf4; }
.hist-era-btn.completed:hover { border-color: var(--color-success, #16a34a); }

/* ---- ACTIVITY CARDS GRID ---- */
.hist-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.hist-activity-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.hist-activity-card:hover {
  transform: translateY(-3px);
  border-color: #b45309;
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.12);
}

.hist-card-emoji {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.hist-card-body {
  flex: 1;
  min-width: 0;
}

.hist-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-1);
}

.hist-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.hist-card-progress {
  font-size: var(--text-xs);
  color: #b45309;
  font-weight: 600;
}

/* ---- ACTIVITY SCREEN (shared game layout) ---- */
.hist-activity-screen {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: var(--space-8);
}

.hist-activity-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.hist-activity-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0;
}

.hist-progress-bar {
  flex: 1;
  background: var(--color-surface-2);
  border-radius: var(--radius-full, 50px);
  height: 8px;
  overflow: hidden;
}

.hist-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b45309, #f59e0b);
  border-radius: var(--radius-full, 50px);
  transition: width 0.3s ease;
}

.hist-score-display {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}

.hist-round-display {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

/* ---- QUESTION CARD ---- */
.hist-question-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
}

.hist-q-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-2);
  color: #b45309;
  border-radius: var(--radius-full, 50px);
  font-size: var(--text-xs);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.hist-q-prompt {
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
  margin: var(--space-3) 0 var(--space-4);
}

.hist-q-counter {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

/* ---- OPTIONS ---- */
.hist-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hist-option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.hist-option-btn:hover:not(:disabled) {
  border-color: #b45309;
  background: var(--color-surface-2);
}

.hist-option-btn.correct,
.hist-option-btn.hist-correct {
  border-color: #22c55e !important;
  background: var(--feedback-correct-bg) !important;
  color: var(--feedback-correct-text);
}

.hist-option-btn.wrong,
.hist-option-btn.hist-wrong {
  border-color: #ef4444 !important;
  background: var(--feedback-wrong-bg) !important;
  color: var(--feedback-wrong-text);
}

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

.hist-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ---- FEEDBACK ---- */
.hist-feedback {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md, 12px);
  text-align: center;
}

.hist-feedback-correct {
  background: var(--feedback-correct-bg);
  border: 1px solid #bbf7d0;
  color: var(--feedback-completed-text);
}

.hist-feedback-wrong {
  background: var(--feedback-wrong-bg);
  border: 1px solid #fecaca;
  color: var(--feedback-wrong-text);
}

.hist-feedback-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.hist-feedback-correct .hist-funfact {
  color: var(--feedback-correct-text);
}

.hist-funfact {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-2);
}

.hist-next-btn {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: #b45309;
  color: #fff;
  border: none;
  border-radius: var(--radius-full, 50px);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  font-family: inherit;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: background 0.15s;
}

.hist-next-btn:hover { background: #d97706; }

/* ---- HIST BUTTONS ---- */
.hist-btn {
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full, 50px);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  font-family: inherit;
  transition: all 0.15s;
}

.hist-btn.primary {
  background: #b45309;
  color: #fff;
  border-color: #b45309;
}

.hist-btn.primary:hover {
  background: #d97706;
  border-color: #d97706;
}

.hist-btn.secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.hist-btn:hover { transform: translateY(-1px); }

.hist-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* ---- STUDY FLASHCARD (Time Machine) ---- */
.hist-study-counter {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.hist-study-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-6);
  text-align: center;
  margin-bottom: var(--space-4);
}

.hist-study-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-3);
}

.hist-study-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2);
}

.hist-era-period {
  font-size: var(--text-sm);
  color: #b45309;
  font-weight: 600;
  margin: 0 0 var(--space-4);
}

.hist-study-facts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  text-align: left;
}

.hist-study-fact {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.hist-study-highlight {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md, 12px);
  margin-bottom: var(--space-3);
  text-align: left;
}

.hist-study-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.hist-study-value {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;
}

.hist-study-funfact {
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  text-align: left;
  margin-top: var(--space-3);
}

.hist-study-nav {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.hist-study-nav .hist-btn {
  flex: 1;
  max-width: 180px;
}

/* ---- FAMOUS FACES PERSON CARD ---- */
.hist-person-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-6);
  text-align: center;
  margin-bottom: var(--space-4);
}

.hist-person-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.hist-person-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0 0 var(--space-1);
}

.hist-person-era {
  font-size: var(--text-sm);
  color: #b45309;
  font-weight: 600;
  margin: 0 0 var(--space-4);
}

.hist-person-achievement {
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md, 12px);
  text-align: left;
  margin-bottom: var(--space-3);
}

.hist-person-achievement p {
  margin: var(--space-1) 0 0;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
}

/* ---- HISTORY MYSTERY (clue-based) ---- */
.hist-clue-indicator {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hist-clue-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  transition: all 0.2s;
}

.hist-clue-dot.active {
  background: #f59e0b;
  color: #fff;
}

.hist-clue-label {
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.hist-clue-text {
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-md, 12px);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.hist-points-info {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.hist-hint-btn {
  display: block;
  width: 100%;
  margin: 0 auto var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 12px);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: center;
}

.hist-hint-btn:hover { background: linear-gradient(135deg, #d97706, #b45309); transform: translateY(-1px); }

.hist-mystery-reveal {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

/* ---- TIMELINE BUILDER ---- */
.hist-timeline-instruction {
  text-align: center;
  margin-bottom: var(--space-4);
}

.hist-timeline-instruction p {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
  font-weight: 600;
}

.hist-timeline-step {
  font-size: var(--text-sm);
  color: #b45309;
  font-weight: 700;
}

.hist-timeline-placed {
  margin-bottom: var(--space-4);
}

.hist-timeline-placed-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.hist-timeline-slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  margin-bottom: var(--space-2);
  transition: all 0.15s;
}

.hist-timeline-slot.filled {
  border-color: #f59e0b;
  background: var(--color-surface-2);
}

.hist-timeline-slot.correct {
  border-color: #22c55e;
  background: var(--feedback-correct-bg);
}

.hist-timeline-slot.wrong {
  border-color: #ef4444;
  background: var(--feedback-wrong-bg);
}

.hist-timeline-pos {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.hist-timeline-year {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #b45309;
  min-width: 50px;
}

.hist-timeline-evt-text {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
}

.hist-timeline-evt-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.hist-timeline-check {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hist-timeline-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hist-timeline-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.hist-timeline-choice:hover {
  border-color: #b45309;
  background: var(--color-surface-2);
  transform: translateY(-1px);
}

.hist-timeline-reveal {
  margin: var(--space-4) 0;
}

.hist-timeline-reveal-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* ---- RESULTS SCREEN ---- */
.hist-results-screen {
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-6) 0;
}

.hist-results-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-6);
  text-align: center;
}

.hist-results-header {
  margin-bottom: var(--space-4);
}

.hist-results-emoji {
  font-size: 4rem;
  margin-bottom: var(--space-2);
}

.hist-results-card h2 {
  font-family: var(--font-display);
  margin: 0 0 var(--space-2);
}

.hist-results-body {
  margin-bottom: var(--space-4);
}

.hist-results-score {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #b45309;
  margin-bottom: var(--space-1);
}

.hist-results-score-big {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #b45309;
}

.hist-results-pct {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.hist-results-coins {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius-full, 50px);
  font-weight: 700;
  color: var(--color-text);
  margin: var(--space-3) 0;
  font-size: var(--text-sm);
}

.hist-perfect-banner {
  font-size: var(--text-lg);
  font-weight: 800;
  color: #f59e0b;
  margin: var(--space-3) 0;
}

.hist-results-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

/* ---- PROGRESS DOTS ---- */
.hist-progress-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.hist-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-surface-2);
  transition: all 0.2s;
}

.hist-progress-dot.active {
  background: #f59e0b;
}

.hist-progress-dot.done {
  background: #22c55e;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .hist-card-grid { grid-template-columns: 1fr; }

  .hist-era-row { flex-direction: column; }
  .hist-era-btn { width: 100%; }

  .hist-clue-text { font-size: var(--text-base); }

  .hist-activity-top { flex-wrap: wrap; }

  .hist-results-actions { flex-direction: column; }
  .hist-results-actions .hist-btn { width: 100%; }

  .hist-timeline-slot { flex-wrap: wrap; }

  .hist-study-nav { flex-direction: column; }
  .hist-study-nav .hist-btn { max-width: 100%; }
}

/* ======== STORY-STYLE ERA READER ======== */
.hist-tm-era-badge {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary);
}

.hist-tm-period-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, rgba(228,99,126,0.12), rgba(228,99,126,0.04));
  border: 1px solid rgba(228,99,126,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.hist-tm-years {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--text-base);
}

.hist-tm-region {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.hist-tm-page-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5) var(--space-6);
  margin-bottom: var(--space-3);
  min-height: 200px;
}

.hist-tm-page-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0 0 var(--space-4);
  color: var(--color-primary);
  line-height: 1.3;
}

.hist-tm-paragraph {
  font-size: var(--text-base);
  line-height: 1.8;
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}

.hist-tm-paragraph:last-child {
  margin-bottom: 0;
}

/* Vocabulary section */
.hist-tm-vocab {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
}

.hist-tm-vocab h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0 0 var(--space-3);
  color: var(--color-primary);
}

.hist-tm-vocab-word {
  font-size: var(--text-base);
  line-height: 1.6;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.hist-tm-vocab-word:last-child {
  border-bottom: none;
}

.hist-tm-vocab-word strong {
  color: var(--color-primary);
}

/* Quiz styles */
.hist-tm-quiz-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-3);
}

.hist-tm-quiz-question {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--space-4);
  color: var(--color-text);
  line-height: 1.4;
}

.hist-tm-quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hist-tm-quiz-option {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--color-text);
}

.hist-tm-quiz-option:hover:not(:disabled) {
  border-color: var(--color-primary);
  background: rgba(228,99,126,0.05);
}

.hist-tm-quiz-option.correct {
  border-color: var(--color-success);
  background: var(--color-success-light);
  color: var(--color-success);
  font-weight: 700;
}

.hist-tm-quiz-option.wrong {
  border-color: var(--color-error);
  background: var(--color-error-light);
  color: var(--color-error);
}

.hist-tm-quiz-option:disabled {
  cursor: default;
  opacity: 0.7;
}

.hist-tm-quiz-feedback {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  font-weight: 600;
}

.hist-tm-quiz-feedback .correct-text { color: var(--color-success); }
.hist-tm-quiz-feedback .wrong-text { color: var(--color-error); }

/* Results card overrides for Time Machine quiz results */
