/* backgammon-solo.css — page de jeu solo (et base réutilisée par multi / défi) */

:root {
  --bg-bois: #2a1810;
  --bg-bois2: #3a2416;
  --bg-ambre: #d98f3a;
  --bg-ambre-clair: #e8c07d;
  --bg-carte: rgba(38, 24, 14, 0.72);
  --bg-bord: rgba(232, 192, 125, 0.22);
  --bg-texte: #f2e6cf;
  --bg-texte-doux: #c9b78f;
}

#app {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 18px 40px;
  color: var(--bg-texte);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.top-bar h1 { font-size: 1.5rem; margin: 0; color: var(--bg-ambre-clair); }
.back-link { color: var(--bg-texte-doux); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { color: var(--bg-ambre-clair); }
.niveau-tag {
  background: rgba(217, 143, 58, 0.18);
  border: 1px solid var(--bg-bord);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.bg-ic { color: var(--bg-ambre-clair); }

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #a9560f, #d98f3a); color: #fff; }
.btn-secondary { background: rgba(232, 192, 125, 0.14); color: var(--bg-texte); border: 1px solid var(--bg-bord); }

.cache { display: none !important; }

/* ---- Écran de setup ---- */
#bg-setup { display: flex; justify-content: center; }
.bg-setup-box {
  background: var(--bg-carte);
  border: 1px solid var(--bg-bord);
  border-radius: 16px;
  padding: 22px 24px;
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.bg-setup-box h2 { margin: 0 0 18px; color: var(--bg-ambre-clair); }
.bg-setup-bloc { margin-bottom: 20px; }
.bg-setup-label { margin: 0 0 10px; font-size: 0.9rem; color: var(--bg-texte-doux); }
.bg-setup-choices { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bg-setup-btn {
  flex: 1 1 140px;
  background: rgba(232, 192, 125, 0.08);
  border: 2px solid var(--bg-bord);
  border-radius: 12px;
  padding: 12px 10px;
  color: var(--bg-texte);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s, background 0.15s;
}
.bg-setup-btn strong { color: var(--bg-ambre-clair); font-size: 1rem; }
.bg-setup-btn small { color: var(--bg-texte-doux); font-size: 0.75rem; }
.bg-setup-btn:hover { border-color: var(--bg-ambre); }
.bg-setup-btn.actif { border-color: var(--bg-ambre); background: rgba(217, 143, 58, 0.2); }
.bg-setup-radios { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: 0.92rem; }
.bg-setup-radios label { cursor: pointer; }
#bg-start { margin-top: 6px; }

/* ---- Aire de jeu ---- */
.bg-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 48px;
}
.bg-des-wrap { display: flex; align-items: center; }
#bg-des { display: flex; gap: 6px; }
.bg-de {
  font-size: 2.1rem;
  line-height: 1;
  color: var(--bg-ambre-clair);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.bg-de.utilise { opacity: 0.3; color: var(--bg-texte-doux); }
.bg-message {
  flex: 1 1 200px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--bg-texte);
  min-height: 1.2em;
}
.bg-btn-annuler { padding: 8px 14px; font-size: 0.85rem; }

.bg-plateau-wrap { display: flex; justify-content: center; }
#bg-canvas {
  width: 100%;
  max-width: 760px;
  height: auto;
  aspect-ratio: 3 / 2;
  display: block;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}
.bg-aide { text-align: center; font-size: 0.8rem; color: var(--bg-texte-doux); margin: 14px 0 0; }

/* ---- Overlay fin de partie ---- */
#bg-fin {
  position: fixed;
  inset: 0;
  background: rgba(15, 9, 5, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
#bg-fin.visible { display: flex; }
.bg-fin-box {
  background: var(--bg-bois2);
  border: 1px solid var(--bg-bord);
  border-radius: 16px;
  padding: 26px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.bg-fin-box h2 { margin: 0 0 8px; color: var(--bg-ambre-clair); font-size: 1.6rem; }
#bg-fin-detail { margin: 0 0 6px; }
#bg-fin-elo { margin: 0 0 12px; color: var(--bg-ambre-clair); font-weight: 600; }
.bg-cta-inscription { margin: 14px 0; padding: 14px; background: rgba(217,143,58,0.12); border-radius: 12px; }
.bg-cta-inscription p { margin: 0 0 10px; font-size: 0.9rem; }
.bg-cta-btns, .bg-fin-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bg-fin-btns { margin-top: 14px; }

/* Masquer les bandeaux latéraux pendant la partie (PC uniquement, gérés par le portail) */
body.backgammon-en-jeu .bandeau-infos-wrap,
body.backgammon-en-jeu .bloc-jeux-une-wrap { display: none !important; }

/* ---- Défi du jour ---- */
.bg-defi-entete { text-align: center; color: var(--bg-texte-doux); font-size: 0.92rem; margin-bottom: 16px; }
.bg-defi-entete strong { color: var(--bg-ambre-clair); }
.bg-defi-carte {
  background: var(--bg-carte);
  border: 1px solid var(--bg-bord);
  border-radius: 16px;
  padding: 22px 24px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto 18px;
}
.bg-defi-carte h2 { margin: 0 0 10px; color: var(--bg-ambre-clair); }
.bg-defi-carte p { margin: 0 0 12px; }
.bg-defi-carte .btn { margin-top: 6px; }
.bg-defi-grosscore { font-size: 1.15rem; }
.bg-defi-grosscore strong { color: var(--bg-ambre-clair); font-size: 1.5rem; }
.bg-defi-classement-wrap { max-width: 520px; margin: 22px auto 0; }
.bg-defi-classement-wrap h3 { text-align: center; color: var(--bg-ambre-clair); font-size: 1.1rem; }
.bg-defi-liste { list-style: none; counter-reset: rang; padding: 0; margin: 0; }
.bg-defi-liste li {
  counter-increment: rang;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(232, 192, 125, 0.1);
}
.bg-defi-liste li::before { content: counter(rang); width: 26px; color: var(--bg-ambre-clair); font-weight: 700; }
.bg-defi-pseudo { flex: 1; text-align: left; padding-left: 6px; }
.bg-defi-score { color: var(--bg-texte-doux); font-size: 0.9rem; }
.bg-defi-vide { text-align: center; color: var(--bg-texte-doux); font-size: 0.9rem; padding: 14px; }
