/* ============================================================
   ZINIE.CSS — Carte TCG style Pokemon, dark mode, palette dynastique
   Extrait de profil/index.php le 2026-05-20

   Variables dynamiques (--p3-accent/sombre/clair) injectees
   par le PHP a chaque requete, selon la dynastie du bot.
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0A0807;
  color: #E8DFD0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}


.p3-page {
  --p3-bg: #0A0807;
  --p3-card: #15110D;
  --p3-line: rgba(255,240,200,0.08);
  --p3-line-2: rgba(255,240,200,0.16);
  --p3-text: #E8DFD0;
  --p3-muted: #7A6F5C;
  --p3-gain: #4ADE80;
  --p3-loss: #F87171;

  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, var(--p3-sombre) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, var(--p3-sombre) 0%, transparent 50%),
    var(--p3-bg);
}

/* TOP BAR ---------------------------------------------------- */
.p3-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--p3-line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--p3-muted);
}
.p3-bar a { color: inherit; text-decoration: none; transition: color 0.2s; }
.p3-bar a:hover { color: var(--p3-text); }
.p3-bar strong { color: var(--p3-text); font-weight: 600; }

/* MAIN ------------------------------------------------------- */
.p3-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* CARTE TCG -------------------------------------------------- */
.p3-card-wrap {
  position: relative;
  margin-bottom: 32px;
}

.p3-card {
  position: relative;
  aspect-ratio: 5 / 7;
  background:
    linear-gradient(135deg, var(--p3-sombre) 0%, #0A0807 60%, var(--p3-sombre) 100%);
  border: 2px solid var(--p3-accent);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 24px 60px -20px rgba(0,0,0,0.8),
    0 0 80px -30px var(--p3-accent),
    inset 0 0 60px -20px rgba(0,0,0,0.6);
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.p3-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--p3-accent);
  opacity: 0.35;
  border-radius: 8px;
  pointer-events: none;
}
.p3-card-wrap:hover .p3-card {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.6),
    0 32px 80px -20px rgba(0,0,0,0.9),
    0 0 100px -25px var(--p3-accent),
    inset 0 0 60px -20px rgba(0,0,0,0.6);
}

/* En-tête de carte */
.p3-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--p3-line-2);
  position: relative;
  z-index: 2;
}
.p3-head-left { display: flex; align-items: center; gap: 8px; }
.p3-glyph {
  font-size: 22px;
  color: var(--p3-accent);
  line-height: 1;
  font-weight: 600;
  text-shadow: 0 0 12px var(--p3-accent);
}
.p3-rank {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--p3-clair);
  font-weight: 600;
}
.p3-tag {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--p3-accent);
  padding: 3px 7px;
  border: 1px solid var(--p3-accent);
  border-radius: 3px;
}

/* Cadre SVG centré */
.p3-svg-frame {
  margin: 18px auto 14px;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.p3-svg-frame::before {
  content: "";
  position: absolute;
  inset: -6px;
  background:
    radial-gradient(circle at center, var(--p3-accent) 0%, transparent 70%);
  opacity: 0.18;
  filter: blur(8px);
  pointer-events: none;
}
.p3-svg-frame svg {
  width: 130px;
  height: 130px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* Nom + sous-titre */
.p3-name {
  font-family: "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 2px;
  text-align: center;
  color: var(--p3-text);
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.p3-subtitle {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--p3-clair);
  text-align: center;
  margin-bottom: 16px;
  opacity: 0.85;
  position: relative;
  z-index: 2;
}

/* Stats RPG */
.p3-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}
.p3-stat {
  text-align: center;
  padding: 10px 4px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--p3-line-2);
  border-radius: 6px;
  backdrop-filter: blur(6px);
}
.p3-stat-val {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--p3-clair);
}
.p3-stat-val.pos { color: var(--p3-gain); }
.p3-stat-val.neg { color: var(--p3-loss); }
.p3-stat-lbl {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--p3-muted);
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Attributs (âme / méthode / rune) */
.p3-attrs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}
.p3-attr {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--p3-text);
  padding: 5px 8px;
  background: rgba(0,0,0,0.25);
  border-left: 2px solid var(--p3-accent);
  border-radius: 3px;
  line-height: 1.4;
}
.p3-attr strong {
  color: var(--p3-accent);
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* Footer de carte */
.p3-card-foot {
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--p3-line-2);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--p3-muted);
  position: relative;
  z-index: 2;
}
.p3-card-foot strong { color: var(--p3-clair); font-weight: 700; }

/* Watermark Zinies */
.p3-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: "Iowan Old Style", Baskerville, serif;
  font-size: 110px;
  font-weight: 700;
  color: var(--p3-accent);
  opacity: 0.025;
  letter-spacing: 12px;
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
}

/* Bouton télécharger */
.p3-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  background: var(--p3-accent);
  color: #0A0807;
  border: none;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 24px -8px var(--p3-accent);
}
.p3-download:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px var(--p3-accent); }
.p3-download:active { transform: translateY(0); }
.p3-download:disabled { opacity: 0.6; cursor: wait; }

/* Compteur de vues */
.p3-views {
  text-align: center;
  margin-top: 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--p3-muted);
}

/* SECTIONS SECONDAIRES --------------------------------------- */
.p3-section {
  background: var(--p3-card);
  border: 1px solid var(--p3-line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
}
.p3-section h2 {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--p3-accent);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.p3-recit {
  font-family: "Iowan Old Style", Baskerville, serif;
  font-size: 14px;
  line-height: 1.8;
  font-style: italic;
  color: var(--p3-text);
  padding-left: 14px;
  border-left: 2px solid var(--p3-accent);
}

/* Performance — stats hors carte */
.p3-perf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.p3-perf-stat {
  text-align: center;
  padding: 14px 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--p3-line);
  border-radius: 6px;
}
.p3-perf-val {
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--p3-text);
}
.p3-perf-val.pos { color: var(--p3-gain); }
.p3-perf-val.neg { color: var(--p3-loss); }
.p3-perf-lbl {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--p3-muted);
  margin-top: 6px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Mini-graphique history en barres */
.p3-chart-wrap { margin-top: 12px; }
.p3-chart-lbl {
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--p3-muted);
  margin-bottom: 6px;
}
.p3-chart-max { color: var(--p3-clair); }
.p3-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
}
.p3-chart-bar {
  flex: 1;
  min-width: 4px;
  background: var(--p3-muted);
  border-radius: 1px;
  transition: opacity 0.15s;
}
.p3-chart-bar.pos { background: var(--p3-gain); }
.p3-chart-bar.neg { background: var(--p3-loss); }
.p3-chart-bar:hover { opacity: 0.65; }
.p3-chart-axis {
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--p3-muted);
  opacity: 0.6;
  margin-top: 6px;
}

@media (max-width: 540px) {
  .p3-perf-stats { grid-template-columns: repeat(2, 1fr); }
  .p3-perf-val { font-size: 17px; }
}

/* Trade en cours */
.p3-live {
  background: linear-gradient(135deg, rgba(74,222,128,0.06), transparent);
  border: 1px solid rgba(74,222,128,0.3);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.p3-live.short {
  background: linear-gradient(135deg, rgba(248,113,113,0.06), transparent);
  border-color: rgba(248,113,113,0.3);
}
.p3-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.p3-live-title {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--p3-text);
}
.p3-live-title .dir { font-weight: 700; }
.p3-live-title .dir.long { color: var(--p3-gain); }
.p3-live-title .dir.short { color: var(--p3-loss); }
.p3-live-pnl { font-family: ui-monospace, monospace; font-size: 22px; font-weight: 700; }
.p3-live-pnl.pos { color: var(--p3-gain); }
.p3-live-pnl.neg { color: var(--p3-loss); }

/* Voix récentes */
.p3-voix {
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.p3-voix-row {
  display: grid;
  grid-template-columns: 90px 60px 1fr;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--p3-line);
}
.p3-voix-time { color: var(--p3-muted); }
.p3-voix-vote { font-weight: 700; letter-spacing: 1px; }
.p3-voix-vote.BULL { color: var(--p3-gain); }
.p3-voix-vote.BEAR { color: var(--p3-loss); }
.p3-voix-vote.NEUTRE { color: var(--p3-muted); }
.p3-voix-detail { color: var(--p3-muted); font-style: italic; }

/* Cousins */
.p3-cousins {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.p3-cousin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--p3-line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.p3-cousin:hover { border-color: var(--p3-accent); transform: translateY(-2px); }
.p3-cousin svg { width: 48px; height: 48px; }
.p3-cousin .c-name { font-family: monospace; font-size: 8px; letter-spacing: 0.5px; text-align: center; color: var(--p3-text); }
.p3-cousin .c-pnl { font-family: monospace; font-size: 10px; font-weight: 700; }
.p3-cousin .c-pnl.pos { color: var(--p3-gain); }
.p3-cousin .c-pnl.neg { color: var(--p3-loss); }

/* Partage social */
.p3-share-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.p3-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--p3-line-2);
  border-radius: 8px;
  color: var(--p3-text);
  text-decoration: none;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.p3-share-btn:hover { border-color: var(--p3-accent); color: var(--p3-accent); }

/* Voice button (auto-injecte par voice.js) */
.zp-voice-btn { font-family: monospace !important; }

/* Erreur 404 */
.p3-404 {
  text-align: center;
  padding: 80px 20px;
  color: var(--p3-muted);
  font-style: italic;
}
.p3-404 strong { color: var(--p3-clair); }

@media (max-width: 540px) {
  .p3-name { font-size: 24px; }
  .p3-svg-frame { width: 130px; height: 130px; }
  .p3-svg-frame svg { width: 110px; height: 110px; }
  .p3-watermark { font-size: 80px; }
}
