/* ============================================================
   pages.css — styles spécifiques pages, extraits des templates
   pour éviter des <style> inline dans <main>.
   ============================================================ */

/* ---------- Home : hero split + carte compétition ---------- */
.hero-split {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-text { text-align: left; }
.hero-text h1 { text-align: left; }
.hero-text .hero-actions { justify-content: flex-start; flex-wrap: wrap; }
.hero-text .hero-stats { justify-content: flex-start; gap: 2rem; flex-wrap: wrap; }

.hero-comp-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: none;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.hero-comp-top {
  padding: 1.2rem 1.2rem 0.8rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: #2D1B0E;
}
.hero-comp-top .hero-comp-icon { font-size: 1.8rem; display: block; margin-bottom: 0.2rem; }
.hero-comp-top .hero-comp-title { color: #F7A838; font-size: 1.15rem; margin-bottom: 0.2rem; font-weight: 800; }
.hero-comp-top p { color: rgba(255,255,255,0.6); font-size: 0.75rem; }

.hero-comp-list { padding: 0.2rem 0; }
.hero-comp-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.hero-comp-row:last-child { border-bottom: none; }
.hero-comp-row:hover { background: #FFF9F5; }
.hero-comp-top3 { background: #FFF3E0; }
.hero-comp-rank { font-size: 1.1rem; min-width: 28px; text-align: center; }
.hero-comp-name { flex: 1; font-weight: 700; font-size: 0.85rem; color: var(--text); }
.hero-comp-score {
  background: var(--warm-gradient);
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.75rem;
}

.hero-comp-empty {
  padding: 1.2rem;
  text-align: center;
  color: var(--text-light);
}
.hero-comp-empty .hero-comp-trophy { font-size: 1.8rem; display: block; margin-bottom: 0.3rem; }
.hero-comp-empty p { font-size: 0.8rem; line-height: 1.4; }

.hero-comp-btn {
  display: block;
  margin: 0.6rem 1rem 1rem;
  text-align: center;
  background: var(--warm-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  transition: all var(--transition);
  text-decoration: none;
}
.hero-comp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,100,58,0.3);
  color: #fff;
}

@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text { text-align: center; }
  .hero-text h1 { text-align: center; }
  .hero-text .hero-actions { justify-content: center; }
  .hero-text .hero-stats { justify-content: center; }
  .hero-comp-card {
    max-width: 360px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.75rem; line-height: 1.15; word-break: normal; hyphens: auto; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 1rem !important; }
  .hero-stats .stat-number { font-size: 1.4rem; }
  .hero-stats .stat-label { font-size: 0.7rem; }
}

/* ---------- Competition page ---------- */
.comp-hero {
  background: var(--warm-gradient);
  border-radius: var(--radius-xl);
  padding: 3rem;
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.comp-hero::after {
  content: '';
  position: absolute;
  top: -60%;
  right: -15%;
  width: 350px;
  height: 350px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.comp-hero h1 { color: #fff; font-size: 2.2rem; margin-bottom: 0.5rem; }
.comp-hero p { color: rgba(255,255,255,0.9); font-size: 1.1rem; margin-bottom: 1.5rem; }
.comp-play-btn {
  background: #fff !important;
  color: var(--primary) !important;
  font-size: 1.1rem !important;
  padding: 0.9rem 2.5rem !important;
  border-radius: 50px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
}
.comp-play-btn:hover { transform: scale(1.05) !important; box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important; }
.comp-hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 2rem;
}
.comp-stat-num { display: block; font-size: 1.8rem; font-weight: 800; color: #fff; font-family: var(--font-heading); }
.comp-stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); }

.comp-rules { margin-bottom: 2rem; }
.comp-rules h2 { text-align: center; margin-bottom: 1rem; font-size: 1.4rem; }
.comp-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.comp-rule {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.comp-rule-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.comp-rule strong { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; }
.comp-rule p { font-size: 0.8rem; color: var(--text-light); margin: 0; }

.comp-leaderboard {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.comp-table { width: 100%; border-collapse: collapse; }
.comp-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
}
.comp-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.comp-table tbody tr:hover { background: var(--bg); }
.comp-rank { font-size: 1.2rem; text-align: center; width: 50px; }
.comp-top-1 { background: #FFF3E0; }
.comp-top-2 { background: #8892; }
.comp-top-3 { background: #CD7F320A; }
.comp-score-badge {
  display: inline-block;
  background: var(--warm-gradient);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
}
.comp-score-good { color: var(--success); font-weight: 700; }
.comp-score-bad { color: var(--danger); font-weight: 700; }
.comp-date { color: var(--text-lighter); font-size: 0.8rem; }

.comp-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.comp-history-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .comp-rules-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-hero { padding: 2rem 1.5rem; }
  .comp-table th:nth-child(5), .comp-table td:nth-child(5),
  .comp-table th:nth-child(7), .comp-table td:nth-child(7) { display: none; }
}
@media (max-width: 480px) {
  .comp-rules-grid { grid-template-columns: 1fr; }
}

/* ---------- Report widget ---------- */
.report-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 42px;
  border-radius: 21px;
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(108,92,231,0.35);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1rem 0 0.7rem;
  z-index: 1000;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}
.report-fab-icon { font-size: 1.2rem; line-height: 1; }
.report-fab-label { letter-spacing: 0.3px; }
.report-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(108,92,231,0.5);
  background: linear-gradient(135deg, #5a4bd1, #6C5CE7);
}
.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.report-modal-overlay.active { display: flex; }
.report-modal {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  position: relative;
  animation: reportSlideUp 0.3s ease;
}
@keyframes reportSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.report-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #b2bec3;
  line-height: 1;
}
.report-close:hover { color: #2d3436; }
.report-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.report-header-icon { font-size: 1.5rem; }
.report-header h3 { font-size: 1.15rem; margin: 0; }
.report-hint { font-size: 0.85rem; color: #636e72; margin-bottom: 1.25rem; }
.report-types { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.report-type-option input { display: none; }
.report-type-btn {
  display: block;
  text-align: center;
  padding: 0.6rem 0.5rem;
  border: 2px solid #dfe6e9;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.report-type-option input:checked + .report-type-btn {
  border-color: #d63031;
  background: #d6303110;
  color: #d63031;
}
.report-type-btn:hover { border-color: #b2bec3; }
#reportMessage {
  width: 100%;
  border: 2px solid #dfe6e9;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}
#reportMessage:focus { outline: none; border-color: #6c5ce7; }
.report-context { font-size: 0.75rem; color: #b2bec3; margin-bottom: 1rem; word-break: break-all; }
.report-submit { width: 100%; }
.report-success { display: none; text-align: center; padding: 1rem; color: #00b894; font-weight: 700; font-size: 1rem; }
@media (max-width: 480px) {
  .report-types { grid-template-columns: 1fr; }
  .report-modal { padding: 1.5rem; }
}

/* ---------- Legal pages ---------- */
.legal-page { max-width: 820px; margin: 2rem auto; padding: 2rem 2.5rem; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.legal-page h1 { margin-bottom: 1.5rem; font-size: 1.8rem; }
.legal-page h2 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.25rem; color: var(--primary); }
.legal-page p, .legal-page li { line-height: 1.6; color: var(--text); }
.legal-page ul { margin: 0.75rem 0 1rem 1.5rem; }
.legal-page .updated { color: var(--text-light); font-size: 0.85rem; font-style: italic; }

/* ---------- Footer links ---------- */
.footer-container { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; justify-content: space-between; padding: 2rem 1.5rem 1rem; max-width: 1200px; margin: 0 auto; }
.footer-brand { flex: 1; min-width: 220px; }
.footer-brand p { margin-top: 0.5rem; color: var(--text-light); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 2rem; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-bottom: 0.6rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1rem 1.5rem; text-align: center; color: var(--text-light); font-size: 0.85rem; }

/* ---------- Subject levels : empty state "À venir" ---------- */
.level-card-empty {
  position: relative;
  opacity: 0.55;
  cursor: not-allowed;
  background: repeating-linear-gradient(
    135deg,
    rgba(0,0,0,0.02),
    rgba(0,0,0,0.02) 8px,
    rgba(0,0,0,0.04) 8px,
    rgba(0,0,0,0.04) 16px
  );
  pointer-events: none;
}
.level-card-empty .level-name { color: var(--text-light); }
.level-card-empty .level-soon {
  display: inline-block;
  background: var(--text-light);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
