/* ===========================
   Arcade ProGamer — style.css
   Thème : noir profond + halo bordeaux
   Responsive + effets néon + ripple
   =========================== */

/* --------- Reset de base --------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, Montserrat, Arial, sans-serif;
  color: #e8e8ea;
  background: #0b0b0d; /* noir profond */
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------- Fond avec halo optionnel --------- */
/* Si tu veux une image de fond : décommente la ligne background-image */
/* body.pg-bg { background: #0b0b0d url("images/background.jpg") center/cover fixed no-repeat; } */
body.pg-bg {
  background: radial-gradient(800px 400px at 10% 8%, rgba(176,19,58,.24), rgba(0,0,0,0) 60%) #0b0b0d;
}

/* --------- Conteneur principal --------- */
.arcade-wrap { width: min(1100px, 92%); margin: 40px auto 30px; text-align: center; }
.arcade-title { font-weight: 800; font-size: 28px; margin: 0 0 16px; }

/* --------- Barre d’outils --------- */
.toolbar { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.search {
  width: min(420px, 90%);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: #121214;
  color: #e8e8ea;
  outline: none;
  transition: .2s border-color, .2s box-shadow;
}
.search:focus {
  border-color: rgba(123,7,34,.55);
  box-shadow: 0 0 0 3px rgba(123,7,34,.18);
}
.counter {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(123,7,34,.35), rgba(176,19,58,.35));
  border: 1px solid rgba(123,7,34,.5);
  color: #fff;
  font-weight: 700;
}

/* --------- Grille de jeux --------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: #121214;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  transition: .2s transform, .2s border-color, .2s box-shadow;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(123,7,34,.35);
  box-shadow: 0 18px 36px rgba(0,0,0,.45);
}
.thumb {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 0 12px rgba(123,7,34,.30);
  display: block;
}
.card h3 { margin: 6px 0 10px; font: 700 16px/1.2 Montserrat, Inter, Arial; }

/* --------- Boutons (néon + ripple) --------- */
.play {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: inline-block;
  border: 1px solid rgba(255,255,255,.12);
  color: #f3f3f6;
  background:
    radial-gradient(200px 200px at var(--mx) var(--my), rgba(176,19,58,.22), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(176,19,58,.12), rgba(0,0,0,.0));
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .3px;
  transition: .15s transform, .15s box-shadow, .15s border-color;
  overflow: hidden;
  isolation: isolate;
}
.play.small { font-size: 14px; }
.play:hover {
  transform: translateY(-1px);
  border-color: rgba(176,19,58,.55);
  box-shadow: 0 0 22px rgba(176,19,58,.25), inset 0 0 12px rgba(176,19,58,.18);
}
.play:active { transform: translateY(0); }

/* Ripple energy on click */
.play .ripple {
  position: absolute;
  pointer-events: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,80,120,.75), rgba(176,19,58,.35) 40%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: .9;
  animation: ripple-burst .6s ease-out forwards;
  mix-blend-mode: screen;
}
@keyframes ripple-burst {
  to { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}

/* --------- Modale (overlay) --------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Boîte de dialogue : largeur par défaut (petits jeux) */
.dialog {
  background: #121214;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  width: min(660px, 94%);
  max-height: 90vh;
  overflow: auto;
}

/* Conteneur du player */
.frame {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

/* Boutons de la modale */
.close, .fullscreen-btn {
  position: absolute;
  top: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: #9a9aa0;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s all;
  height: 36px; min-width: 36px;
}
.close { right: 10px; font-size: 22px; }
.fullscreen-btn { right: 50px; font-size: 20px; }
.close:hover, .fullscreen-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,.3);
  transform: scale(1.07);
}

/* --------- Scoreboard (barre + liste) --------- */
#scorebar {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#scorebar input[type="text"],
#scorebar input[type="number"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: #0e0e10;
  color: #fff;
  outline: none;
}
#scorebar input:focus {
  border-color: rgba(176,19,58,.5);
  box-shadow: 0 0 0 2px rgba(176,19,58,.2);
}
#scoreboard {
  margin-top: 10px;
  display: none;
  text-align: left;
}
#scoreboard h4 { margin: 6px 0 8px; }
#sbList { margin: 0; padding-left: 20px; }

/* --------- Responsive : tablettes & mobiles --------- */
@media (max-width: 900px) {
  .arcade-wrap { margin-top: 28px; }
  .toolbar { gap: 10px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .card { padding: 10px; }
  .thumb { border-radius: 10px; }
  .dialog { width: min(760px, 96%); }
}

/* Mobile : zoom plein écran visuel (géré en JS pour le player) */
@media (max-width: 768px) {
  .arcade-title { font-size: 22px; }
  .search { width: 100%; }
  .dialog {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
  }
  .fullscreen-btn { right: 52px; top: 8px; }
  .close { right: 10px; }
}

/* --------- Helper : étiquettes / badges si besoin --------- */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(90deg, rgba(176,19,58,.15), rgba(0,0,0,0));
}

/* Miniatures : toutes au même format visuel */
.card .thumb{
  width: 100%;
  /* force une fenêtre 320×200 ˜ ratio 16:10 */
  aspect-ratio: 16 / 10;
  height: auto;           /* laisse le navigateur calculer la hauteur */
  object-fit: cover;      /* rogne proprement si l'image est plus haute/large */
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(123,7,34,.30);
}
/* ====== Header + Hero ====== */
.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; background:rgba(0,0,0,.55); backdrop-filter:blur(6px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand{display:flex; align-items:center; gap:10px; font:700 18px/1.1 Montserrat,Inter,system-ui}
.brand .logo{
  width:34px;height:34px;border-radius:10px;overflow:hidden;flex:0 0 34px;
  box-shadow:0 0 8px rgba(0,136,255,.6);
}
.brand .logo img{width:100%;height:100%;object-fit:cover;display:block}
.badge{
  padding:8px 12px;border-radius:999px;font-weight:700;
  background:#2a1218;border:1px solid rgba(176,19,58,.6); color:#fff;
}
.hero{
  width:min(1100px,92%); margin:34px auto 18px; text-align:center;
  background:radial-gradient(1200px 380px at 40% -20%, rgba(176,19,58,.16), transparent 60%);
}
.hero h1{font:800 48px/1.05 Montserrat,Inter,system-ui;margin:14px 0 10px;color:#eaeaf1;letter-spacing:.4px}
.hero p{color:#c9c9d1;margin:0 0 20px}
.hero .search-wide{
  width:min(620px,96%); padding:14px 16px; border-radius:14px;
  border:1px solid rgba(255,255,255,.10); background:#121214; color:#e8e8ea; outline:none;
}
.hero .chips{display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin:14px 0 6px}
.chip{
  padding:8px 14px; border-radius:12px; background:#1a1a1d; color:#ddd; border:1px solid rgba(255,255,255,.08);
  cursor:pointer; font-weight:700; transition:.15s
}
.chip.active{background:#2a1218; color:#fff; border-color:rgba(176,19,58,.7)}
/* petit badge compteur côté droit dans le hero */
.hero .count-right{position:absolute; right:0; top:0; transform:translateY(-50%);}
@media (max-width:720px){
  .hero h1{font-size:34px}
}


