/* ============================================================
   ARCHIPELAGO THEME - Horlogium Blue & Gold
   Clean rebuild 2025
============================================================ */

/* mini-reset safe Bootstrap */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { background: none; border: 0; color: inherit; font: inherit; }

:root {
  --horlogium-blue: #181a46;
  --horlogium-blue-light: #1a1f48;
  --horlogium-gold: #efaf22;
  --text-light: #f5f5f5;
  --text-muted: #b0b0b0;
  --transition-fast: 0.2s ease;
  --border-radius: 10px;

  /* hauteur du header centralisée pour éviter les décalages */
  --header-height: 70px; /* si tu changes height dans .site-header, change aussi cette variable */
  --header-gap: 0px; /* marge supplémentaire */
}

/* =============================
   BASE & BODY
============================= */
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: var(--horlogium-blue);
  color: var(--text-light);
}

/* =============================
   HEADER (fixed top)
============================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height); /* utilisation de la variable */
  background-color: var(--horlogium-blue);
  color: var(--horlogium-gold);
  border-bottom: 2px solid var(--horlogium-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  z-index: 1000;
  display: flex;
}

/* ===== ESPACE SOUS LE HEADER ===== */
main,
.site-content, /* fallback si tu gardes la div */
.container-fluid.site-body {
  margin-top: calc(var(--header-height) + var(--header-gap));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  width: 100%;
}

.logo-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.logo-img {
  height: 40px;
  width: auto;
}

.logo-archipelago {
  height: 40px;
  width: auto;
}

.logo-text {
  color: var(--horlogium-gold);
  font-weight: 700;
  font-size: 1.25rem;
  font-family: "Cinzel", serif;
  text-shadow: 0 0 6px rgba(212,175,55,0.6);
}

/* Header nav — forcer affichage horizontal */
.header-nav {
  flex: 1;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: center;
}

/* s'assurer que les links s'affichent en inline-flex */
.header-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .5rem;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
}

/* optionnel : style visuel quand on est sur mobile (réduire gap) */
@media (max-width: 576px) {
  .logo-text { display: none; } /* si tu veux gagner de la place sur petit écran */
}

/* nav-right / steam login */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* conteneur commun */
.user-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--horlogium-blue);
  border: 1px solid rgba(239, 175, 34, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  color: var(--text-light);
  transition: all var(--transition-fast);
}

.user-box:hover {
  border-color: var(--horlogium-gold);
  box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

/* avatar rond */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(239, 175, 34, 0.4)
}

/* nom utilisateur */
.user-name {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  color: var(--horlogium-gold);
  white-space: nowrap;
}

/* icône Steam dans le nom */
.user-name iconify-icon {
  color: var(--horlogium-gold);
}

/* bouton logout intégré */
.user-box .nav-link.logout {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: transform 0.2s ease;
  margin-left: 0.2rem;
}

.user-box .nav-link.logout:hover {
  transform: scale(1.15);
}
.user-box .nav-link.logout iconify-icon {
  color: var(--horlogium-gold);
}
.user-box .nav-link.logout:hover iconify-icon {
  color: #fff;
} 
/* fin de l'insertion */
.nav-link.login {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--horlogium-blue);
  color: #fff;
  padding: .35rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--transition-fast);
}

.nav-link.login:hover {
  color: var(--horlogium-gold);
  background: var(--horlogium-blue);
  box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

/* =============================
   GAME GRID
============================= */
#game-grid {
  /* margin-top: 80px; space for header */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
  padding: 1.5rem 3rem;
}

/* =============================
   GAME CARD
============================= */
.game-card {
  background-color: var(--horlogium-blue-light);
  border: 1px solid var(--horlogium-gold);
  border-radius: var(--border-radius);
  color: var(--text-light);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.game-card img {
  object-fit: cover;
  width: 100%;
}

/* === Image conteneur === */
.game-image-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;   /* ← la hauteur est verrouillée ici */
}

.game-grid-image {
  width: 100%;
  display: block;
  height: 100%;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--horlogium-gold);
}

.game-card .card-body {
  padding: 0.8rem 1rem;
  flex: 1;
}

.game-card .card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.game-card .card-text {
  font-size: 0.85rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* =============================
   ICONES ET METADATA
============================= */
.meta-icons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.meta-icons a {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

iconify-icon {
  color: var(--horlogium-gold);
  vertical-align: middle;
}

.platform-icon {
  height: 28px;
  width: auto;
  display: inline-flex;       /* ← Pour un contrôle plus précis */
  align-items: center;        /* ← Centre le contenu verticalement */
  justify-content: center;
  vertical-align: middle;     /* ← Évite le décalage avec le texte */
  /* margin-top: -2px; */
}

.icon-steam:hover { transform: scale(1.06); }

.icon-steam {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: #101820;        /* gris profond */
  color: #fff;
  font-size: 1.4rem; /* augmente la taille du logo Steam */
  width: 32px;
  /* height: 34px; */
  border-radius: 50%;
  padding: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.icon-gold {
  color: var(--horlogium-gold);
  font-size: 1.1rem;
}

.icon-free {
  color: var(--horlogium-gold);
  font-size: 1.1rem;
}

.icon-steam:hover,
.icon-gold:hover,
.icon-free:hover {
  transform: scale(1.1);
}


/* =============================
   SCORES / BADGES
============================= */
.score-bar {
  display: flex;
  justify-content: space-between; /* Metacritic à gauche, HLTB à droite */
  align-items: center;
  margin-top: auto; /* pousse le bloc vers le bas */
  padding-top: 0.5rem;
  gap: 0.6rem;
}

/* garder une largeur minimale pour le badge Metacritic */
.metacritic {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:#fff;
}

/* placeholder : invisible mais prend la place */
.metacritic.placeholder,
.hltb.placeholder {
  background: transparent;
  box-shadow: none;
  border: 0;
  visibility: hidden;    /* n'affiche rien mais occupe la place */
}

.hltb {
  min-width: 56px;
  height: 36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 20px;
  font-weight:600;
  color:#fff;
  background: linear-gradient(135deg,#0069d9,#00a6ff);
  padding: 0.3rem 0.6rem;
  gap: 0.3rem;
}

.icon-hltb {
  font-size: 1.2rem;
  color: #fff;
}

/* couleurs Metacritic (contraste fort et daltonien-friendly) */
/* 🔱 Doré (90+) */
.mc-90 {
  background: linear-gradient(135deg, #f9e07f 0%, #d4af37 40%, #b4881d 100%);
  box-shadow:
    0 0 8px rgba(212,175,55,0.4),
    0 0 20px rgba(255,215,100,0.4);
}

/* 🍀 Vert (80–89) */
.mc-80 {
  background: linear-gradient(135deg, #66ff99 0%, #1fa748 60%, #066621 100%);
  box-shadow: 0 0 10px rgba(40,180,80,0.6);
}

/* 💎 Bleu (70–79) */
.mc-70 {
  background: linear-gradient(135deg, #87cefa 0%, #007bff 60%, #0044cc 100%);
  box-shadow: 0 0 10px rgba(0,123,255,0.6);
}

/* 🔮 Violet (60–69) */
.mc-60 {
  background: linear-gradient(135deg, #d9a7ff 0%, #9b59b6 60%, #5b2c6f 100%);
  box-shadow: 0 0 10px rgba(155,89,182,0.6);
}

/* 🍊 Orange (50–59) */
.mc-50 {
  background: linear-gradient(135deg, #ffc67d 0%, #ff9800 60%, #b85b00 100%);
  box-shadow: 0 0 10px rgba(255,152,0,0.6);
}

/* ❤️ Rouge (<50) */
.mc-bad {
  background: linear-gradient(135deg, #ff9a9e 0%, #ff4e50 60%, #8b0000 100%);
  box-shadow: 0 0 10px rgba(255,78,80,0.6);
}

/* =============================
   FOOTER
============================= */
.site-footer {
  background: linear-gradient(180deg, #172454 0%, #0e1433 100%);
  padding: 1rem;
  color: var(--horlogium-gold);
  border-top: 2px solid var(--horlogium-gold) !important;
  margin-top: 2rem;
}
.site-footer a {
  color: var(--horlogium-gold);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 768px) {
  #game-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* =============================
   STEAM ID
============================= */
.steam-id {
  color: var(--horlogium-gold);
  font-weight: 600;
  margin-right: 0.6rem;
}

.nav-link.logout {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.nav-link.logout iconify-icon {
  color: var(--horlogium-gold);
  font-size: 1.2rem;
  transition: color 0.3s ease;
  z-index: 2; /* reste au-dessus du pseudo-élément */
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link.logout:hover iconify-icon { color: #fff; }
.nav-link.logout:hover { transform: scale(1.1); }

/* 💫 Effet “shine” */
.nav-link.logout::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  transform: skewX(-25deg);
  transition: left 0.5s ease;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

/* ✨ Animation au survol */
.nav-link.logout:hover::before {
  left: 125%;
  opacity: 1;
}

.nav-link.logout:hover {
  transform: scale(1.1);
}

/* =============================
   OWNED GAMES
============================= */
/* Coche Steam */
.steam-link {
  position: relative; /* pour que la coche se positionne par rapport au cercle */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-steam {
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #101820;
  color: #fff;
}

.owned-check-steam {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  color: #4caf50;
  font-size: 12px;
}

/* Bibliothèque / toggle AP */
.icon-owned img {
  width: 20px;       /* même taille que les autres icônes */
  height: 20px;
  object-fit: contain; /* conserve les proportions */
  filter: brightness(0) invert(1); /* transforme le noir en blanc */
  display: inline-block;
  vertical-align: middle;
  border: none;
}

/* Supprimer le sous-lignage des liens dans les icônes */
.icon-owned,
.icon-owned a,
.icon-owned img {
  text-decoration: none;
}

.icon-owned .owned-check-AP {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  display: none;
}

.icon-owned.owned .owned-check-AP {
  display: block;
}

/* Couleur bibliothèque */
.icon-owned iconify-icon:first-child {
  color: #fff;
}

.icon-owned.owned iconify-icon:first-child {
  color: var(--horlogium-gold);
}

/* ============================================================
   Layout général : footer toujours en bas
   ============================================================ */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* hauteur = toute la fenêtre */
}

main.container-fluid {
  flex: 1; /* prend tout l’espace libre entre header et footer */
}

/* ============================
   Horlogium Flash Banners
   ============================ */

:root {
  /* Utilise tes variables existantes si déjà définies.
     Sinon, ces valeurs de secours seront utilisées. */
  --hlg-gold: var(--horlogium-gold, #D4AF37);
  --hlg-navy: #0a0e1a;
  --hlg-navy-2: #0f1b33;
  --hlg-white: #ffffff;
}

.hlg-flash-stack {
  position: sticky; /* reste sous le header, défile avec la page */
  top: 0;
  z-index: 1020; /* > header si besoin, < modales */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(10,14,26,0.85), rgba(10,14,26,0.35));
  backdrop-filter: blur(2px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hlg-flash {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 4px solid var(--hlg-gold);
  border-radius: 10px;
  color: var(--hlg-white);
  background: rgba(15, 27, 51, 0.85);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  animation: hlgFlashIn .28s ease;
}

.hlg-flash.is-hiding { animation: hlgFlashOut .22s ease forwards; }

.hlg-flash__icon iconify-icon {
  color: var(--hlg-gold);
  width: 22px; height: 22px;
}

.hlg-flash__text {
  font-weight: 600;
  letter-spacing: .2px;
}

.hlg-flash__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--hlg-white);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.hlg-flash__close:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.05);
}
.hlg-flash__close iconify-icon { width: 18px; height: 18px; }

/* Variantes */
.hlg-flash--success { border-left-color: #22c55e; background: rgba(12, 44, 24, 0.9); }
.hlg-flash--info    { border-left-color: #60a5fa; background: rgba(10, 26, 56, 0.9); }
.hlg-flash--warning { border-left-color: #f59e0b; background: rgba(61, 41, 5, 0.92); }
.hlg-flash--error   { border-left-color: #ef4444; background: rgba(56, 10, 18, 0.92); }

@keyframes hlgFlashIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hlgFlashOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* Optionnel : dark header separation */
.site-header + .hlg-flash-stack {
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Edition des infos */
#edit-panel .edit-field {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

#edit-panel label {
    color: var(--horlogium-gold);
    font-weight: 600;
    margin-bottom: 4px;
}

#edit-panel input,
#edit-panel textarea,
#edit-panel select {
    background: var(--horlogium-blue-light);
    color: var(--text-light);
    border: 1px solid var(--horlogium-gold);
    border-radius: 6px;
    padding: 6px 8px;
}
