:root {
  --bg: #2b2419;
  --fg: #f3ece0;
  --card: #3a3024;
  --surface: #423728;
  --muted: #5a4d3d;
  --muted-fg: #aa9b85;
  --border: #4d4031;
  --primary: #e8b94a;
  --primary-fg: #2b2419;
  --accent: #e07b3a;
  --wave: #2c8df0;
  --orange-money: #ff7a00;
  --yas: #2bb673;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Fredoka', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}
h1, h2, h3 { font-family: 'Fredoka', sans-serif; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }

/* Header */
/* .header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 1rem;
} */
.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo img { width: 48px; height: 48px; object-fit: contain; }
.logo-title { display: block; font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.logo-sub { font-size: 0.6rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.1em; }

.main-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav-btn, .auth-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.1rem; border-radius: 9999px;
  background: var(--surface); color: var(--fg);
  font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--border); transition: all 0.2s;
}
.nav-btn:hover, .auth-btn:hover {
  background: var(--primary); color: var(--primary-fg);
  transform: translateY(-1px);
}

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem; }
.layout { display: grid; grid-template-columns: 200px 1fr 240px; gap: 1rem; }

/* Sidebar */
.section-title {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-fg);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.category-list { display: flex; flex-direction: column; gap: 0.25rem; }
.category-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem; border-radius: var(--radius);
  cursor: pointer; transition: background 0.2s;
}
.category-item:hover { background: var(--surface); }
.category-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; transition: all 0.2s;
}
.category-item:hover .category-icon { background: var(--primary); border-color: var(--primary); }
.category-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--muted-fg); }
.category-item:hover .category-label { color: var(--fg); }

/* Hero */
.hero {
  position: relative; border-radius: var(--radius);
  overflow: hidden; min-height: 400px;
}
.hero img { width: 100%; height: 100%; min-height: 400px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(43,36,25,0.85), rgba(43,36,25,0.1));
}
.hero-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 1rem;
}
.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.hero-content p { margin-top: 0.5rem; opacity: 0.9; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.hero-play-btn {
  margin-top: 1.5rem;
  padding: 0.75rem 2.5rem; border-radius: 9999px;
  background: rgba(80,70,55,0.7); color: var(--primary);
  font-weight: 700; font-size: 1.3rem;
  backdrop-filter: blur(4px);
  border: 2px solid var(--primary);
  transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.hero-play-btn:hover { background: var(--primary); color: var(--primary-fg); transform: scale(1.05); }

/* Featured */
.featured-list { display: flex; flex-direction: column; gap: 0.75rem; }
.featured-card {
  position: relative; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  display: block; transition: all 0.3s;
}
.featured-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.featured-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.featured-overlay {
  position: absolute; inset: 0;
  background: rgba(43,36,25,0.3);
  display: flex; align-items: center; justify-content: center;
}
.play-btn {
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: rgba(80,70,55,0.7); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; backdrop-filter: blur(4px);
  transition: all 0.3s;
}
.featured-card:hover .play-btn { background: var(--primary); color: var(--primary-fg); transform: scale(1.1); }
.featured-title {
  position: absolute; bottom: 0.5rem; left: 0.5rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Download */
.download-section {
  margin-top: 1.5rem; padding: 2rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.download-section h2 { font-size: 1.2rem; font-weight: 700; }
.subtitle { color: var(--muted-fg); font-size: 0.9rem; margin: 0.4rem 0 1.2rem; }
.payment-grid {
  display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap;
}
.payment-btn {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.5rem; border-radius: var(--radius);
  font-weight: 600; min-width: 200px; justify-content: center;
  transition: all 0.2s; color: white; font-size: 1rem;
}
.payment-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.pb-small { font-size: 0.7rem; opacity: 0.85; text-align: left; }
.pb-name { font-weight: 700; text-align: left; }
.payment-wave { background: var(--wave); }
.payment-orange { background: var(--orange-money); color: #2b2419; }
.payment-yas { background: var(--yas); }
.footnote { color: var(--muted-fg); font-size: 0.75rem; margin-top: 1rem; }

/* Footer */
.footer {
  text-align: center; padding: 1.5rem;
  color: var(--muted-fg); font-size: 0.75rem;
  border-top: 1px solid var(--border); margin-top: 2rem;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(43,36,25,0.85);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1.5rem;
  max-width: 380px; width: 100%;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.modal-header h3 { font-weight: 700; }
.modal-close { background: transparent; color: var(--muted-fg); font-size: 1.2rem; }
.modal-close:hover { color: var(--fg); }
.amount-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem; text-align: center; margin-bottom: 1rem;
}
.amount-box p { color: var(--muted-fg); font-size: 0.85rem; }
.amount { color: var(--primary); font-size: 1.6rem; font-weight: 700; margin-top: 0.25rem; }
.modal label { display: block; font-size: 0.85rem; color: var(--muted-fg); margin-bottom: 0.4rem; }
.modal input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); font-family: inherit; font-size: 1rem;
}
.modal input:focus { outline: none; border-color: var(--primary); }
.confirm-btn {
  width: 100%; padding: 0.85rem; margin-top: 1rem;
  border-radius: var(--radius); font-weight: 700;
  background: var(--primary); color: var(--primary-fg);
  transition: all 0.2s;
}
.confirm-btn:disabled { background: var(--muted); color: var(--muted-fg); cursor: not-allowed; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--primary); border-top-color: transparent;
  border-radius: 50%; margin: 1.5rem auto 1rem;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { text-align: center; font-weight: 600; }
.loading-sub { text-align: center; color: var(--muted-fg); font-size: 0.85rem; margin-top: 0.25rem; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(43,182,115,0.2); color: var(--yas);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 1rem auto;
}
.success-title { text-align: center; font-weight: 700; font-size: 1.1rem; }
.success-sub { text-align: center; color: var(--muted-fg); font-size: 0.85rem; margin: 0.25rem 0 1rem; }
.download-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-fg);
  font-weight: 700; margin: 0 auto; width: fit-content;
}
.download-btn { display: flex; justify-content: center; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .main-nav { width: 100%; justify-content: center; }
}

/* Page secondaires */
.back-link {
  display: inline-block; color: var(--muted-fg);
  font-size: 0.85rem; margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--fg); }
.page-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-sub { color: var(--muted-fg); margin-bottom: 2rem; }

.grid-3 {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.content-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: all 0.2s;
}
.content-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.card-emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.content-card h3 { font-weight: 700; margin-bottom: 0.5rem; }
.content-card p { color: var(--muted-fg); font-size: 0.9rem; margin-bottom: 1rem; }
.price-tag {
  display: inline-block; padding: 0.3rem 0.75rem;
  border-radius: 9999px; background: var(--primary);
  color: var(--primary-fg); font-weight: 700; font-size: 0.8rem;
}

/* Events */
.event-list { display: flex; flex-direction: column; gap: 1rem; }
.event-card {
  display: flex; gap: 1.5rem; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: all 0.2s;
}
.event-card:hover { border-color: var(--primary); }
.event-date {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border-radius: var(--radius);
  padding: 0.75rem 1rem; min-width: 70px;
}
.event-date .day { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.event-date .month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-fg); }
.event-card h3 { font-weight: 700; margin-bottom: 0.25rem; }
.event-card p { color: var(--muted-fg); font-size: 0.9rem; margin-bottom: 0.5rem; }
.event-loc { font-size: 0.8rem; color: var(--primary); }

/* Auth */
.container.narrow { max-width: 440px; }
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 2rem;
}
.auth-card h1 { text-align: center; font-weight: 700; margin-bottom: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-card label { font-size: 0.85rem; color: var(--muted-fg); margin-top: 0.5rem; }
.auth-card input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); font-family: inherit; font-size: 1rem;
}
.auth-card input:focus { outline: none; border-color: var(--primary); }
.auth-card .confirm-btn { margin-top: 1rem; }
.auth-toggle { text-align: center; margin-top: 1rem; color: var(--muted-fg); font-size: 0.9rem; }
.auth-toggle button { background: transparent; color: var(--primary); font-weight: 600; padding: 0 0.25rem; }
.auth-toggle button:hover { text-decoration: underline; }

/* ===== Animations ===== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes float-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.animate-fade-in    { animation: fade-in 0.6s ease-out both; }
.animate-scale-in   { animation: scale-in 0.3s ease-out both; }
.animate-slide-in   { animation: slide-in-right 0.5s ease-out both; }
.hover-scale        { transition: transform 0.2s ease; }
.hover-scale:hover  { transform: scale(1.05); }

/* Stagger entrance for homepage elements */
.hero            { animation: fade-in 0.6s ease-out both; }
/* .sidebar         { animation: fade-in 0.6s ease-out 0.1s both; } */
.featured        { animation: fade-in 0.6s ease-out 0.2s both; }
.download-section{ animation: fade-in 0.6s ease-out 0.3s both; }
.hero-content h1 { animation: fade-in 0.6s ease-out 0.3s both; }
.hero-content p  { animation: fade-in 0.6s ease-out 0.45s both; }
.hero-play-btn   { animation: scale-in 0.5s ease-out 0.6s both, float-pulse 3s ease-in-out 2s infinite; }

.featured-card   { animation: fade-in 0.5s ease-out both; }
.featured-card:nth-child(1){ animation-delay: .25s; }
.featured-card:nth-child(2){ animation-delay: .35s; }
.featured-card:nth-child(3){ animation-delay: .45s; }
.featured-card:nth-child(4){ animation-delay: .55s; }
.featured-card:nth-child(5){ animation-delay: .65s; }

.category-item   { animation: slide-in-right 0.4s ease-out both; }
.category-item:nth-child(1){ animation-delay: .15s; }
.category-item:nth-child(2){ animation-delay: .2s; }
.category-item:nth-child(3){ animation-delay: .25s; }
.category-item:nth-child(4){ animation-delay: .3s; }
.category-item:nth-child(5){ animation-delay: .35s; }
.category-item:nth-child(6){ animation-delay: .4s; }

.modal           { animation: scale-in 0.25s ease-out both; }
.content-card    { animation: fade-in 0.5s ease-out both; }
.event-card      { animation: slide-in-right 0.5s ease-out both; }
.event-card:nth-child(2){ animation-delay: .1s; }
.event-card:nth-child(3){ animation-delay: .2s; }

/* ===== Game detail page ===== */
.container.narrow-md { max-width: 900px; }

.game-detail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; overflow: hidden;
}
.game-detail-media { position: relative; }
.game-detail-media img {
  width: 100%; height: 360px; object-fit: cover; display: block;
}
.game-detail-overlay {
  position: absolute; inset: 0;
  background: rgba(43,36,25,0.4);
  display: flex; align-items: center; justify-content: center;
}
.play-btn-xl {
  width: 5rem; height: 5rem; font-size: 2rem;
  cursor: pointer; border: none;
}
.game-detail-body { padding: 2rem; }
.game-detail-body h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; }
.game-desc { color: var(--muted-fg); margin-bottom: 1.25rem; line-height: 1.6; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag {
  padding: 0.35rem 0.85rem; border-radius: 9999px;
  background: var(--surface); color: var(--fg);
  font-size: 0.75rem; font-weight: 600;
}

.game-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
  padding: 1rem; background: var(--surface);
  border-radius: var(--radius);
}
.stat { text-align: center; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; }

.related-section { margin-top: 2.5rem; }
.related-img {
  width: 100%; height: 130px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 0.75rem;
}

/* Game launcher modal */
.game-launcher { max-width: 720px; }
.game-frame {
  aspect-ratio: 16/9;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-top: 0.5rem;
}
.game-loading { text-align: center; }


.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

/* bouton hamburger visible */
.navbar-toggler {
  border: none;
}


/* centrer menu mobile */
@media (max-width: 991px) {
  .navbar-nav {
    gap: 10px;
    margin-top: 15px;
  }

  .auth-btn {
    margin-top: 15px;
  }
}

/* Desktop = normal */
/* Desktop = visible */
.sidebar {
  display: block;
  z-index: 9999;
}

/* Mobile */
@media (max-width: 991px) {

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%; /* caché */
    width: 260px;
    height: 100%;
    background: #2b2419;
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding: 20px;

    display: block !important; /* force l'affichage interne */
  }

  .sidebar.active {
    left: 0; /* visible */
  }
}
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9998;
}

#overlay.active {
  display: block;
}
