/* Conteneur global de page */
.page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  justify-content: center;  /* ← centre verticalement */
  align-items: center;      /* ← en plus, centre horizontalement */
}

/* 1) On fait de game-container un flex-child qui grandit */
.page-wrapper > .game-container {
  flex: 1;                  /* occupe toute la place entre header et footer */
  display: flex;            /* on active le flex pour ses enfants */
  flex-direction: column;   /* colonne pour empiler game-inner, form, etc. */
}

/* 1) Conteneur qui centre la barre et limite sa largeur */
.topbar-wrapper {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 2) S’assurer que la game-topbar occupe toute la largeur de son parent */
.topbar-wrapper .game-topbar {
  width: 100%;
}

@keyframes pulse {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.3);
    opacity: 1;
  }
}

#orb-background {
  width: 100%;
  height: 100%;
  display: block;
}

/* Contenu principal (entre header et footer) */
.page-content {
  flex: 1;
}

/* Conteneur principal de jeu */
.game-container {
  margin: 0 auto;
  max-width: 850px;
  max-height: none;
  width: 100%;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  background-color: #1a1a1a;
  background-image: url('../images/voronoi-pattern.png');
  background-size: 200px 200px;     /* ← réduit le motif */
  background-repeat: repeat;        /* ← duplique l’image */
  background-position: center;
  border-left: 2px solid #000000;
  border-right: 2px solid #000000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  color: #fff;
  text-align: center;
  box-sizing: border-box;
  padding: 0rem;
  overflow-y: auto;  
  margin: 0 auto;
  justify-content: center;    /* centre verticalement */
  position: relative; /* nécessaire pour contenir les orbes */
  z-index: 0;         /* garantit que le canvas est derrière */
  flex: 1;
  overflow: hidden;
}

/* Header (ton <header> inclus via header.php) */
header {
  flex: 0 0 auto;         /* prend sa hauteur naturelle */
}

/* Footer (ta .super-footer) */
.super-footer {
  flex: 0 0 auto;         /* prend sa hauteur naturelle */
}

/* Header principal */
header {
  margin-bottom: 0 !important;
}

/* Barre supérieure sticky */
.super-topbar {
  position: sticky;
  top: 0;
  z-index: 1001;
  background-color: #1e1e1e;
  backdrop-filter: blur(6px);
  border: 2px solid #000000;
  border-radius: 12px 12px 0 0;
  padding: 0.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Layout des trois zones */
.superbar-left,
.superbar-center,
.superbar-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.superbar-left  { justify-content: flex-start; }
.superbar-right { justify-content: flex-end; }

/* Logo dans la topbar */
.superbar-logo {
  height: 40px;
  max-width: 100px;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.15));
  transition: filter 0.3s ease;
}
.superbar-logo:hover {
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.25));
}

/* Titre sobre */
.superbar-title {
  font-family: 'SunsetHeavy', 'Segoe UI', 'Arial', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.5px;
}

.super-footer {
  background-color: #1e1e1e;
  backdrop-filter: blur(6px);
  border: solid 2px #000000;
  border-radius: 0 0 12px 12px;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 850px;
  width: 100%;
  height: 3rem;
  margin: 0 auto;
  box-sizing: border-box;
  color: #ffffff;
  font-size: 1rem;
}

.super-footer a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.super-footer a:hover {
  color: #dddddd;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-left  { justify-content: flex-start; }
.footer-right { justify-content: flex-end; }

/* Contenu principal (entre header et footer) */
.page-content {
  flex: 1;
}

.game-interaction-box {
  margin: 0 auto; /* pour centrer la box */
  padding: 1rem;
  background-color: rgba(26, 26, 26, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  box-sizing: border-box;
}

/* cache complètement les boxes marquées "hidden" */
.game-interaction-box.hidden {
  display: none !important;
  margin: 0;
  padding: 0;
  border: none;
}

/* 2) États de base et caché */
.box-content {
  display: none;       /* caché par défaut */
  overflow: hidden;    /* éviter débordement pendant l’anim */
  margin-top: 1rem;
  margin-bottom: auto;
}

/* 3) Classe pour l’ouverture */
.box-content.showing {
  display: block;      /* rend visible */
  animation: slideDownFade 0.4s ease forwards;
}

/* 4) Classe pour la fermeture */
.box-content.hiding {
  animation: slideUpFade 0.3s ease forwards;
}

#game-inner {
  flex: 1;               /* occupe toute la hauteur de .game-container */
  width: 100%;
  display: flex;         /* si vous voulez aussi centrer son contenu */
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;             /* s’assure d’être au-dessus du canevas */
}

/* ———————————————————————————
   2) Aligner “Générer” et “Visualiser”
————————————————————————————— */
/* Suppression de toute marge inutile */
#generate-section,
#visualize-section {
  margin-top: 0 !important;
  padding-top: 1rem !important;
}

/* Si tu as un <hr> entre les sections, donne-lui une classe et ajuste-la */
.section-divider {
  margin: 1.5rem auto !important;
  width: 80%;
  border: none;
  height: 2px;
  background: #333;
}

/* Conteneur global de page */
.page-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  justify-content: center;  /* ← centre verticalement */
  align-items: center;      /* ← en plus, centre horizontalement */
}

/* 1) On fait de game-container un flex-child qui grandit */
.page-wrapper > .game-container {
  flex: 1;                  /* occupe toute la place entre header et footer */
  display: flex;            /* on active le flex pour ses enfants */
  flex-direction: column;   /* colonne pour empiler game-inner, form, etc. */
}

/* 1) Conteneur qui centre la barre et limite sa largeur */
.topbar-wrapper {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 2) S’assurer que la game-topbar occupe toute la largeur de son parent */
.topbar-wrapper .game-topbar {
  width: 100%;
}

#orb-background-wrapper {
  position: fixed;
  inset: 0;               /* top/right/bottom/left = 0 */
  overflow: hidden;
  z-index: 0;
  pointer-events: none;   /* laisse passer les clics */
  margin: 0 auto;
  max-width: 848px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 0;
  left: 0;
}
#orb-background {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(30px);
}

#orb-background {
  width: 100%;
  height: 100%;
  display: block;
}

.box-content.game-interaction-box {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  margin-bottom: 2rem;
  margin-top: 0;
}

/* Pour cacher la scrollbar sans bloquer le scroll */
.box-content.game-interaction-box::-webkit-scrollbar {
  width: 0;
}
.box-content.game-interaction-box {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.form-inner {
  overflow-x: auto;
}

/* BULLE : état caché de base */
.settings-bubble {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  visibility: hidden;
  opacity: 0;
  /* largeur responsive à 80% */
  width: 80%;
  max-width: 360px;               /* ne dépasse pas 360px sur mobile */
  background: rgba(30,30,30,0.95);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  border: 1px solid #333;
  z-index: 1500;
  text-align: center;
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out,
    visibility 0s linear 0.25s;   /* délai pour masquer après la transition */
}

/* BULLE : état visible */
.settings-bubble.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  transition-delay: 0s;
}

/* Au-delà de 1024px, on élargit « desktop » */
@media (min-width: 1024px) {
  .settings-bubble {
    width: 50%;                  /* prend 50% de l’écran desktop */
    max-width: 600px;            /* ne dépasse pas 600px */
  }
}

.available-pack {
  position: relative;
}

/* Le lien “info” */
.available-pack .info-link {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #ffffff;        /* bleu */
  font-size: 1.2rem;     /* ajustable */
  text-decoration: none; /* pas de soulignement */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  line-height: 1;
}

/* Optionnel : effet hover */
.available-pack .info-link:hover {
  color: #00d2ff;
}

/* Ajuste la taille de l’icône */
.available-pack .info-link svg {
  width: 1em;
  height: 1em;
}

.rules-overlay.active {
  display: flex;
  backdrop-filter: blur(6px);
}

/* fond sombre + flou */
.pack-info-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 10000;
}

/* boîte de contenu (le “card”) */
.pack-info-content {
  background: rgba(30, 30, 30, 0.95);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border: 1px solid #333;
  color: #fff;             /* ou la couleur qui convient */
  position: relative;
  max-width: 90%;
  width: 400px;
  box-sizing: border-box;
}

.pack-info-content .pack-info-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #aaa;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.25rem;
  transition: color 0.2s;
}
.pack-info-content .pack-info-close:hover {
  color: #fff;
}

.pack-description {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.4;
}

/* === Stats table : full-width + coins arrondis === */
.profile-stats{
  width: 100%;
  display: block;                 /* au lieu du grid centré */
}

.profile-stats .stats-table{
  width: 100% !important;         /* prend toute la largeur disponible */
  max-width: none !important;
  border-collapse: separate;      /* nécessaire pour border-radius sur table */
  border-spacing: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid #2a2a2a;
  border-radius: 12px;            /* coins arrondis */
  overflow: hidden;               /* clippe les coins arrondis */
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* cellules */
.stats-table.stats-kv th,
.stats-table.stats-kv td{
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stats-table.stats-kv tbody tr:last-child th,
.stats-table.stats-kv tbody tr:last-child td{
  border-bottom: 0;
}

/* colonne libellé (gauche) et valeur (droite) */
.stats-table.stats-kv th{
  width: 50%;
  text-align: left;
  background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
  color: #9ee7ff;                 /* petit accent */
  font-weight: 700;
  letter-spacing: .2px;
}
.stats-table.stats-kv td{
  width: 50%;
  text-align: right;
  color: #fff;
  font-weight: 800;
}

/* petit feedback au survol */
.stats-table.stats-kv tbody tr:hover{
  background: rgba(255,255,255,0.02);
}

/* mobile: empile la valeur sous le libellé si très étroit */
@media (max-width: 360px){
  .stats-table.stats-kv th, .stats-table.stats-kv td{
    display: block;
    width: 100%;
    text-align: left;
    padding: .6rem 1rem .4rem;
  }
  .stats-table.stats-kv td{
    padding-top: 0;
    opacity: .95;
  }
}


.game-container{
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;  /* inertie iOS */
  overscroll-behavior: contain;       /* limite le pull-to-refresh */
}

/* ===== Scroll visible et sobre dans .game-interaction-box ===== */

/* 0) S'assurer que la box peut scroller correctement dans un parent flex */
.game-interaction-box{
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0;                 /* évite les blocages de scroll en flex */
  -ms-overflow-style: auto !important; /* réactive l'affichage (IE/Edge Legacy) */
  scrollbar-width: thin !important;     /* Firefox: réactive + mince */
  scrollbar-color: #7a7a7a rgba(255,255,255,0.06) !important;
}

/* 1) Annule les anciennes règles qui cachaient la scrollbar */
.game-interaction-box::-webkit-scrollbar{
  width: 10px !important;  /* remplace le width:0 précédent */
  height: 10px !important; /* pour le scroll horizontal éventuel */
}

/* 2) WebKit: style sobre gris */
.game-interaction-box::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.06);
  border-left: 1px solid rgba(0,0,0,0.6);
}
.game-interaction-box::-webkit-scrollbar-thumb{
  background-color: #7a7a7a;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.game-interaction-box:hover::-webkit-scrollbar-thumb{
  background-color: #8b8b8b;
}
.game-interaction-box::-webkit-scrollbar-thumb:active{
  background-color: #9a9a9a;
}

/* 3) Option confort (iOS inertie + padding scroll-top pour ancres) */
.game-interaction-box{
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 12px;
}

.fade-form{ display:none; opacity:0; transition:opacity .25s ease; }
.fade-form.showing{ display:block; }
.fade-form.visible{ opacity:1; }


/* ——— Split du profil en 2 cartes ——— */
.profile-split{
  display: grid;
  gap: 1rem;
}

/* 2 colonnes sur écrans larges */
@media (min-width: 900px){
  .profile-split{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Style des deux cartes internes */
.profile-card{
  background: rgba(26,26,26,0.7);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  height: 100%;
}

/* (Option) allège le fond du conteneur principal si tu trouves le double cadre trop chargé */
/*
#box-avatar.game-interaction-box{
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
*/

.available-pack .pack-media {
  margin-bottom: 0.75rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #333;
}

.available-pack .pack-thumb {
  display: block;
  width: 100%;
  height: 140px;        /* ajuste selon ton design */
  object-fit: cover;    /* recadrage propre */
}

/* ───────── PROFILE CARD : bordure épaisse + bandeau de titre ───────── */
.profile-card{
  --edge: #29b6f6;                 /* couleur par défaut (aqua) */
  position: relative;
  background: #161616 !important;
  border: 5px solid var(--edge) !important;
  border-radius: 14px;
  box-shadow:
    0 8px 24px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
  /* on réserve la place du bandeau */
  padding-top: 64px;               /* hauteur du bandeau (56) + marge */
}

/* Bandeau plein en haut (même couleur que la bordure) */
.profile-card::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;               /* top:0; left:0; right:0 */
  height: 56px;
  background: var(--edge);
  z-index: 0;
}

/* Option A — Titre automatique via data-title */
.profile-card[data-title]::after{
  content: attr(data-title);
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .75rem;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #111;                     /* lisible sur le bandeau coloré */
  z-index: 1;
}

/* Option B — Si tu préfères placer un élément titre (texte ou image) */
.profile-card .card-title{
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 0 .75rem;
  z-index: 1;
}
.profile-card .card-title img{ max-height: 44px; }

/* Variantes de couleur, cohérentes avec tes tuiles */
.profile-card.card--mint    { --edge:#00ffc6; }
.profile-card.card--grape   { --edge:#a874ff; }
.profile-card.card--sunset  { --edge:#ff9a6b; }
.profile-card.card--aqua    { --edge:#00d2ff; }
.profile-card.card--amber   { --edge:#ffc107; }
.profile-card.card--rose    { --edge:#ff00ff; }
.profile-card.card--emerald { --edge:#00e6b3; }

/* ───────── Variante opt-in pour certaines boxes ───────── */
.game-interaction-box.game-box--framed{
  --edge:#29b6f6;                 /* couleur par défaut (aqua) */
  position: relative;
  background:#161616;
  border:5px solid var(--edge);
  border-radius:14px;
  box-shadow:
    0 8px 24px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.06);
  padding-top:64px;               /* réserve la place du bandeau (56px) */
  overflow: auto;                 /* conserve le scroll interne */
}

/* Bandeau plein en haut */
.game-interaction-box.game-box--framed::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:56px;
  background:var(--edge);
  z-index:0;
}

/* Option A — titre auto via data-title */
.game-interaction-box.game-box--framed[data-title]::after{
  content:attr(data-title);
  position:absolute;
  top:0;left:0;right:0;
  height:56px;
  display:flex;align-items:center;justify-content:center;
  padding:0 .75rem;
  font-weight:900; letter-spacing:.5px; text-transform:uppercase;
  color:#111;
  z-index:1;
  text-shadow:0 1px 0 rgba(255,255,255,.25);
}

/* Option B — bloc .card-title si tu préfères du HTML */
.game-interaction-box.game-box--framed .card-title{
  position:absolute;
  top:0;left:0;right:0;
  height:56px;
  display:flex;align-items:center;justify-content:center;gap:.5rem;
  padding:0 .75rem;
  z-index:1;
}
.game-interaction-box.game-box--framed .card-title h2{
  margin:0;
  color:#111;
  text-shadow:0 1px 0 rgba(255,255,255,.25);
}
.game-interaction-box.game-box--framed .card-title img{ max-height:44px; }

/* Variantes de couleur pour la bordure/bandeau */
.game-interaction-box.game-box--mint    { --edge:#00ffc6; }
.game-interaction-box.game-box--grape   { --edge:#a874ff; }
.game-interaction-box.game-box--sunset  { --edge:#ff9a6b; }
.game-interaction-box.game-box--aqua    { --edge:#0ff; }
.game-interaction-box.game-box--amber   { --edge:#ffc107; }
.game-interaction-box.game-box--rose    { --edge:#ff00ff; }
.game-interaction-box.game-box--emerald { --edge:#00e6b3; }


/* Titres des boxes encadrées : blanc + plus grand */
.game-interaction-box.game-box--framed::after,
.game-interaction-box.game-box--framed .card-title,
.game-interaction-box.game-box--framed .card-title *,

.profile-card.game-box--framed::after,
.profile-card.game-box--framed .card-title,
.profile-card.game-box--framed .card-title * {
  color: #fff !important;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.game-interaction-box.game-box--framed::after,
.game-interaction-box.game-box--framed .card-title,
.game-interaction-box.game-box--framed .card-title *,
.profile-card.game-box--framed::after,
.profile-card.game-box--framed .card-title,
.profile-card.game-box--framed .card-title *{
  /* ombre multilayer pour plus de relief */
  text-shadow:
    0 1px 0 rgba(0,0,0,.50),
    0 2px 2px rgba(0,0,0,.45),
    0 4px 6px rgba(0,0,0,.35);
}

/* utilise --edge si présent (profile-card/game-box--framed) */
.profile-card.game-box--framed[data-title],
.game-interaction-box.game-box--framed[data-title],
.profile-card.game-box--framed .card-title,
.game-interaction-box.game-box--framed .card-title{
  /* halo coloré + profondeur */
  text-shadow:
    0 0 6px  color-mix(in oklab, var(--edge, #29b6f6) 60%, #000 40%),
    0 2px 3px rgba(0,0,0,.55),
    0 6px 12px rgba(0,0,0,.35);
}

/* TITRE BANDEAU (frameBoxOn) — blanc + plus grand + ombre marquée */
.game-interaction-box.game-box--framed.game-box--aqua[data-title]::after,
.game-interaction-box.game-box--framed[data-title]::after{
  color:#fff !important;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem) !important;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(0,0,0,.85),
    0 3px 6px rgba(0,0,0,.65),
    0 8px 18px rgba(0,0,0,.55) !important;
}

