/* =============================================
   DOFUS FAN SITE - Retro MMO Community Theme
   ============================================= */

/* --- Custom Properties --- */
:root {
  --parchment: #F5E6C8;
  --parchment-dark: #E8D5A8;
  --parchment-darker: #D9C28A;
  --orange: #FF6B35;
  --orange-dark: #E85520;
  --gold: #FFD700;
  --gold-dark: #E6B800;
  --blue: #2B4F8C;
  --blue-light: #3A6BB5;
  --green: #6B8E23;
  --green-light: #8AAB2E;
  --brown: #3D2B1F;
  --brown-light: #5C3D2E;
  --cream: #FFF8E7;
  --red: #C0392B;
  --shadow-pixel: 3px 3px 0px rgba(61, 43, 31, 0.4);
  --shadow-card: 4px 4px 0px rgba(61, 43, 31, 0.3);
  --border-pixel: 2px solid var(--brown);
  --radius-sm: 4px;
  --radius-md: 8px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--parchment);
  color: var(--brown);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background texture pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(43, 79, 140, 0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23b8924a' fill-opacity='0.06'%3E%3Crect x='0' y='0' width='2' height='2'/%3E%3Crect x='20' y='20' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: 'Fredoka One', 'Arial Black', sans-serif;
  font-weight: 400;
  line-height: 1.2;
  color: var(--brown);
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--orange);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Utility Classes --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--brown);
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 0px var(--parchment-darker);
  letter-spacing: 0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--brown-light);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  font-style: italic;
}

.pixel-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  margin: 0.75rem auto 1rem;
  position: relative;
}

.pixel-divider::before,
.pixel-divider::after {
  content: '';
  position: absolute;
  top: 0;
  width: 8px;
  height: 4px;
  background: var(--orange-dark);
}

.pixel-divider::before { left: -8px; }
.pixel-divider::after { right: -8px; }

/* --- Pixel Border Mixin --- */
.pixel-border {
  border: var(--border-pixel);
  box-shadow: var(--shadow-card);
  position: relative;
}

.pixel-border::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(61, 43, 31, 0.15);
  pointer-events: none;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.05rem;
  border: 2px solid var(--brown);
  box-shadow: var(--shadow-pixel);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px rgba(61, 43, 31, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: var(--brown);
  transform: translateY(-2px);
  box-shadow: 4px 5px 0px rgba(61, 43, 31, 0.4);
}

.btn-secondary {
  background: var(--parchment);
  color: var(--blue);
}

.btn-secondary:hover {
  background: var(--blue);
  color: white;
  transform: translateY(-2px);
}

/* ===========================================
   NAVIGATION
   =========================================== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, var(--brown) 0%, var(--brown-light) 100%);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 0 var(--brown), 0 5px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

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

.nav-logo {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.7rem;
  color: var(--gold);
  text-shadow: 2px 2px 0px var(--orange-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.03em;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.9rem;
  color: var(--parchment);
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border: 2px solid transparent;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: 2px solid var(--parchment);
  border-radius: var(--radius-sm);
}

.nav-hamburger span {
  width: 22px;
  height: 2px;
  background: var(--parchment);
  display: block;
  transition: 0.3s;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--brown);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 4px solid var(--gold);
    gap: 0.5rem;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    text-align: center;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
  }
}

/* ===========================================
   HERO SECTION
   =========================================== */
#hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(61, 43, 31, 0.82) 0%, rgba(43, 26, 14, 0.90) 50%, rgba(26, 15, 8, 0.96) 100%),
    url('../images/alphacoders-1049134-dark-fantasy-castle-bakulin.jpg') center center / cover no-repeat;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  opacity: 0.4;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text {
  animation: heroSlideIn 0.8s ease-out;
}

@keyframes heroSlideIn {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

.hero-badge {
  display: inline-block;
  background: var(--blue);
  color: var(--gold);
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gold);
  box-shadow: 2px 2px 0 var(--brown);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  color: #F5E6C8;
  text-shadow: 3px 3px 0px #3D2B1F, 6px 6px 0px rgba(61,43,31,0.5);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.hero-title span {
  color: var(--gold);
  text-shadow: 3px 3px 0px #B8860B, 6px 6px 0px rgba(255,215,0,0.4);
}

.hero-subtitle {
  font-family: 'Fredoka One', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: #C9A96E;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.hero-tagline {
  font-size: 1rem;
  color: #D4B896;
  font-style: italic;
  margin-bottom: 2rem;
  max-width: 440px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-mascot {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: heroSlideIn 0.8s ease-out 0.2s both;
}

.hero-mascot-wrapper {
  position: relative;
  width: 340px;
  height: 340px;
}

.hero-mascot-glow {
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 180, 50, 0.5) 0%, rgba(200, 120, 20, 0.25) 40%, transparent 70%);
  animation: mascotGlow 3s ease-in-out infinite;
}

@keyframes mascotGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.hero-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: mascotFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 32px rgba(255, 180, 50, 0.6)) drop-shadow(0 0 16px rgba(200, 120, 20, 0.4));
  border-radius: var(--radius-md);
}

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

.hero-stats-banner {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  border: 2px solid var(--gold);
  box-shadow: 3px 3px 0 var(--brown);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 1.5rem;
  white-space: nowrap;
}

.hero-stat {
  font-family: 'Fredoka One', sans-serif;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.hero-stat span {
  color: white;
  font-size: 0.8rem;
  font-family: 'Nunito', sans-serif;
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.6;
  animation: bounceDown 2s ease-in-out infinite;
}

.scroll-hint span {
  font-size: 0.8rem;
  color: #C9A96E;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 20px 80px;
  }

  .hero-mascot-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-stats-banner {
    gap: 1rem;
    font-size: 0.8rem;
  }

  .hero-tagline {
    margin: 0 auto 2rem;
  }
}

/* ===========================================
   SECTION WRAPPERS
   =========================================== */
section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 1rem;
}

.section-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Alternating section backgrounds */
.section-alt {
  background: linear-gradient(180deg, var(--parchment-dark) 0%, var(--parchment) 100%);
}

.section-dark {
  background: linear-gradient(180deg, var(--brown) 0%, var(--brown-light) 100%);
  color: var(--parchment);
}

.section-dark .section-title,
.section-dark h3 {
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--brown);
}

.section-dark .section-subtitle {
  color: var(--parchment-dark);
}

/* Pixel wave separator */
.pixel-wave {
  width: 100%;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0px,
    var(--gold) 8px,
    var(--orange) 8px,
    var(--orange) 16px
  );
  opacity: 0.4;
}

/* ===========================================
   BESTIAIRE SECTION
   =========================================== */
#bestiaire {
  background: var(--parchment);
}

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

.monster-card {
  background: linear-gradient(145deg, var(--cream), var(--parchment));
  border: 2px solid var(--parchment-darker);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0px var(--parchment-darker), 0 0 0 1px rgba(61,43,31,0.1);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  position: relative;
}

.monster-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(255,215,0,0);
  transition: box-shadow 0.25s ease;
}

.monster-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--orange);
  box-shadow:
    4px 4px 0px var(--orange-dark),
    0 0 20px rgba(255, 107, 53, 0.35),
    0 0 40px rgba(255, 215, 0, 0.15);
}

.monster-card:hover::after {
  box-shadow: inset 0 0 0 2px rgba(255,215,0,0.4);
}

.monster-img-wrap {
  height: 160px;
  background: linear-gradient(135deg, var(--parchment-dark), var(--parchment-darker));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 2px solid var(--parchment-darker);
}

.monster-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.monster-card:hover .monster-img-wrap img {
  transform: scale(1.08);
}

.monster-img-wrap .monster-level {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--blue);
  color: var(--gold);
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--gold);
}

.monster-svg-wrap {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--parchment-dark), var(--parchment-darker));
  border-bottom: 2px solid var(--parchment-darker);
  position: relative;
}

.monster-svg-wrap svg {
  width: 110px;
  height: 110px;
  transition: transform 0.3s ease;
}

.monster-card:hover .monster-svg-wrap svg {
  transform: scale(1.1);
}

.monster-info {
  padding: 1rem 1rem 0.8rem;
}

.monster-name {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.25rem;
  color: var(--brown);
  margin-bottom: 0.15rem;
}

.monster-zone {
  font-size: 0.78rem;
  color: var(--brown-light);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.monster-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.6rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--brown-light);
}

.stat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.stat-label {
  font-weight: 700;
  color: var(--brown);
}

.monster-family {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.family-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid;
}

.family-badge.boss {
  background: rgba(192, 57, 43, 0.1);
  color: var(--red);
  border-color: var(--red);
}

.family-badge.common {
  background: rgba(107, 142, 35, 0.1);
  color: var(--green);
  border-color: var(--green);
}

.family-badge.rare {
  background: rgba(43, 79, 140, 0.1);
  color: var(--blue);
  border-color: var(--blue);
}

/* Bouftou SVG monster illustration */
.bouftou-svg { color: #8B4513; }

/* ===========================================
   CLASSES SECTION
   =========================================== */
#classes {
  background: linear-gradient(180deg, var(--parchment-dark) 0%, var(--parchment) 100%);
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

@media (max-width: 900px) {
  .classes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .classes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.class-card {
  background: linear-gradient(145deg, var(--cream), var(--parchment));
  border: 2px solid var(--parchment-darker);
  border-radius: var(--radius-md);
  box-shadow: 3px 3px 0 var(--parchment-darker);
  padding: 1.4rem 1rem 1.2rem;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.class-card:hover {
  transform: translateY(-6px) scale(1.04);
  border-color: var(--gold);
  box-shadow: 3px 3px 0 var(--gold-dark), 0 0 16px rgba(255, 215, 0, 0.3);
}

.class-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  transition: all 0.25s ease;
}

.class-card:hover .class-icon {
  transform: rotate(10deg) scale(1.1);
}

.class-icon svg {
  width: 32px;
  height: 32px;
}

.class-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* Color badge icons (for classes without image assets) */
.class-icon-badge {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  transition: all 0.25s ease;
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.1;
  padding: 4px;
}

.class-card:hover .class-icon-badge {
  transform: rotate(10deg) scale(1.1);
}

.class-name {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.1rem;
  color: var(--brown);
  margin-bottom: 0.3rem;
}

.class-role {
  font-size: 0.72rem;
  color: var(--brown-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.class-element {
  margin-top: 0.5rem;
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
}

/* Class color themes */
.class-fire .class-icon { border-color: #E74C3C; background: rgba(231,76,60,0.1); color: #E74C3C; }
.class-water .class-icon { border-color: #3498DB; background: rgba(52,152,219,0.1); color: #3498DB; }
.class-earth .class-icon { border-color: #8B6914; background: rgba(139,105,20,0.1); color: #8B6914; }
.class-air .class-icon { border-color: #27AE60; background: rgba(39,174,96,0.1); color: #27AE60; }
.class-neutral .class-icon { border-color: var(--brown-light); background: rgba(92,61,46,0.1); color: var(--brown-light); }
.class-shadow .class-icon { border-color: #8E44AD; background: rgba(142,68,173,0.1); color: #8E44AD; }

/* Per-class color badge themes */
.class-feca .class-icon-badge    { border-color: #7D5A3C; background: rgba(125,90,60,0.15); color: #7D5A3C; }
.class-osamodas .class-icon-badge { border-color: #3A8C3A; background: rgba(58,140,58,0.15); color: #2D6E2D; }
.class-eniripsa .class-icon-badge { border-color: #C8A800; background: rgba(200,168,0,0.15); color: #A88800; }
.class-iop .class-icon-badge      { border-color: #D04A14; background: rgba(208,74,20,0.15); color: #D04A14; }
.class-cra .class-icon-badge      { border-color: #2B6CB0; background: rgba(43,108,176,0.15); color: #2B6CB0; }
.class-sadida .class-icon-badge   { border-color: #5A7A2A; background: rgba(90,122,42,0.15); color: #5A7A2A; }
.class-sacrieur .class-icon-badge { border-color: #C0392B; background: rgba(192,57,43,0.15); color: #C0392B; }
.class-sram .class-icon-badge     { border-color: #5B2C6F; background: rgba(91,44,111,0.15); color: #5B2C6F; }
.class-xelor .class-icon-badge    { border-color: #5BA3C9; background: rgba(91,163,201,0.15); color: #4A8FB5; }
.class-pandawa .class-icon-badge  { border-color: #C47A2A; background: rgba(196,122,42,0.15); color: #C47A2A; }
.class-enutrof .class-icon-badge  { border-color: #B8860B; background: rgba(184,134,11,0.15); color: #8B6914; }

/* ===========================================
   GALLERIE SECTION
   =========================================== */
#gallerie {
  background: var(--brown);
}

#gallerie .section-title {
  color: var(--gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 215, 0, 0.3);
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: all 0.25s ease;
}

.gallery-item.large {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(61,43,31,0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-caption {
  color: var(--parchment);
  font-family: 'Fredoka One', sans-serif;
  font-size: 1rem;
  text-shadow: 1px 1px 0 var(--brown);
}

.gallery-zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  transition: all 0.25s ease;
  background: rgba(255,215,0,0.9);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover .gallery-zoom-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-item.large {
    grid-column: 1 / -1;
  }
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border: 3px solid var(--gold);
  box-shadow: 0 0 60px rgba(255,215,0,0.2);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  box-shadow: var(--shadow-pixel);
  font-weight: 700;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--parchment);
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.1rem;
  background: rgba(61,43,31,0.85);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
}

/* ===========================================
   ACTUALITES SECTION
   =========================================== */
#actualites {
  background: var(--parchment);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--cream);
  border: 2px solid var(--parchment-darker);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 var(--parchment-darker);
  overflow: hidden;
  transition: all 0.25s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--orange);
  box-shadow: 4px 4px 0 var(--orange-dark);
}

.news-card-header {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-category {
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-date {
  font-size: 0.78rem;
  color: rgba(245, 230, 200, 0.7);
}

.news-card-body {
  padding: 1.2rem;
}

.news-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  color: var(--brown);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.news-excerpt {
  font-size: 0.88rem;
  color: var(--brown-light);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.news-read-more {
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.88rem;
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.news-read-more:hover {
  color: var(--gold-dark);
  border-color: var(--gold-dark);
}

.news-tag {
  display: inline-block;
  background: rgba(107,142,35,0.12);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 3px;
  font-size: 0.7rem;
  padding: 2px 7px;
  margin-right: 4px;
  margin-bottom: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===========================================
   LIENS UTILES SECTION
   =========================================== */
#liens {
  background: linear-gradient(180deg, var(--parchment-dark) 0%, var(--parchment) 100%);
}

.liens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.lien-card {
  background: var(--cream);
  border: 2px solid var(--parchment-darker);
  border-radius: var(--radius-md);
  box-shadow: 3px 3px 0 var(--parchment-darker);
  padding: 1.2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.lien-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 3px 3px 0 var(--blue);
  color: inherit;
}

.lien-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid;
}

.lien-icon svg {
  width: 22px;
  height: 22px;
}

.lien-info h4 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1rem;
  color: var(--brown);
  margin-bottom: 0.2rem;
}

.lien-info p {
  font-size: 0.8rem;
  color: var(--brown-light);
  line-height: 1.4;
}

.lien-arrow {
  margin-left: auto;
  color: var(--parchment-darker);
  transition: all 0.2s ease;
  flex-shrink: 0;
  align-self: center;
}

.lien-card:hover .lien-arrow {
  color: var(--blue);
  transform: translateX(4px);
}

/* ===========================================
   FOOTER
   =========================================== */
footer {
  background: linear-gradient(180deg, var(--brown) 0%, #2A1A10 100%);
  border-top: 4px solid var(--gold);
  padding: 3rem 0 2rem;
  position: relative;
  z-index: 1;
}

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

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.footer-brand h3 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--orange-dark);
  margin-bottom: 0.8rem;
}

.footer-brand p {
  color: rgba(245, 230, 200, 0.7);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-col h4 {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul a {
  color: rgba(245, 230, 200, 0.7);
  font-size: 0.88rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(245, 230, 200, 0.4);
}

.footer-nostalgic {
  font-family: 'Fredoka One', sans-serif;
  font-size: 0.9rem;
  color: var(--orange);
  letter-spacing: 0.03em;
}

.footer-heart {
  color: var(--red);
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================================
   PARTICLES
   =========================================== */
.particle {
  position: absolute;
  border-radius: 2px;
  pointer-events: none;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* ===========================================
   BACK TO TOP
   =========================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--orange);
  border: 2px solid var(--brown);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pixel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gold);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  color: white;
}

/* ===========================================
   PIXEL DECORATIONS
   =========================================== */
.pixel-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--gold);
}

.pixel-corner.tl { top: -2px; left: -2px; }
.pixel-corner.tr { top: -2px; right: -2px; }
.pixel-corner.bl { bottom: -2px; left: -2px; }
.pixel-corner.br { bottom: -2px; right: -2px; }

/* Retro progress bars */
.stat-bar-wrap {
  height: 8px;
  background: var(--parchment-darker);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(61,43,31,0.2);
  margin-top: 4px;
}

.stat-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.stat-bar.hp { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.stat-bar.mp { background: linear-gradient(90deg, #2980b9, #3498db); }
.stat-bar.pa { background: linear-gradient(90deg, #f39c12, #f1c40f); }

/* ===========================================
   LOADING / RETRO ELEMENTS
   =========================================== */
.retro-box {
  border: 2px solid var(--brown);
  box-shadow: 4px 4px 0 var(--brown);
  background: var(--cream);
  position: relative;
  padding: 1.5rem;
}

/* pixel art dot pattern overlay */
.dot-pattern {
  background-image: radial-gradient(circle, var(--parchment-darker) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--parchment-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--brown-light);
  border-radius: 2px;
  border: 1px solid var(--parchment-darker);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brown);
}

/* AOS overrides */
[data-aos] {
  pointer-events: none;
}

[data-aos].aos-animate {
  pointer-events: auto;
}

/* Selection */
::selection {
  background: var(--orange);
  color: white;
}
