@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --bg-void: #080810;
  --bg-deep: #0d0d1a;
  --bg-card: #11111f;
  --gold: #c9a84c;
  --gold-light: #e8c96d;
  --gold-dim: #7a6030;
  --text-bright: #f0e8d5;
  --text-muted: #7a7060;
  --border: rgba(201, 168, 76, 0.2);
  --border-hover: rgba(201, 168, 76, 0.6);
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Crimson Text', Georgia, serif;
  background-color: var(--bg-void);
  color: var(--text-bright);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201,168,76,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(224,92,42,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
nav.tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg-void);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

nav.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover { color: var(--gold-light); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── HEADER ── */
header {
  text-align: center;
  padding: 56px 20px 40px;
  position: relative;
  z-index: 1;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 60px rgba(201,168,76,0.25);
  animation: fadeDown 0.8s ease both;
}

#subtitle {
  font-family: 'Crimson Text', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 10px;
  letter-spacing: 0.04em;
  animation: fadeDown 0.8s 0.1s ease both;
}

.ornament {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-top: 28px;
  animation: fadeDown 0.8s 0.2s ease both;
}

.ornament::before,
.ornament::after {
  content: '';
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.ornament span { color: var(--gold-dim); font-size: 0.8rem; }

/* ── APP ── */
#app {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
}

/* ── ONGLETS ── */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.4s ease both; }

/* ── SECTIONS ── */
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: 'Crimson Text', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 28px;
}

/* ── TOP 10 ── */
.top10-section { margin-bottom: 16px; }

.top10-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top10-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.top10-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.top10-card:hover { border-color: var(--border-hover); transform: translateX(4px); }
.top10-card:hover::before { opacity: 1; }

.top10-rank {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold-dim);
  min-width: 32px;
  text-align: center;
  line-height: 1;
}

.top10-card:nth-child(1) .top10-rank { color: var(--gold); font-size: 1.6rem; }
.top10-card:nth-child(2) .top10-rank { color: #c0c0c0; }
.top10-card:nth-child(3) .top10-rank { color: #cd7f32; }

.top10-card img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.top10-info { flex: 1; min-width: 0; text-align: left; }

.top10-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top10-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

/* ── QUIZ ── */
.quiz-section { text-align: center; }

.question { animation: fadeUp 0.5s ease both; padding: 20px 0; }

.question-text {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 32px;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.option-btn {
  background: var(--bg-card);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 28px;
  font-family: 'Crimson Text', serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.option-btn:hover {
  border-color: var(--border-hover);
  color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201,168,76,0.1);
}

.progress {
  font-family: 'Cinzel', serif;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.restart-btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 14px 40px;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 24px;
}

.restart-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201,168,76,0.12);
}

/* ── FILTRES ── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
  text-align: left;
}

.filter-group { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }

.filter-toggle {
  width: 100%;
  background: var(--bg-card);
  border: none;
  color: var(--text-bright);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.filter-toggle:hover { background: #15152a; }
.chevron { font-size: 0.65rem; color: var(--gold-dim); }

.filter-options {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.filter-options.hidden { display: none; }

.filter-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Crimson Text', serif;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover { border-color: var(--gold-dim); color: var(--text-bright); }
.filter-chip.active { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.08); }

.filter-options input[type="text"] {
  width: 100%;
  background: var(--bg-void);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-bright);
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-options input[type="text"]:focus { border-color: var(--gold-dim); }

.filter-hint {
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
  margin-top: 4px;
}

.search-bar { margin-top: 4px; }

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-bright);
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  padding: 14px 20px;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: var(--gold-dim); }

/* ── RÉSULTATS ── */
.results-grid,
.mods-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.mod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.2s;
  animation: fadeUp 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.mod-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.mod-card:hover { border-color: var(--border-hover); transform: translateX(4px); }
.mod-card:hover::before { opacity: 1; }

.mod-card img {
  width: 54px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.mod-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.mod-info p {
  font-family: 'Crimson Text', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.mod-info-link {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 1px;
  cursor: pointer;
}

/* ── FALLBACK ── */
.fallback-notice {
  background: rgba(201,168,76,0.06);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: 4px;
  padding: 14px 18px;
  font-family: 'Crimson Text', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
  text-align: left;
}

.fallback-notice strong { color: var(--gold); font-style: normal; }

/* ── LOAD MORE ── */
.load-more {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 40px;
}

.load-more:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── PAGE DÉTAIL ── */
#detail-page {
  position: fixed;
  inset: 0;
  background: var(--bg-void);
  z-index: 200;
  overflow-y: auto;
  animation: fadeUp 0.35s ease both;
}

#detail-page.detail-hidden { display: none; }

.detail-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.detail-back {
  background: transparent;
  border: none;
  color: var(--gold-dim);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.detail-back:hover { color: var(--gold); }

.detail-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.detail-hero img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-hero-info h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-align: left;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.detail-hero-info p {
  font-family: 'Crimson Text', serif;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
}

.detail-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  margin: 40px 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.detail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
  text-align: center;
  transition: border-color 0.2s;
}

.detail-stat:hover { border-color: var(--gold-dim); }

.detail-stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stat-badge {
  font-size: 0.55rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}

.detail-stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.detail-tag {
  background: rgba(201,168,76,0.07);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 2px;
}

.detail-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 16px;
}

.detail-description {
  font-family: 'Crimson Text', serif;
  font-size: 1.05rem;
  color: var(--text-bright);
  line-height: 1.8;
  margin-bottom: 48px;
}

.detail-description a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
}

.detail-description a:hover { color: var(--gold-light); }

.detail-description code {
  font-family: monospace;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--gold-light);
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-cta {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 16px 40px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

.detail-cta:hover {
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
  box-shadow: 0 0 24px rgba(201,168,76,0.12);
}

.detail-share {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.detail-share:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 14px 28px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
  white-space: nowrap;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── LOADING ── */
.loading {
  font-family: 'Cinzel', serif;
  color: var(--gold-dim);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  padding: 40px 0;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

footer p {
  font-family: 'Crimson Text', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
}

footer a {
  color: var(--gold-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
}

footer a:hover { color: var(--gold); }

/* ── ANIMATIONS ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
/* ── QUIZ SECTION ── */
.quiz-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 32px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.quiz-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
/* ── GUIDES ── */
.guides-section { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; }
.guide-card {
  background: var(--card-bg, #1a1a2e);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeUp 0.4s ease both;
}
.guide-card:hover { border-color: rgba(201,168,76,0.5); transform: translateY(-3px); }
.guide-emoji { font-size: 2rem; margin-bottom: 12px; }
.guide-card h3 { font-size: 1rem; color: var(--gold, #c9a84c); margin-bottom: 8px; }
.guide-card p { font-size: 0.85rem; opacity: 0.7; line-height: 1.5; margin-bottom: 12px; }
.guide-lire { font-size: 0.8rem; color: var(--gold, #c9a84c); }

/* ── MODALES ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #12121f;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 16px;
  padding: 36px;
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.modal-box h3 { color: var(--gold, #c9a84c); margin-bottom: 16px; font-size: 1.3rem; }
.modal-box h4 { color: var(--gold, #c9a84c); margin: 20px 0 8px; font-size: 1rem; }
.modal-box p { opacity: 0.85; line-height: 1.7; margin-bottom: 10px; font-size: 0.92rem; }
.modal-box a { color: var(--gold, #c9a84c); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.2rem; cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover { color: white; }

/* ── FOOTER LINKS ── */
.footer-links { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.footer-link-btn {
  background: none; border: none;
  color: rgba(201,168,76,0.7);
  font-size: 0.8rem; cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}
.footer-link-btn:hover { color: var(--gold, #c9a84c); }
.footer-sep { color: rgba(255,255,255,0.2); font-size: 0.8rem; }