/* ======== MATH OLYMPIAD STYLES ======== */
/* Gold/purple competition theme */

/* ---- ANIMATIONS ---- */
@keyframes oly-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes oly-shine {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes oly-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---- SCREEN WRAPPER ---- */
.oly-screen {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: var(--space-8);
  animation: oly-fadeIn 0.35s ease;
}

/* ---- ACTIVITY TOP BAR ---- */
.oly-activity-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

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

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

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

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

/* Stats bar — JS uses oly-stat-chip */
.oly-stats-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.oly-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;
}

.oly-subtitle {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* ---- TIER CARDS ---- */
.oly-tier-group {
  margin-bottom: var(--space-3);
}

.oly-tier-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #7c3aed;
  margin-bottom: var(--space-2);
}

.oly-set-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.oly-set-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface, #fff);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}
.oly-set-btn:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.oly-set-btn.completed {
  border-color: #22c55e;
  background: var(--feedback-completed-bg);
}
.oly-set-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.oly-set-emoji { font-size: 1.5rem; }
.oly-set-name { font-weight: 600; font-size: 0.8rem; color: var(--color-text); }
.oly-check { color: #22c55e; font-size: 0.9rem; }

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

.oly-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);
  position: relative;
  overflow: hidden;
}

.oly-activity-card:hover:not(.locked) {
  transform: translateY(-3px);
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25), 0 6px 20px rgba(0, 0, 0, 0.08);
}

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

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

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

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

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

/* ---- PROBLEM VIEWER ---- */
.oly-problem-card {
  background: #1e1b4b;
  border: 2px solid #312e81;
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  color: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: oly-fadeIn 0.35s ease;
}

/* JS uses oly-problem-counter */
.oly-problem-counter {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 10px;
  margin-bottom: var(--space-3);
}

/* JS uses oly-problem-text */
.oly-problem-text {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: var(--space-4);
  color: #f1f5f9;
}

.oly-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* JS uses oly-option (not oly-option-btn) */
.oly-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  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%;
  color: #f1f5f9;
}

.oly-option:hover:not(:disabled):not(.disabled) {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.oly-option.correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac;
  animation: oly-pop 0.35s ease;
}

.oly-option.wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5;
}

.oly-option.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.oly-option:disabled,
.oly-option.disabled {
  cursor: default;
  opacity: 0.7;
}

/* JS uses oly-option-letter (not oly-opt-letter) */
.oly-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ---- FEEDBACK ---- */
/* JS uses oly-feedback (not oly-explanation) */
.oly-feedback {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #e2e8f0;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.oly-feedback.correct {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.oly-feedback.wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ---- HINT ---- */
.oly-hint-btn {
  display: inline-block;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md, 12px);
  color: #f59e0b;
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.oly-hint-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
}

.oly-hint-box {
  padding: var(--space-3) var(--space-4);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-sm);
  color: #f59e0b;
  margin-top: var(--space-3);
  border-left: 3px solid #f59e0b;
}

/* ---- PROGRESS BAR ---- */
.oly-progress-bar {
  height: 8px;
  background: var(--color-surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.oly-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* ---- BUTTONS ---- */
.oly-btn {
  padding: 10px 20px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  font-family: inherit;
}

.oly-btn:hover {
  border-color: #f59e0b;
  background: var(--color-surface-2);
}

.oly-btn.primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-color: #f59e0b;
}

.oly-btn.primary:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.oly-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---- RESULTS ---- */
/* JS uses oly-results (not oly-results-card) */
.oly-results {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-6);
  text-align: center;
  animation: oly-fadeIn 0.35s ease;
}

.oly-results h2 {
  font-family: var(--font-display);
  margin: 0 0 var(--space-3);
}

.oly-results-set {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.oly-results-score {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #7c3aed;
  margin-bottom: var(--space-2);
}

.oly-results-stars {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

.oly-star {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.oly-star.earned {
  opacity: 1;
}

/* JS uses oly-medal */
.oly-medal {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-3);
}

.oly-perfect {
  color: #f59e0b;
  font-weight: 600;
  margin: var(--space-2) 0;
}

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

/* ---- SPEED ROUND ---- */
.oly-speed-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.oly-speed-question {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
  font-family: var(--font-display);
  text-align: center;
}

.oly-speed-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.oly-speed-input {
  width: 160px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  border: 3px solid #7c3aed;
  border-radius: var(--radius-lg, 16px);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.oly-speed-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.oly-speed-stats {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-3);
}

.oly-speed-stat {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

/* JS uses oly-streak-bar */
.oly-streak-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(124, 58, 237, 0.15));
  border-radius: var(--radius-full, 50px);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #f59e0b;
  margin: 0 auto var(--space-4);
  width: fit-content;
}

/* ---- 24 GAME ---- */
/* JS uses oly-24-cards / oly-24-card (not oly-24-numbers) */
.oly-24-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.oly-24-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: #1e1b4b;
  color: #f59e0b;
  border: 2px solid #312e81;
  border-radius: var(--radius-lg, 16px);
  font-family: var(--font-display);
  transition: all 0.15s;
  cursor: pointer;
}

.oly-24-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.oly-24-operators {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.oly-24-op {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: rgba(124, 58, 237, 0.1);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 50%;
  color: #7c3aed;
  cursor: pointer;
  transition: all 0.15s;
}

.oly-24-op:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
}

.oly-24-expr-row {
  margin-bottom: var(--space-3);
}

.oly-24-expr {
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.oly-24-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
}

/* ---- SUDOKU ---- */
.oly-sudoku-grid {
  border-collapse: collapse;
  margin: 0 auto;
  background: #1e1b4b;
  border: 3px solid #312e81;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  margin-bottom: var(--space-4);
  width: auto;
  table-layout: fixed;
}

.oly-sudoku-cell {
  width: 48px;
  height: 48px;
  text-align: center;
  vertical-align: middle;
  font-size: var(--text-lg);
  border: 1px solid #312e81;
  font-weight: 700;
  background: #1e1b4b;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}

.oly-sudoku-cell.box-left {
  border-left: 3px solid #7c3aed;
}
.oly-sudoku-cell.box-top {
  border-top: 3px solid #7c3aed;
}
.oly-sudoku-cell.selected {
  background: rgba(245, 158, 11, 0.3) !important;
  outline: 2px solid #f59e0b;
}

.oly-sudoku-cell.given {
  color: #c4b5fd;
  font-weight: 800;
}

.oly-sudoku-cell:not(.given):hover {
  background: rgba(245, 158, 11, 0.1);
}

.oly-sudoku-cell.error {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.oly-sudoku-picker {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}
.oly-sudoku-num {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-size: var(--text-lg);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.oly-sudoku-num:hover {
  background: #7c3aed;
  color: white;
}

.oly-sudoku-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.oly-instructions {
  text-align: center;
  color: #64748b;
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

/* ---- NIM GAME ---- */
.oly-nim-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: rgba(124, 58, 237, 0.06);
  border-radius: var(--radius-lg, 16px);
}

.oly-nim-count {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.oly-nim-stones {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.oly-nim-stone {
  font-size: 1.5rem;
  line-height: 1;
}

.oly-nim-turn {
  text-align: center;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.oly-nim-btns {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
}

/* ---- PRACTICE TEST ---- */
.oly-test-intro {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
}

.oly-test-intro h3 {
  font-family: var(--font-display);
  margin: 0 0 var(--space-2);
}

.oly-test-intro p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.oly-test-timer {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: #f59e0b;
  margin-left: auto;
}

.oly-test-nav {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.oly-test-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--color-text-muted);
}

.oly-test-dot.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.oly-test-dot.answered {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.oly-test-btns {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  margin-top: var(--space-4);
}

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

  .oly-problem-text {
    font-size: var(--text-lg);
  }

  .oly-speed-question {
    font-size: 1.8rem;
  }

  .oly-24-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .oly-24-card {
    font-size: 1.5rem;
  }

  .oly-sudoku-grid {
    max-width: 100%;
  }

  .oly-sudoku-cell {
    font-size: var(--text-sm);
    width: 36px;
    height: 36px;
  }

  .oly-test-btns {
    flex-direction: column;
  }

  .oly-test-btns .oly-btn {
    width: 100%;
  }

  .oly-activity-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .oly-speed-input-row {
    flex-direction: column;
  }

  .oly-nim-stone {
    font-size: 1.2rem;
  }
}
