/* === COMPTE : bouton de la barre du haut, popup de connexion, menu (voir shared/js/compte.js) ===
   Chargée sur chaque page, y compris l'accueil (qui n'a pas les variables de base.css : couleurs
   de repli dans les var()). Téléphone : voir la fin du fichier et shared/css/mobile.css. */

.cpt-zone {
  display: flex;
  align-items: center;
  margin-left: 0.6rem;
}
.cpt-zone + .lang-switch { margin-left: 0.6rem; }

.cpt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 12rem;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent, #B6D8F2);
  background: rgba(182, 216, 242, 0.08);
  border: 1px solid rgba(182, 216, 242, 0.35);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.cpt-btn:hover { background: rgba(182, 216, 242, 0.16); border-color: var(--accent, #B6D8F2); }
.cpt-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.cpt-label { overflow: hidden; text-overflow: ellipsis; }

/* Pages de jeu (barre déjà chargée) : pastille ronde sans texte, le pseudo est dans le menu */
/* (marges resserrées : le quotidien tient encore sur une ligne en 1366 px de large) */
.top-bar-right .cpt-zone { margin-left: 0; }
.top-bar-right .cpt-zone + .lang-switch { margin-left: 0.3rem; }
.top-bar-right .cpt-btn, .top-bar-right .cpt-btn.cpt-connecte {
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border-radius: 50%;
}
.top-bar-right .cpt-label { display: none; }

/* Connecté : pastille avec l'initiale du pseudo */
.cpt-btn.cpt-connecte { padding-left: 0.3rem; }
.cpt-initiale {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--accent, #B6D8F2);
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 900;
}
.cpt-initiale-icone svg { width: 0.95rem; height: 0.95rem; }
/* Photo de profil Discord à la place de l'initiale */
.cpt-avatar { overflow: hidden; background: rgba(182, 216, 242, 0.15); }
.cpt-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- Popup de connexion ---- */
.cpt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
}
.cpt-overlay.hidden { display: none !important; }

.cpt-box {
  position: relative;
  width: 100%;
  max-width: 24rem;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.75rem 1.5rem 1.4rem;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 1.25rem;
  text-align: center;
  animation: cptIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cptIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

.cpt-box h3 {
  font-family: 'Lilita One', 'Nunito', sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-size: 1.35rem;
  color: var(--accent, #B6D8F2);
}
.cpt-intro { margin: 0.45rem 0 1.2rem; font-size: 0.9rem; line-height: 1.45; color: var(--text-secondary, #94a3b8); }
.cpt-erreur {
  margin: -0.4rem 0 1rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: 0.6rem;
}
.cpt-erreur.hidden { display: none !important; }

.cpt-fermer {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.15s;
}
.cpt-fermer:hover { color: var(--text-primary, #f1f5f9); }

.cpt-fournisseurs { display: flex; flex-direction: column; gap: 0.65rem; }
.cpt-fournisseur {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  border-radius: 0.75rem;
  transition: background 0.2s, border-color 0.2s;
}
.cpt-fournisseur svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.cpt-discord { color: #fff; background: #5865F2; border: 1px solid #5865F2; }
.cpt-discord:hover { background: #4752c4; border-color: #4752c4; }
.cpt-google { color: #1f1f1f; background: #fff; border: 1px solid #dadce0; }
.cpt-google:hover { background: #eef2f7; }

.cpt-note { margin-top: 1.1rem; font-size: 0.75rem; line-height: 1.4; color: var(--text-muted, #64748b); }

/* ---- Menu du compte connecté (dans le <body>, placé sous le bouton par compte.js) ---- */
.cpt-menu {
  position: fixed;
  z-index: 1000;
  min-width: 13rem;
  max-width: calc(100vw - 1rem);
  padding: 0.85rem 0.5rem 0.5rem;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-family: 'Nunito', sans-serif;
}
.cpt-menu-nom {
  padding: 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpt-menu-via { padding: 0 0.6rem 0.6rem; font-size: 0.78rem; color: var(--text-secondary, #94a3b8); }
.cpt-menu-item {
  display: block;
  box-sizing: border-box;
  text-decoration: none;
  width: 100%;
  padding: 0.55rem 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  color: var(--accent, #B6D8F2);
  background: none;
  border: none;
  border-top: 1px solid var(--border, #334155);
  cursor: pointer;
  transition: background 0.15s;
}
.cpt-menu-item:hover, .cpt-menu-item:focus-visible { background: rgba(182, 216, 242, 0.1); outline: none; }

/* ---- Téléphone : bouton réduit à une pastille ronde (place de la barre du haut) ---- */
@media (max-width: 700px) {
  .cpt-zone { margin: 0; }
  .cpt-zone + .lang-switch { margin-left: 0; }
  .cpt-btn, .cpt-btn.cpt-connecte {
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
  }
  .cpt-label { display: none; }
  .cpt-initiale { width: 1.55rem; height: 1.55rem; }
}
