/* =========================================================
   Page Jeux / Ludothèque
   ========================================================= */

.deck-ludo-page {
  background: var(--deck-bg-light);
  color: var(--deck-deep);
  padding: 2.5rem 0 5rem;
}

.deck-ludo-header {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto 3rem;
  text-align: center;
}

.deck-ludo-header h1 {
  margin-bottom: 1.5rem !important;
}


/* =========================================================
   Recherche + filtres
   ========================================================= */

.deck-ludo-toolbar {
  width: min(1100px, 100%);
  margin: 0 auto 3rem;
}

.deck-ludo-search {
  width: min(520px, 100%);
  margin: 0 auto 2rem;
  position: relative;
}

.deck-ludo-search input {
  width: 100% !important;
  height: 46px;
  border: 2px solid var(--deck-deep) !important;
  border-radius: var(--deck-radius-pill) !important;
  padding: 0 1.2rem 0 3rem !important;
  font-family: var(--deck-font-main);
  font-size: 1rem;
  background: var(--deck-white);
  color: var(--deck-deep);
}

.deck-ludo-search input::placeholder {
  color: rgba(0, 51, 51, 0.45);
}

.deck-ludo-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  color: var(--deck-deep);
  z-index: 2;
}

.deck-ludo-filters {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.deck-ludo-filters select {
  width: auto !important;
  min-width: 150px;
  max-width: 220px;
  height: 42px;
  background: var(--deck-green) !important;
  color: var(--deck-white) !important;
  border: 1px solid var(--deck-deep) !important;
  border-radius: var(--deck-radius-pill) !important;
  padding: 0 2.5rem 0 1rem !important;
  font-family: var(--deck-font-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.deck-ludo-submit,
.deck-ludo-reset {
  height: 42px;
  border-radius: var(--deck-radius-pill) !important;
  padding: 0 1.25rem !important;
  font-family: var(--deck-font-main);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.deck-ludo-submit {
  background: var(--deck-accent) !important;
  color: var(--deck-dark) !important;
  border: 2px solid var(--deck-green) !important;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deck-ludo-reset {
  background: transparent !important;
  color: var(--deck-deep) !important;
  border: 1px solid var(--deck-deep) !important;
}

.deck-ludo-reset:hover {
  background: var(--deck-deep) !important;
  color: var(--deck-white) !important;
}

.deck-ludo-empty,
.deck-ludo-search-result {
  text-align: center;
  color: var(--deck-deep);
}


/* =========================================================
   Grille des cartes
   ========================================================= */

.deck-ludo-grid {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  align-items: stretch;
}


/* =========================================================
   Cartes cliquables
   ========================================================= */

.deck-game-card-link {
  display: block;
  height: 100%;
  color: inherit !important;
  text-decoration: none !important;
}

.deck-game-card-link:hover {
  color: inherit !important;
  text-decoration: none !important;
}


/* =========================================================
   Carte jeu
   ========================================================= */

.deck-game-card {
  position: relative;
  height: 100%;
  background: var(--deck-white);
  border: 2px solid var(--deck-grey-light);
  border-radius: 22px;
  padding: 14px 14px 12px;
  text-align: center;
  box-shadow:
    0 2px 0 rgba(0, 51, 51, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;

  display: flex;
  flex-direction: column;
}

.deck-game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 51, 51, 0.35);
  box-shadow:
    0 8px 18px rgba(0, 51, 51, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.deck-game-referent {
  border: 1px solid var(--deck-deep);
  border-radius: 0.7rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--deck-deep);
  background: var(--deck-white);
}


/* =========================================================
   Image jeu
   ========================================================= */

.deck-game-image {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.deck-game-image img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

.deck-game-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--deck-dark);
  color: var(--deck-white);
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}


/* =========================================================
   Textes carte
   ========================================================= */

.deck-game-title {
  color: var(--deck-deep);
  font-family: var(--deck-font-main);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
  margin: 0 !important;
  min-height: 2.8rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.deck-game-type {
  color: var(--deck-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0.85rem !important;
  min-height: 1.3rem;
}


/* =========================================================
   Badges carte : emplacement / joueurs / durée
   ========================================================= */

.deck-game-meta {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* Style commun des pastilles */
.deck-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 28px;
  padding: 0 0.65rem;
  border-radius: var(--deck-radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Emplacement : pastille verte, sans icône */
.deck-meta-location {
  background: var(--deck-accent);
  color: #003333;
  border: 1px solid #003333;
  font-weight: 900;
}

/* Sécurité : aucune icône sur l’emplacement */
.deck-meta-location::before {
  display: none !important;
  content: none !important;
}

/* Joueurs + durée : pastilles foncées */
.deck-meta-players,
.deck-meta-time {
  background: var(--deck-dark);
  color: var(--deck-white);
  border: 1px solid var(--deck-dark);
}

/* On désactive les anciennes icônes en pseudo-élément */
.deck-meta-players::before,
.deck-meta-time::before {
  display: none !important;
  content: none !important;
}

/* Icône Material Symbols insérée directement en HTML par le PHP */
.deck-meta-icon {
  font-family: "Material Symbols Outlined" !important;
  font-weight: normal !important;
  font-style: normal !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 0.95rem;

  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: nowrap !important;
  direction: ltr !important;

  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;

  font-variation-settings:
    "FILL" 0,
    "wght" 300,
    "GRAD" 0,
    "opsz" 24;
}


/* =========================================================
   Ludothèque - chargement automatique
   ========================================================= */

.deck-ludo-loader {
  width: min(1140px, calc(100% - 40px));
  min-height: 70px;
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-ludo-loader::after {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 4px solid rgba(0, 51, 51, 0.15);
  border-top-color: var(--deck-green);
  opacity: 0;
  animation: deckLudoSpin 0.8s linear infinite;
}

.deck-ludo-loader.is-loading::after {
  opacity: 1;
}

.deck-ludo-loader.is-done {
  display: none;
}

.deck-ludo-end {
  text-align: center;
  color: var(--deck-deep);
  font-weight: 600;
  margin: 2rem 0 0;
}

@keyframes deckLudoSpin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   Ludothèque - bandeau nouveaux jeux
   ========================================================= */

.deck-game-card-new {
  border-color: var(--deck-accent);
  box-shadow:
    0 4px 12px rgba(1, 255, 46, 0.20),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.deck-game-new-ribbon {
  position: absolute;
  top: 12px;
  left: -34px;
  z-index: 5;

  width: 145px;
  padding: 5px 0;

  background: var(--deck-accent);
  color: #003333;

  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  transform: rotate(-38deg);
  box-shadow: 0 2px 6px rgba(0, 51, 51, 0.22);
}


/* =========================================================
   Responsive ludothèque
   ========================================================= */

@media (max-width: 1024px) {
  .deck-ludo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .deck-ludo-page {
    padding: 2rem 0 4rem;
  }

  .deck-ludo-header {
    width: min(100% - 28px, 1140px);
  }

  .deck-ludo-header h1 {
    font-size: clamp(3rem, 15vw, 5rem) !important;
  }

  .deck-ludo-toolbar {
    width: min(100% - 28px, 1100px);
  }

  .deck-ludo-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .deck-ludo-filters select,
  .deck-ludo-submit,
  .deck-ludo-reset {
    width: 100% !important;
    max-width: none;
  }

  .deck-ludo-grid {
    width: min(100% - 28px, 1140px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .deck-game-card {
    padding: 0.65rem;
    border-radius: 18px;
  }

  .deck-game-image {
    height: 135px;
  }

  .deck-game-title {
    font-size: 1.05rem;
    min-height: 2.3rem;
  }

  .deck-game-type {
    font-size: 0.8rem;
    min-height: 1.1rem;
  }

  .deck-game-meta {
    gap: 0.3rem;
  }

  .deck-meta-pill {
    min-height: 24px;
    padding: 0 0.45rem;
    font-size: 0.68rem;
  }

  .deck-meta-icon {
    width: 0.85rem;
    height: 0.85rem;
    flex-basis: 0.85rem;
    font-size: 0.85rem !important;
  }
}

/* =========================================================
   Ludothèque - titre mobile sur une seule ligne
   ========================================================= */

@media (max-width: 767px) {
  .deck-ludo-header h1 {
    font-size: clamp(3.1rem, 15vw, 4.2rem) !important;
    line-height: 0.9 !important;
    letter-spacing: -0.07em !important;
    white-space: nowrap !important;
    margin-bottom: 1rem !important;
  }
}
