/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e8e8ed;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 0.5rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-dot {
  color: #86868b;
  font-weight: 600;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn-sm {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #1d1d1f;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-sm:hover { opacity: 0.8; }

.btn-danger {
  background: transparent;
  color: #ff3b30;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border: 1px solid #ff3b30;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover { background: #fff0ef; }

.btn-icon {
  background: none;
  border: none;
  color: #86868b;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: #1d1d1f;
  background: #f5f5f7;
}

/* Loading */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.loading-content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.loading-content p {
  color: #86868b;
  font-size: 0.9rem;
}

/* Vote Section */
.vote-section {
  padding: 1rem 1rem 0.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.vote-prompt {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1d1d1f;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.vote-container {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: center;
}

.vote-card {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
}

.vote-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.vote-card:active { transform: scale(0.98); }

.card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #e8e8ed;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Vote overlay */
.vote-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.vote-overlay.winner { background: rgba(52, 199, 89, 0.85); opacity: 1; }
.vote-overlay.loser  { background: rgba(255, 59, 48, 0.6); opacity: 1; }

.overlay-text {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
}

.overlay-elo {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.overlay-badge {
  margin-top: 0.4rem;
}

.card-info {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.card-age {
  font-weight: 400;
  font-size: 0.8rem;
  color: #86868b;
}

.card-height {
  font-size: 1rem;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}
.height-cm {
  font-weight: 400;
  font-size: 0.8rem;
  color: #86868b;
}

/* VS Badge */
.vs-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #86868b;
  flex-shrink: 0;
  align-self: center;
}

.vote-meta {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: #86868b;
}

/* Disabled card — allow overlay clicks after vote */
.vote-card.disabled { pointer-events: none; }
.vote-card.disabled .vote-overlay { pointer-events: auto; }

/* === VOTE ANIMATIONS === */

@keyframes winnerSlideGlow {
  0% { transform: translateY(0); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  30% { transform: translateY(-8px); box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2); }
  60% { transform: translateY(-6px); box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3); }
  100% { transform: translateY(-4px); box-shadow: 0 0 16px rgba(255, 215, 0, 0.3), 0 0 32px rgba(255, 215, 0, 0.15); }
}

@keyframes loserShakeShrink {
  0% { transform: scale(1) translateX(0); opacity: 1; }
  10% { transform: scale(0.98) translateX(-4px); }
  20% { transform: scale(0.97) translateX(4px); }
  30% { transform: scale(0.96) translateX(-3px); }
  40% { transform: scale(0.95) translateX(2px); }
  50% { transform: scale(0.95) translateX(0); opacity: 0.85; }
  100% { transform: scale(0.94) translateX(0); opacity: 0.75; }
}

@keyframes pairFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(120px) translateX(var(--drift-x, 0px)) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

.vote-card.winner-anim {
  animation: winnerSlideGlow 0.6s ease-out forwards;
}

.vote-card.loser-anim {
  animation: loserShakeShrink 0.5s ease-out forwards;
}

.vote-card.pair-enter {
  animation: pairFadeIn 0.35s ease-out;
}

.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall 1s ease-in forwards;
  z-index: 5;
}

/* Tier Badges */
.tier-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.15);
}

.tier-badge-sm {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Leaderboards */
.leaderboards {
  padding: 1.5rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Leaderboard tabs */
.lb-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e8e8ed;
}

.lb-tab {
  flex: 0 0 auto;
  padding: 0.6rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  color: #86868b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lb-tab.active {
  color: #1d1d1f;
  border-bottom-color: #1d1d1f;
}

.lb-tab:hover { color: #1d1d1f; }

/* Country sub-filter */
.lb-filter {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.form-input-sm {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  width: auto;
  min-width: 180px;
  margin-bottom: 0;
}

/* Leaderboard pagination */
.lb-pagination {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  animation: fadeIn 0.3s ease backwards;
}

.lb-row.top-1 {
  background: linear-gradient(135deg, #fff9e6, #fff3cc);
  box-shadow: 0 2px 8px rgba(255, 204, 0, 0.2);
}

.lb-row.top-2 {
  background: linear-gradient(135deg, #f5f5f5, #e8e8ed);
}

.lb-row.top-3 {
  background: linear-gradient(135deg, #fdf0e6, #fbe4d0);
}

.lb-rank {
  font-size: 1rem;
  font-weight: 800;
  width: 1.5rem;
  text-align: center;
  color: #86868b;
  flex-shrink: 0;
}

.top-1 .lb-rank { color: #f5a623; }
.top-2 .lb-rank { color: #8e8e93; }
.top-3 .lb-rank { color: #cd7f32; }

.lb-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lb-name {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-flag {
  font-size: 1rem;
  margin-right: 0.15rem;
}

.lb-stats {
  font-size: 0.65rem;
  color: #86868b;
}

.stat-w { color: #34c759; font-weight: 700; }
.stat-l { color: #ff3b30; font-weight: 700; }

.lb-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.lb-elo {
  font-weight: 800;
  font-size: 0.85rem;
}

/* Stagger animation */
.lb-row:nth-child(1)  { animation-delay: 0.03s; }
.lb-row:nth-child(2)  { animation-delay: 0.06s; }
.lb-row:nth-child(3)  { animation-delay: 0.09s; }
.lb-row:nth-child(4)  { animation-delay: 0.12s; }
.lb-row:nth-child(5)  { animation-delay: 0.15s; }
.lb-row:nth-child(6)  { animation-delay: 0.18s; }
.lb-row:nth-child(7)  { animation-delay: 0.21s; }
.lb-row:nth-child(8)  { animation-delay: 0.24s; }
.lb-row:nth-child(9)  { animation-delay: 0.27s; }
.lb-row:nth-child(10) { animation-delay: 0.30s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hover preview popup */
.lb-hover-popup {
  position: fixed;
  z-index: 200;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 0.75rem;
  display: flex;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 280px;
  transition: opacity 0.15s;
}

.hover-photo {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.hover-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  justify-content: center;
}

.hover-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.hover-height {
  font-size: 0.8rem;
  color: #86868b;
}

.hover-percentile {
  font-size: 0.75rem;
  color: #86868b;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Header PFP circle */
.header-pfp {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #e8e8ed;
  transition: border-color 0.15s;
}

.header-pfp:hover {
  border-color: #0071e3;
}

.header-pfp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-link {
  background: none;
  border: none;
  color: #86868b;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover { color: #1d1d1f; }

.btn-primary {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  background: #1d1d1f;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-accent {
  background: #0071e3;
  color: #fff;
}

.btn-accent:hover { opacity: 0.85; }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 1rem;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #86868b;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: #1d1d1f; }

/* Auth modal */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e8e8ed;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: #86868b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: #1d1d1f;
  border-bottom-color: #1d1d1f;
}

.auth-tab:hover { color: #1d1d1f; }

.auth-error {
  font-size: 0.8rem;
  color: #ff3b30;
  text-align: center;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e8e8ed;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #fff;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: #0071e3;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Form groups */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6e6e73;
  margin-bottom: 0.35rem;
}

.form-hint {
  font-size: 0.75rem;
  color: #86868b;
  margin-top: 0.25rem;
}

/* Photo upload */
.photo-upload {
  position: relative;
}

.photo-upload input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.8rem;
}

.photo-preview {
  max-width: 160px;
  max-height: 200px;
  border-radius: 12px;
  object-fit: cover;
  margin-top: 0.5rem;
}

/* Full-screen profile view */
.profile-fullscreen {
  position: fixed;
  inset: 0;
  background: #f5f5f7;
  z-index: 100;
  overflow-y: auto;
}

.profile-fullscreen-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0071e3;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.profile-back-btn:hover {
  text-decoration: underline;
}

/* Profile header section */
.profile-header-section {
  text-align: center;
  margin-bottom: 1rem;
}

.profile-photo-lg {
  width: 200px;
  height: 266px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 0 auto 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.profile-name-lg {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.profile-height-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 0.4rem;
}

.profile-tier-lg {
  margin-bottom: 0.25rem;
}

.profile-percentile {
  font-size: 0.85rem;
  color: #86868b;
  font-weight: 600;
}

.profile-country-stat {
  font-size: 0.85rem;
  color: #86868b;
  margin-top: 0.25rem;
}

/* Daily change */
.daily-up { color: #34c759; font-size: 0.85rem; font-weight: 700; }
.daily-down { color: #ff3b30; font-size: 0.85rem; font-weight: 700; }
.daily-flat { color: #86868b; font-size: 0.85rem; font-weight: 600; }

/* Bell curve container */
.bell-curve-container {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  height: 220px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Profile stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.stat-box {
  text-align: center;
  padding: 0.75rem 0.25rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}

/* Owner actions */
.profile-owner-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid #e8e8ed;
  border-bottom: 1px solid #e8e8ed;
}

/* Match history */
.history-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #6e6e73;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.75rem;
}

.history-empty {
  font-size: 0.85rem;
  color: #86868b;
  text-align: center;
  padding: 1.5rem 0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  background: #fff;
}

.history-row:hover { background: #f0f0f2; }
.history-win { border-left-color: #34c759; }
.history-loss { border-left-color: #ff3b30; }

.history-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.history-name {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-rank {
  font-size: 0.7rem;
  font-weight: 600;
  color: #86868b;
  margin-left: 0.25rem;
}

.history-result {
  font-size: 0.7rem;
  font-weight: 600;
}

.history-elo-delta {
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Search */
.search-wrapper {
  position: relative;
  flex: 0 1 240px;
  margin: 0 0.5rem;
}

.search-input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid #e8e8ed;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  color: #1d1d1f;
  background: #f5f5f7;
  transition: border-color 0.15s, background 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: #0071e3;
  background: #fff;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: #f5f5f7;
}

.search-result-item:first-child { border-radius: 10px 10px 0 0; }
.search-result-item:last-child { border-radius: 0 0 10px 10px; }

.search-result-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-name {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.7rem;
  color: #86868b;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #86868b;
}

/* Responsive — mobile */
@media (max-width: 600px) {
  .logo { font-size: 1.1rem; }
  .vote-container { gap: 0.4rem; }
  .card-info { padding: 0.5rem; }
  .card-name { font-size: 0.8rem; }
  .card-height { font-size: 0.85rem; }
  .overlay-text { font-size: 1rem; }
  .overlay-elo { font-size: 0.85rem; }

  .lb-row { padding: 0.4rem 0.5rem; }
  .lb-photo { width: 36px; height: 36px; }

  .header { flex-wrap: wrap; }
  .header-actions { gap: 0.3rem; }
  .search-wrapper { flex: 1 1 100%; order: 10; margin: 0.5rem 0 0; }
  .search-input { font-size: 0.75rem; padding: 0.35rem 0.6rem; }

  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-photo-lg { width: 160px; height: 213px; }

  /* Disable hover popup on mobile */
  .lb-hover-popup { display: none !important; }
}

/* Provisional profiles */
.lb-row.provisional { opacity: 0.65; }
.lb-row.provisional .lb-elo { font-style: italic; }
.provisional-confidence { color: #86868b; font-style: italic; }

/* ===== Your Type Section ===== */
@keyframes archetype-reveal {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes yt-badge-glow {
  0%   { text-shadow: 0 0 0px rgba(255,214,10,0); }
  50%  { text-shadow: 0 0 18px rgba(255,214,10,0.7); }
  100% { text-shadow: 0 0 0px rgba(255,214,10,0); }
}

@keyframes yt-toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes yt-toast-out {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

.your-type-section {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.25rem;
  margin: 1rem 0;
  color: #fff;
}

.your-type-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #86868b;
  margin-bottom: 0.85rem;
}

/* --- Locked state --- */
.your-type-locked {
  opacity: 0.85;
}

.your-type-lock-msg {
  font-size: 0.92rem;
  color: #e5e5ea;
  line-height: 1.5;
  margin-bottom: 0.85rem;
  text-align: center;
}

.your-type-lock-msg strong {
  color: #ffd60a;
}

.your-type-progress-track {
  height: 6px;
  background: #2c2c2e;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.your-type-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0071e3, #5ac8fa);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.your-type-progress-label {
  font-size: 0.78rem;
  color: #636366;
  text-align: center;
  margin-top: 0.35rem;
}

/* --- Unlocked / revealed state --- */
.your-type-unlocked {
  border-color: rgba(255,214,10,0.15);
}

.archetype-reveal {
  animation: archetype-reveal 0.4s ease-out both;
}

.yt-archetype-badge {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffd60a;
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0.25rem 0 0.4rem;
  animation: yt-badge-glow 2s ease-in-out 0.4s 2;
}

.yt-celebrity {
  font-size: 0.82rem;
  color: #86868b;
  text-align: center;
  margin-bottom: 0.85rem;
}

.yt-celebrity strong {
  color: #e5e5ea;
  font-weight: 600;
}

.yt-description {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #c7c7cc;
  margin-bottom: 0.85rem;
}

.yt-match-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.yt-match-label {
  font-size: 0.75rem;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.yt-match-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #34c759;
}

/* --- Recommended profiles grid --- */
.yt-recs {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 1rem;
}

.yt-recs-label {
  font-size: 0.72rem;
  color: #636366;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
  text-align: center;
}

.yt-recs-grid {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.yt-rec-photo-wrap {
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.yt-rec-photo-wrap:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #ffd60a;
}

.yt-rec-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid #3a3a3c;
}

/* --- Update progress row --- */
.yt-update-row {
  margin-top: 0.5rem;
}

/* --- Toast notification --- */
.your-type-toast {
  position: fixed;
  bottom: 2rem;
  right: 1.25rem;
  background: linear-gradient(135deg, #1c1c1e, #2c2c2e);
  border: 1px solid rgba(255,214,10,0.3);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: yt-toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 260px;
}

.your-type-toast-hide {
  animation: yt-toast-out 0.4s ease-in both;
}

.your-type-toast-icon {
  font-size: 1.3rem;
  color: #ffd60a;
  flex-shrink: 0;
}

.your-type-toast-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.your-type-toast-text strong {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}

.your-type-toast-text span {
  font-size: 0.78rem;
  color: #86868b;
}

.your-type-loading {
  font-size: 0.85rem;
  color: #86868b;
  text-align: center;
  padding: 1rem 0;
}

/* Age */
.hover-age {
  font-size: 0.8rem;
  color: #86868b;
}

.age-hint {
  font-size: 0.75rem;
  color: #ff3b30;
  margin-top: 0.25rem;
}

.your-type-loading {
  font-size: 0.85rem;
  color: #86868b;
  text-align: center;
  padding: 1rem 0;
}
