/* RPG Profile Hero — gaming character sheet */

.profile-hero {
  position: relative;
  background: linear-gradient(165deg, #0a0e14 0%, #111820 45%, #0d1218 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 18px 14px 14px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 55%, rgba(34, 197, 94, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 10%, rgba(249, 115, 22, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.ph-currencies {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  z-index: 3;
}

.ph-currency {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.45);
}

.ph-currency--green { color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.ph-currency--orange { color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.ph-currency .token-svg { width: 14px; height: 14px; }

.ph-grid {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 38%) 1fr;
  gap: 4px 0;
  align-items: start;
  position: relative;
  z-index: 2;
  min-height: 280px;
}

.ph-col--left { padding-right: 4px; }
.ph-col--right { padding-left: 4px; }

.ph-col--center {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 5;
  margin: 0 -12px;
  align-self: stretch;
  pointer-events: none;
}

.ph-name {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 32px);
  letter-spacing: 1px;
  line-height: 1;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.ph-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ph-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
}

.ph-badge--xp {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.ph-badge--trophy {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

.ph-status-wrap { margin-bottom: 14px; }
.ph-status-wrap .status-badge { font-size: 10px; }

.ph-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 10px;
}

.ph-section-label--right { text-align: right; }

.ph-stat-row, .ph-prog-row {
  margin-bottom: 10px;
}

.ph-stat-head, .ph-prog-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.ph-stat-icon { font-size: 12px; }
.ph-stat-label { flex: 1; }
.ph-stat-lvl, .ph-prog-lvl {
  font-size: 9px;
  color: #4ade80;
  font-weight: 800;
}

.ph-prog-head { justify-content: space-between; }

/* Segmented progress bars */
.ph-seg-bar {
  display: flex;
  gap: 2px;
  height: 10px;
}

.ph-seg-bar--green-dim { height: 6px; }

.ph-seg {
  flex: 1;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.3s, box-shadow 0.3s;
}

.ph-seg-bar--green .ph-seg.on {
  background: linear-gradient(180deg, #4ade80, #16a34a);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.ph-seg-bar--green-dim .ph-seg.on {
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.ph-seg-bar--capped .ph-seg.on {
  background: linear-gradient(180deg, #fbbf24, #d97706);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

/* Standing character */
.swimmer-standing {
  position: relative;
  line-height: 0;
}

.swimmer-hero .swimmer-stand-svg {
  width: clamp(120px, 34vw, 160px);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(34, 197, 94, 0.25));
}

.swimmer-hero-glow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 40px;
  background: radial-gradient(ellipse, rgba(34, 197, 94, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.swimmer-stand-anim .sw-stand-body { animation: standBob 2.5s ease-in-out infinite; transform-origin: 60px 100px; }
.swimmer-stand-anim .sw-stand-legs { animation: standLegs 3s ease-in-out infinite; transform-origin: 60px 108px; }

@keyframes standBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes standLegs {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.03); }
}

.ph-coach-avatar {
  width: 120px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
}

.ph-coach-icon { animation: coachPulse 2s ease-in-out infinite; }
@keyframes coachPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }

/* Sparkline cards */
.ph-spark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}

.ph-spark-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  overflow: hidden;
}

.ph-spark-card--green { border-color: rgba(34, 197, 94, 0.2); }
.ph-spark-card--orange { border-color: rgba(249, 115, 22, 0.2); }

.ph-spark-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ph-spark-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.ph-spark-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  cursor: default;
  padding: 0;
}

.ph-spark-val {
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  line-height: 1.1;
}

.ph-spark-delta {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ph-spark-delta--up { color: #4ade80; }
.ph-spark-delta--down { color: #f87171; }

.ph-spark-svg {
  width: 100%;
  height: 36px;
  display: block;
  margin-top: 4px;
}

.ph-bio {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 12px;
  line-height: 1.4;
  position: relative;
  z-index: 2;
}

/* Mobile: character on top */
@media (max-width: 520px) {
  .ph-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: unset;
  }

  .ph-col--center {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 0 8px;
    min-height: 150px;
  }

  .ph-col--left { grid-column: 1; grid-row: 2; }
  .ph-col--right { grid-column: 2; grid-row: 2; }

  .ph-name { font-size: 22px; }
  .ph-spark-row { grid-template-columns: 1fr; }
}

.profile-hero--legend {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 40px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-hero--legend .ph-name {
  background: linear-gradient(90deg, #fde68a, #c4b5fd, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile-hero--legend .ph-badge,
.profile-hero--legend .ph-currency {
  border-color: rgba(251, 191, 36, 0.4);
}

.profile-hero--legend .ph-spark-val {
  font-size: clamp(22px, 5vw, 28px);
}
