/* GameFactory — styles du menu catalogue
   Direction visuelle : atelier / usine de jeux, accent menthe, fond chaud texturé */

:root {
  --bg-deep: #1a2e28;
  --bg: #243d35;
  --bg-soft: #2f4f45;
  --surface: #f3efe6;
  --surface-2: #e8e2d4;
  --ink: #14241f;
  --ink-muted: #4a5f57;
  --mint: #3dcf9a;
  --mint-deep: #1f9a6c;
  --amber: #e8a838;
  --line: rgba(20, 36, 31, 0.12);
  --shadow: 0 18px 40px rgba(10, 24, 20, 0.28);
  --radius: 18px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(61, 207, 154, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(232, 168, 56, 0.22), transparent 50%),
    linear-gradient(160deg, var(--bg-deep), var(--bg) 45%, #1e3830);
  line-height: 1.5;
}

/* Texture légère (points) pour éviter un fond plat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(circle at 1px 1px, rgba(243, 239, 230, 0.55) 1px, transparent 0);
  background-size: 22px 22px;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* ——— En-tête / marque ——— */
.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: rise 0.7s ease both;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--surface);
}

.brand h1 span {
  color: var(--mint);
}

.brand p {
  margin: 0.55rem 0 0;
  max-width: 28rem;
  color: rgba(243, 239, 230, 0.78);
  font-size: 1.05rem;
}

.badge-free {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(61, 207, 154, 0.18);
  border: 1px solid rgba(61, 207, 154, 0.45);
  color: var(--mint);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ——— Barre outils (recherche + tri) ——— */
.toolbar {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease 0.08s both;
}

.search-wrap {
  position: relative;
}

.search-wrap label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#search {
  width: 100%;
  padding: 0.95rem 1.1rem 0.95rem 2.85rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%234a5f57' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m15 15 3.5 3.5'/%3E%3C/svg%3E") 1rem center no-repeat;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search:focus {
  border-color: var(--mint-deep);
  box-shadow: 0 0 0 3px rgba(61, 207, 154, 0.35), var(--shadow);
}

#search::placeholder {
  color: var(--ink-muted);
}

.sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.sort-row label {
  color: rgba(243, 239, 230, 0.75);
  font-size: 0.9rem;
}

#sort {
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(243, 239, 230, 0.2);
  background: rgba(20, 36, 31, 0.35);
  color: var(--surface);
  font: inherit;
}

/* ——— Filtres styles ——— */
.styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  animation: rise 0.7s ease 0.14s both;
}

.style-btn {
  appearance: none;
  border: 1px solid rgba(243, 239, 230, 0.22);
  background: rgba(20, 36, 31, 0.28);
  color: rgba(243, 239, 230, 0.9);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.style-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 207, 154, 0.55);
}

.style-btn.is-active {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--bg-deep);
}

/* ——— Grille de jeux ——— */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  animation: rise 0.7s ease 0.2s both;
}

.game-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 40%;
  height: 140px;
  background: radial-gradient(circle, rgba(61, 207, 154, 0.35), transparent 70%);
  pointer-events: none;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(10, 24, 20, 0.35);
  outline: none;
}

.game-card.is-soon {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

.game-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.game-card__preview {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--bg-deep);
  background: linear-gradient(145deg, var(--mint), #7be0b8);
}

.game-card__status {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: rgba(31, 154, 108, 0.15);
  color: var(--mint-deep);
}

.game-card__status.soon {
  background: rgba(232, 168, 56, 0.18);
  color: #9a6a12;
}

.game-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.game-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  flex: 1;
}

.game-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-muted);
}

.empty {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(243, 239, 230, 0.12);
  color: rgba(243, 239, 230, 0.85);
}

.footer {
  margin-top: 2.5rem;
  color: rgba(243, 239, 230, 0.55);
  font-size: 0.85rem;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
