/* Page Compte & équipe — habillage uniquement (chargé par compte.html, body.page-compte).
   Les identifiants et la logique restent dans account.js. */

/* ============ Accroche ============ */
.page-compte .cp-hero {
  position: relative; overflow: hidden;
  padding: 68px 0 56px;
  border-bottom: 1px solid var(--border);
}
.page-compte .cp-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 234, 240, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 234, 240, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 85% at 0% 0%, #000 0%, transparent 75%);
}
.page-compte .cp-hero-glow {
  position: absolute; pointer-events: none;
  width: 680px; height: 440px; top: -200px; right: -140px;
  background:
    radial-gradient(circle at 40% 40%, rgba(34, 211, 238, 0.2), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(255, 90, 31, 0.16), transparent 55%);
  filter: blur(26px);
}
.page-compte .cp-hero-inner { position: relative; }
.page-compte .cp-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: "Oxanium", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.26em; font-size: 0.72rem; color: var(--accent-2);
}
.page-compte .cp-kicker::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--accent-2); }
.page-compte .cp-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); text-transform: uppercase; line-height: 1.02; margin: 16px 0 16px; }
.page-compte .cp-lead { color: var(--muted); max-width: 640px; font-size: 1.02rem; line-height: 1.7; }

/* Parcours en trois étapes (compte → équipe → sessions) */
.page-compte .cp-steps {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px;
}
.page-compte .cp-steps li {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--text);
}
.page-compte .cp-step-n {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #12060a;
  font-size: 0.72rem; font-weight: 800;
}

/* ============ Cartes ============ */
.page-compte .auth-card {
  background: linear-gradient(170deg, rgba(34, 211, 238, 0.06), transparent 42%), var(--surface);
  border-radius: 18px; padding: 32px 30px;
}
.page-compte .auth-card:hover { border-color: rgba(255, 255, 255, 0.12); }

/* Grille : carte principale + colonne d'aide qui reste visible au défilement */
.page-compte .auth { gap: 32px; margin-top: 0; }
.page-compte .auth-side { position: sticky; top: 124px; }
.page-compte .auth-side h3 {
  display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 16px;
}
.page-compte .auth-side h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.page-compte .auth-side .list-dot { margin-bottom: 24px; }
.page-compte .auth-side .notice {
  background: linear-gradient(160deg, rgba(255, 90, 31, 0.1), transparent 70%), var(--surface);
  border-radius: 16px; padding: 18px 20px;
}

/* Onglets (connexion / inscription, équipe / messagerie) : pilule segmentée */
.page-compte .tabs { background: var(--bg); margin-bottom: 26px; }
.page-compte .tab { padding: 11px 14px; }

/* ============ Formulaires ============ */
.page-compte .auth-form { gap: 18px; }
.page-compte .field input {
  padding: 13px 15px; border-radius: 12px; background: var(--bg-alt);
  transition: border-color 0.15s ease;
}
.page-compte .field input:hover { border-color: var(--muted); }
.page-compte .auth-form .btn { min-height: 46px; }
.page-compte .form-msg.ok { color: var(--ok); }
.page-compte .form-msg.err { color: var(--bad); }

/* Blocs repliables (changer le mot de passe, créer une équipe) */
.page-compte details.panel {
  background: var(--bg-alt); border-radius: 16px; padding: 18px 20px;
  transition: border-color 0.2s ease;
}
.page-compte details.panel:hover { border-color: rgba(255, 255, 255, 0.12); }
.page-compte details.panel[open] { border-color: rgba(34, 211, 238, 0.35); }
.page-compte details.panel > summary { list-style: none; display: flex; align-items: center; gap: 10px; }
.page-compte details.panel > summary::-webkit-details-marker { display: none; }
.page-compte details.panel > summary::before {
  content: ""; width: 4px; height: 14px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.page-compte details.panel > summary::after {
  content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.15s ease;
}
.page-compte details.panel[open] > summary::after { transform: rotate(180deg); }

/* ============ Profil (vue connectée) ============ */
/* Carte pleine largeur : bandeau en haut, avatar qui chevauche le bandeau, identité à droite. */
.page-compte .pf-card { padding: 0 30px 30px; overflow: hidden; }
.page-compte .pf-banner {
  position: relative; height: 128px; margin: 0 -30px;
  background:
    linear-gradient(120deg, rgba(34, 211, 238, 0.22), transparent 55%),
    radial-gradient(circle at 88% 30%, rgba(255, 90, 31, 0.3), transparent 55%),
    linear-gradient(180deg, #161a26, var(--surface));
  border-bottom: 1px solid var(--border);
}
.page-compte .pf-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 234, 240, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 234, 240, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(90deg, #000, transparent 80%);
}
.page-compte .pf-status {
  position: absolute; top: 16px; right: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(10, 11, 15, 0.6); border: 1px solid var(--border);
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ok);
}
.page-compte .pf-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.page-compte .profile-head {
  position: relative; z-index: 1; /* au-dessus du bandeau (position: relative), sinon il le recouvre */
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  margin: -48px 0 0; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.page-compte .profile-avatar {
  width: 96px; height: 96px; font-size: 2.1rem;
  border: 5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), 0 16px 32px -14px rgba(255, 90, 31, 0.6);
}
/* Le texte commence sous le bandeau (seul l'avatar le chevauche) : 80px de décalage + 60px = 140px, bandeau = 128px */
/* flex: 1 1 0 : le bloc prend la place restante à côté de l'avatar au lieu de passer à la ligne */
.page-compte .profile-head-text { flex: 1 1 0; gap: 4px; min-width: 0; padding-top: 60px; }
.page-compte .profile-head-text h2 {
  font-size: 1.8rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.05;
  overflow-wrap: anywhere;
}
.page-compte .profile-email { font-size: 0.9rem; overflow-wrap: anywhere; }
/* Pastille de rang + points, injectés par account.js dans #myRankPill */
.page-compte #myRankPill { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.page-compte #myRankPill .section-note {
  font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--text);
}
.page-compte .profile-head-actions {
  margin-left: auto; padding-top: 60px; flex-wrap: wrap; justify-content: flex-end;
}

.page-compte .stat-tiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 26px;
}
.page-compte .stat-tile {
  position: relative; overflow: hidden; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.page-compte .stat-tile::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: var(--accent-2); opacity: 0.8;
}
.page-compte .stat-tile:nth-child(2)::before { background: var(--accent); }
.page-compte .stat-tile:nth-child(3)::before { background: #b35cff; }
.page-compte .stat-tile dt { font-size: 0.72rem; letter-spacing: 0.12em; margin-bottom: 8px; }
.page-compte .stat-tile dd { font-size: 1.25rem; overflow-wrap: anywhere; }

.page-compte .invites-zone {
  position: relative; background: linear-gradient(120deg, rgba(255, 90, 31, 0.1), transparent 70%), var(--surface);
  border-radius: 16px; padding: 20px 22px 18px; margin-bottom: 26px;
}
.page-compte .invites-zone::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), #ff8a3d);
}
.page-compte .invites-zone .mt-h { margin-top: 0; }

.page-compte .team-row { border-radius: 14px; background: var(--bg-alt); }
.page-compte #teamsList .mt-h { margin-top: 8px; }
.page-compte .msg-list { gap: 12px; }

/* Messagerie de l'organisation : cartes plus aérées (même style que la page Espace organisation) */
.page-compte .msg-item { padding: 18px 20px; border-radius: 16px; background: var(--bg-alt); }

/* ============ Mes parties (onglet du profil, my-games.js) ============ */
.page-compte .gp-tiles { margin: 18px 0 4px; }
.page-compte .gp-tiles .eq-tile { background: var(--bg-alt); }
.page-compte .gp-tiles .eq-tile dd { font-size: 1.3rem; }
.page-compte .gp-h { font-size: 1rem; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.page-compte .gp-h::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.page-compte .gp-list { list-style: none; display: grid; gap: 10px; }
.page-compte .gp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 14px;
}
.page-compte .gp-item-main { flex: 1 1 260px; min-width: 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.page-compte .gp-item-main strong { color: var(--text); }
.page-compte .gp-item .msg-badge { flex: none; }
.page-compte .gp-empty { padding: 14px 18px; color: var(--muted); font-size: 0.9rem; border: 1px dashed var(--border); border-radius: 14px; }
.page-compte .gp-empty a { color: var(--accent-2); }
.page-compte .gp-results { margin-top: 0; }
.page-compte .gp-combat { color: var(--accent-2); white-space: nowrap; }
.page-compte .gp-feed .msg-item--unread { box-shadow: inset 3px 0 0 var(--accent); }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .page-compte .auth-side { position: static; }
}
@media (max-width: 600px) {
  .page-compte .cp-hero { padding: 44px 0 40px; }
  .page-compte .auth-card { padding: 22px 18px; border-radius: 16px; }
  .page-compte details.panel { padding: 16px 16px; }
  .page-compte .profile-head-actions { margin-left: 0; width: 100%; }
  .page-compte .profile-head-actions .btn { flex: 1; }
  .page-compte .pf-card { padding: 0 18px 22px; }
  .page-compte .pf-banner { height: 96px; margin: 0 -18px; }
  .page-compte .pf-status { top: 12px; right: 12px; font-size: 0.64rem; }
  .page-compte .profile-head { margin-top: -38px; gap: 14px; }
  .page-compte .profile-head-text { padding-top: 46px; }
  .page-compte .profile-head-actions { padding-top: 0; }
  .page-compte .profile-avatar { width: 76px; height: 76px; font-size: 1.6rem; }
  .page-compte .profile-head-text h2 { font-size: 1.5rem; }
  .page-compte .stat-tiles { grid-template-columns: 1fr; }
}

/* Entrée douce, comme les autres pages (désactivée par le bloc reduced-motion de styles.css) */
.sa-anim .page-compte .cp-hero-inner { animation: sa-in-soft 0.55s ease both; }

/* ============ Invitation d'un joueur, dans la carte de l'équipe ============ */
.page-compte .team-row { flex-wrap: wrap; }
.page-compte .team-invite { flex: 1 1 100%; display: grid; gap: 10px; margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--border); }
.page-compte .team-invite-label { display: grid; gap: 6px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.page-compte .team-invite input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.95rem; text-transform: none; letter-spacing: normal;
}
.page-compte .team-invite input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.page-compte .team-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-compte .team-invite .form-msg { margin: 0; }

/* Étape déjà franchie : pastille verte avec une coche. */
.page-compte .cp-steps li.is-done { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.page-compte .cp-steps li.is-done .cp-step-n { background: var(--ok); font-size: 0; }
.page-compte .cp-steps li.is-done .cp-step-n::before { content: "\2713"; font-size: 0.8rem; }

/* ============ Paramètres du compte (sous les onglets) ============ */
.page-compte .pf-settings { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.page-compte .pf-settings-title { font-family: "Oxanium", sans-serif; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.page-compte .pf-settings #accountRules { margin: 10px 0 0 !important; }
.page-compte .pf-settings #pwChangeDetails { margin-top: 14px !important; }

/* ============ Tuiles du profil : quatre de front, les trois premières mènent à l'onglet correspondant ============ */
.page-compte .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-compte .stat-tile[data-goto] { cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.page-compte .stat-tile[data-goto]:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.page-compte .stat-tile[data-goto]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.page-compte .stat-tile[data-goto] dt::after { content: " ›"; color: var(--accent-2); }
@media (max-width: 860px) { .page-compte .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .page-compte .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .page-compte .stat-tile { padding: 14px; } }

/* ============ En-tête compact une fois connecté ============ */
/* Les étapes d'accueil (créer un compte, une équipe, jouer) n'ont plus lieu d'être quand les trois sont faites : on libère la place. */
.page-compte.cp-all-done .cp-lead, .page-compte.cp-all-done .cp-steps { display: none; }
.page-compte.cp-logged .cp-hero { padding: 44px 0 34px; }
.page-compte.cp-logged .cp-hero h1 { margin-bottom: 0; }

/* ============ Personnalisation de l'équipe : repliée par défaut (elle reste à un clic) ============ */
.page-compte details.team-custom { margin-top: 20px; }
.page-compte details.team-custom > summary { cursor: pointer; font-family: "Oxanium", sans-serif; font-weight: 700; }
.page-compte details.team-custom[open] > summary { margin-bottom: 14px; }

/* Téléphone : quatre onglets en 2 × 2 (au lieu d'une rangée coupée), gros boutons faciles à toucher ; tuiles à la taille du texte. */
@media (max-width: 480px) {
  .page-compte #teamTabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 18px; gap: 4px; }
  .page-compte #teamTabs .tab { padding: 12px 8px; }
  .page-compte .stat-tile dd { font-size: 1.05rem; }
}
