/* ============================================
   PA Stats Metrics — Player Profile Styles
   ============================================ */

/* --- Profile Header --- */
.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(66, 71, 84, 0.15);
}

.profile-avatar {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar .avatar-glow {
  position: absolute;
  inset: 0;
  background: rgba(77, 142, 255, 0.2);
  border-radius: 50%;
  filter: blur(24px);
}

.profile-avatar .avatar-circle {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 3px solid var(--primary-container);
  background: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(77, 142, 255, 0.3);
  z-index: 1;
}

.profile-avatar .avatar-circle .material-symbols-outlined {
  font-size: 2.5rem;
  color: var(--primary);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  line-height: 1.1;
}

.profile-uber-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--on-surface-variant);
  opacity: 0.5;
  margin-top: 0.25rem;
}

.profile-hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 0.75rem;
}

.profile-hero-stat {
  display: flex;
  flex-direction: column;
}

.profile-hero-stat .label {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--on-surface-variant);
}

.profile-hero-stat .value {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.profile-hero-stat .value.neutral {
  color: var(--on-surface);
}

/* --- Filter Bar --- */
.profile-filters {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(31, 31, 37, 0.4);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-radius: var(--radius-lg);
}

.profile-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-filter-label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.6;
  white-space: nowrap;
}

.profile-filter-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.profile-filter-chip {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(66, 71, 84, 0.2);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.profile-filter-chip:hover {
  border-color: rgba(173, 198, 255, 0.3);
  color: var(--on-surface);
}

.profile-filter-chip.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.profile-filter-select {
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(66, 71, 84, 0.2);
  background: var(--surface-container);
  color: var(--on-surface);
  cursor: pointer;
  max-width: 12rem;
}

.profile-filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.profile-filter-count {
  margin-left: auto;
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

/* --- Match Tags --- */
.match-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  margin-left: 0.3rem;
  vertical-align: middle;
}

.tag-ai { background: rgba(255, 152, 0, 0.2); color: #ff9800; }
.tag-sandbox { background: rgba(156, 39, 176, 0.2); color: #ce93d8; }
.tag-gw { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.tag-ranked { background: rgba(255, 215, 0, 0.2); color: #ffd700; }

/* --- Stats Grid (4 cards) --- */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.profile-stat-card {
  background: rgba(31, 31, 37, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-top: 1px solid rgba(173, 198, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition-normal);
}

.profile-stat-card:hover {
  border-color: rgba(173, 198, 255, 0.3);
}

.profile-stat-card .card-label {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin-bottom: 0.5rem;
}

.profile-stat-card .card-value {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  color: var(--on-surface);
}

.profile-stat-card .card-sub {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
}

.profile-stat-card .card-sub.positive {
  color: #34d399;
}

.profile-stat-card .card-sub.negative {
  color: var(--error);
}

.profile-stat-card .card-sub.neutral {
  color: var(--on-surface-variant);
}

/* --- Recent Matches Table --- */
.profile-matches {
  background: rgba(31, 31, 37, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-top: 1px solid rgba(173, 198, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.profile-matches-header {
  padding: 1.25rem 1.5rem;
  background: rgba(42, 41, 47, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-matches-header h3 {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--on-surface);
}

.profile-matches table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.profile-matches thead tr {
  border-bottom: 1px solid rgba(66, 71, 84, 0.1);
}

.profile-matches thead th {
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--on-surface-variant);
}

.profile-matches tbody tr {
  border-bottom: 1px solid rgba(66, 71, 84, 0.05);
  transition: background var(--transition-fast);
}

.profile-matches tbody tr:hover {
  background: rgba(77, 142, 255, 0.05);
}

.profile-matches tbody td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--on-surface);
}

.profile-matches .result-win {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: #34d399;
}

.profile-matches .result-loss {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--error);
}

.profile-matches .result-unknown {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--on-surface-variant);
}

.profile-matches .view-link {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.profile-matches .view-link:hover {
  color: var(--on-surface);
}

.profile-matches .system-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.profile-matches .game-mode-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* --- Mode Badges --- */
.badge-mode {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid;
}

.badge-team {
  color: #7ecbff;
  background: rgba(126, 203, 255, 0.1);
  border-color: rgba(126, 203, 255, 0.3);
}

.badge-ffa {
  color: #ffa07a;
  background: rgba(255, 160, 122, 0.1);
  border-color: rgba(255, 160, 122, 0.3);
}

.badge-duel {
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.08);
  border-color: rgba(173, 198, 255, 0.2);
}

/* --- Team Info --- */
.team-info {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  color: var(--on-surface-variant);
  opacity: 0.7;
}

.team-info .team-label {
  font-style: italic;
  margin-right: 0.2rem;
}

.team-info .teammate-name {
  color: #7ecbff;
  font-weight: 500;
}

/* --- Mode Breakdown Win Rates --- */
.mode-breakdown {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.mode-wr {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid;
}

.mode-wr .mode-count {
  font-weight: 400;
  opacity: 0.6;
}

.mode-duel {
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.08);
  border-color: rgba(173, 198, 255, 0.2);
}

.mode-team {
  color: #7ecbff;
  background: rgba(126, 203, 255, 0.08);
  border-color: rgba(126, 203, 255, 0.2);
}

.mode-ffa {
  color: #ffa07a;
  background: rgba(255, 160, 122, 0.08);
  border-color: rgba(255, 160, 122, 0.2);
}

/* --- Loading state --- */
.profile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
}

.profile-loading .spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(173, 198, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Empty State --- */
.profile-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--on-surface-variant);
}

.profile-empty .material-symbols-outlined {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.profile-empty p {
  font-size: 0.875rem;
}

/* --- Name History --- */
.profile-names {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.profile-names .name-chip,
.compare-hdr-names .name-chip {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
}

.names-aka-label {
  font-size: 0.6rem;
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.names-toggle {
  font-size: 0.65rem;
  color: var(--primary);
  cursor: pointer;
  opacity: 0.7;
  margin-left: 0.25rem;
}

.names-toggle:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ============================================
   Compare Feature
   ============================================ */

/* --- Compare Button --- */
.compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(173, 198, 255, 0.3);
  background: rgba(77, 142, 255, 0.08);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.compare-btn .material-symbols-outlined {
  font-size: 1.1rem;
}

.compare-btn:hover {
  border-color: var(--primary);
  color: var(--on-surface);
  background: rgba(77, 142, 255, 0.18);
  box-shadow: 0 0 15px rgba(77, 142, 255, 0.3);
}

/* --- Compare Page: Player Selection Bar --- */
.compare-select-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(31, 31, 37, 0.4);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-radius: var(--radius-lg);
}

.compare-select-slot {
  flex: 1;
  position: relative;
}

.compare-slot-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.5;
  margin-bottom: 0.4rem;
}

.compare-slot-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-slot-icon {
  font-size: 1rem;
  color: var(--on-surface-variant);
  opacity: 0.4;
}

.compare-slot-input {
  flex: 1;
  background: rgba(31, 31, 37, 0.6);
  border: 1px solid rgba(66, 71, 84, 0.25);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--on-surface);
  outline: none;
  transition: border-color var(--transition-fast);
}

.compare-slot-input:focus {
  border-color: var(--primary);
}

.compare-slot-input::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.35;
}

/* Dropdown */
.compare-slot-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: rgba(31, 31, 37, 0.97);
  border: 1px solid rgba(66, 71, 84, 0.2);
  border-radius: var(--radius-lg);
  max-height: 14rem;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.compare-slot-dropdown::-webkit-scrollbar { width: 4px; }
.compare-slot-dropdown::-webkit-scrollbar-thumb { background: rgba(66, 71, 84, 0.4); border-radius: 2px; }

.compare-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid rgba(66, 71, 84, 0.05);
}

.compare-dd-item:hover {
  background: rgba(77, 142, 255, 0.08);
}

.compare-dd-name {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--on-surface);
}

.compare-dd-count {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.compare-dd-empty {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  opacity: 0.5;
}

/* Selected player chip */
.compare-slot-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-slot-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compare-slot-avatar .material-symbols-outlined {
  font-size: 0.9rem;
}

.compare-slot-avatar.p1-accent {
  background: rgba(77, 142, 255, 0.15);
  border: 1px solid rgba(77, 142, 255, 0.4);
  color: var(--primary);
}

.compare-slot-avatar.p1-accent .material-symbols-outlined { color: var(--primary); }

.compare-slot-avatar.p2-accent {
  background: rgba(110, 86, 207, 0.15);
  border: 1px solid rgba(110, 86, 207, 0.4);
  color: #b39ddb;
}

.compare-slot-avatar.p2-accent .material-symbols-outlined { color: #b39ddb; }

.compare-slot-name {
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--on-surface);
}

.compare-slot-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: auto;
}

.compare-slot-clear .material-symbols-outlined { font-size: 0.8rem; }

.compare-slot-clear:hover {
  background: rgba(255, 180, 171, 0.1);
  color: var(--error);
}

/* VS divider */
.compare-vs {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  opacity: 0.3;
  flex-shrink: 0;
  padding: 0 0.25rem;
  padding-top: 1rem;
}

/* --- Compare Columns Layout --- */
.compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.compare-col {
  min-width: 0;
}

/* P2 column accent */
.compare-col-p2 .profile-hero-stat .value:not(.neutral) {
  color: #b39ddb;
}

/* --- Compare Empty State --- */
.compare-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--on-surface-variant);
}

.compare-empty .material-symbols-outlined {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.2;
}

.compare-empty p {
  font-size: 0.875rem;
  opacity: 0.5;
}

/* --- Compare Header Accent (purple) --- */
.compare-header {
  border-bottom-color: rgba(110, 86, 207, 0.2);
}

.compare-avatar .avatar-glow {
  background: rgba(110, 86, 207, 0.2) !important;
}

.compare-circle {
  border-color: rgba(110, 86, 207, 0.6) !important;
  box-shadow: 0 0 30px rgba(110, 86, 207, 0.3) !important;
}

.compare-circle .material-symbols-outlined {
  color: #b39ddb !important;
}

.compare-header .profile-hero-stat .value:not(.neutral) {
  color: #b39ddb;
}

/* --- Compare Modal Overlay --- */
.compare-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.compare-modal {
  width: 90%;
  max-width: 28rem;
  background: rgba(31, 31, 37, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(66, 71, 84, 0.2);
  border-top: 1px solid rgba(173, 198, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(66, 71, 84, 0.15);
}

.compare-modal-header h3 {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
}

.compare-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.compare-modal-close:hover {
  background: rgba(66, 71, 84, 0.3);
  color: var(--on-surface);
}

.compare-modal-close .material-symbols-outlined { font-size: 1.1rem; }

/* --- Modal Search Input --- */
.compare-modal-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(66, 71, 84, 0.1);
}

.compare-search-icon {
  font-size: 1.1rem;
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.compare-modal-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--on-surface);
}

.compare-modal-search input::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.4;
}

/* --- Modal Results --- */
.compare-modal-results {
  max-height: 18rem;
  overflow-y: auto;
}

.compare-modal-results::-webkit-scrollbar {
  width: 4px;
}

.compare-modal-results::-webkit-scrollbar-thumb {
  background: rgba(66, 71, 84, 0.4);
  border-radius: 2px;
}

.compare-search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid rgba(66, 71, 84, 0.05);
}

.compare-search-result:hover {
  background: rgba(77, 142, 255, 0.08);
}

.compare-result-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-container-highest);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compare-result-avatar .material-symbols-outlined {
  font-size: 1rem;
  color: var(--on-surface-variant);
}

.compare-result-info {
  flex: 1;
  min-width: 0;
}

.compare-result-name {
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-result-meta {
  font-size: 0.65rem;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.compare-result-count {
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  opacity: 0.5;
  white-space: nowrap;
}

.compare-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ============================================
   Compare Page — Headers & Comparison Table
   ============================================ */

/* --- Side-by-side Headers --- */
.compare-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.compare-header-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(31, 31, 37, 0.5);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-top: 1px solid rgba(173, 198, 255, 0.1);
  border-radius: var(--radius-lg);
}

.compare-header-card-p2 {
  border-top-color: rgba(110, 86, 207, 0.15);
}

.compare-hdr-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compare-hdr-avatar .material-symbols-outlined {
  font-size: 1.6rem;
}

.compare-hdr-avatar.p1-glow {
  background: rgba(77, 142, 255, 0.12);
  border: 2px solid rgba(77, 142, 255, 0.4);
  box-shadow: 0 0 20px rgba(77, 142, 255, 0.2);
  color: var(--primary);
}

.compare-hdr-avatar.p1-glow .material-symbols-outlined { color: var(--primary); }

.compare-hdr-avatar.p2-glow {
  background: rgba(110, 86, 207, 0.12);
  border: 2px solid rgba(110, 86, 207, 0.4);
  box-shadow: 0 0 20px rgba(110, 86, 207, 0.2);
  color: #b39ddb;
}

.compare-hdr-avatar.p2-glow .material-symbols-outlined { color: #b39ddb; }

.compare-hdr-info {
  flex: 1;
  min-width: 0;
}

.compare-hdr-name {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-hdr-names {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.compare-hdr-hero {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.6rem;
}

.compare-hdr-stat {
  display: flex;
  flex-direction: column;
}

.compare-hdr-stat .lbl {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.compare-hdr-stat .val {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.compare-header-card-p2 .compare-hdr-stat .val {
  color: #b39ddb;
}

/* --- Comparison Table --- */
.compare-table {
  background: rgba(31, 31, 37, 0.5);
  border: 1px solid rgba(66, 71, 84, 0.1);
  border-top: 1px solid rgba(173, 198, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  max-width: 80%;
  margin: 0 auto;
}

.ct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(42, 41, 47, 0.4);
  border-bottom: 1px solid rgba(66, 71, 84, 0.1);
}

.ct-header-title {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  opacity: 0.7;
}

.ct-header-name {
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 700;
}

.ct-header-name.p1-color { color: var(--primary); }
.ct-header-name.p2-color { color: #b39ddb; }

/* Row */
.ct-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(66, 71, 84, 0.06);
  transition: background var(--transition-fast);
}

.ct-row:last-child { border-bottom: none; }

.ct-row:hover {
  background: rgba(77, 142, 255, 0.03);
}

/* Values on each side */
.ct-val {
  width: 5.5rem;
  font-family: var(--font-headline);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--on-surface);
  opacity: 0.85;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ct-val-p1 { text-align: right; }
.ct-val-p2 { text-align: left; }

.ct-val.winner {
  opacity: 1;
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.35);
}

.ct-val.loser {
  opacity: 1;
  color: var(--error);
  text-shadow: 0 0 20px rgba(255, 180, 171, 0.25);
}

.ct-val.equal {
  opacity: 0.7;
  color: var(--primary);
}

/* Center area: bars + label */
.ct-center {
  flex: 1;
  padding: 0 1.25rem;
  min-width: 0;
}

.ct-bars {
  display: flex;
  gap: 3px;
  height: 8px;
  margin-bottom: 0.4rem;
}

.ct-bar-side {
  flex: 1;
  background: rgba(66, 71, 84, 0.12);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ct-bar-left {
  display: flex;
  justify-content: flex-end;
}

.ct-bar-right {
  display: flex;
  justify-content: flex-start;
}

.ct-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ct-fill-p1 {
  background: rgba(255, 255, 255, 0.1);
}

.ct-fill-p2 {
  background: rgba(255, 255, 255, 0.1);
}

.ct-fill-p1.glow-win {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.1), rgba(52, 211, 153, 0.55));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.ct-fill-p1.glow-lose {
  background: linear-gradient(90deg, rgba(255, 180, 171, 0.08), rgba(255, 107, 107, 0.45));
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}

.ct-fill-p2.glow-win {
  background: linear-gradient(270deg, rgba(52, 211, 153, 0.1), rgba(52, 211, 153, 0.55));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.ct-fill-p2.glow-lose {
  background: linear-gradient(270deg, rgba(255, 180, 171, 0.08), rgba(255, 107, 107, 0.45));
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}

.ct-fill-p1.glow-equal,
.ct-fill-p2.glow-equal {
  background: rgba(77, 142, 255, 0.3);
}

/* Stat label below bar */
.ct-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--on-surface);
  opacity: 0.8;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ct-diff {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--on-surface);
  opacity: 0.7;
  padding: 0.15rem 0.45rem;
  background: rgba(66, 71, 84, 0.25);
  border-radius: 3px;
}

/* --- Delta Indicators on Stat Cards --- */
.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.stat-delta.better {
  color: #34d399;
}

.stat-delta.worse {
  color: var(--error);
}

.stat-delta.equal {
  color: var(--on-surface-variant);
  opacity: 0.4;
}

.stat-delta .material-symbols-outlined {
  font-size: 0.7rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .profile-filters {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-filter-count {
    margin-left: 0;
  }
  .compare-columns {
    grid-template-columns: 1fr;
  }
  .compare-select-bar {
    flex-direction: column;
  }
  .compare-vs {
    padding-top: 0;
  }
  .compare-headers {
    grid-template-columns: 1fr;
  }
  .ct-val {
    width: 4rem;
    font-size: 1.1rem;
  }
  .ct-center {
    padding: 0 0.75rem;
  }
}

@media (max-width: 600px) {
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .compare-header-card {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .compare-hdr-hero {
    justify-content: center;
  }
  .ct-val {
    width: 3.5rem;
    font-size: 0.95rem;
  }
  .ct-row {
    padding: 0.75rem 0.75rem;
  }
}
