/* 
  WinIt Code Web Dashboard Styles
  Modern Glassmorphism Theme (Light & Dark)
*/

/* Define theme variables */
:root {
  /* DARK THEME (Default) */
  --bg-color: #1E1E1E;
  --panel-bg: #252526;
  --text-main: #E5E5E5;
  --text-muted: #A0A0A0;
  --accent-green: #10D34E;
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(37, 37, 38, 0.95);
  --hover-bg: rgba(255, 255, 255, 0.05);
}

/* LIGHT THEME */
@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #F8FAFC;
    --panel-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --accent-green: #10D34E;
    --border-light: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --hover-bg: rgba(0, 0, 0, 0.05);
  }
}

/* Force light or dark mode via class */
body.light-mode {
  --bg-color: #F8FAFC;
  --panel-bg: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --accent-green: #10D34E;
  --border-light: rgba(0, 0, 0, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --hover-bg: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
  --bg-color: #1E1E1E;
  --panel-bg: #252526;
  --text-main: #E5E5E5;
  --text-muted: #A0A0A0;
  --accent-green: #10D34E;
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(37, 37, 38, 0.95);
  --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Outfit', 'Inter', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 8px 32px var(--shadow-color);
  transition: all 0.3s ease;
}

/* --- SPLASH SCREEN (LOGIN) --- */
.splash-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
  margin-top: -32px; /* Offset the main padding to be truly full screen */
}

/* --- SPLASH SCREEN (LOGIN) --- */
.splash-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  background: radial-gradient(circle at center, rgba(37, 37, 38, 0.8) 0%, rgba(30, 30, 30, 0.95) 100%); /* Adds depth so card looks like a popup */
}
.splash-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('https://www.transparenttextures.com/patterns/cubes.png'); /* Subtle texture */
  opacity: 0.1;
  pointer-events: none;
}

.splash-card {
  position: relative;
  z-index: 1;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  max-width: 850px; /* Much wider for desktop split layout */
  width: 100%;
  box-shadow: 0 10px 40px var(--shadow-color);
}

.split-layout {
  display: flex;
  flex-direction: row;
}

.login-left-panel {
  flex: 1;
  background: linear-gradient(135deg, rgba(16, 211, 78, 0.1) 0%, rgba(30, 30, 30, 1) 100%);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.left-panel-text {
  margin-top: 24px;
}
.left-panel-text h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 8px 0;
}
.left-panel-text p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.login-right-panel {
  flex: 1.2;
  padding: 48px 40px;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left; /* Image 2 logic: left aligned form text */
}

/* Mobile Responsiveness for Split Layout */
@media (max-width: 768px) {
  .splash-container {
    padding: 20px 10px;
  }
  .split-layout {
    flex-direction: column;
  }
  .login-left-panel {
    background: transparent;
    border-right: none;
    border-bottom: none;
    padding: 30px 20px 10px 20px;
  }
  .left-panel-text {
    display: none; /* Hide decorative text on mobile to save space */
  }
  .login-right-panel {
    padding: 10px 20px 30px 20px;
    text-align: center; /* Center align text to mimic the mobile app perfectly */
  }
  .splash-close-btn {
    top: 15px;
    right: 15px;
  }
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  /* margin-bottom removed because text is below it now */
}

.app-logo-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  box-shadow: inset 0 0 15px rgba(16, 211, 78, 0.2), 0 0 15px rgba(16, 211, 78, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 0;
}

#splash-app-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(16, 211, 78, 0.5));
}

.welcome-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.splash-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Close Btn */
.splash-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  left: auto;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}
.splash-close-btn:hover { color: var(--text-main); }

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--accent-green);
}

.input-group input {
  width: 100%;
  background: var(--bg-color); /* Uses app background color to contrast the card */
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 14px 14px 44px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input-group input:focus {
  border-color: var(--accent-green);
}

.forgot-password {
  text-align: right;
  margin-bottom: 4px;
}
.forgot-password a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}
.forgot-password a:hover { color: var(--text-main); }

.splash-login-btn {
  background: var(--accent-green) !important;
  color: #000 !important;
  font-size: 15px !important;
  padding: 14px !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 15px rgba(16, 211, 78, 0.3) !important;
  margin-top: 8px;
}

.splash-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 20px;
}
.splash-divider::before, .splash-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}
.splash-divider span {
  padding: 0 10px;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: var(--border-light);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.google-signin-btn:hover { background: #3d3d3d; }

.guest-link {
  display: block;
  color: var(--accent-green);
  text-decoration: underline;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 20px;
}

.signup-prompt {
  font-size: 13px;
  color: var(--text-muted);
}
.signup-prompt a {
  color: var(--accent-green);
  font-weight: 700;
  text-decoration: none;
}

.google-signin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

.google-icon {
  width: 24px;
  height: 24px;
}

/* --- Loading Overlay --- */
.spinner-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-light);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.spinner-container p {
  margin-top: 20px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Transitions */
.fade-transition {
  opacity: 1;
  transition: opacity 0.5s ease;
}
.fade-transition.hidden-fade {
  opacity: 0;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* --- NAVBAR --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-actions {
  display: flex;
  align-items: center;
}

.theme-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.theme-btn:hover {
  background: rgba(128, 128, 128, 0.2);
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.logo span {
  color: var(--accent-green);
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 211, 78, 0.1);
  border: 1px solid var(--accent-green);
  padding: 8px 16px;
  border-radius: 24px;
  font-weight: 700;
}

.coin-icon {
  color: #FFD700;
}

/* --- BUTTONS --- */
.primary-btn, .action-btn {
  background: var(--text-main);
  color: var(--bg-color);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn:hover, .action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* --- RPG DASHBOARD LAYOUT --- */
.rpg-wrapper {
  background: var(--bg-color);
  min-height: 100vh;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  padding: 0 24px 24px 24px;
}

/* TOPBAR */
.rpg-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 30px;
}

.rpg-brand h1 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  color: var(--text-main);
}
.rpg-brand span {
  color: var(--accent-green);
}

.rpg-nav-links {
  display: flex;
  gap: 30px;
}
.rpg-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.rpg-nav-links a:hover, .rpg-nav-links a.active {
  color: var(--accent-green);
  border-bottom: 2px solid var(--accent-green);
  padding-bottom: 4px;
}

.rpg-top-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.rpg-league-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 20px;
  border-right: 1px solid var(--border-light);
}

.league-icon {
  color: #CD7F32; /* Bronze color */
  font-size: 28px;
}

.league-text {
  display: flex;
  flex-direction: column;
}

.league-label {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
}

.league-value {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.rpg-user-profile-container {
  position: relative;
}

.rpg-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px;
  border-radius: 20px;
  transition: background 0.2s;
}

.rpg-user-profile:hover {
  background: var(--border-light);
}

.avatar-container {
  position: relative;
  width: 44px;
  height: 44px;
}

.rpg-user-profile img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-green);
  background: #2a2a2a;
}

.level-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.level-badge::before {
  content: '';
  position: absolute;
  top: 1px; left: 1px; right: 1px; bottom: 1px;
  background: var(--accent-green);
  border: 2px solid var(--panel-bg);
  transform: rotate(45deg);
  border-radius: 4px;
  z-index: -1;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.profile-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.rpg-user-profile.active .profile-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.profile-dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  width: 200px;
  padding: 8px 0;
  box-shadow: 0 10px 30px var(--shadow-color);
  z-index: 1000;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s;
}

.profile-dropdown-menu.hidden {
  display: block !important;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--border-light);
}

.dropdown-item i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

.logout-item i {
  color: #ff3b30;
}
.logout-item:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* GRID LAYOUT */
.rpg-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto auto;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.rpg-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px var(--shadow-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.legend-dots {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 10px; height: 10px; border-radius: 2px;
}
.dot.purple { background: var(--accent-green); }

/* AREA 1: Grow Data */
.area-grow-data {
  grid-column: 1 / 8;
  grid-row: 1;
}
.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

/* AREA 2: Overall Stats */
.area-overall-stats {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
}
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}
.progress-bar {
  background: var(--border-light);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}
.fill-purple { background: linear-gradient(90deg, #10D34E, #82f2a1); }
.fill-cyan { background: linear-gradient(90deg, #00d2ff, #3a7bd5); }
.fill-green { background: linear-gradient(90deg, #10D34E, #1de9b6); }

.stats-footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
}
.stats-footer p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.rpg-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--border-light); color: var(--text-main); }
.btn-secondary { background: transparent; border: 1px solid var(--border-light); color: var(--text-main); }

/* AREA 3: Big Cards */
.area-big-cards {
  grid-column: 1 / 8;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.big-card {
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.card-green-dark {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-left: 4px solid #10D34E;
  box-shadow: 0 4px 16px var(--shadow-color);
}
.card-green-light {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-left: 4px solid #00E5FF;
  box-shadow: 0 4px 16px var(--shadow-color);
}
.bg-letter {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -20px;
  font-size: 130px;
  font-weight: 900;
  color: var(--text-main);
  opacity: 0.08;
  line-height: 1;
}
.card-content {
  position: relative;
  z-index: 1;
  text-align: right;
  width: 100%;
}
.card-content p {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.card-content h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
}

.redeem-gift-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  background: rgba(16, 211, 78, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(16, 211, 78, 0.3);
  color: #10D34E !important;
  border-radius: 20px;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 800;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(16, 211, 78, 0.1);
}

.redeem-gift-btn:hover {
  transform: translateY(-2px);
  background: rgba(16, 211, 78, 0.25);
  border-color: rgba(16, 211, 78, 0.5);
  box-shadow: 0 4px 10px rgba(16, 211, 78, 0.2);
}

.redeem-gift-btn i {
  margin-right: 6px;
}

/* AREA 4: Quest Summaries */
.area-quest-summaries {
  grid-column: 1 / 5;
  grid-row: 3;
}
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--card-bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
}
.transaction-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
  background: rgba(255, 255, 255, 0.05);
}
.tx-info h4 { margin: 0 0 2px 0; font-size: 12px; color: var(--text-main); font-weight: 700; }
.tx-info p { margin: 0; font-size: 10px; color: var(--text-muted); }
.tx-amount { font-weight: 900; color: #10D34E; font-size: 12px; background: rgba(16, 211, 78, 0.1); padding: 2px 6px; border-radius: 6px;}
.tx-amount.negative { color: #ff5252; background: rgba(255, 82, 82, 0.1); }

/* AREA 5: Job Skills */
.area-job-skills {
  grid-column: 5 / 9;
  grid-row: 3;
}
.radar-container {
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* AREA 6: Party Members */
.area-party-members {
  grid-column: 9 / 13;
  grid-row: 3;
}
.referral-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.referral-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.3s ease;
}
.referral-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
  background: rgba(255, 255, 255, 0.05);
}
.referral-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-purple);
}
.ref-info { flex: 1; }
.ref-info h4 { margin: 0 0 6px 0; font-size: 15px; color: var(--text-main); font-weight: 700; }
.ref-info p { margin: 0; font-size: 12px; color: var(--text-muted); }
.ref-level {
  font-size: 12px; font-weight: 700; color: var(--accent-green);
}

/* Scrollbar styling for lists */
.transaction-list::-webkit-scrollbar, .referral-list::-webkit-scrollbar {
  width: 4px;
}
.transaction-list::-webkit-scrollbar-thumb, .referral-list::-webkit-scrollbar-thumb {
  background: var(--hover-bg);
  border-radius: 4px;
}

/* Legends Tab */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.legend-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, background 0.2s;
}

.legend-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
}

.legend-icon-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-icon-bg {
  font-size: 55px;
  position: absolute;
}

.legend-icon-text {
  position: relative;
  font-weight: 900;
  font-size: 20px;
  z-index: 2;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.legend-content {
  flex: 1;
}

.legend-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-main);
}

.legend-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.3;
}

.legend-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--hover-bg);
  border-radius: 3px;
  border-radius: 3px;
  overflow: hidden;
}

.legend-progress-fill {
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 10px currentColor;
}

.legend-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

/* =========================================
   ACHIEVEMENTS / CATEGORIES (Archive)
   ========================================= */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.achievement-card {
  background: #1c1e28;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.achievement-card:hover {
  transform: translateY(-2px);
}

.achievement-icon-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.achievement-icon-bg {
  font-size: 50px;
  position: absolute;
  color: #333;
}
.achievement-icon-text {
  position: relative;
  z-index: 2;
  font-weight: 900;
  font-size: 16px;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.achievement-info {
  flex: 1;
}
.achievement-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}
.achievement-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.achievement-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.achievement-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--hover-bg);
  border-radius: 3px;
  overflow: hidden;
}
.achievement-progress-fill {
  height: 100%;
  border-radius: 3px;
  box-shadow: 0 0 10px currentColor;
}
.achievement-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* =========================================
   LEGENDS PODIUM
   ========================================= */
.legends-container {
  padding: 20px;
}

.legends-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 40px;
}
.legends-filters {
  display: flex;
  gap: 16px;
}
.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}
.filter-btn:hover {
  color: var(--text-main);
  background: var(--hover-bg);
}
.filter-btn.active {
  color: var(--text-main);
  background: var(--border-light);
}

.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  height: 300px;
  margin-bottom: 60px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  position: relative;
}

.podium-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #333;
  object-fit: cover;
  margin-bottom: -15px;
  z-index: 2;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.podium-slot.rank-1 .podium-avatar { width: 90px; height: 90px; border-color: #ffd700; margin-bottom: -20px; }
.podium-slot.rank-2 .podium-avatar { border-color: #c0c0c0; }
.podium-slot.rank-3 .podium-avatar { border-color: #cd7f32; }

.podium-stats {
  display: flex;
  gap: 8px;
  background: #1e2130;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 3;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}
.podium-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
}
.podium-stat i { font-size: 10px; }
.podium-stat.streak { color: #ff9800; }
.podium-stat.xp { color: #10D34E; }

.podium-username {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
  word-break: break-word;
}

.podium-block {
  width: 100%;
  background: linear-gradient(180deg, #252526 0%, #1E1E1E 100%);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 5px var(--hover-bg), 0 10px 30px var(--shadow-color);
}
.podium-slot.rank-1 .podium-block { height: 160px; }
.podium-slot.rank-2 .podium-block { height: 120px; }
.podium-slot.rank-3 .podium-block { height: 90px; }

.podium-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--hover-bg);
  margin-top: 20px;
  font-family: 'Outfit', sans-serif;
}

.top-users-list-header h3 {
  font-size: 18px;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.top-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-user-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--hover-bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  gap: 16px;
}
.top-user-item:hover {
  background: var(--hover-bg);
}

.tu-rank {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}
.top-user-item.rank-1 .tu-rank { color: #ffd700; }
.top-user-item.rank-2 .tu-rank { color: #c0c0c0; }
.top-user-item.rank-3 .tu-rank { color: #cd7f32; }

.tu-avatar {
  position: relative;
}
.tu-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.tu-level-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.tu-level-badge::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px; right: 2px; bottom: 2px;
  background: var(--accent-green);
  border: 2px solid var(--panel-bg);
  transform: rotate(45deg);
  border-radius: 4px;
  z-index: -1;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.tu-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.tu-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}
.tu-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.tu-stat.streak { color: var(--text-main); }
.tu-stat.streak i { color: #ff9800; }
.tu-stat.xp { color: var(--text-main); }
.tu-stat.xp i { color: #10D34E; }

/* Responsive Grid */
@media (max-width: 1024px) {
  .rpg-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .area-grow-data, .area-overall-stats, .area-big-cards, .area-quest-summaries, .area-job-skills, .area-party-members {
    grid-column: 1 / -1;
  }
  .area-overall-stats { grid-row: auto; }
}

/* =========================================
   FOOTER
   ========================================= */
.dashboard-footer {
  margin-top: 40px;
  padding: 30px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  font-size: 12px;
}

.footer-copyright, .footer-contact, .footer-links, .footer-theme {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-green {
  color: var(--accent-green);
  font-weight: 600;
  text-decoration: none;
}
.text-green:hover {
  opacity: 0.8;
}

.text-blue {
  color: #3b82f6;
  text-decoration: none;
}
.text-blue:hover {
  text-decoration: underline;
}

.footer-links {
  gap: 12px;
}

.footer-theme {
  gap: 12px;
}

/* Theme Switch Toggle */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 2px;
}

/* Dark mode specific track color */
body:not(.light-mode) .theme-slider {
  background-color: rgba(255, 255, 255, 0.2);
}

.theme-slider-thumb {
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}

.theme-slider-thumb i {
  font-size: 11px;
  line-height: 1;
  display: block;
}

input:checked + .theme-slider .theme-slider-thumb {
  transform: translateX(20px);
}

/* =========================================
   PROFILE TAB
   ========================================= */
#tab-profile {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.profile-header-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 16px var(--shadow-color);
}

.profile-avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
}

#profile-big-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--accent-green);
  object-fit: cover;
  background-color: var(--border-light);
}

.edit-avatar-btn {
  position: absolute;
  bottom: 0;
  right: -5px;
  background: var(--accent-green);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: transform 0.2s;
}

.edit-avatar-btn:hover {
  transform: scale(1.1);
}

#profile-big-username {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

#profile-big-email {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

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

.profile-ranks-card {
  padding: 24px;
}

.ranks-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.ranks-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-rank-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.profile-rank-item.active {
  background: rgba(255, 255, 255, 0.03);
}

.profile-rank-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 16px;
  box-shadow: 0 0 8px currentColor;
}

.profile-rank-info {
  flex: 1;
}

.profile-rank-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.profile-rank-range {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-rank-boost {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
}

.profile-rank-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 12px;
  border-radius: 0 0 0 12px;
  font-size: 10px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.quest-title {
  font-weight: 700;
  color: var(--text-main);
}

.ranks-note {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
  align-items: flex-start;
}
.ranks-note i {
  margin-top: 2px;
}

/* =========================================
   FOOTER V2
   ========================================= */
.dashboard-footer-v2 {
  border-top: 1px solid var(--border-light);
  padding: 30px 40px;
  margin-top: 40px;
  font-family: 'Inter', sans-serif;
  color: #a0a0a0;
  font-size: 13px;
}

.footer-v2-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-v2-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-v2-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-v2-links a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-v2-links a:hover {
  color: var(--text-main);
}

.footer-v2-dot {
  color: #666;
}

.footer-v2-disclaimer {
  font-size: 11px;
  color: #666;
}

.footer-v2-disclaimer a {
  color: #a0a0a0;
  text-decoration: underline;
}

.footer-v2-disclaimer a:hover {
  color: var(--text-main);
}

.footer-v2-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.footer-v2-theme {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-selector-pill {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
  user-select: none;
}

.theme-selector-pill:hover {
  border-color: var(--text-muted);
}

.theme-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 120px;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 8px 16px var(--shadow-color);
}

.theme-dropdown-menu.hidden {
  display: none;
}

.theme-option {
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 13px;
  transition: background 0.2s;
}

.theme-option:hover {
  background: var(--hover-bg);
}

.theme-option.active {
  background: rgba(16, 211, 78, 0.15);
  color: var(--accent-green);
  font-weight: 600;
}

.footer-v2-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
}

.footer-v2-socials a {
  color: #888;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}

.footer-v2-socials a:hover {
  color: var(--text-main);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .footer-v2-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-v2-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* AREA STORE */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.store-card {
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.store-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px var(--shadow-color);
  border-color: var(--accent-green);
}
.store-card img {
  max-width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}
.store-card h4 {
  color: var(--text-main);
  margin-bottom: 4px;
  font-size: 16px;
}
.store-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.store-cost {
  background: rgba(16, 211, 78, 0.1);
  color: var(--accent-green);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none !important;
}

/* --- Leagues Modal Styles --- */
.league-modal-content {
  max-width: 850px;
  width: 95%;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  max-height: 85vh;
  overflow-y: auto;
}

.league-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.league-tabs::-webkit-scrollbar {
  height: 4px;
}
.league-tabs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.league-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.league-tab-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
}

.league-tab-btn:hover {
  background: rgba(255,255,255,0.1);
}

.league-tab-btn.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}

.league-tab-btn.active img {
  filter: none;
  opacity: 1;
}

.league-banner {
  background: linear-gradient(90deg, rgba(205,127,50,0.2) 0%, rgba(0,0,0,0) 100%); /* Color updated via JS */
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.05);
}

#league-banner-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.position-container {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border-light);
}

#league-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* REFERRALS REDESIGN */
.ref-top-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  position: relative;
}
.ref-promo-card {
  background: white;
  border: 1px solid rgba(16, 211, 78, 0.3);
  border-radius: 20px;
  padding: 30px 20px;
  text-align: center;
  flex: 1;
  max-width: 250px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.ref-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 211, 78, 0.1);
  color: #10D34E;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px auto;
}
.ref-promo-title {
  color: #000;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 8px;
}
.ref-promo-sub {
  color: #666;
  font-size: 14px;
}
.ref-plus-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #10D34E;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  z-index: 2;
}

.ref-ways-section {
  margin-bottom: 40px;
}
.ref-way-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.ref-way-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10D34E;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.ref-way-content {
  flex: 1;
}
.ref-way-content h4 {
  margin: 0 0 12px 0;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
}
.ref-link-box {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 12px;
  align-items: center;
}
.ref-copy-btn {
  background: rgba(16, 211, 78, 0.1);
  color: #10D34E;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.ref-copy-btn:hover { background: rgba(16, 211, 78, 0.2); }

.ref-social-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ref-social-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.ref-social-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.ref-social-btn.whatsapp { background: #25D366; }
.ref-social-btn.facebook { background: #1877F2; }
.ref-social-btn.twitter { background: #0F1419; }
.ref-social-btn.telegram { background: #0088CC; }
.ref-social-btn.reddit { background: #FF4500; }
.ref-social-btn.email { background: #6B7280; }

.ref-invite-inputs {
  display: flex;
  gap: 12px;
}
.ref-invite-inputs input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-main);
  outline: none;
}

.ref-activity-section {
  background: transparent;
}
.ref-total-badge {
  background: #e0e0e0;
  color: #333;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}
.ref-table-header {
  display: flex;
  padding: 12px 20px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}
.ref-table-row {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.ref-table-row .account { flex: 2; font-weight: 700; font-size: 15px; }
.ref-table-row .status { flex: 1; text-align: center; font-weight: 700; font-size: 14px; }
.ref-table-row .status.pending { color: #FFA000; }
.ref-table-row .status.earned { color: #10D34E; }
.ref-table-row .date { flex: 1; text-align: center; color: #666; font-size: 14px; }
.ref-table-row .earned { flex: 1; text-align: right; font-weight: 800; font-size: 15px; }

/* Dark mode overrides for referrals */
.dark-mode .ref-promo-card { background: var(--card-bg); border-color: rgba(16, 211, 78, 0.2); }
.dark-mode .ref-promo-title { color: white; }
.dark-mode .ref-promo-sub { color: #999; }
.dark-mode .ref-table-row { background: var(--card-bg); color: white; border: 1px solid var(--border-light); }
.dark-mode .ref-plus-badge { background: #333; }
.dark-mode .ref-total-badge { background: #333; color: white; }
.dark-mode .ref-table-row .date { color: #999; }

/* =========================================
   MOBILE RESPONSIVENESS (< 768px)
   ========================================= */
@media (max-width: 768px) {
  /* General Layout */
  .rpg-wrapper {
    padding: 10px;
  }
  .rpg-card {
    padding: 16px !important;
  }
  
  /* Topbar */
  .rpg-topbar {
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
  }
  .rpg-nav-links {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
    gap: 16px;
    justify-content: flex-start;
  }
  .rpg-top-right {
    width: 100%;
    justify-content: space-between;
  }

  /* Referrals Top Section */
  .ref-top-section {
    flex-direction: column;
    gap: 16px;
  }
  .ref-promo-card {
    max-width: 100%;
    width: 100%;
  }

  /* Referrals 3 Ways Section */
  .ref-way-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ref-social-buttons {
    flex-direction: column;
    width: 100%;
  }
  .ref-social-btn {
    width: 100%;
    justify-content: center;
  }
  .ref-invite-inputs {
    flex-direction: column;
  }

  /* Referrals Activity Table */
  .ref-table-header {
    display: none; /* Hide desktop table headers */
  }
  .ref-table-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 8px;
    border-radius: 12px;
  }
  .ref-table-row > div {
    text-align: left !important;
    width: 100%;
  }
  .ref-table-row .account {
    font-size: 16px;
  }
  .ref-table-row .date {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .ref-table-row .status {
    display: inline-block;
    width: auto;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(0,0,0,0.05);
  }
  .dark-mode .ref-table-row .status {
    background: rgba(255,255,255,0.1);
  }
  .ref-table-row .earned {
    font-size: 18px;
    margin-top: 8px;
  }

  /* Store Grid */
  #store-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Redesigned Profile Modal */
.profile-modal-content {
  max-width: 800px !important;
  width: 95%;
  background: linear-gradient(135deg, #161823 0%, #0d0f15 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  padding: 32px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.profile-modal-content::-webkit-scrollbar {
  width: 6px;
}

.profile-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-container {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(16, 211, 78, 0.4);
  box-shadow: 0 4px 15px rgba(16, 211, 78, 0.15);
}

.profile-level-badge {
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 32px;
  height: 36px;
  background: #10D34E;
  color: #000;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: 5;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.vip-upgrade-badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}
.vip-upgrade-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  filter: brightness(1.1);
}

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

.profile-display-username {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.5px;
}

.profile-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 16px;
  border-radius: 20px;
  width: fit-content;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

.profile-rank-pill img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.profile-rank-pill span {
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.profile-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.profile-badge-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 20px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-badge-pill i {
  font-size: 10px;
}

.profile-xp-progress-section {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 24px;
}

.profile-xp-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.profile-xp-bar-outer {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
}

.profile-xp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #10D34E, #00E5FF);
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 211, 78, 0.3);
}

.profile-stats-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.profile-metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.25s ease;
  min-height: 120px;
}

.profile-metric-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(16, 211, 78, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.profile-metric-card .icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 16px;
}

.profile-metric-card.m-credits .icon-circle {
  background: rgba(255, 215, 0, 0.1);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.profile-metric-card.m-rewards .icon-circle {
  background: rgba(168, 85, 247, 0.1);
  color: #A855F7;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.profile-metric-card.m-streak .icon-circle {
  background: rgba(255, 82, 82, 0.1);
  color: #FF5252;
  border: 1px solid rgba(255, 82, 82, 0.15);
}

.profile-metric-card.m-referrals .icon-circle {
  background: rgba(0, 229, 255, 0.1);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.profile-metric-card .label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.profile-metric-card .val {
  font-size: 22px;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  margin: 0;
}

@media (max-width: 768px) {
  .profile-stats-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-modal-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-header-right {
    align-items: flex-start;
    width: 100%;
  }
  .profile-badge-pill {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Glassmorphism ligero para el botón Redeem */
.redeem-gift-btn {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.redeem-gift-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  color: #fff;
}
