.pv-hist-page {
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 58, 237, 0.18), transparent 55%),
    #060d24;
  min-height: 100vh;
  color: #e2e8f0;
  padding-bottom: 3rem;
}

.pv-hist-loading {
  padding: 3rem 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}

.pv-hist-gate {
  padding: 2rem 0 3rem;
  text-align: center;
}

.pv-hist-hero {
  padding: 2.5rem 0 1.5rem;
}

.pv-dash-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.pv-dash-vip-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(145deg, #fafbfd 0%, #d8e0ea 40%, #9eb0c0 100%);
  color: #141c28;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(220, 228, 236, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 2px 10px rgba(120, 140, 160, 0.28);
}

.pv-dash-cta {
  margin-top: 1rem;
  display: inline-block;
}

.pv-hist-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0;
  background: linear-gradient(120deg, #f0f4f8, #c5ced8, #9aaab8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pv-hist-note {
  font-size: 0.85rem;
  opacity: 0.75;
  max-width: 640px;
  line-height: 1.5;
}

.pv-hist-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 1.5rem 0 1.25rem;
}

.pv-dash-chart-section {
  margin: 0 0 2rem;
  padding: 1.25rem 1.35rem 1.1rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.pv-dash-chart-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #f1f5f9;
}

.pv-dash-chart-hint {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.72;
  line-height: 1.45;
  max-width: 640px;
}

.pv-dash-chart-wrap {
  margin-top: 1rem;
  width: 100%;
  min-height: 200px;
}

.pv-dash-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.pv-dash-chart-empty {
  margin: 1.5rem 0 0.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: #94a3b8;
  padding: 2rem 1rem;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 12px;
}

.pv-dash-chart-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 0.75rem;
  font-size: 0.78rem;
}

.pv-dash-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.85;
}

.pv-dash-chart-legend-item::before {
  content: '';
  width: 22px;
  height: 3px;
  border-radius: 2px;
}

.pv-dash-chart-legend-item--up::before {
  background: #22c55e;
}

.pv-dash-chart-legend-item--down::before {
  background: #ef4444;
}

.pv-dash-chart-value {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.95rem;
}

.pv-dash-chart-value.is-pos {
  color: #4ade80;
}

.pv-dash-chart-value.is-neg {
  color: #f87171;
}

.pv-dash-chart-value.is-flat {
  color: #94a3b8;
}

.pv-stat-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  backdrop-filter: blur(8px);
}

.pv-stat-card--win { border-color: rgba(34, 197, 94, 0.45); }
.pv-stat-card--loss { border-color: rgba(239, 68, 68, 0.4); }
.pv-stat-card--rate { border-color: rgba(34, 211, 238, 0.35); }

.pv-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.35rem;
}

.pv-stat-value {
  font-size: 1.65rem;
  font-weight: 800;
}

.pv-winrate-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0 calc(var(--pct, 0) * 1%), rgba(255, 255, 255, 0.1) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  position: relative;
}

.pv-winrate-ring::after {
  content: '';
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0f172a;
  position: absolute;
}

.pv-stat-card--rate .pv-stat-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* —— Liste tickets —— */
.pv-hist-tickets-section {
  margin-top: 0.5rem;
}

.pv-hist-tickets-head {
  margin-bottom: 1.25rem;
}

.pv-hist-tickets-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #e8eef4;
}

.pv-hist-tickets-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #94a3b8;
  max-width: 720px;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 12px;
}

.pv-hist-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 820px;
}

.pv-ticket-card {
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.55), rgba(30, 41, 59, 0.35));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: auto;
  align-self: start;
  width: 100%;
  box-sizing: border-box;
}

.pv-ticket-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.pv-ticket-card.status-WON {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.65), rgba(34, 197, 94, 0.15));
}

.pv-ticket-card.status-LOST {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(239, 68, 68, 0.12));
}

.pv-ticket-card.status-PENDING {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.45), rgba(100, 116, 139, 0.2));
}

.pv-ticket-card.status-VOID {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.5), rgba(71, 85, 105, 0.2));
}

.pv-ticket-card__inner {
  background: linear-gradient(165deg, rgba(12, 18, 40, 0.98) 0%, rgba(6, 13, 36, 1) 100%);
  border-radius: 15px;
  padding: 1rem 1.15rem 1.05rem;
  height: auto;
}

.pv-ticket-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.pv-ticket-card__top-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pv-ticket-status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pv-ticket-status--pending {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
}

.pv-ticket-status--awaiting {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
}

.pv-ticket-status--won {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.pv-ticket-status--lost {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.pv-ticket-status--void {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.3);
}

.pv-ticket-type {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.pv-ticket-odds {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}

.pv-ticket-odds span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  margin-right: 4px;
}

.pv-ticket-date {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  margin-left: auto;
}

.pv-ticket-legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-ticket-leg {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.45);
}

.pv-ticket-leg__match {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
  grid-column: 1 / -1;
}

.pv-ticket-leg__when {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: #67e8f9;
  letter-spacing: 0.01em;
  margin-top: -2px;
}

.pv-ticket-date--event {
  color: #67e8f9;
  font-weight: 600;
}

.pv-ticket-leg__bet {
  font-size: 0.78rem;
  color: #94a3b8;
}

.pv-ticket-leg__cote {
  font-size: 0.82rem;
  font-weight: 700;
  color: #c4b5fd;
  text-align: right;
}

.pv-hist-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  opacity: 0.8;
  font-size: 0.92rem;
  line-height: 1.55;
  border-radius: 14px;
  border: 1px dashed rgba(100, 116, 139, 0.35);
  background: rgba(15, 23, 42, 0.4);
}

.pv-hist-week {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.pv-hist-refresh-status {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.35rem 0 0;
  transition: color 0.2s ease;
}

.pv-hist-refresh-status.is-loading {
  color: #22d3ee;
}

.pv-hist-refresh-status.is-ok {
  color: #22c55e;
}

.pv-hist-refresh-status.is-idle {
  color: #64748b;
}

@media (min-width: 900px) {
  /* Masonry 2 colonnes : pas d'étirement des cartes simples à côté d'un combiné */
  .pv-hist-grid {
    display: block;
    columns: 2;
    column-gap: 16px;
    max-width: none;
  }

  .pv-hist-grid .pv-ticket-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 16px;
  }

  .pv-hist-tickets-hint {
    max-width: none;
  }
}

@supports (grid-template-rows: masonry) {
  @media (min-width: 900px) {
    .pv-hist-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: masonry;
      align-items: start;
      gap: 16px;
      columns: auto;
    }

    .pv-hist-grid .pv-ticket-card {
      margin-bottom: 0;
    }
  }
}

@media (max-width: 520px) {
  .pv-ticket-card__top {
    flex-direction: column;
    align-items: stretch;
  }

  .pv-ticket-date {
    margin-left: 0;
  }
}
