﻿.profile-overlay {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 600;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.profile-overlay.profile-visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-window {
  background: #0d0d0d;
  border: 2px solid #1a1a1a;
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.profile-overlay.profile-visible .profile-window {
  transform: scale(1) translateY(0);
}

.profile-header {
  position: relative;
  padding: 32px 28px 24px;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.profile-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 10;
}

.profile-close-btn:hover {
  background: #1a1a1a;
  border-color: #444;
  color: #aaa;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 4px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  animation: profileAvatarIn 0.4s cubic-bezier(0.22,1,0.36,1) both;
  background-size: cover;
  background-position: center;
}

.profile-avatar-large.has-image {
  background: none;
  color: transparent;
}

@keyframes profileAvatarIn {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.profile-username {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  text-align: center;
  animation: profileSlideUp 0.3s 0.1s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-crowns-display {
  font-size: 20px;
  font-weight: 700;
  color: #fbbf24;
  text-align: center;
  margin-top: -4px;
  animation: profileSlideUp 0.3s 0.15s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes profileSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-balance {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 14px;
  animation: profileSlideUp 0.3s 0.15s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-balance-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-balance-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.profile-balance-icon-coin {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe066, #f0a800 55%, #c07800);
  border: 2px solid #c07800;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,0.25), 0 1px 4px rgba(240,168,0,0.5);
  position: relative;
}

.profile-balance-icon-coin::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}

.profile-balance-icon-crystal {
  display: inline-block;
  width: 20px;
  height: 24px;
  position: relative;
  background: linear-gradient(160deg, #a5f3fc 0%, #0ea5e9 40%, #0369a1 100%);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  box-shadow: 0 0 8px rgba(14,165,233,0.6);
}

.profile-balance-icon-crystal::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 5px;
  height: 6px;
  background: rgba(255,255,255,0.5);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.profile-balance-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px 28px;
  animation: profileSlideUp 0.3s 0.2s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-stat-card {
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.profile-stat-card:hover {
  background: #1a1a1a;
  border-color: #2a2a2a;
  transform: translateY(-2px);
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #2563eb;
}

.profile-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  scrollbar-width: thin;
  scrollbar-color: #1a1a1a transparent;
}

.profile-content::-webkit-scrollbar {
  width: 6px;
}

.profile-content::-webkit-scrollbar-thumb {
  background: #1a1a1a;
  border-radius: 3px;
}

.profile-content::-webkit-scrollbar-thumb:hover {
  background: #2a2a2a;
}

.profile-section {
  margin-bottom: 24px;
  animation: profileSlideUp 0.3s 0.25s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.profile-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.profile-item-slot {
  aspect-ratio: 1;
  background: #111;
  border: 2px solid #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-item-slot:hover {
  background: #1a1a1a;
  border-color: #2563eb;
  transform: scale(1.05);
}

.profile-item-slot.empty {
  opacity: 0.3;
  cursor: default;
}

.profile-item-slot.empty:hover {
  background: #111;
  border-color: #1a1a1a;
  transform: none;
}

.profile-actions {
  padding: 20px 28px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: profileSlideUp 0.3s 0.3s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-action-btn {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  color: #aaa;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-action-btn:hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #fff;
  transform: translateY(-1px);
}

.profile-action-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.profile-action-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.profile-action-btn-danger {
  border-color: #dc2626;
  color: #dc2626;
}

.profile-action-btn-danger:hover {
  background: rgba(220,38,38,0.1);
  border-color: #b91c1c;
  color: #ef4444;
}

.profile-action-btn-duel {
  border-color: #7c3aed;
  color: #7c3aed;
}

.profile-action-btn-duel:hover {
  background: rgba(124,58,237,0.1);
  border-color: #6d28d9;
  color: #8b5cf6;
}

.profile-action-btn:disabled {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.profile-action-btn:disabled:hover {
  background: #1a1a1a;
  border-color: #2a2a2a;
  color: #666;
  transform: none;
}

.profile-action-btn-primary:disabled {
  background: #333;
  border-color: #333;
  color: #666;
  opacity: 0.4;
}

.profile-action-btn-primary:disabled:hover {
  background: #333;
  border-color: #333;
  color: #666;
  transform: none;
}

.profile-footer {
  padding: 16px 28px;
  border-top: 1px solid #1a1a1a;
  text-align: center;
  animation: profileSlideUp 0.3s 0.35s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-created-date {
  font-size: 12px;
  color: #555;
  font-weight: 600;
}

.profile-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.profile-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.theme-light .profile-overlay {
  background: rgba(200,210,230,0.95);
}

.theme-light .profile-window {
  background: #fff;
  border-color: #d0ddf0;
  box-shadow: 0 30px 80px rgba(0,0,0,0.2);
}

.theme-light .profile-header {
  border-bottom-color: #e0e8f0;
}

.theme-light .profile-close-btn {
  border-color: #d0d8f0;
  color: #888;
}

.theme-light .profile-close-btn:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #444;
}

.theme-light .profile-username {
  color: #1a1a40;
}

.theme-light .profile-header.bg-red .profile-username,
.theme-light .profile-header.bg-green .profile-username,
.theme-light .profile-header.bg-gray .profile-username,
.theme-light .profile-header.bg-purple .profile-username,
.theme-light .profile-header.bg-blue .profile-username,
.theme-light .profile-header.bg-yellow .profile-username,
.theme-light .profile-header.bg-black .profile-username,
.theme-light .profile-header.bg-cyan .profile-username,
.theme-light .profile-header.bg-orange .profile-username,
.theme-light .profile-header.bg-pink .profile-username,
.theme-light .profile-header.bg-lime .profile-username,
.theme-light .profile-header.bg-indigo .profile-username {
  color: #fff;
}

.theme-light .profile-balance {
  background: #f8faff;
  border-color: #e0e8f0;
}

.theme-light .profile-balance-value {
  color: #1a1a40;
}

.theme-light .profile-stat-card {
  background: #f8faff;
  border-color: #e0e8f0;
}

.theme-light .profile-stat-card:hover {
  background: #f0f4ff;
  border-color: #d0d8f0;
}

.theme-light .profile-stat-label {
  color: #8896b0;
}

.theme-light .profile-content {
  scrollbar-color: #d0ddf0 transparent;
}

.theme-light .profile-section-title {
  color: #8896b0;
}

.theme-light .profile-item-slot {
  background: #f8faff;
  border-color: #e0e8f0;
}

.theme-light .profile-item-slot:hover {
  background: #f0f4ff;
  border-color: #2563eb;
}

.theme-light .profile-item-slot.empty:hover {
  background: #f8faff;
  border-color: #e0e8f0;
}

.theme-light .profile-actions {
  border-top-color: #e0e8f0;
}

.theme-light .profile-action-btn {
  border-color: #d0d8f0;
  color: #4060a0;
}

.theme-light .profile-action-btn:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #1a1a40;
}

.theme-light .profile-action-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.theme-light .profile-action-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.theme-light .profile-action-btn-danger {
  border-color: #dc2626;
  color: #dc2626;
}

.theme-light .profile-action-btn-danger:hover {
  background: rgba(220,38,38,0.1);
  border-color: #b91c1c;
  color: #dc2626;
}

.theme-light .profile-action-btn-duel {
  border-color: #7c3aed;
  color: #7c3aed;
}

.theme-light .profile-action-btn-duel:hover {
  background: rgba(124,58,237,0.1);
  border-color: #6d28d9;
  color: #7c3aed;
}

.theme-light .profile-footer {
  border-top-color: #e0e8f0;
}

.theme-light .profile-created-date {
  color: #8896b0;
}

.theme-light .profile-empty-state {
  color: #8896b0;
}

.profile-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-clickable:hover {
  transform: scale(1.02);
}

.profile-clickable:active {
  transform: scale(0.98);
}

.profile-customize-btn {
  position: absolute;
  top: 16px;
  right: 56px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-customize-btn:hover {
  background: #1a1a1a;
  border-color: #7c3aed;
  color: #a78bfa;
  transform: scale(1.05);
}

.profile-customization-panel {
  position: absolute;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100%;
  background: #0a0a0a;
  border-left: 2px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.22,1,0.36,1);
  z-index: 20;
}

.profile-customization-panel.profile-customization-visible {
  right: 0;
}

.profile-customization-header {
  padding: 24px 20px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.profile-customization-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: #1a1a1a transparent;
}

.profile-customization-content::-webkit-scrollbar {
  width: 6px;
}

.profile-customization-content::-webkit-scrollbar-thumb {
  background: #1a1a1a;
  border-radius: 3px;
}

.profile-customization-section {
  margin-bottom: 28px;
}

.profile-customization-label {
  font-size: 13px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.profile-bg-default-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 2px dashed #2a2a2a;
  border-radius: 8px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
  text-align: center;
}

.profile-bg-default-btn:hover {
  border-color: #7c3aed;
  color: #a78bfa;
  background: rgba(124,58,237,0.05);
}

.profile-bg-default-btn.active {
  border-color: #7c3aed;
  border-style: solid;
  color: #a78bfa;
  background: rgba(124,58,237,0.1);
}

.profile-bg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.profile-bg-btn {
  aspect-ratio: 1;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 50px;
}

.profile-bg-btn:hover {
  border-color: #7c3aed;
  transform: scale(1.05);
}

.profile-bg-btn.active {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px #7c3aed33;
}

.profile-bg-btn.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.profile-customization-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  font-size: 14px;
  color: #ccc;
}

.toggle-switch.active {
  background: #7c3aed;
}

.toggle-switch.active .toggle-circle {
  transform: translateX(24px);
}

.profile-customization-footer {
  padding: 20px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  gap: 10px;
}

.profile-customization-save-btn,
.profile-customization-cancel-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-customization-save-btn {
  background: #7c3aed;
  border: 1px solid #7c3aed;
  color: #fff;
}

.profile-customization-save-btn:hover {
  background: #6d28d9;
  border-color: #6d28d9;
  transform: translateY(-1px);
}

.profile-customization-cancel-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #888;
}

.profile-customization-cancel-btn:hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #aaa;
  transform: translateY(-1px);
}

.profile-confirm-overlay {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 700;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-confirm-overlay.profile-confirm-visible {
  opacity: 1;
}

.profile-confirm-card {
  background: #0d0d0d;
  border: 2px solid #1a1a1a;
  border-radius: 16px;
  padding: 32px;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: profileSlideUp 0.3s cubic-bezier(0.22,1,0.36,1) both;
}

.profile-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.profile-confirm-buttons {
  display: flex;
  gap: 12px;
}

.profile-confirm-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.profile-confirm-btn-yes {
  background: #7c3aed;
  border: 1px solid #7c3aed;
  color: #fff;
}

.profile-confirm-btn-yes:hover {
  background: #6d28d9;
  border-color: #6d28d9;
  transform: translateY(-1px);
}

.profile-confirm-btn-no {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #888;
}

.profile-confirm-btn-no:hover {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #aaa;
  transform: translateY(-1px);
}

.profile-inventory-locked {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #666;
  background: #111;
  border: 2px dashed #1a1a1a;
  border-radius: 12px;
}

.profile-header.bg-red {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.profile-header.bg-green {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.profile-header.bg-gray {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.profile-header.bg-purple {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
}

.profile-header.bg-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.profile-header.bg-yellow {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
}

.profile-header.bg-black {
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.profile-header.bg-cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.profile-header.bg-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.profile-header.bg-pink {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.profile-header.bg-lime {
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
}

.profile-header.bg-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.theme-light .profile-customize-btn {
  border-color: #d0d8f0;
  color: #888;
}

.theme-light .profile-customize-btn:hover {
  background: #f0f4ff;
  border-color: #7c3aed;
  color: #7c3aed;
}

.theme-light .profile-customization-panel {
  background: #f8faff;
  border-left-color: #e0e8f0;
}

.theme-light .profile-customization-header {
  border-bottom-color: #e0e8f0;
  color: #1a1a40;
}

.theme-light .profile-customization-content {
  scrollbar-color: #d0ddf0 transparent;
}

.theme-light .profile-customization-label {
  color: #8896b0;
}

.theme-light .profile-bg-default-btn {
  border-color: #d0d8f0;
  color: #4060a0;
}

.theme-light .profile-bg-default-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124,58,237,0.05);
}

.theme-light .profile-bg-default-btn.active {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124,58,237,0.1);
}

.theme-light .profile-bg-btn {
  border-color: #e0e8f0;
}

.theme-light .profile-bg-btn:hover {
  border-color: #7c3aed;
}

.theme-light .profile-customization-toggle {
  background: #fff;
  border-color: #e0e8f0;
  color: #1a1a40;
}

.theme-light .profile-customization-footer {
  border-top-color: #e0e8f0;
}

.theme-light .profile-customization-cancel-btn {
  border-color: #d0d8f0;
  color: #4060a0;
}

.theme-light .profile-customization-cancel-btn:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #1a1a40;
}

.theme-light .profile-confirm-overlay {
  background: rgba(200,210,230,0.9);
}

.theme-light .profile-confirm-card {
  background: #fff;
  border-color: #d0ddf0;
}

.theme-light .profile-confirm-title {
  color: #1a1a40;
}

.theme-light .profile-confirm-btn-no {
  border-color: #d0d8f0;
  color: #4060a0;
}

.theme-light .profile-confirm-btn-no:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #1a1a40;
}

.theme-light .profile-inventory-locked {
  background: #f8faff;
  border-color: #e0e8f0;
  color: #8896b0;
}
