/**
 * WDHC Streak Badges v4 · Premium milestone medals
 */

/* === Hero: ring + stats === */
.streak-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.streak-ring {
  --ring-size: 132px;
  --ring-pct: 0;
  --ring-color: #D4AF37;
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  background: conic-gradient(
    var(--ring-color) calc(var(--ring-pct) * 1%),
    rgba(255, 255, 255, 0.06) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    0 0 40px rgba(212, 175, 55, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.4);
}

.streak-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #161616, #080808);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.streak-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}

.streak-ring-weeks {
  display: block;
  font-family: 'Roboto Mono', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: #D4AF37;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.streak-ring-unit {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b0b0b0;
  margin-top: 4px;
}

.streak-hero-meta {
  flex: 1;
  min-width: 220px;
}

.streak-hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.8px;
  color: #fff;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.streak-hero-sub {
  font-size: 1.02rem;
  color: #b8b8b8;
  margin: 0 0 16px;
  line-height: 1.5;
}

.streak-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.streak-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.94rem;
  color: #c8c8c8;
}

.streak-stat-chip strong {
  font-family: 'Roboto Mono', monospace;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.streak-stat-chip--warn {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.streak-stat-chip--good {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.streak-year-club {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 10px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #D4AF37, #8a702a);
  color: #000;
  font-family: 'Oswald', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

/* === Milestone progress === */
.streak-milestone-progress {
  margin-bottom: 24px;
}

.streak-milestone-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.94rem;
  color: #b0b0b0;
  margin-bottom: 10px;
  gap: 12px;
}

.streak-milestone-label .streak-milestone-end {
  color: #D4AF37;
  font-weight: 700;
  font-size: 1rem;
}

.streak-milestone-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.streak-milestone-fill {
  background: linear-gradient(90deg, #cd7f32, #D4AF37, #22c55e);
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.streak-milestone-remaining {
  font-size: 0.94rem;
  color: #b8b8b8;
  margin-top: 10px;
  text-align: center;
}

.streak-all-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: #D4AF37;
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.8px;
  padding: 16px;
  margin-bottom: 20px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
}

/* === Shield milestone medals === */
.streak-medals-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.streak-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100px;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.2s ease;
}

.streak-medal.locked {
  opacity: 0.42;
  filter: grayscale(0.8);
}

.streak-medal.earned {
  opacity: 1;
}

.streak-medal.earned:hover {
  transform: translateY(-5px) scale(1.04);
}

.streak-medal-face {
  width: 76px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  clip-path: polygon(50% 0%, 94% 14%, 100% 48%, 82% 92%, 50% 100%, 18% 92%, 0% 48%, 6% 14%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.streak-medal-face::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: linear-gradient(155deg, rgba(255,255,255,0.38) 0%, transparent 40%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 2;
}

.streak-medal-icon {
  width: 1.85rem;
  height: 1.85rem;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.streak-medal--bronze .streak-medal-face {
  background: radial-gradient(ellipse 80% 60% at 30% 20%, #f0c090, #cd7f32 42%, #6b3a12 78%, #3d1f08);
}
.streak-medal--bronze .streak-medal-icon { color: #fff4e8; }

.streak-medal--silver .streak-medal-face {
  background: radial-gradient(ellipse 80% 60% at 30% 20%, #f4f6fa, #b8c0cc 42%, #6a7280 78%, #3a4048);
}
.streak-medal--silver .streak-medal-icon { color: #fff; }

.streak-medal--gold .streak-medal-face {
  background: radial-gradient(ellipse 80% 60% at 30% 20%, #fff0b0, #D4AF37 40%, #9a7b20 75%, #5c4510);
  box-shadow: 0 10px 32px rgba(212, 175, 55, 0.3);
}
.streak-medal--gold .streak-medal-icon { color: #1a1400; }

.streak-medal--platinum .streak-medal-face {
  background: radial-gradient(ellipse 80% 60% at 30% 20%, #f8faff, #c0cce8 40%, #7080b8 75%, #3a4870);
  box-shadow: 0 10px 32px rgba(160, 180, 230, 0.25);
}
.streak-medal--platinum .streak-medal-icon { color: #1a2040; }

.streak-medal-tier {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c0c0c0;
}

.streak-medal.earned .streak-medal-tier { color: #e8e8e8; }

.streak-medal-weeks {
  font-size: 0.82rem;
  color: #a8a8a8;
  line-height: 1.3;
  font-weight: 600;
}

.streak-medal-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.streak-medal-check .wdhc-icon {
  width: 0.7rem;
  height: 0.7rem;
  color: #000;
}

/* === Weekly heatmap === */
.streak-heatmap {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.streak-heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.streak-heatmap-label {
  font-size: 0.88rem;
  color: #b0b0b0;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

.streak-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #a0a0a0;
}

.streak-heatmap-legend span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.streak-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 4px;
}

.streak-heat {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.15s ease;
}

.streak-heat--active {
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.65), rgba(212, 175, 55, 0.3));
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.streak-heat--current {
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.7);
}

.streak-heat:hover {
  transform: scale(1.2);
  z-index: 1;
}

.streak-empty-cta {
  text-align: center;
  padding: 36px 24px;
}

.streak-empty-cta p {
  color: #b8b8b8;
  font-size: 1.05rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .streak-ring { --ring-size: 110px; }
  .streak-ring-weeks { font-size: 1.8rem; }
  .streak-medal { width: 88px; }
  .streak-medal-face { width: 68px; height: 76px; }
  .streak-heatmap-grid { grid-template-columns: repeat(13, 1fr); }
  .streak-year-club { margin-left: 0; margin-top: 12px; }
}