/*
 * Profile Page - User profile tiles, stat cards, event list
 */

/* ── Stat tile color variants ───────────────────────────────────────────── */

.profile-tile--indigo {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: rgba(99, 102, 241, 0.3) !important;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-tile--cyan {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
  border-color: rgba(0, 212, 255, 0.3) !important;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-tile--pink {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
  border-color: rgba(236, 72, 153, 0.3) !important;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.profile-tile--amber {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-color: rgba(251, 191, 36, 0.3) !important;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

/* Icon on the tile front face */
.profile-tile-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ── Split stat color variants ──────────────────────────────────────────── */

.profile-split-stat--cyan .profile-split-stat-value-primary {
  color: var(--accent-cyan);
}
.profile-split-stat--cyan .profile-split-stat-divider {
  border-left-color: rgba(0, 212, 255, 0.45);
}
.profile-split-stat--cyan .profile-split-stat-value-muted {
  color: rgba(0, 212, 255, 0.55);
}

.profile-split-stat--purple .profile-split-stat-value-primary {
  color: var(--accent-purple);
}
.profile-split-stat--purple .profile-split-stat-divider {
  border-left-color: rgba(129, 140, 248, 0.45);
}
.profile-split-stat--purple .profile-split-stat-value-muted {
  color: rgba(129, 140, 248, 0.55);
}

/* Large gold number (net worth, coin clicks) */
.profile-tile-big-stat {
  color: var(--accent-gold);
  font-size: 1.75rem;
}

/* ── Live events list ───────────────────────────────────────────────────── */

.profile-event-list-item {
  padding: 0.875rem 0;
}

.profile-event-title {
  font-size: 1rem;
}

.profile-event-badge {
  padding: 0.5rem 1rem;
}

/* ── Misc utilities used on this page ───────────────────────────────────── */

.text-accent-cyan {
  color: var(--accent-cyan) !important;
}

/* Larger toggle switch for settings section */
.form-switch-profile {
  width: 3rem;
  height: 1.5rem;
  cursor: pointer;
}

/* Trophy emoji in modal */
.trophy-modal-emoji {
  font-size: 2.25rem;
  line-height: 1;
}

/* ── Profile header + stats panels ──────────────────────────────────────── */

.profile-header-panel {
  padding: 1.15rem 0.85rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(0, 212, 255, 0.15) 100%);
  border-radius: 1rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.profile-header-main {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.profile-header-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-header-username {
  display: block;
  font-size: clamp(1.2rem, 2.7vw, 2rem);
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
}

.profile-header-balance {
  flex: 0 1 auto;
  margin-left: auto;
  text-align: right;
}

.profile-header-balance .badge {
  white-space: nowrap;
}

.profile-stat-positive {
  color: #16a34a;
}

.profile-stat-negative {
  color: #ef4444;
}

.profile-stat-value {
  font-weight: 700;
}

.profile-rank-badge {
  font-size: clamp(1rem, 2.6vw, 1.4rem);
}

.profile-rank-badge-position {
  font-size: inherit;
  font-weight: 700;
  margin-right: 0.35rem;
}

.profile-coin-ledger-badge {
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid rgba(0, 212, 255, 0.45);
  color: #9be9ff;
}

.showcase-picker-toggle {
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-trophy-card {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 0.5rem;
  min-height: 7.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.profile-trophy-card:hover {
  border-color: var(--border-secondary);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.profile-trophy-card-emoji {
  font-size: 1.65rem;
  line-height: 1;
}

.profile-trophy-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.profile-trophy-card-score {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.profile-trophy-card-holder {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.trophies-page-card {
  min-height: 8.2rem;
  padding: 0.85rem 0.55rem;
}

.trophies-grid {
  margin-bottom: var(--space-2);
}

.leaderboard-trophy-card {
  min-height: 4.8rem;
  padding: 0.55rem 0.4rem;
  gap: 0.2rem;
}

.leaderboard-trophies-strip .profile-trophy-card-emoji {
  font-size: 1.3rem;
}

.leaderboard-trophies-strip .profile-trophy-card-holder,
.leaderboard-trophies-strip .profile-trophy-card-score {
  font-size: 0.66rem;
}

.leaderboard-trophies-link {
  letter-spacing: 0.01em;
}

.profile-trophies-panel-body {
  height: auto;
  overflow: visible;
}

@media (max-width: 768px) {
  .profile-header-main {
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .profile-header-panel {
    padding: 0.95rem 0.7rem;
  }

  .profile-header-username {
    white-space: normal;
  }

  .profile-rank-badge {
    font-size: clamp(0.95rem, 4vw, 1.2rem);
  }
}

/* ── Clickable stat cards + flip tiles ──────────────────────────────────── */

.clickable-stat-card {
  text-decoration: none !important;
}

.clickable-stat-card .card {
  transition: all 0.2s ease;
}

.clickable-stat-card:hover .card {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.clickable-stat-card:hover .card[style*="rgba(99, 102, 241"] {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.clickable-stat-card:hover .card[style*="rgba(0, 212, 255"] {
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.clickable-stat-card:hover .card[style*="rgba(236, 72, 153"] {
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.clickable-stat-card:hover .card[style*="rgba(251, 191, 36"] {
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.profile-split-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.profile-split-stat-value {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.profile-split-stat-divider {
  display: inline-block;
  height: 1.1rem;
  border-left: 1px solid;
}

.profile-flip-tile {
  perspective: 1000px;
}

.profile-flip-tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.profile-flip-tile-inner.is-flipped {
  transform: rotateY(180deg);
}

.profile-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.profile-flip-face-back {
  transform: rotateY(180deg);
}

.profile-coin-clicks-dog-sprite {
  max-width: 84%;
  max-height: 84%;
  object-fit: contain;
  image-rendering: auto;
}

/* ── Achievements grid ──────────────────────────────────────────────────── */

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.achievement-card-wrapper {
  flex: 0 1 calc(50% - 0.375rem);
  min-width: 150px;
  max-width: calc(50% - 0.375rem);
}

@media (max-width: 767px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 140px;
    max-width: calc(50% - 0.375rem);
  }
}

@media (min-width: 768px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 200px;
    max-width: calc(50% - 0.375rem);
  }

  .col-lg-4 .achievements-grid .achievement-card-wrapper {
    flex: 0 1 100%;
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .achievement-card-wrapper {
    flex: 0 1 calc(33.333% - 0.5rem);
    min-width: 180px;
    max-width: calc(33.333% - 0.5rem);
  }

  .col-lg-4 .achievements-grid .achievement-card-wrapper {
    flex: 0 1 calc(50% - 0.375rem);
    min-width: 200px;
    max-width: calc(50% - 0.375rem);
  }
}
