:root {
  --bg: #fbe8c8;           /* jaune pastel du logo (fond du cercle) */
  --panel: #fff8ea;        /* carte plus claire, presque crème */
  --line: #e8d3a3;         /* liseré doré doux */
  --text: #2b1e4a;         /* violet très foncé, lisible sur fond clair */
  --muted: #7a6a52;        /* brun/violet grisé pour texte secondaire */
  --accent: #3d2a6d;       /* violet du logo (anneau extérieur) */
  --accent-hover: #573b96;
  --success: #10b981;
  --warning: #f4c430;      /* jaune du dé */
  --danger: #ef4444;

  /* couleurs supplémentaires piochées dans le logo, pour les orbes */
  --purple: #3d2a6d;
  --purple-light: #6b4fa8;
  --blue: #8fa3e6;
  --gold: #f4c430;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.hidden { display: none !important; }

/* ORBES DÉCORATIFS — glow façon logo (violet / rose / bleu) posés sur le fond jaune pastel */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 480px;
  height: 480px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--purple-light), var(--purple) 70%);
}

body::after {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle at 40% 40%, var(--accent), var(--blue) 75%);
}

/* orbe supplémentaire, plus discret, au centre-droit */
main::before {
  content: "";
  position: fixed;
  top: 35%;
  right: 15%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), transparent 70%);
  filter: blur(80px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

/* on repasse le contenu au-dessus des orbes */
.topbar, main, footer { position: relative; z-index: 1; }

/* HEADER & TOPBAR */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; border-bottom: 1px solid var(--line); }
.brand { font-size: 16px; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.brand-mark { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 4px; }
.brand-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.topbar nav { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 500; }

/* LAYOUT GENERAL */
main { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section { margin-top: 60px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.eyebrow { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 1.5px; }
h1 { font-size: 42px; line-height: 1.1; font-weight: 800; color: var(--purple); }
h2 { font-size: 24px; font-weight: 700; color: var(--purple); }
.muted { color: var(--muted); }

/* COMPOSANTS UI */
.button { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; transition: 0.2s; }
.button:hover { border-color: var(--purple-light); }
.button.primary { background: var(--accent); color: #fff; border: none; }
.button.primary:hover { background: var(--accent-hover); }

.admin-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-notification-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  box-sizing: border-box;
}
.button.danger { background: var(--danger); color: #fff; border: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: 0 4px 16px rgba(61, 42, 109, 0.08); }
.badge { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-warning { background: rgba(244, 196, 48, 0.2); color: #8a6a00; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* HISTORIQUE DES DEMANDES TRAITÉES — affichage compact */
.admin-history { margin-top: 16px; }
.admin-history > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--purple);
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
}
.admin-history > summary::-webkit-details-marker { display: none; }
.admin-history > summary::before { content: "▸ "; }
.admin-history[open] > summary::before { content: "▾ "; }
.admin-history-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

.admin-card-compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  opacity: 0.9;
}
.admin-card-compact-main { flex: 1 1 260px; color: var(--text); }
.admin-card-compact-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-card-compact .button, .admin-card-compact-actions .button {
  padding: 4px 10px;
  font-size: 12px;
}

/* HERO */
/* HERO ACCUEIL : contenu + prochain événement */
.hero { position: relative; padding: 60px 0; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 40px;
  align-items: center;
}
.home-hero > div:first-child { grid-column: 1; grid-row: 1; }
.home-hero > #featuredEvent { grid-column: 2; grid-row: 1; }
@media (max-width: 850px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero #featuredEvent { justify-self: stretch; width: 100%; }
}
.hero-copy { color: var(--muted); max-width: 500px; margin: 16px 0 24px 0; font-size: 16px; }

/* FILTRES & CATALOGUE */
.toolbar { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.toolbar input, .toolbar select { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 10px 14px; border-radius: 6px; outline: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 16px rgba(61, 42, 109, 0.08); transition: 0.15s; }
.card[data-event-id]:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .cover { height: 160px; background: #f3ddb0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body .tag { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.card-body h3 { font-size: 18px; margin: 4px 0; color: var(--purple); }
.card-body .publisher { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.card-body .meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.card-body .desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.game-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  flex-wrap: wrap;
}

.game-card-action {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: .15s ease;
}

.game-card-action-secondary {
  background: var(--bg);
  color: var(--text);
}

.game-card-action-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.game-card-action:hover,
.game-card-action:focus-visible {
  transform: translateY(-1px);
}

.game-card-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .game-card-actions {
    flex-direction: column;
  }

  .game-card-action {
    width: 100%;
  }
}

/* RÉSERVATION LAYOUT 2 COLONNES */
.reservation-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 850px) { .reservation-layout { grid-template-columns: 1fr; } }
.reservation-info { display: flex; flex-direction: column; gap: 16px; }
.reservation-info p { color: var(--muted); font-size: 14px; }
.reservation-rules { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; list-style: none; }
.reservation-rules li::before { content: "✦"; color: var(--accent); margin-right: 8px; }

.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 4px 20px rgba(61, 42, 109, 0.12); }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.form-group input, .form-group select { background: #fff; border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 6px; outline: none; width: 100%; }
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-message { font-weight: 600; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

/* CATALOGUE — BOUTON "AFFICHER TOUS LES JEUX" */
#catalogueToggle { display: none; justify-content: center; margin-top: 24px; }
#showAllGamesBtn { display: inline-flex; align-items: center; gap: 8px; }
#showAllGamesArrow { display: inline-block; transition: transform 0.15s; }

/* CALENDRIER STRUCTURE & DESIGN */
.calendar-wrapper { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.calendar-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.cal-day { background: #fff; border: 1px solid var(--line); border-radius: 6px; min-height: 90px; padding: 6px; font-size: 11px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-day.has-events { cursor: pointer; transition: 0.15s; }
.cal-day.has-events:hover { border-color: var(--accent); background: rgba(61, 42, 109, 0.06); }
.cal-day-num { font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.cal-event { background: var(--accent); color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* MODALES */
.modal { position: fixed; inset: 0; background: rgba(43, 30, 74, 0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 10px 40px rgba(61, 42, 109, 0.25); }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.admin-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.admin-form-grid input { background: #fff; border: 1px solid var(--line); color: var(--text); padding: 8px; border-radius: 4px; }

footer { display: flex; justify-content: space-between; padding: 40px 20px; border-top: 1px solid var(--line); margin-top: 80px; font-size: 12px; color: var(--muted); }
/* =========================================================
   NOTATION PAR ÉTOILES
   ========================================================= */

.star-button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--line);
  cursor: pointer;
  padding: 2px;
  margin: 0;
  font-size: 30px;
  line-height: 1;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.star-button:hover {
  color: var(--accent);
  transform: scale(1.08);
}

.star-button.active {
  color: var(--accent);
}


/* Étoiles affichées dans les avis */

.review-stars {
  color: var(--accent);
  letter-spacing: 2px;
  font-size: 17px;
  line-height: 1;
}


/* Carte d'un avis */

.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

.review-card:hover {
  border-color: var(--accent);
}


/* Note moyenne */

#reviewAverage {
  display: flex;
  align-items: center;
  gap: 6px;
}


/* Zone de sélection des étoiles */

#starRating {
  display: flex;
  align-items: center;
  gap: 3px;
}


/* Texte sous les étoiles */

#ratingHelp {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}


/* Étoiles non sélectionnées */

#starRating .star-button:not(.active) {
  color: var(--line);
}


/* Étoiles sélectionnées */

#starRating .star-button.active {
  color: var(--accent);
}

/* =========================================================
   PAGE CONTACT — TROMBINOSCOPE
========================================================= */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(61, 42, 109, 0.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.team-card:hover,
.team-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(61, 42, 109, 0.14);
  outline: none;
}

.team-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg);
}

.team-card-body {
  padding: 18px;
}

.team-card-body h3 {
  margin: 4px 0 6px;
  color: var(--purple);
  font-size: 20px;
}

.team-card-body .muted {
  font-size: 12px;
}

.team-modal-card {
  max-width: 760px;
}

.team-modal-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  padding-right: 12px;
}

.team-modal-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: .15s ease;
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 850px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-modal-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-modal-photo {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }
}

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

  .contact-links {
    grid-template-columns: 1fr;
  }
}
