/* ──────────────────────────────────────────────────────────────────────────
   shared/theme.css — styles communs à tout le Game Center.
   Extrait du CSS dupliqué dans les 31 jeux + l'accueil.
   Un jeu peut redéfinir sa couleur d'accent via  body { --accent: #5dcaa5 }.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #1a1240;
  --accent: #a89fff;
  --txt: #fff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Pas de zoom au double-tap : Safari iOS ignore volontairement le
   « user-scalable=no » de la balise viewport, mais il respecte touch-action.
   « manipulation » ne coupe que le double-tap — le défilement et le zoom à
   deux doigts restent possibles. Un jeu peut durcir en touch-action:none. */
html, body { touch-action: manipulation; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem 2.5rem;
  color: var(--txt);
  -webkit-user-select: none;
  user-select: none;
}

/* ── Bouton retour (identique dans tous les jeux) ── */
.back {
  align-self: flex-start;
  text-decoration: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 0.9rem;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.13);
  border: 1.5px solid rgba(255,255,255,0.28);
  transition: background 0.15s, transform 0.1s;
}
.back:hover { background: rgba(255,255,255,0.24); }
.back:active { transform: scale(0.96); }

/* ── Titres ── */
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.2rem; }
h1 span { color: var(--accent); }
.subtitle { font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 1rem; text-align: center; }

/* ── Pills (catégories / niveaux / etc.) ── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
  text-align: center;
}
.pill-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 1.2rem;
  background: rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 5px;
  justify-content: center;
  flex-wrap: wrap;
}
.pill-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
}
.pill-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.pill-btn.active { color: #1a1240; background: var(--accent); }

/* ── HUD / stats ── */
.stat { text-align: center; }
.stat-val { font-size: 24px; font-weight: 700; line-height: 1; color: #fff; }
.stat-lbl { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Grille de réponses (quiz, tables, alphabet…) ── */
#answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 420px; }
.answer {
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.08s;
}
.answer:active { transform: scale(0.97); }
.answer.correct { background: #5dcaa5; color: #1a1240; }
.answer.wrong   { background: #e24b4a; color: #fff; }

/* ── Barre du haut (retour + titre + sélecteur de langue) ── */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.8rem;
}
.topbar .back { margin-bottom: 0; flex-shrink: 0; }
/* Titre centré entre le bouton retour (gauche) et le sélecteur de langue (droite) */
.topbar h1 {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1.45rem;
  margin-bottom: 0;
}
.topbar #lang-switch { flex-shrink: 0; }

@media (max-width: 380px) {
  .topbar h1 { font-size: 1.2rem; }
}

/* ── Sélecteur de langue (FR / EN / PT) ── */
.lang-switch {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 4px;
}
.lang-btn {
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.lang-btn.active { color: #1a1240; background: var(--accent); }

/* ── Bannière « et si tu changeais de jeu ? » (injectée par shared/shell.js) ──
   Simple calque posé sur le jeu : position fixe, et surtout aucun décalage du
   contenu en dessous — une partie en cours ne doit pas sauter parce qu'un
   rappel s'affiche. Elle recouvre donc le haut de la page le temps qu'on la
   congédie (un appui dessus suffit). */
.gc-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--bg);           /* opaque : posée sur le jeu, elle ne doit rien laisser transparaître */
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  transform: translateY(-100%);
  transition: transform 0.28s ease;
}
.gc-banner.show { transform: translateY(0); }
.gc-banner-txt {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}
.gc-banner-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.08s;
}
.gc-banner-btn:active { transform: scale(0.96); }
.gc-banner-go { background: var(--accent); color: #1a1240; }
.gc-banner-later { background: rgba(255,255,255,0.13); color: rgba(255,255,255,0.75); }
.gc-banner-later:hover { background: rgba(255,255,255,0.24); color: #fff; }
