/* === Blocs Fusion — page de jeu (solo) ===
   Le chrome de gameplay (plateau, pièces, boutons) est dans blocs-fusion-jeu.css. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(129,140,248,0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(45,212,191,0.12) 0%, transparent 50%),
    #0b1020;
  color: #e2e8f0;
  padding: 12px;
  overflow-x: hidden;
}

#app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(17, 24, 47, 0.6);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.15);
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.back-link {
  font-size: 0.85rem;
  color: var(--color-light, #2dd4bf);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.back-link:hover { filter: brightness(1.2); }
h1 {
  flex: 1;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-align: center;
  font-weight: 800;
  background: linear-gradient(90deg, var(--color-light, #2dd4bf), var(--color-mid, #818cf8), var(--color-accent, #fbbf24));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* HUD */
.hud {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-card {
  flex: 1;
  background: rgba(10, 15, 35, 0.7);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 10px;
  padding: 7px 6px;
  text-align: center;
}
.stat-label {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-accent, #fbbf24);
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Écran de préparation */
.setup {
  text-align: center;
  padding: 18px 8px 8px;
}
.setup h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #f1f5f9;
}
.setup p { color: #cbd5e1; font-size: 0.92rem; line-height: 1.6; margin-bottom: 8px; }
.setup ul {
  list-style: none;
  text-align: left;
  max-width: 360px;
  margin: 14px auto 18px;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.8;
}
.setup li::before { content: '🧩 '; }

/* Choix du mode (Détente / Classique), avant la partie */
.choix-mode-titre {
  font-size: 0.75rem !important;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8 !important;
  margin: 4px 0 10px !important;
}
.choix-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto 8px;
}
.carte-mode {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  text-align: left;
  font-family: inherit;
  color: #cbd5e1;
  background: rgba(10, 15, 35, 0.6);
  border: 2px solid rgba(129, 140, 248, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.carte-mode:hover { border-color: rgba(129, 140, 248, 0.55); }
.carte-mode.active {
  border-color: var(--color-accent, #fbbf24);
  background: rgba(251, 191, 36, 0.08);
}
.carte-mode-titre { font-size: 1rem; font-weight: 800; color: #f1f5f9; }
.carte-mode-texte { font-size: 0.8rem; line-height: 1.45; }
.choix-mode-note { font-size: 0.78rem !important; color: #94a3b8 !important; margin-bottom: 16px !important; }
@media (max-width: 380px) {
  .choix-mode { grid-template-columns: 1fr; }
}

/* Mode de la partie en cours, entre « Recommencer » et le bouton son */
.mode-actif {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-accent, #fbbf24);
}
/* Mode Classique : pas de rotation, donc pas d'aide sur la rotation */
body.bf-classique .aide-rotation { display: none; }

.lien-classement-fin {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-light, #2dd4bf);
  text-decoration: none;
}
.lien-classement-fin:hover { filter: brightness(1.2); }

/* Overlay fin de partie */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 26, 0.92);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.overlay.visible { display: flex; }
.overlay-box {
  background: rgba(17, 24, 47, 0.98);
  border: 2px solid rgba(129, 140, 248, 0.5);
  border-radius: 16px;
  padding: 26px 24px 22px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(79, 70, 229, 0.3);
}
.overlay-box h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
  color: #f87171;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(129, 140, 248, 0.08);
  border-radius: 10px;
}
.stat-cell .stat-val { font-size: 1.1rem; }
.overlay-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.fin-sous-titre { color: #cbd5e1; font-size: 0.9rem; margin-bottom: 14px; }
.fin-validation { font-size: 0.82rem; margin: -6px 0 14px; color: #94a3b8; }
.fin-validation:empty { display: none; }
.fin-validation.ok { color: #5eead4; }
.fin-validation.refus { color: #f87171; }
.fin-validation.attente { color: #94a3b8; }
.cta-score-msg { color: var(--color-accent, #fbbf24); font-size: 0.82rem; margin-bottom: 10px; }
.cta-auth-btns { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }

footer { font-size: 0.74rem; color: #64748b; margin-top: 12px; text-align: center; }
footer a { color: var(--color-light, #2dd4bf); text-decoration: none; }
footer a:hover { filter: brightness(1.2); }

/* Pendant la partie : masquer bandeaux latéraux (réaffichés en fin de partie) */
body.bf-en-jeu .bandeau-infos-wrap,
body.bf-en-jeu .bloc-jeux-une-wrap { display: none !important; }

/* La barre de connexion (fixe, en haut à droite, ~350 px de large) recouvrait la barre
   du haut (« ← Accueil », titre, « Classement ») dès que les marges latérales sont
   plus étroites qu'elle : téléphone, tablette et petits écrans d'ordinateur. */
@media (max-width: 1280px) {
  body { padding-top: 58px; }
}

@media (max-width: 600px) {
  body { padding-top: 50px; }
  #app { padding: 12px 10px 10px; }
  h1 { font-size: 1rem; }
  .stat-val { font-size: 0.95rem; }
}

/* Téléphone en paysage : plus large, sous la barre de connexion (voir blocs-fusion-jeu.css) */
@media (orientation: landscape) and (max-height: 540px) {
  body { padding-top: 50px; }
  #app { max-width: 820px; }
  .top-bar { display: none; }
  .hud { margin-bottom: 8px; }
}
