/* ============================================================
   ONE PIECE QUIZ - Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Nunito:wght@400;600;700;800&display=swap');

/* === VARIABLES === */
:root {
  --gold: #FFD700;
  --gold-dark: #c8a800;
  --navy: #0d1b2a;
  --navy-mid: #1a2d44;
  --navy-light: #243d5e;
  --red: #e63946;
  --red-dark: #b52b35;
  --white: #f8f9fa;
  --gray: #adb5bd;
  --green: #2d9e5a;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.25s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* === FOND ANIMÉ === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(22, 70, 120, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(230, 57, 70, 0.15) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* === HEADER === */
.site-header {
  background: linear-gradient(135deg, #0a1520, #1a2d44);
  border-bottom: 3px solid var(--gold);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.logo-text {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fff8dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--gray);
  font-family: 'Nunito', sans-serif;
  -webkit-text-fill-color: var(--gray);
  display: block;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-nav { display: flex; gap: 8px; }
.header-nav a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  transition: var(--transition);
  border: 1px solid transparent;
}
.header-nav a:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
}

/* === BANNIÈRE ADSENSE === */
.adsense-banner {
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,215,0,0.3);
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 16px;
  margin: 16px auto;
  max-width: 1200px;
  font-size: 0.75rem;
  color: var(--gray);
}
.adsense-banner.top { margin-bottom: 0; }

/* === HÉRO === */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(230,57,70,0); }
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #fff8dc, var(--gold));
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes shimmer {
  0%, 100% { background-position: 0%; }
  50% { background-position: 100%; }
}

.hero p {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 30px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.stat {
  text-align: center;
}
.stat-number {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  display: block;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === MODE SELECTOR === */
.mode-selector {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.mode-selector h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  text-align: center;
  color: var(--gold);
  margin-bottom: 20px;
}

.mode-tabs {
  display: flex;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  padding: 6px;
  border-radius: 50px;
  border: 1px solid rgba(255,215,0,0.2);
}

.mode-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 40px;
  color: var(--gray);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Nunito', sans-serif;
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
}

.mode-tab:hover:not(.active) {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* === DIFFICULTY FILTER === */
.difficulty-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  padding: 0 20px;
}

.diff-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 2px solid;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Nunito', sans-serif;
}

.diff-btn.all { border-color: var(--gray); color: var(--gray); background: transparent; }
.diff-btn.easy { border-color: #2d9e5a; color: #2d9e5a; background: transparent; }
.diff-btn.medium { border-color: #f0a500; color: #f0a500; background: transparent; }
.diff-btn.hard { border-color: var(--red); color: var(--red); background: transparent; }

.diff-btn.active.all { background: var(--gray); color: var(--navy); }
.diff-btn.active.easy { background: #2d9e5a; color: white; }
.diff-btn.active.medium { background: #f0a500; color: var(--navy); }
.diff-btn.active.hard { background: var(--red); color: white; }

/* === GRILLE DES CATÉGORIES === */
.categories-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.categories-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 20px;
  text-align: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.category-card {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,215,0,0.05), transparent);
  opacity: 0;
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 40px rgba(255,215,0,0.2);
}

.category-card:hover::before { opacity: 1; }

.card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.card-episodes {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 10px;
}
.card-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
}
.card-count span {
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

.card-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}

.card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* === QUIZ CONTAINER === */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* === QUIZ HEADER === */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.quiz-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quiz-category-badge {
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.4);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.quiz-difficulty-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.quiz-difficulty-badge.easy { background: rgba(45,158,90,0.2); color: #2d9e5a; }
.quiz-difficulty-badge.medium { background: rgba(240,165,0,0.2); color: #f0a500; }
.quiz-difficulty-badge.hard { background: rgba(230,57,70,0.2); color: var(--red); }
.quiz-difficulty-badge.all { background: rgba(173,181,189,0.2); color: var(--gray); }

/* === TIMER === */
.timer-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  min-width: 45px;
  text-align: center;
  transition: color 0.3s;
}
.timer.warning { color: #f0a500; animation: blink 0.5s infinite; }
.timer.danger { color: var(--red); animation: blink 0.3s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === BARRE DE PROGRESSION === */
.progress-section { margin-bottom: 24px; }

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 8px;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* === QUESTION CARD === */
.question-card {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.question-num {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.question-text {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--white);
}

/* === OPTIONS === */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .options-grid { grid-template-columns: 1fr; }
}

.option-btn {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(255,215,0,0.1);
  transform: translateX(4px);
}

.option-letter {
  background: rgba(255,215,0,0.2);
  color: var(--gold);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-family: 'Cinzel', serif;
}

.option-btn.correct {
  border-color: var(--green);
  background: rgba(45,158,90,0.2);
}
.option-btn.correct .option-letter {
  background: var(--green);
  color: white;
}

.option-btn.wrong {
  border-color: var(--red);
  background: rgba(230,57,70,0.2);
}
.option-btn.wrong .option-letter {
  background: var(--red);
  color: white;
}

.option-btn:disabled { cursor: not-allowed; }

/* === EXPLICATION === */
.explanation-box {
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s ease;
}
.explanation-box.show { display: block; }
.explanation-box p {
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.9;
}
.explanation-box strong {
  color: var(--gold);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === BOUTONS DE NAVIGATION === */
.quiz-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,215,0,0.4); }

.btn-secondary {
  background: transparent;
  color: var(--gray);
  border: 2px solid rgba(255,255,255,0.2);
}
.btn-secondary:hover { border-color: var(--white); color: var(--white); }

.btn-danger {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(230,57,70,0.4); }

/* === SCORE EN DIRECT === */
.score-display {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 16px 0;
}

.score-item {
  text-align: center;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
}

.score-item.correct-score { border: 1px solid var(--green); }
.score-item.wrong-score { border: 1px solid var(--red); }
.score-item.skip-score { border: 1px solid var(--gray); }

.score-num {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 900;
}
.correct-score .score-num { color: var(--green); }
.wrong-score .score-num { color: var(--red); }
.score-item .score-label { font-size: 0.75rem; color: var(--gray); }

/* === RÉSULTATS === */
.results-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.results-trophy {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.results-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 8px;
}

.results-subtitle {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 30px;
}

.results-score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 6px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  background: rgba(255,215,0,0.05);
  box-shadow: 0 0 40px rgba(255,215,0,0.2);
}

.score-percentage {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.score-fraction {
  font-size: 0.9rem;
  color: var(--gray);
  margin-top: 4px;
}

.rank-box {
  background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius);
  padding: 20px 30px;
  margin-bottom: 24px;
  display: inline-block;
}

.rank-label { font-size: 0.8rem; color: var(--gray); text-transform: uppercase; letter-spacing: 2px; }
.rank-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
}

.results-breakdown {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.breakdown-item {
  padding: 12px 20px;
  border-radius: 12px;
  min-width: 100px;
  border: 1px solid;
}
.breakdown-item.correct { border-color: var(--green); background: rgba(45,158,90,0.1); }
.breakdown-item.wrong { border-color: var(--red); background: rgba(230,57,70,0.1); }
.breakdown-item.skipped { border-color: var(--gray); background: rgba(173,181,189,0.1); }

.breakdown-num {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 900;
  display: block;
}
.correct .breakdown-num { color: var(--green); }
.wrong .breakdown-num { color: var(--red); }
.skipped .breakdown-num { color: var(--gray); }
.breakdown-lbl { font-size: 0.8rem; color: var(--gray); }

/* === ACCUEIL - SECTION COMMENT ÇA MARCHE === */
.how-section {
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,215,0,0.15);
  border-bottom: 1px solid rgba(255,215,0,0.15);
  padding: 50px 20px;
  text-align: center;
  margin-bottom: 60px;
}

.how-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 30px;
}

.how-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.how-item { padding: 20px; }
.how-icon { font-size: 2.5rem; margin-bottom: 12px; }
.how-title {
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
  font-size: 1rem;
}
.how-desc { font-size: 0.85rem; color: var(--gray); }

/* === FOOTER === */
.site-footer {
  background: linear-gradient(135deg, #0a1520, #0d1b2a);
  border-top: 3px solid var(--gold);
  padding: 40px 20px 20px;
  text-align: center;
  margin-top: 60px;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--gray);
  font-size: 0.85rem;
  max-width: 500px;
  margin: 0 auto 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold); }

.footer-affiliate {
  background: rgba(255,215,0,0.05);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  margin: 16px auto;
  max-width: 600px;
  font-size: 0.85rem;
  color: var(--gray);
}

.footer-affiliate a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
}

.footer-copyright {
  font-size: 0.75rem;
  color: rgba(173,181,189,0.5);
  margin-top: 16px;
}

/* === PAGES TABS (menu de contenu) === */
.page { display: none; }
.page.active { display: block; }

/* === ÉCRAN DE CHARGEMENT DU QUIZ === */
.quiz-loading {
  text-align: center;
  padding: 80px 20px;
}
.quiz-loading .spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,215,0,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === MODAL de confirmation === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--navy-mid);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.modal h3 { font-family: 'Cinzel', serif; color: var(--gold); margin-bottom: 12px; }
.modal p { color: var(--gray); font-size: 0.9rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* === GOOGLE TRANSLATE WIDGET === */
.translate-bar {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,215,0,0.1);
  padding: 6px 20px;
  text-align: right;
  font-size: 0.8rem;
  color: var(--gray);
}
.translate-bar > * { vertical-align: middle; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .hero { padding: 40px 16px 30px; }
  .hero-stats { gap: 20px; }
  .question-card { padding: 20px 16px; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr; }
  .mode-tabs { flex-direction: column; }
  .results-breakdown { gap: 10px; }
}
