/* =========================================================
   Deck Bar - Page Jeux / Ludothèque
   Fichier : deckbar-games.css
   ========================================================= */

/* =========================================================
   1. Structure générale
   ========================================================= */

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

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

.deck-ludo-header h1,
.deck-ludo-title {
  margin: 0 0 1rem !important;
}

/* Intro SEO courte */
.deck-ludo-intro-text {
  width: 100%;
  max-width: none;
  margin: 0rem 0.2rem 0.8rem !important;

  color: var(--deck-grey-dark);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.45;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  text-transform: none !important;
}

/* =========================================================
   2. Recherche + logo BGG + filtres
   ========================================================= */

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

/* Ligne recherche + logo BGG */
.deck-ludo-search-row {
  width: min(760px, 100%);
  margin: 0 auto 2rem;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

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

.deck-ludo-search-row .deck-ludo-search {
  flex: 1 1 auto;
  margin: 0 !important;
}

.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;

  background: var(--deck-white);
  color: var(--deck-deep);

  font-family: var(--deck-font-ui);
  font-size: 1rem;
}

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

.deck-ludo-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  z-index: 2;

  transform: translateY(-50%);

  color: var(--deck-deep);
  font-size: 1.25rem;
}

/* Logo BGG : simple lien image, pas un bouton */
.deck-ludo-bgg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  padding: 0;
  margin: 0;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  line-height: 1;
  text-decoration: none !important;

  opacity: 0.9;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.deck-ludo-bgg-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.deck-ludo-bgg-link img {
  display: block;
  width: 92px;
  max-height: 34px;
  height: auto;
  object-fit: contain;
}

/* Filtres */
.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: 0 !important;
  max-width: none !important;
  height: 42px;

  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;

  background-color: var(--deck-green) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='7' viewBox='0 0 10 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.3L5 5.3L9 1.3' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.65rem center !important;
  background-size: 10px 7px !important;

  color: var(--deck-white) !important;

  border: 1px solid var(--deck-deep) !important;
  border-radius: var(--deck-radius-pill) !important;

  padding: 0 1.7rem 0 0.9rem !important;
  box-sizing: border-box;
  white-space: nowrap;

  font-family: var(--deck-font-ui);
  font-weight: 600;
  font-size: 0.95rem;

  cursor: pointer;
}
.deck-ludo-filters select:nth-of-type(1) {
  width: 18.5ch !important;
}

.deck-ludo-filters select:nth-of-type(2) {
  width: 8.5ch !important;
}

.deck-ludo-filters select:nth-of-type(3) {
  width: 11ch !important;
}

.deck-ludo-filters select:nth-of-type(4) {
  width: 13ch !important;
}

.deck-ludo-filters select:nth-of-type(5) {
  width: 14.5ch !important;
}

.deck-ludo-submit,
.deck-ludo-reset {
  height: 42px;

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

  border-radius: var(--deck-radius-pill) !important;
  padding: 0 1.25rem !important;

  font-family: var(--deck-font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none !important;
}

.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);
}

/* =========================================================
   3. 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;
}

/* =========================================================
   4. Cartes jeux
   ========================================================= */

.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;
}

.deck-game-card {
  position: relative;

  height: 100%;
  padding: 14px 14px 12px;

  display: flex;
  flex-direction: column;

  background: var(--deck-white);
  border: 2px solid var(--deck-grey-light);
  border-radius: 22px;

  text-align: center;
  overflow: hidden;

  box-shadow:
    0 2px 0 rgba(0, 51, 51, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.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);
}

/* Référent */
.deck-game-referent {
  margin-bottom: 0.8rem;
  padding: 0.55rem 0.7rem;

  background: var(--deck-white);
  color: var(--deck-deep);

  border: 1px solid var(--deck-deep);
  border-radius: 0.7rem;

  font-size: 0.8rem;
  font-weight: 600;
}

/* Image */
.deck-game-image {
  height: 190px;
  margin-bottom: 12px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-game-image img {
  display: block !important;

  max-width: 100% !important;
  max-height: 100% !important;

  width: auto !important;
  height: auto !important;

  object-fit: contain !important;
}

.deck-game-image-placeholder {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--deck-dark);
  color: var(--deck-white);

  border-radius: 0.8rem;

  font-weight: 700;
}

/* Textes carte */
.deck-game-title {
  min-height: 2.8rem;
  margin: 0 !important;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  color: var(--deck-deep);

  font-family: var(--deck-font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;

  text-transform: none !important;
}

.deck-game-type {
  min-height: 1.3rem;
  margin: 0.25rem 0 0.85rem !important;

  color: var(--deck-muted);

  font-size: 0.9rem;
}

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

.deck-game-meta {
  margin-top: auto;
  padding-top: 0.75rem;

  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.deck-meta-pill {
  min-height: 28px;
  padding: 0 0.65rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;

  border-radius: var(--deck-radius-pill);

  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Emplacement */
.deck-meta-location {
  background: var(--deck-accent);
  color: var(--deck-deep);

  border: 1px solid var(--deck-deep);

  font-weight: 900;
}

.deck-meta-location::before {
  display: none !important;
  content: none !important;
}

/* Joueurs + durée */
.deck-meta-players,
.deck-meta-time {
  background: var(--deck-dark);
  color: var(--deck-white);

  border: 1px solid var(--deck-dark);
}

.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 {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 0.95rem;

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

  font-family: "Material Symbols Outlined" !important;
  font-size: 1.2rem !important;
  font-style: normal !important;
  font-weight: normal !important;
  line-height: 1 !important;

  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;
}

/* =========================================================
   6. 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: var(--deck-deep);

  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);
}

/* =========================================================
   7. 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 {
  margin: 2rem 0 0;

  color: var(--deck-deep);

  text-align: center;
  font-weight: 600;
}

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

/* =========================================================
   8. Responsive ludothèque
   ========================================================= */

@media (max-width: 1024px) {
  .deck-ludo-intro-text {
    max-width: 760px;
    white-space: normal;
  }

  .deck-ludo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

  .deck-ludo-intro-text {
    margin: 1rem auto 1.5rem !important;

    text-align: center;
    white-space: normal;

    font-size: 1rem;
  }

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

  .deck-ludo-search-row {
    width: 100%;
    gap: 0.6rem;
  }

  .deck-ludo-bgg-link img {
    width: 72px;
    max-height: 28px;
  }

  .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 {
    min-height: 2.3rem;

    font-size: 1.05rem;
    line-height: 1.05;
  }

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

  .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;
  }

  @media (max-width: 767px) {
  body:has(.deck-ludo-page) .elementor-widget-shortcode:first-of-type {
    margin-bottom: 1.6rem !important;
  }

  body:has(.deck-ludo-page) .deck-ludo-page {
    padding-top: 1rem !important;
  }
}
}


/* =========================================================
   Mobile - Ordre ludothèque :
   filtres > recherche texte > bouton recherche > reset
   ========================================================= */

@media (max-width: 767px) {
  .deck-ludo-toolbar {
    width: min(100% - 28px, 346px);
    margin: 0 auto 2.5rem;

    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 0.65rem;
    row-gap: 0.8rem;
    align-items: center;
  }

  /* On laisse les enfants du formulaire se placer dans la grille globale */
  .deck-ludo-filters {
    display: contents !important;
  }

  /* Bulles select */
  .deck-ludo-filters select {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 42px;
    padding: 0 1.45rem 0 0.75rem !important;

    font-size: 0.84rem;
    text-overflow: ellipsis;

    justify-self: center;
  }

  /* Ligne 1 : Nombre de joueurs + Âge minimum */
  .deck-ludo-filters select:nth-of-type(1) {
    grid-column: 1 / 4;
    grid-row: 1;
    width: 100% !important;
  }

  .deck-ludo-filters select:nth-of-type(5) {
    grid-column: 4 / 7;
    grid-row: 1;
    width: 100% !important;
  }

  /* Ligne 2 : Durée + Difficulté + Type de jeu */
  .deck-ludo-filters select:nth-of-type(2) {
    grid-column: 1 / 3;
    grid-row: 2;
    width: 100% !important;
  }

  .deck-ludo-filters select:nth-of-type(3) {
    grid-column: 3 / 5;
    grid-row: 2;
    width: 100% !important;
  }

  .deck-ludo-filters select:nth-of-type(4) {
    grid-column: 5 / 7;
    grid-row: 2;
    width: 100% !important;
  }

  /* Champ recherche sous les bulles */
  .deck-ludo-search-row {
    grid-column: 1 / 7;
    grid-row: 3;

    width: 100% !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
  }

  .deck-ludo-search-row .deck-ludo-search {
    width: 100% !important;
    margin: 0 !important;
    flex: 1 1 auto;
  }

  .deck-ludo-search input {
    height: 42px;
    font-size: 0.9rem;
  }

  .deck-ludo-bgg-link {
    flex: 0 0 auto;
  }

  .deck-ludo-bgg-link img {
    width: 68px;
    max-height: 26px;
  }

  /* Bouton recherche sous le champ texte */
  .deck-ludo-submit {
    grid-column: 1 / 7;
    grid-row: 4;

    width: 100% !important;
    max-width: none !important;
    height: 42px;

    margin-top: 0.25rem;
  }

  /* Reset en dessous */
  .deck-ludo-reset {
    grid-column: 1 / 7;
    grid-row: 5;

    width: 100% !important;
    max-width: none !important;
    height: 42px;
  }
}

/* Masquer le bouton Recherche */
.deck-ludo-submit {
  display: none !important;
}
@media (max-width: 767px) {
  .deck-ludo-reset {
    grid-row: 4 !important;
    grid-column: 1 / 7 !important;
  }
}
.deck-ludo-filters {
  margin-bottom: 0 !important;
}