/* portail.css — page d'accueil (index.html) : fond d'espace + grille de 18 jeux */

:root {
  --bg: #02030a;
  --ink: #e8f0ff;
  --muted: #8ea2c8;
  --line: rgba(150, 190, 255, 0.22);
  --glass: rgba(10, 16, 40, 0.55);
  --accent: #ffcc33;
  --accent-2: #4fd1ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* le champ d'étoiles couvre toute la fenêtre, derrière le contenu */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  min-height: 100dvh;
}

.top { text-align: center; }

.top h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: 0.32em;
  padding-left: 0.32em; /* recentre malgré l'espacement des lettres */
  color: var(--ink);
  text-shadow: 0 0 22px rgba(79, 209, 255, 0.55), 0 0 60px rgba(79, 209, 255, 0.25);
}

.top p {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  letter-spacing: 0.04em;
}

/* ---------- grille : 6 × 3 sur grand écran, 3 × 6 puis 2 × 9 ---------- */
.grid {
  list-style: none;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 16px; } }

.slot { display: flex; }

.card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 188px;
  padding: 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: inherit;
  text-decoration: none;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.num {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
}
.icon svg { width: 100%; height: 100%; display: block; }

.name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.desc {
  margin-top: 4px;
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

/* jeu disponible */
.card.live {
  border-color: rgba(255, 204, 51, 0.55);
  box-shadow: 0 0 18px rgba(255, 204, 51, 0.16);
  cursor: pointer;
}
.card.live .tag { background: linear-gradient(#ffcc33, #ff9900); color: #1a2a05; }
.card.live:hover,
.card.live:focus-visible {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(255, 204, 51, 0.38), 0 10px 26px rgba(0, 0, 0, 0.5);
  background: rgba(16, 26, 60, 0.72);
  outline: none;
}
.card.live:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* emplacement encore vide */
.card.empty {
  border-style: dashed;
  opacity: 0.55;
  cursor: default;
}
.card.empty .icon { opacity: 0.45; }
.card.empty .tag { border: 1px solid var(--line); color: var(--muted); }

.foot {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
