/* Espace compte — styles, alignés sur la charte d'Omnia amplecti.
   Les variables ci-dessous alimentent aussi /assets/site.css (nav + footer). */
:root {
  --ink: #1a1814;
  --paper: #f2f5fa;
  --paper-dark: #e6ecf6;
  --brand: #1d3a5f;
  --gold: #b89a5a;
  --gold-light: #d4b87a;
  --muted: #7a7060;
  --nav-h: 72px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

a { color: var(--brand); }

.compte-main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3rem) 1.5rem 2rem;
  min-height: 60vh;
}

/* ── Titres ── */
.auth-title, .param-title, .profil-name, .profil-h2, .param-h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--brand);
  font-weight: 600;
}

/* ── Cartes ── */
.auth-card, .param-card, .profil-wrap {
  background: #fff;
  border: 1px solid rgba(184, 154, 90, 0.28);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(26, 24, 20, 0.06);
}

/* ── Connexion ── */
.auth-wrap { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 440px; padding: 2.4rem 2rem; text-align: center; }
.auth-eyebrow {
  text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.68rem;
  color: var(--gold); margin: 0 0 0.4rem;
}
.auth-title { font-size: 2.2rem; margin: 0 0 0.8rem; }
.auth-sub { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin: 0 0 1.6rem; }

.auth-buttons { display: flex; flex-direction: column; gap: 0.8rem; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 0.85rem 1rem; border-radius: 999px; text-decoration: none;
  font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 0.9rem;
  letter-spacing: 0.02em; border: 1px solid transparent; transition: transform 0.15s, box-shadow 0.2s;
}
.btn-oauth:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26, 24, 20, 0.12); }
.btn-oauth-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; font-weight: 700; font-size: 0.9rem;
}
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google .btn-oauth-icon { color: #4285f4; background: #fff; border: 1px solid #eee; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord .btn-oauth-icon { color: #fff; }

.auth-legal { font-size: 0.75rem; color: var(--muted); margin: 1.4rem 0 0; }
.auth-error, .auth-notice {
  font-size: 0.85rem; padding: 0.6rem 0.9rem; border-radius: 10px; margin: 0 0 1.2rem;
}
.auth-error  { background: #fbeaea; color: #9a3838; border: 1px solid #f0c9c9; }
.auth-notice { background: #e8f3ec; color: #2f6b45; border: 1px solid #c7e3d1; }

/* ── Profil ── */
.profil-wrap { padding: 2rem; }
.profil-head { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.profil-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--gold-light); background: var(--paper-dark);
}
.profil-avatar--letter {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; color: var(--brand);
}
.profil-name { font-size: 1.9rem; margin: 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.badge-admin {
  font-family: 'Montserrat', sans-serif; font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: #2c2102;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.profil-pseudo { color: var(--gold); font-size: 0.9rem; margin: 0.2rem 0 0; }
.profil-since { color: var(--muted); font-size: 0.8rem; margin: 0.3rem 0 0; }

.profil-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.6rem 0 0; }
.profil-section { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid rgba(184, 154, 90, 0.2); }
.profil-h2 { font-size: 1.4rem; margin: 0 0 0.6rem; }
.profil-empty { color: var(--muted); font-style: italic; font-size: 0.88rem; margin: 0; }

/* Cartes de score sur le profil */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.8rem; }
.score-card {
  display: flex; flex-direction: column; gap: 0.15rem; text-decoration: none;
  background: var(--paper); border: 1px solid rgba(184, 154, 90, 0.28);
  border-radius: 12px; padding: 0.9rem 1rem; transition: border-color 0.2s, transform 0.15s;
}
.score-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.score-jeu { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.score-main { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.9rem; font-weight: 600; color: var(--brand); line-height: 1.1; }
.score-sep { color: var(--gold); margin: 0 0.05em; }
.score-sub { font-size: 0.74rem; color: var(--muted); }

/* ── Paramètres ── */
.param-title { font-size: 2rem; margin: 0 0 1.4rem; }
.param-card { padding: 1.5rem 1.6rem; margin: 0 0 1.2rem; }
.param-h2 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.param-help { color: var(--muted); font-size: 0.85rem; line-height: 1.6; margin: 0 0 1rem; }
.param-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.param-form input[type="text"] {
  flex: 1 1 12rem; padding: 0.65rem 0.85rem; border-radius: 10px;
  border: 1px solid rgba(184, 154, 90, 0.4); background: var(--paper);
  color: var(--ink); font-size: 0.95rem;
}
.param-danger { border-color: #f0c9c9; background: #fdf6f6; }
.param-back { margin-top: 1rem; }
.param-back a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.param-back a:hover { color: var(--gold); }

/* ── Boutons ── */
.btn-plain, .btn-solid, .btn-danger {
  display: inline-block; padding: 0.6rem 1.2rem; border-radius: 999px;
  font-family: 'Montserrat', sans-serif; font-weight: 500; font-size: 0.82rem;
  letter-spacing: 0.04em; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.btn-plain { background: var(--paper-dark); color: var(--brand); border-color: rgba(184, 154, 90, 0.35); }
.btn-plain:hover { background: #fff; transform: translateY(-1px); }
.btn-solid { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #2c2102; }
.btn-solid:hover { transform: translateY(-1px); }
.btn-danger { background: #b64545; color: #fff; }
.btn-danger:hover { background: #9a3838; }

/* ── Onboarding (choix du pseudo) ── */
.onboard-form { margin-top: 0.4rem; }
.onboard-field {
  display: flex; align-items: center; gap: 0.3rem;
  border: 1px solid rgba(184, 154, 90, 0.4); border-radius: 12px;
  background: var(--paper); padding: 0.2rem 0.9rem; transition: border-color 0.2s;
}
.onboard-field:focus-within { border-color: var(--gold); }
.onboard-at { color: var(--gold); font-size: 1.1rem; font-weight: 500; }
.onboard-field input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 1.15rem; padding: 0.6rem 0; color: var(--ink);
  font-family: 'Montserrat', sans-serif; letter-spacing: 0.02em;
}
.onboard-hint { color: var(--muted); font-size: 0.78rem; margin: 0.5rem 0 1.2rem; }
.onboard-submit { width: 100%; padding: 0.8rem; font-size: 0.9rem; }

.score-flame { display: inline-flex; align-items: baseline; gap: 0.2rem; }
.score-detail-link { margin: 1rem 0 0; }
.score-detail-link a { color: var(--gold); text-decoration: none; font-size: 0.85rem; }
.score-detail-link a:hover { text-decoration: underline; }

/* ── Historique Roidle ── */
.roidle-wrap { }
.rd-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem;
  background: #fff; border: 1px solid rgba(184, 154, 90, 0.28); border-radius: 16px;
  padding: 1.4rem 1.6rem; margin: 0 0 1rem;
}
.rd-flame { text-align: center; min-width: 6.5rem; }
.rd-flame-emoji { font-size: 2.2rem; line-height: 1; }
.rd-flame-n { font-family: 'Cormorant Garamond', serif; font-size: 3rem; font-weight: 600; color: var(--gold); line-height: 1; }
.rd-flame-lib { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.rd-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; flex: 1; justify-content: space-around; }
.rd-stat { text-align: center; }
.rd-stat-v { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 600; color: var(--brand); }
.rd-stat-l { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rd-encart {
  background: #fbf3e3; border: 1px solid rgba(184, 154, 90, 0.4); border-radius: 10px;
  padding: 0.7rem 1rem; font-size: 0.9rem; color: #6a5a35; margin: 0 0 1rem;
}

/* Calendrier heatmap */
.cal { max-width: 360px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { margin-bottom: 5px; }
.cal-dow span { text-align: center; font-size: 0.62rem; color: var(--muted); }
.cal-cell { aspect-ratio: 1; border-radius: 4px; background: var(--paper-dark); }
.cal-cell.cal-won { background: var(--gold); }
.cal-cell.cal-lost { background: #dbb2a8; }
.cal-cell.cal-empty { background: var(--paper-dark); box-shadow: inset 0 0 0 1px rgba(122, 112, 96, 0.12); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.7rem 0 0; font-size: 0.72rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-legend i.cal-won { background: var(--gold); }
.cal-legend i.cal-lost { background: #dbb2a8; }
.cal-legend i.cal-empty { background: var(--paper-dark); box-shadow: inset 0 0 0 1px rgba(122, 112, 96, 0.2); }

/* Barres par mode */
.mode-rows { display: flex; flex-direction: column; gap: 0.6rem; max-width: 460px; }
.mode-row { display: grid; grid-template-columns: 5.5rem 1fr 2.6rem; align-items: center; gap: 0.7rem; }
.mode-name { font-size: 0.85rem; color: var(--ink); }
.mode-bar { height: 0.55rem; background: var(--paper-dark); border-radius: 999px; overflow: hidden; }
.mode-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); }
.mode-val { font-size: 0.8rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Derniers jours */
.recent { list-style: none; margin: 0; padding: 0; max-width: 520px; }
.recent-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(184, 154, 90, 0.16); }
.recent-date { min-width: 5rem; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-none { font-size: 0.8rem; color: #b7b0a4; font-style: italic; }
.recent-modes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rb { font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.rb-ok { background: #eaf4ec; color: #2f6b45; border: 1px solid #cfe6d5; }
.rb-ko { background: #fbeae7; color: #9a4a3a; border: 1px solid #f0cec6; }

/* ── Badges (profil) ── */
.badge-count { font-family: 'Montserrat', sans-serif; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.badge-families { display: flex; flex-direction: column; gap: 1.1rem; }
.badge-fam-title { font-family: 'Montserrat', sans-serif; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); margin: 0 0 0.5rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.badge { width: 5.2rem; text-align: center; }
.badge-medal {
  display: flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; margin: 0 auto 0.3rem; border-radius: 50%;
  font-size: 1.4rem; background: var(--paper-dark); border: 2px solid transparent;
}
.badge.is-locked .badge-medal { filter: grayscale(1); opacity: 0.45; }
.badge.is-locked .badge-name { color: var(--muted); }
.badge-name { font-size: 0.6rem; line-height: 1.2; color: var(--ink); display: block; }
.badge.tier-bois .badge-medal    { border-color: #8a5a2b; background: #efe6dc; }
.badge.tier-bronze .badge-medal  { border-color: #cd7f32; background: #f6e9da; }
.badge.tier-argent .badge-medal  { border-color: #9aa3ad; background: #eef1f4; }
.badge.tier-or .badge-medal      { border-color: #d4af37; background: #f8f0d8; }
.badge.tier-diamant .badge-medal { border-color: #57c6de; background: #e0f4f8; }
.badge.tier-special .badge-medal { border-color: var(--gold); background: #f8f0d8; }

/* ── Favoris ── */
.profil-manage { font-family: 'Montserrat', sans-serif; font-size: 0.72rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--gold); text-decoration: none; }
.profil-manage:hover { text-decoration: underline; }
.fav-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.fav-card {
  display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none;
  background: var(--paper); border: 1px solid rgba(184, 154, 90, 0.3); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: 0.85rem; color: var(--brand);
  transition: border-color 0.2s, transform 0.15s;
}
.fav-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.fav-star { color: var(--gold); }

.jeux-help { color: var(--muted); font-size: 0.88rem; margin: 0 0 1rem; }
.jeux-list { list-style: none; margin: 0 0 0.6rem; padding: 0; max-width: 460px; }
.jeux-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.55rem 0; border-bottom: 1px solid rgba(184, 154, 90, 0.16); }
.jeux-name { color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.jeux-name:hover { color: var(--gold); }
.fav-toggle { background: none; border: none; cursor: pointer; font-size: 1.35rem; line-height: 1; color: #c9c2b4; padding: 0.1rem 0.35rem; transition: color 0.2s, transform 0.15s; }
.fav-toggle:hover { transform: scale(1.15); }
.fav-toggle.is-fav { color: var(--gold); }

@media (max-width: 600px) {
  .compte-main { padding-top: calc(var(--nav-h) + 1.5rem); }
  .auth-card, .profil-wrap { padding: 1.6rem 1.2rem; }
  .rd-flame { min-width: 5rem; }
  .cal { max-width: 100%; }
}
