/* Hoshi TCG — pages sociales & progression : profil, amis, messages, missions, succès, classement, échanges, landing, combat. */

/* ── Profil ── */
.profile-head { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; margin-bottom: var(--s5); }
.avatar-big {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--gold); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
}
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big .initial { font-family: var(--font-display); font-size: 2rem; color: var(--gold); }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--bg-card); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold); font-size: 0.9rem; }
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.profile-head .bio { color: var(--ink-dim); font-size: 0.92rem; max-width: 52ch; }

/* Sélecteur d'avatar (Paramètres) : même gabarit que .avatar-big, mais cliquable — pas de bouton
   "Choisir" séparé, la photo elle-même ouvre le sélecteur (retour Noé 2026-07-29). */
.avatar-picker-btn {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--border-strong); background: var(--bg-card); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: border-color var(--t-fast);
}
.avatar-picker-btn:hover { border-color: var(--gold); }
.avatar-picker-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker-btn .initial { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: var(--s2); max-height: 300px; overflow-y: auto; }
.avatar-option { width: 100%; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); cursor: pointer; transition: border-color var(--t-fast); }
.avatar-option:hover { border-color: var(--gold); }
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }

/* Sélecteur de dos de carte (Paramètres) : swatches visuels au lieu d'un <select> textuel
   (retour Noé 2026-07-29). Réutilise .card-back/.sleeve-* déjà stylées pour la boutique. */
.sleeve-picker { display: flex; gap: var(--s3); flex-wrap: wrap; }
.sleeve-option {
  position: relative; width: 56px; aspect-ratio: var(--card-ratio); border-radius: var(--r-sm);
  overflow: hidden; cursor: pointer; border: 2px solid var(--border-strong); transition: border-color var(--t-fast);
}
.sleeve-option:hover { border-color: var(--gold); }
.sleeve-option.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.sleeve-option .emblem { width: 40%; }
.rank-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-soft); color: var(--gold);
  border-radius: var(--r-pill); padding: 4px 12px; font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* Boutons Compétences / Succès : ligne pleine largeur sous les stats. Masqués sur téléphone
   (retour Noé 2026-07-28) : déplacés dans le tiroir de menu mobile, doublon sinon. */
.profile-actions { display: flex; gap: var(--s3); margin: var(--s3) 0 var(--s6); }
.profile-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
@media (max-width: 720px) { .profile-actions { display: none; } }

/* ── Vitrine du profil (4 slots) ── */
/* Taille de carte fixe (comme .card-grid) : auto-fill ajoute des colonnes pour utiliser toute la
   largeur de ligne, mais n'étire JAMAIS les cartes elles-mêmes au-delà de leur taille classique
   (retour Noé 2026-07-29 : les 4 cartes de la vitrine s'agrandissaient au lieu de garder leur taille
   normale — corrige la première tentative qui utilisait minmax(150px, 1fr)/auto-fit). */
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: var(--s3); }
.showcase-empty { aspect-ratio: var(--card-ratio); border: 1px dashed var(--border-strong); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 1.6rem; }
@media (max-width: 480px) { .showcase-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Listes de personnes (amis, conversations) ── */
.person-row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-raised); margin-bottom: var(--s2);
}
.person-row .who { flex: 1; min-width: 0; }
.person-row .who .nm { font-weight: 700; }
.person-row .who .sub { font-size: 0.78rem; color: var(--ink-dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.person-row .unread-dot { min-width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--danger);
  color: #fff; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
/* Actions (Message / Échanger / Retirer) sur leur propre ligne sous l'avatar+pseudo (retour Noé
   2026-07-28) : en inline ça poussait le nom et débordait sur téléphone. */
.person-row { flex-wrap: wrap; }
.person-actions { display: flex; gap: var(--s2); flex-basis: 100%; justify-content: flex-end; margin-top: var(--s2); }
/* Liste « Mes amis » sur 2 colonnes (retour Noé 2026-07-28, réf. capture) — 1 colonne en dessous
   de 640px, les 3 boutons + le nom ne tiendraient pas côte à côte sur téléphone. */
.friends-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.friends-grid .person-row { margin-bottom: 0; }
@media (max-width: 640px) { .friends-grid { grid-template-columns: 1fr; } }

/* ── Fil de messages ── */
/* Centré (retour Noé 2026-07-28) : sur grand écran le panel s'étire pleine largeur, ce qui rendait
   le fil de discussion et la ligne d'envoi bizarrement étalés — on les recentre avec une largeur max. */
.chat-box { display: flex; flex-direction: column; gap: var(--s2); max-height: 55vh; overflow-y: auto; padding: var(--s2);
  max-width: 640px; margin: 0 auto; }
.msg { max-width: 72%; padding: var(--s2) var(--s3); border-radius: var(--r-md); font-size: 0.92rem; }
.msg.mine { align-self: flex-end; background: var(--gold-soft); border: 1px solid rgba(245, 198, 79, 0.35); border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg .when { display: block; font-size: 0.66rem; color: var(--ink-faint); margin-top: 2px; }
.chat-send { display: flex; gap: var(--s2); margin: var(--s3) auto 0; max-width: 640px; }
/* Bouton icône plutôt que texte (retour Noé 2026-07-28 : « Envoyer » débordait du container sur
   téléphone — son padding + son texte dépassaient le minimum que l'input pouvait céder). Carré,
   collé à l'input plutôt que flottant à droite avec un vide. */
.chat-send .chat-send-btn { flex-shrink: 0; width: 44px; padding: 0; }
.chat-send .input { flex: 1; }

/* ── Missions ── */
.mission-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-raised); margin-bottom: var(--s3); }
.mission-row .info { flex: 1; }
.mission-row .desc { font-size: 0.85rem; color: var(--ink-dim); }
.progress-bar { height: 8px; border-radius: var(--r-pill); background: var(--bg-card); overflow: hidden; margin-top: var(--s2); }
.progress-bar .fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width var(--t-med) var(--ease-out); }
.mission-row.done .progress-bar .fill { background: linear-gradient(90deg, #3E8E54, var(--success)); }
.reward-tag { font-size: 0.8rem; color: var(--gold); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Succès ── */
.ach-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ach { display: flex; flex-wrap: wrap; gap: var(--s3); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-raised); }
.ach .ico { font-size: 1.5rem; line-height: 1; filter: grayscale(1) opacity(0.4); }
.ach.unlocked .ico { filter: none; }
.ach.unlocked { border-color: rgba(188, 215, 255, 0.3); }
.ach.claimable { border-color: rgba(188, 215, 255, 0.6); box-shadow: 0 0 16px rgba(188, 215, 255, 0.12); }
/* Bouton sur sa propre ligne sous le texte plutôt qu'inline (retour Noé 2026-07-29 : ça décale
   le texte) — même pattern que .person-actions (flex-wrap + flex-basis: 100%). */
.ach.claimable .btn-sm { flex-basis: 100%; margin-top: var(--s1); }
.ach .t { font-weight: 700; font-size: 0.92rem; }
.ach .d { font-size: 0.8rem; color: var(--ink-dim); }
.ach .meta-line { font-size: 0.72rem; color: var(--ink-faint); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── Échanges ── */
.trade-card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-raised); padding: var(--s4); margin-bottom: var(--s4); }
.trade-card .head-line { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.trade-card .status { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 10px; border-radius: var(--r-pill); }
.status.pending { background: var(--gold-soft); color: var(--gold); }
.status.accepted { background: rgba(111, 208, 140, 0.15); color: var(--success); }
.status.declined, .status.cancelled { background: rgba(255, 107, 122, 0.12); color: var(--danger); }
.trade-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s3); align-items: center; }
.trade-side { display: flex; gap: var(--s2); flex-wrap: wrap; }
.trade-side .mini { width: 46px; border-radius: 6px; position: relative; }
.trade-side .mini img { border-radius: 6px; }
.trade-side .mini .st-mini { position: absolute; top: -4px; right: -4px; background: var(--gold); color: #241A05;
  font-size: 0.6rem; font-weight: 800; border-radius: var(--r-pill); padding: 0 4px; }
.trade-sides .arrow { color: var(--ink-faint); }
/* Symbole d'échange miniature accolé au libellé « contre » (retour Noé 2026-07-28 : sur téléphone
   le gros symbole ⇄ tombait sur sa propre ligne, séparé du texte). Caché en desktop où le gros
   symbole central sert déjà de repère visuel entre les deux colonnes. */
.trade-contre { display: flex; align-items: center; gap: 5px; }
.arrow-mini { display: none; color: var(--ink-faint); flex-shrink: 0; }
@media (max-width: 560px) {
  .trade-sides { grid-template-columns: 1fr; }
  .trade-sides > .arrow { display: none; }
  .arrow-mini { display: inline-block; }
}

/* Composeur d'échange */
.compose-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .compose-grid { grid-template-columns: 1fr; } }
.pick-zone { border: 1px dashed var(--border-strong); border-radius: var(--r-md); min-height: 84px;
  display: flex; gap: var(--s2); flex-wrap: wrap; padding: var(--s2); }
.pick-zone .mini { width: 52px; position: relative; cursor: pointer; }
.search-results { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  max-height: 300px; overflow-y: auto; margin-top: var(--s2); }
.result-row { display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; font-size: 0.8rem; background: var(--bg-card); }
.result-row:hover { border-color: var(--gold); }
.result-row img { width: 30px; height: 40px; object-fit: cover; border-radius: 4px; }

/* ── Classement : podium top 3 (1er au centre, socles de hauteurs différentes) ── */
.podium { display: flex; gap: var(--s4); justify-content: center; align-items: flex-end; margin-bottom: var(--s6); }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; flex: 0 1 160px; min-width: 0; }
.podium .step.rank-1 { order: 2; }
.podium .step.rank-2 { order: 1; }
.podium .step.rank-3 { order: 3; }
.podium-avatar {
  position: relative; width: 66px; height: 66px; border-radius: 50%; overflow: visible;
  border: 2px solid var(--border-strong); background: var(--bg-card); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.podium-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.podium-avatar .initial { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); }
.podium-avatar .medal { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); font-size: 1.2rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.podium .rank-1 .podium-avatar { width: 88px; height: 88px; border-color: #f5c64f; box-shadow: 0 0 26px rgba(245, 198, 79, 0.35); }
.podium .rank-2 .podium-avatar { border-color: #c8d2e0; }
.podium .rank-3 .podium-avatar { border-color: #cd9b6a; }
.podium .rank-1 .podium-avatar .medal { font-size: 1.5rem; }
.podium-name { font-size: 0.95rem; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .rank-1 .podium-name { font-size: 1.05rem; }
.podium .hint { font-size: 0.72rem; }
.pedestal {
  width: 100%; margin-top: 8px; border-radius: var(--r-md) var(--r-md) 0 0;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-card)); border: 1px solid var(--border); border-bottom: none;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 10px;
}
.pedestal-num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ink-faint); }
.podium .rank-1 .pedestal { height: 92px; border-color: rgba(245, 198, 79, 0.5); box-shadow: inset 0 0 24px rgba(245, 198, 79, 0.1); }
.podium .rank-1 .pedestal-num { color: #f5c64f; }
.podium .rank-2 .pedestal { height: 66px; border-color: rgba(200, 210, 224, 0.4); }
.podium .rank-2 .pedestal-num { color: #c8d2e0; }
.podium .rank-3 .pedestal { height: 46px; border-color: rgba(205, 155, 106, 0.4); }
.podium .rank-3 .pedestal-num { color: #cd9b6a; }
@media (max-width: 480px) { .podium { gap: var(--s2); } .podium .step { flex-basis: 104px; } .podium-avatar { width: 54px; height: 54px; } .podium .rank-1 .podium-avatar { width: 68px; height: 68px; } }

/* ── Landing ── */
.hero { text-align: center; padding: var(--s8) var(--s4) var(--s6); }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.4rem); max-width: 17ch; margin: 0 auto var(--s4); }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { color: var(--ink-dim); max-width: 54ch; margin: 0 auto var(--s5); font-size: 1.05rem; }
/* Carrousel de cartes qui défile en continu (retour Noé 2026-07-28 : page d'accueil trop statique
   avant inscription) — piste dupliquée une fois, animée de -50% à 0 pour une boucle sans à-coup. */
.landing-carousel {
  overflow: hidden; margin: var(--s6) 0; max-width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.landing-carousel-track { display: flex; gap: var(--s4); width: max-content; animation: landing-scroll 46s linear infinite; }
.landing-carousel-card { flex: 0 0 auto; width: 150px; }
.landing-carousel-card .tcg { width: 150px; }
@keyframes landing-scroll { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .landing-carousel-track { animation: none; } }
.feature-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: var(--s6); }
.feature { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); }
.feature svg { width: 28px; height: 28px; color: var(--gold); margin-bottom: var(--s3); }
.feature p { font-size: 0.88rem; color: var(--ink-dim); }

/* ── Combat (vitrine) ── */
.combat-hero { text-align: center; padding: var(--s6) var(--s4); }
.combat-hero .soon { display: inline-block; background: var(--gold-soft); color: var(--gold); font-weight: 700;
  font-size: 0.8rem; border-radius: var(--r-pill); padding: 4px 14px; margin-bottom: var(--s4); }
.squad-row { display: flex; gap: var(--s3); justify-content: center; margin-top: var(--s4); }
.squad-row .tcg { width: 120px; }
