/* ============================================
   Bonut Labs — Stats Page Styles
   ============================================ */

/* ── Profile header ── */
.profile-hero {
  padding: 7rem 0 4rem;
  background: linear-gradient(135deg, var(--bg-darker) 0%, #1a2035 40%, #2d1b4e 70%, var(--bg-darker) 100%);
  background-size: 300% 300%;
  animation: profileShift 14s ease infinite;
  position: relative;
  overflow: hidden;
}
.profile-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(189,147,249,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,121,198,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
@keyframes profileShift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.profile-hero .container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.profile-avatar {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--bg-darker), 0 0 0 6px var(--purple), 0 0 40px rgba(189,147,249,.4);
  animation: avatarPulse 4s ease-in-out infinite;
  /* Key for breaking out of frame: DO NOT hide overflow here! */
}
.profile-avatar img {
  width: 130%; /* Make image larger than the container */
  height: 130%; /* Keeps aspect ratio */
  object-fit: contain;
  position: absolute; /* Positions relative to the .profile-avatar container */
  bottom: -5%; /* shift downwards slightly so base is aligned but top pokes out */
  z-index: 10;
  transform-origin: bottom center;
}
@keyframes avatarPulse {
  0%,100% { box-shadow: 0 0 0 4px var(--bg-darker), 0 0 0 6px var(--purple), 0 0 40px rgba(189,147,249,.4); }
  50%     { box-shadow: 0 0 0 4px var(--bg-darker), 0 0 0 6px var(--pink), 0 0 60px rgba(255,121,198,.5); }
}
.profile-info h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: .25rem;
}
.profile-info h1 .accent {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.profile-tagline {
  color: var(--comment);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.profile-badge {
  padding: .3rem .85rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid;
}
.profile-badge.purple { border-color: var(--purple); color: var(--purple); background: rgba(189,147,249,.08); }
.profile-badge.cyan   { border-color: var(--cyan);   color: var(--cyan);   background: rgba(139,233,253,.08); }
.profile-badge.orange { border-color: var(--orange); color: var(--orange); background: rgba(255,184,108,.08); }

/* ── Stats section ── */
.stats-section {
  padding: 5rem 0;
}
.stats-section:nth-child(even) {
  background: var(--bg-darker);
}

/* ── Game character cards ── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.char-card {
  background: var(--current);
  border-radius: var(--radius);
  border: 1px solid transparent;
  overflow: hidden;
  transition: all var(--transition);
}
.char-card:hover {
  transform: translateY(-5px);
}
.char-card.purple:hover { border-color: rgba(189,147,249,.4); box-shadow: 0 12px 40px rgba(189,147,249,.2); }
.char-card.pink:hover   { border-color: rgba(255,121,198,.4); box-shadow: 0 12px 40px rgba(255,121,198,.2); }
.char-card.orange:hover { border-color: rgba(255,184,108,.4); box-shadow: 0 12px 40px rgba(255,184,108,.2); }
.char-card.cyan:hover   { border-color: rgba(139,233,253,.4); box-shadow: 0 12px 40px rgba(139,233,253,.2); }

.char-card-banner {
  height: 8px;
}
.char-card.purple .char-card-banner { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.char-card.pink   .char-card-banner { background: linear-gradient(90deg, var(--pink), var(--purple)); }
.char-card.orange .char-card-banner { background: linear-gradient(90deg, var(--orange), var(--red)); }
.char-card.cyan   .char-card-banner { background: linear-gradient(90deg, var(--cyan), var(--green)); }

.char-card-body {
  padding: 1.5rem;
}
.char-game-logo {
  height: 48px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}
.char-game-logo img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}
.char-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.char-class {
  font-size: .85rem;
  color: var(--comment);
  margin-bottom: 1.25rem;
}
.char-stats {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.stat-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.stat-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--comment);
  width: 80px;
  flex-shrink: 0;
}
.stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,.25);
  border-radius: 3px;
  overflow: hidden;
}
[data-theme="light"] .stat-bar-wrap {
  background: rgba(0,0,0,.1);
}
.stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.stat-bar.wide { width: 0; }
.stat-bar.visible { width: var(--bar-width, 75%); }
.char-card.purple .stat-bar { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.char-card.pink   .stat-bar { background: linear-gradient(90deg, var(--pink), var(--purple)); }
.char-card.orange .stat-bar { background: linear-gradient(90deg, var(--orange), var(--red)); }
.char-card.cyan   .stat-bar { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.stat-value {
  font-size: .85rem;
  font-weight: 600;
  color: var(--fg);
  width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.char-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(98,114,164,.2);
  font-size: .8rem;
  color: var(--comment);
  display: flex;
  justify-content: space-between;
}
.placeholder-note {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--comment);
  padding: .25rem .65rem;
  border-radius: 999px;
  border: 1px dashed var(--comment);
  opacity: .6;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .profile-hero .container {
    flex-direction: column;
    text-align: center;
  }
  .profile-badges { justify-content: center; }
  .char-grid { grid-template-columns: 1fr; }
}
