/* ===== PROFIL BARI ===== */
.profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  color: #333;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.profile-emoji {
  line-height: 0;
  flex-shrink: 0;
}

.profile-emoji .ach-svg {
  width: 36px;
  height: 36px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.profile-level {
  font-size: 0.75rem;
  opacity: 0.8;
}

.profile-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.xp-bar-container {
  width: 100%;
  max-width: 200px;
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, #f9a825, #ff6f00);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.xp-text {
  font-size: 0.7rem;
  color: #888;
  white-space: nowrap;
}

.profile-actions {
  display: flex;
  gap: 6px;
}

.profile-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.profile-btn:active {
  transform: scale(0.95);
}

.profile-register-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.profile-login-btn {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

.profile-logout-btn {
  background: rgba(0, 0, 0, 0.06);
  color: #999;
  font-size: 0.7rem;
}

/* ===== AUTH MODAL ===== */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.auth-overlay.hidden {
  display: none;
}

.auth-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #999;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form.hidden {
  display: none;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #667eea;
}

.auth-submit {
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.auth-submit:active {
  transform: scale(0.97);
}

.auth-error {
  color: #e74c3c;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

/* ===== AUTH SUCCESS TOAST ===== */
.auth-success-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #27ae60;
  color: #fff;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1100;
  box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
  transition: opacity 0.3s;
}

.auth-success-toast.hidden {
  display: none;
}

/* ===== XP BADGE (oyun sonucu) ===== */
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.1rem;
  margin: 12px 0;
}

.xp-badge-earned {
  background: linear-gradient(135deg, #f9a825, #ff6f00);
  color: #fff;
  box-shadow: 0 4px 15px rgba(249, 168, 37, 0.4);
  animation: xpPop 0.5s ease;
}

.xp-badge-none {
  background: rgba(0, 0, 0, 0.08);
  color: #999;
  font-size: 0.9rem;
}

.xp-badge-value {
  font-size: 1.2rem;
}

.xp-badge-mult {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
}

@keyframes xpPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== LEVEL UP ===== */
.xp-levelup {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f9a825;
  text-align: center;
  margin: 8px 0;
  animation: levelUpBounce 0.8s ease;
}

@keyframes levelUpBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== GLOBAL LEADERBOARD ===== */
.global-leaderboard {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.global-lb-title {
  color: #333;
  font-size: 0.95rem;
  margin: 0 0 8px 0;
  text-align: center;
}

.global-lb-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
  margin: 0 -4px;
  padding: 0 4px 4px;
}

.global-lb-scroll::-webkit-scrollbar {
  height: 4px;
}

.global-lb-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
}

.global-lb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 2px 10px;
  min-width: max-content;
}

.global-lb-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background 0.2s;
  min-width: 0;
  white-space: nowrap;
}

.global-lb-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.global-lb-me {
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.global-lb-rank {
  width: 22px;
  text-align: center;
  font-weight: 700;
  color: #666;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.global-lb-emoji {
  line-height: 0;
  flex-shrink: 0;
}

.global-lb-emoji .ach-svg {
  width: 20px;
  height: 20px;
}

.global-lb-avatar-wrap {
  position: relative;
  display: inline-block;
}

.global-lb-medal {
  position: absolute;
  bottom: -3px;
  right: -5px;
  line-height: 0;
}

.global-lb-medal .ach-svg {
  width: 13px;
  height: 13px;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
}

.global-lb-name {
  flex: 1;
  color: #333;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.global-lb-xp {
  color: #e67e22;
  font-weight: 700;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 400px) {
  .global-lb-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

/* ===== OYUN SAYFASI ISIM BADGE ===== */
.player-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  margin: 4px 0;
}

.pnb-emoji {
  line-height: 0;
}

.pnb-emoji .ach-svg {
  width: 28px;
  height: 28px;
}

.pnb-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnb-change {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.5;
  padding: 2px 4px;
  transition: opacity 0.2s;
}

.pnb-change:hover {
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .profile-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .profile-left {
    justify-content: center;
  }

  .profile-right {
    align-items: center;
  }

  .xp-bar-container {
    max-width: 100%;
  }

  .profile-name {
    max-width: 160px;
  }

  .auth-modal {
    padding: 20px 16px;
  }
}

/* ===== STREAK BADGE ===== */
.profile-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 8px;
  white-space: nowrap;
}

.profile-streak .ach-svg {
  width: 16px;
  height: 16px;
}

.streak-badge-result {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: #fff;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 8px 0;
}

.streak-badge-result .ach-svg {
  width: 20px;
  height: 20px;
}

.streak-weekly-bonus {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 4px 0 8px;
  animation: streakBonusPulse 1s ease 2;
}

@keyframes streakBonusPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@media (max-width: 360px) {
  .profile-emoji {
    font-size: 1.6rem;
  }

  .profile-name {
    max-width: 100px;
    font-size: 0.85rem;
  }

  .profile-btn {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .xp-badge {
    padding: 8px 14px;
    font-size: 1rem;
  }
}

/* ===== AVATAR GORUNTULEME ===== */
.profile-avatar { width: 36px; height: 36px; border-radius: 50%; }
.global-lb-avatar { width: 20px; height: 20px; border-radius: 50%; }
.result-avatar { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.pnb-avatar { width: 28px; height: 28px; border-radius: 50%; }
.lb-avatar { width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

/* ===== AVATAR SECIM GRIDI ===== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 8px 0;
}

.avatar-option {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: rgba(0, 0, 0, 0.04);
}

.avatar-option:hover {
  border-color: rgba(102, 126, 234, 0.4);
}

.avatar-option.selected {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.avatar-option-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* ===== ULKE SECICI ===== */
.country-selector {
  position: relative;
  margin: 8px 0;
}

.selected-country {
  padding: 10px 14px;
  background: rgba(102, 126, 234, 0.08);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s;
}

.selected-country:hover {
  border-color: #667eea;
}

.country-arrow {
  margin-left: auto;
  font-size: 0.8rem;
  opacity: 0.5;
}

.country-search {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  margin-top: 4px;
  box-sizing: border-box;
}

.country-search:focus {
  border-color: #667eea;
}

.country-dropdown {
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.country-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.country-item:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* ===== ULKE BAYRAGI (leaderboard) ===== */
.global-lb-flag {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ===== PROFIL DUZENLEME MODALI ===== */
.profile-edit-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.profile-edit-overlay.hidden {
  display: none;
}

.profile-edit-modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.profile-edit-modal h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  color: #333;
  text-align: center;
}

.profile-edit-modal label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin: 12px 0 4px;
}

.profile-edit-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 0.7rem;
}

/* ===== AUTH FORM EXTRA LABELS ===== */
.auth-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin: 12px 0 4px;
}
