/* TriGames — charte graphique steampunk
   Variables centralisées : toucher ce fichier suffit à faire évoluer
   le style sur l'ensemble des pages (accueil + tous les jeux). */

:root {
  /* Palette (cf. docs/02-FUNCTIONAL-SPEC.md §6.2) */
  --color-bg: #2b1d14;
  --color-bg-panel: #3e2b1f;
  --color-accent: #b87333;   /* cuivre */
  --color-accent-2: #c9a227; /* laiton / or */
  --color-alert: #a13d2f;    /* rouille */
  --color-text: #f0e6d2;     /* ivoire */
  --color-text-muted: #cbb99a;

  --font-heading: "Special Elite", "Cinzel", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 6px;
  --shadow-rivet: inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.4);

  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  min-height: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--color-accent-2);
  margin: 0 0 0.5em;
}

a {
  color: var(--color-accent-2);
}

button {
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
}

/* Bouton "levier / rivet" commun à tout le site */
.btn {
  background: var(--color-bg-panel);
  color: var(--color-text);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rivet);
  padding: 0.6em 1.2em;
  min-height: 44px;
  min-width: 44px;
  transition: transform 0.05s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:hover {
  background: #4a3524;
}

.btn-accent {
  border-color: var(--color-accent-2);
  color: var(--color-bg);
  background: var(--color-accent-2);
}

/* Header commun, injecté par shared/header.js */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-height);
  padding: 0 1rem;
  background: var(--color-bg-panel);
  border-bottom: 3px solid var(--color-accent);
}

.site-header__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-accent-2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__back {
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.4rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

/* Grille d'icônes de jeux (accueil) */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--color-text);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius);
  background: var(--color-bg-panel);
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-rivet);
  min-height: 44px;
}

.game-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.game-card__label {
  font-size: 0.85rem;
  text-align: center;
}

.game-card--soon {
  opacity: 0.45;
  pointer-events: none;
}

/* Popup / toast (ex. fin de temps du minuteur) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--color-bg-panel);
  border: 2px solid var(--color-alert);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rivet);
  padding: 1rem 1.25rem;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 100;
}
