/* ============================================================
   LifeQuest — RPG Productivity App
   Complete Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #1a1145;
  --bg-secondary: #30245F;
  --bg-sidebar: #463875;
  --bg-card: #514B91;
  --bg-card-hover: #5d55a0;
  --bg-input: #3d3270;
  --purple-accent: #A855F7;
  --purple-light: #C084FC;
  --magenta-accent: #D946EF;
  --xp-gold: #FFC247;
  --xp-gold-dark: #E5A830;
  --green-success: #34D399;
  --red-danger: #EF4444;
  --blue-info: #60A5FA;
  --orange-warn: #F97316;
  --text-primary: #FFFFFF;
  --text-secondary: #D8D1F0;
  --text-muted: #9B8FC7;
  --border-color: rgba(168, 85, 247, 0.2);
  --shadow: rgba(0, 0, 0, 0.3);
  --sidebar-width: 280px;
  --right-panel-width: 320px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.3s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--purple-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--purple-accent); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-size: inherit; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-accent); }

/* ---------- Utility Classes ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-gold { color: var(--xp-gold) !important; }
.text-purple { color: var(--purple-accent) !important; }
.text-green { color: var(--green-success) !important; }
.text-red { color: var(--red-danger) !important; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ---------- Layout: 3 Column ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-logo .logo-icon { font-size: 2.2rem; display: block; margin-bottom: 4px; }
.sidebar-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Player profile */
.player-profile {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}
.avatar-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  position: relative;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}
.avatar-circle .level-badge {
  position: absolute;
  bottom: -4px; right: -4px;
  background: var(--xp-gold);
  color: #1a1145;
  font-size: 0.7rem;
  font-weight: 800;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--bg-sidebar);
}
.player-profile .username {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.player-profile .player-level {
  font-size: 0.8rem;
  color: var(--xp-gold);
  font-weight: 600;
}

/* Sidebar XP bar */
.sidebar-xp-section {
  margin-top: 10px;
}
.xp-bar-wrapper {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  position: relative;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xp-gold-dark), var(--xp-gold));
  border-radius: 10px;
  transition: width 0.8s ease;
  min-width: 2px;
}
.xp-bar-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

/* Navigation */
.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}
.nav-link:hover {
  background: rgba(168, 85, 247, 0.1);
  color: var(--text-primary);
}
.nav-link.active {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple-accent);
  border-left-color: var(--purple-accent);
  font-weight: 600;
}
.nav-link i, .nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Logout button */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
  margin-left: var(--sidebar-width);
  margin-right: var(--right-panel-width);
  padding: 24px 32px;
  min-height: 100vh;
  flex: 1;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.top-bar h1 {
  font-size: 1.5rem;
  font-weight: 700;
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
}

/* ---------- RIGHT PANEL ---------- */
.right-panel {
  width: var(--right-panel-width);
  position: fixed;
  top: 0; right: 0; bottom: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 24px 16px;
  z-index: 90;
}

.right-panel-section {
  margin-bottom: 24px;
}
.right-panel-section h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* Player level card */
.level-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(168,85,247,0.2));
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}
.level-number {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.level-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
}
.right-xp-bar {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.right-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xp-gold-dark), var(--xp-gold));
  border-radius: 8px;
  transition: width 0.8s ease;
}
.right-xp-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mini stat cards */
.mini-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.mini-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border-color);
}
.mini-stat-card .mini-stat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.mini-stat-card .mini-stat-icon svg, .mini-stat-card .mini-stat-icon i { width: 16px; height: 16px; }
.mini-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  display: block;
}
.mini-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Recent activity */
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg, .activity-icon i { width: 16px; height: 16px; }
.activity-info { flex: 1; min-width: 0; }
.activity-title {
  font-size: 0.8rem;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.activity-xp {
  font-size: 0.8rem;
  color: var(--xp-gold);
  font-weight: 700;
  flex-shrink: 0;
}

/* Achievement preview */
.achievement-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.achievement-mini-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.achievement-mini-icon.unlocked {
  background: linear-gradient(135deg, rgba(255,194,71,0.2), rgba(217,70,239,0.2));
  box-shadow: 0 0 10px rgba(255,194,71,0.2);
}
.achievement-mini-icon svg, .achievement-mini-icon i { width: 18px; height: 18px; color: var(--xp-gold); }
.achievement-mini-title { font-size: 0.8rem; font-weight: 600; display: block; }
.achievement-mini-date { font-size: 0.7rem; color: var(--text-muted); display: block; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  transition: all var(--transition);
}
.card:hover {
  border-color: rgba(168, 85, 247, 0.3);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 svg, .card-header h3 i { width: 20px; height: 20px; color: var(--purple-accent); }

/* ---------- STAT CARDS ---------- */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg, .stat-icon i { width: 22px; height: 22px; }
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- HERO BANNER ---------- */
.hero-banner {
  background: linear-gradient(135deg, var(--bg-card), rgba(168,85,247,0.3), rgba(217,70,239,0.2));
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(168,85,247,0.15), transparent);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; }
.hero-content h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.hero-content p { color: var(--text-secondary); margin-bottom: 16px; }
.hero-art {
  position: relative;
  z-index: 1;
}
.pixel-castle { font-size: 5rem; animation: float 3s ease-in-out infinite; }

/* ---------- QUEST CARDS ---------- */
.quest-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.quest-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.quest-card.category-general::before { background: #A855F7; }
.quest-card.category-health::before { background: #EF4444; }
.quest-card.category-learning::before { background: #60A5FA; }
.quest-card.category-fitness::before { background: #34D399; }
.quest-card.category-creativity::before { background: #D946EF; }
.quest-card.category-social::before { background: #FFC247; }
.quest-card.category-career::before { background: #F97316; }
.quest-card.category-mindfulness::before { background: #06B6D4; }

.quest-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--shadow);
}
.quest-card.completed {
  opacity: 0.7;
}
.quest-card.completed .quest-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.quest-info { flex: 1; min-width: 0; }
.quest-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.quest-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quest-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.quest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge i, .badge svg { width: 12px; height: 12px; }
.badge-easy { background: rgba(52,211,153,0.15); color: #34D399; }
.badge-medium { background: rgba(96,165,250,0.15); color: #60A5FA; }
.badge-hard { background: rgba(168,85,247,0.15); color: #A855F7; }
.badge-epic { background: rgba(217,70,239,0.15); color: #D946EF; }
.badge-legendary { background: rgba(255,194,71,0.15); color: #FFC247; }
.badge-category {
  font-size: 0.7rem;
}
.badge-daily { background: rgba(255,194,71,0.15); color: #FFC247; }

.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--xp-gold);
  font-size: 0.8rem;
  font-weight: 700;
}
.xp-badge i, .xp-badge svg { width: 14px; height: 14px; }
.xp-badge.small { font-size: 0.7rem; }
.xp-badge.small i, .xp-badge.small svg { width: 12px; height: 12px; }

/* ---------- PROGRESS BARS ---------- */
.progress-bar {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--purple-accent), var(--magenta-accent));
}
.progress-fill.gold {
  background: linear-gradient(90deg, var(--xp-gold-dark), var(--xp-gold));
}
.progress-fill.green {
  background: linear-gradient(90deg, #059669, var(--green-success));
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn i, .btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--purple-accent);
  border: 1px solid var(--purple-accent);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, #DC2626, var(--red-danger));
  color: white;
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #059669, var(--green-success));
  color: white;
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3);
}

.btn-gold {
  background: linear-gradient(135deg, var(--xp-gold-dark), var(--xp-gold));
  color: #1a1145;
  font-weight: 700;
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(255, 194, 71, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-sm i, .btn-sm svg { width: 14px; height: 14px; }
.btn-full { width: 100%; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- FORMS ---------- */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  width: 18px; height: 18px;
}
.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}
.input-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239B8FC7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple-accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
input::placeholder { color: var(--text-muted); }

/* No-icon inputs */
input:not(.input-wrapper input),
select:not(.input-wrapper select),
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle svg, .password-toggle i { width: 18px; height: 18px; }

.field-error {
  display: none;
  font-size: 0.78rem;
  color: var(--red-danger);
  margin-top: 4px;
}
.field-error.visible { display: block; }

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--red-danger);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.form-error i, .form-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Username availability */
.availability-indicator {
  font-size: 0.78rem;
  margin-top: 4px;
  min-height: 18px;
}
.availability-indicator.checking { color: var(--text-muted); }
.availability-indicator.available { color: var(--green-success); }
.availability-indicator.taken, .availability-indicator.error { color: var(--red-danger); }

/* Password strength */
.password-strength {
  margin-top: 6px;
}
.strength-bar-track {
  background: rgba(0,0,0,0.3);
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
}
.strength-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: all 0.3s ease;
  width: 0;
}
.strength-text {
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--purple-accent);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0;
}
.checkbox-group label a {
  color: var(--purple-light);
  text-decoration: underline;
}

/* ---------- AUTH PAGES ---------- */
.auth-page {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-container {
  width: 100%;
  max-width: 440px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 36px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px var(--shadow);
  animation: fadeIn 0.5s ease;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}
.auth-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { color: var(--text-muted); font-size: 0.85rem; }
.auth-card h2 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-switch a { color: var(--purple-light); font-weight: 600; }
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--text-muted); margin: 0 4px; }
.auth-footer a:hover { color: var(--purple-light); }
.auth-footer span { margin: 0 4px; }

/* ---------- SPINNER ---------- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner.large { width: 40px; height: 40px; border-width: 3px; }

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 10, 35, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}
.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px var(--shadow);
  transform: translateY(20px);
  transition: transform var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal-content { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ---------- TOAST ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 8px 25px var(--shadow);
}
.toast-exit { animation: slideOutRight 0.3s ease forwards; }
.toast-success { background: #065F46; color: #A7F3D0; border-left: 4px solid var(--green-success); }
.toast-error { background: #7F1D1D; color: #FECACA; border-left: 4px solid var(--red-danger); }
.toast-info { background: #1E3A5F; color: #BFDBFE; border-left: 4px solid var(--blue-info); }
.toast-warning { background: #78350F; color: #FDE68A; border-left: 4px solid var(--xp-gold); }
.toast-icon { flex-shrink: 0; }
.toast-icon svg, .toast-icon i { width: 18px; height: 18px; }
.toast-message { flex: 1; }
.toast-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast-close svg, .toast-close i { width: 14px; height: 14px; }

/* ---------- DATA TABLE ---------- */
.data-table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
  background: rgba(0,0,0,0.2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th:hover { color: var(--text-primary); }
.data-table th.sorted { color: var(--purple-accent); }
.data-table th .sort-icon { display: inline-block; margin-left: 4px; font-size: 0.7rem; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table td { font-size: 0.9rem; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.pagination button {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.pagination button:hover:not(:disabled) {
  background: var(--purple-accent);
  color: white;
}
.pagination button.active {
  background: var(--purple-accent);
  color: white;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 12px;
}

/* ---------- SEARCH & FILTER BAR ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px; height: 18px;
  pointer-events: none;
}
.search-input-wrapper input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}
.search-input-wrapper input:focus {
  border-color: var(--purple-accent);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.filter-select {
  padding: 10px 32px 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239B8FC7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Quest tabs */
.quest-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.quest-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.quest-tab.active {
  background: var(--purple-accent);
  color: white;
}
.quest-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ---------- ACHIEVEMENT CARDS ---------- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.achievement-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  position: relative;
}
.achievement-card.unlocked {
  border-color: rgba(255,194,71,0.3);
}
.achievement-card.unlocked::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,194,71,0.1), transparent);
  pointer-events: none;
}
.achievement-card.locked {
  opacity: 0.6;
}
.achievement-card.locked .achievement-icon-wrapper {
  filter: grayscale(1);
}
.achievement-icon-wrapper {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 1.5rem;
}
.achievement-icon-wrapper.unlocked {
  background: linear-gradient(135deg, rgba(255,194,71,0.2), rgba(217,70,239,0.2));
  box-shadow: 0 0 20px rgba(255,194,71,0.15);
  animation: glow 2s ease-in-out infinite;
}
.achievement-icon-wrapper.locked {
  background: rgba(0,0,0,0.2);
}
.achievement-icon-wrapper svg, .achievement-icon-wrapper i { width: 28px; height: 28px; color: var(--xp-gold); }
.achievement-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.achievement-card .achievement-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.achievement-card .achievement-progress {
  margin-top: 8px;
}
.achievement-card .achievement-progress-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.achievement-card .achievement-xp {
  font-size: 0.75rem;
  color: var(--xp-gold);
  font-weight: 600;
  margin-top: 8px;
}
.achievement-unlock-date {
  font-size: 0.7rem;
  color: var(--green-success);
  margin-top: 6px;
}

/* ---------- STATISTICS PAGE ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.chart-container h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-container h3 svg, .chart-container h3 i { width: 18px; height: 18px; color: var(--purple-accent); }

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: 20px;
}
.bar-chart-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, var(--purple-accent), var(--magenta-accent));
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height 0.5s ease;
  position: relative;
}
.bar-chart-bar.gold {
  background: linear-gradient(180deg, var(--xp-gold), var(--xp-gold-dark));
}
.bar-chart-value {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.bar-chart-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Horizontal bar chart */
.h-bar-chart { display: flex; flex-direction: column; gap: 12px; }
.h-bar-item { display: flex; align-items: center; gap: 12px; }
.h-bar-label { width: 90px; font-size: 0.8rem; text-transform: capitalize; flex-shrink: 0; }
.h-bar-track { flex: 1; height: 24px; background: rgba(0,0,0,0.2); border-radius: 6px; overflow: hidden; position: relative; }
.h-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; display: flex; align-items: center; padding-left: 8px; font-size: 0.7rem; font-weight: 600; min-width: fit-content; }
.h-bar-value { font-size: 0.8rem; width: 40px; text-align: right; color: var(--text-muted); flex-shrink: 0; }

/* ---------- SETTINGS PAGE ---------- */
.settings-section {
  margin-bottom: 32px;
}
.settings-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-weight: 500; }
.settings-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border-radius: 26px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--purple-accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Color picker */
.color-options {
  display: flex;
  gap: 8px;
}
.color-option {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.color-option:hover { transform: scale(1.1); }
.color-option.active { border-color: white; box-shadow: 0 0 10px rgba(168,85,247,0.5); }

/* Danger zone */
.danger-zone {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 24px;
}
.danger-zone h3 { color: var(--red-danger); border-bottom-color: rgba(239,68,68,0.2); }

/* ---------- ADMIN PAGE ---------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  text-align: center;
}
.admin-stat-card .admin-stat-value {
  font-size: 2rem;
  font-weight: 900;
  display: block;
  margin-bottom: 4px;
}
.admin-stat-card .admin-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- EMPTY & ERROR STATES ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state.small { padding: 30px 20px; }
.empty-state .empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 16px; }

.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--red-danger);
}

/* ---------- LEGAL & ABOUT PAGES ---------- */
.legal-page {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  min-height: 100vh;
  padding: 0 20px;
}
.legal-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.legal-header .logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.legal-header .logo-link span { font-size: 1.4rem; }
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 60px;
}
.legal-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--purple-accent), var(--magenta-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.legal-content .last-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.legal-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--purple-light);
}
.legal-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 8px;
}
.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}
.legal-content ul, .legal-content ol {
  margin: 8px 0 16px 20px;
  color: var(--text-secondary);
}
.legal-content li {
  margin-bottom: 6px;
  list-style: disc;
  line-height: 1.6;
}
.legal-content ol li { list-style: decimal; }
.legal-content .notice-box {
  background: rgba(255,194,71,0.1);
  border: 1px solid rgba(255,194,71,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
  color: var(--xp-gold);
  font-size: 0.9rem;
}
.legal-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.legal-footer a { color: var(--text-muted); margin: 0 8px; }
.legal-footer a:hover { color: var(--purple-light); }

/* About page specific */
.about-hero {
  text-align: center;
  padding: 60px 0;
}
.about-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
}
.about-hero .tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow);
}
.feature-card .feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(217,70,239,0.2));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.feature-card .feature-icon svg, .feature-card .feature-icon i {
  width: 28px; height: 28px;
  color: var(--purple-accent);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Tech stack badges */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.tech-badge {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Quest Mini Card (Dashboard) ---------- */
.quest-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.quest-mini-card:last-child { border-bottom: none; }
.quest-mini-card.completed { opacity: 0.6; }
.quest-mini-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.quest-mini-category {
  width: 4px; height: 24px;
  border-radius: 2px;
  flex-shrink: 0;
}
.quest-mini-title {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quest-mini-status {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.quest-mini-status.completed { color: var(--green-success); }
.quest-mini-status svg, .quest-mini-status i { width: 16px; height: 16px; }

/* ---------- GREETING ---------- */
.greeting-section {
  margin-bottom: 20px;
}
.greeting-section h2 { font-size: 1.6rem; font-weight: 700; }
.greeting-section p { color: var(--text-muted); margin-top: 4px; }

/* Current adventure card */
.current-adventure-card .adventure-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.adventure-info { flex: 1; min-width: 0; }
.adventure-info h4 { font-size: 1.1rem; margin-bottom: 4px; }
.adventure-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Account info (Settings) ---------- */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.account-info-item {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.account-info-item .info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.account-info-item .info-value {
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Mobile overlay ---------- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,194,71,0.15); }
  50% { box-shadow: 0 0 25px rgba(255,194,71,0.3); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes progressFill {
  from { width: 0; }
}

.fade-in { animation: fadeIn 0.4s ease; }
.slide-up { animation: slideUp 0.4s ease; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 24px; margin-bottom: 12px; width: 60%; }
.skeleton-card { height: 120px; margin-bottom: 12px; }

/* Mobile-only section hidden by default on desktop (> 1200px) */
.mobile-only-section {
  display: none !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .right-panel { display: none; }
  .main-content { margin-right: 0; }
  .mobile-only-section {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content {
    margin-left: 0;
    padding: 12px 14px 24px 14px;
  }
  .top-bar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(15, 12, 29, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 10px 14px;
    margin: -12px -14px 14px -14px;
    border-bottom: 1px solid var(--border-color);
  }
  .top-bar #page-title {
    font-size: 1.15rem;
  }
  .top-bar-actions {
    gap: 8px;
  }
  .mobile-menu-toggle { display: flex; }
  
  .stat-cards-row, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 14px 12px;
  }

  /* Mobile Boss Raid & Radar Cards (Crocodile / Drake Challenge) */
  .mobile-boss-card {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.55) 0%, rgba(127, 29, 29, 0.45) 100%) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
  .mobile-boss-card .boss-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
  }
  .mobile-boss-card .boss-avatar {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
    animation: boss-breathe 3s infinite ease-in-out;
  }
  .mobile-boss-card .boss-title-wrap {
    flex: 1;
    min-width: 0;
  }
  .mobile-boss-card .boss-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .mobile-boss-card .boss-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #FFA39E;
  }
  .mobile-boss-card .boss-raid-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #FBBF24;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 9999px;
    padding: 1px 6px;
    text-transform: uppercase;
  }
  .mobile-boss-card .boss-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
  }
  .mobile-radar-card {
    padding: 14px 16px !important;
  }
  .mobile-radar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  /* Quest tabs touch-scrolling */
  .quest-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px;
    gap: 6px;
  }
  .quest-tabs::-webkit-scrollbar {
    display: none;
  }
  .quest-tab {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 0.82rem;
  }

  /* Preset chips touch-scrolling */
  .preset-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .preset-chips::-webkit-scrollbar {
    display: none;
  }
  .preset-chip {
    flex-shrink: 0;
  }

  .hero-banner { flex-direction: column; text-align: center; padding: 20px 16px; }
  .hero-art { margin-top: 14px; }
  .hero-art-citadel svg { width: 90px; height: 75px; }
  .current-adventure-card .adventure-content { flex-direction: column; align-items: stretch; gap: 12px; }
  .current-adventure-card .adventure-content .btn { width: 100%; justify-content: center; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-input-wrapper { min-width: 100%; }
  .filter-select { width: 100%; }
  .achievements-grid { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-overlay { padding: 12px; align-items: center; }
  .modal-content { padding: 20px 16px; max-height: 90vh; overflow-y: auto; width: 100%; }
  .auth-card { padding: 30px 24px; }
  .about-hero h1 { font-size: 2rem; }
  .legal-content h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  /* Maintain 2x2 grid on mobile for fast glanceability */
  .stat-cards-row, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 10px 8px !important;
    gap: 8px !important;
  }
  .stat-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
    min-width: 34px !important;
  }
  .stat-value {
    font-size: 1.15rem !important;
  }
  .stat-label {
    font-size: 0.68rem !important;
  }
  .mini-stats-grid { grid-template-columns: 1fr; }

  /* Compact top bar buttons */
  #music-btn-text {
    display: none;
  }
  .music-toggle-btn {
    padding: 6px 10px;
    gap: 4px;
  }
  .btn-action-create-quest span {
    font-size: 0.8rem;
  }

  /* Compact quest cards on mobile */
  .quest-card {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 12px;
    gap: 12px;
  }
  .quest-info {
    width: 100%;
  }
  .quest-title {
    font-size: 0.95rem;
  }
  .quest-meta {
    flex-wrap: wrap;
    gap: 6px;
  }
  .quest-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .quest-actions .btn {
    min-height: 38px;
    padding: 6px 12px;
  }
  .quest-actions .btn-gold,
  .quest-actions .btn-secondary {
    flex: 1;
    justify-content: center;
  }

  /* Compact Boss Card on tiny screens */
  .mobile-boss-card .boss-header {
    gap: 8px;
  }
  .mobile-boss-card .boss-avatar {
    font-size: 1.75rem;
  }
  .mobile-boss-card .boss-title {
    font-size: 0.84rem;
  }

  .bar-chart { height: 120px; }
  .about-hero { padding: 40px 0; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- TOP BAR ACTIONS & FOOTER ---------- */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Background Music Toggle Button */
.music-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.music-toggle-btn:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--purple-accent);
  color: var(--text-primary);
}

.music-toggle-btn.playing {
  background: rgba(168, 85, 247, 0.16);
  border-color: var(--purple-accent);
  color: var(--purple-accent);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.22);
}

.music-toggle-btn #music-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.music-toggle-btn #music-icon-wrapper svg {
  width: 15px;
  height: 15px;
  transition: transform var(--transition);
}

.music-toggle-btn.playing #music-icon-wrapper svg {
  animation: music-bounce 1.6s infinite ease-in-out;
}

@keyframes music-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.music-toggle-btn .music-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition);
}

.music-toggle-btn.playing .music-indicator {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.sidebar-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sidebar-legal-links button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.75rem;
  transition: color var(--transition);
}
.sidebar-legal-links button:hover {
  color: var(--purple-accent);
}

.app-main-footer {
  margin-top: 48px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.app-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  transition: color var(--transition);
}
.footer-link-btn:hover {
  color: var(--purple-accent);
  text-decoration: underline;
}

/* ---------- IN-APP LEGAL / ABOUT VIEWS ---------- */
.spa-legal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border-color);
  max-width: 900px;
  margin: 0 auto 30px;
}
.spa-legal-card h2 {
  color: var(--purple-light);
  margin: 24px 0 10px;
  font-size: 1.25rem;
}
.spa-legal-card h3 {
  color: var(--text-primary);
  margin: 16px 0 8px;
  font-size: 1.05rem;
}
.spa-legal-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}
.spa-legal-card ul, .spa-legal-card ol {
  margin: 8px 0 16px 24px;
  color: var(--text-secondary);
}
.spa-legal-card li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* ---------- RANDOMNESS VENTURES BRANDING ---------- */
.creator-attribution {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(81, 75, 145, 0.4);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  margin-bottom: 6px;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}
.creator-attribution:hover {
  background: rgba(81, 75, 145, 0.7);
  border-color: var(--purple-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.25);
}
.creator-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.creator-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.creator-text span {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.creator-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFC247, #D946EF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-creator-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(30, 20, 69, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(168, 85, 247, 0.2);
  text-decoration: none;
  cursor: pointer;
  color: inherit;
  transition: all var(--transition);
}
.sidebar-creator-credit:hover {
  background: rgba(48, 36, 95, 0.85);
  border-color: var(--purple-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}
.sidebar-creator-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}
.sidebar-creator-credit span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.sidebar-creator-credit strong {
  color: #FFC247;
  font-weight: 700;
}

.auth-creator-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-creator-badge:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}
.auth-creator-badge:hover strong {
  color: #FDE047;
  text-decoration: underline;
}
.creator-logo-small {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}
.auth-creator-badge strong {
  color: #FFC247;
}

.creator-inline-link {
  color: #FFC247;
  text-decoration: none;
  transition: all var(--transition);
}
.creator-inline-link:hover {
  color: #FDE047;
  text-decoration: underline;
}

.creator-spotlight-card {
  background: linear-gradient(135deg, rgba(81, 75, 145, 0.55), rgba(48, 36, 95, 0.75));
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin: 28px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.creator-spotlight-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.creator-spotlight-logo-link {
  display: inline-block;
  transition: transform var(--transition);
  line-height: 0;
}
.creator-spotlight-logo-link:hover {
  transform: scale(1.05);
}
.creator-spotlight-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.creator-spotlight-title-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
.creator-spotlight-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #FFC247, #D946EF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition);
}
.creator-spotlight-title-link:hover h3 {
  filter: brightness(1.2);
}
.creator-spotlight-tagline {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}
.creator-spotlight-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ============================================================
   LIFEQUEST 3.0 — GAMIFICATION & VISUAL POLISH ENHANCEMENTS
   ============================================================ */

/* ---------- 1. AVATAR PROGRESSION FRAMES & RANKS ---------- */
.avatar-circle {
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}
.avatar-circle:hover {
  transform: scale(1.05);
}

.avatar-frame-wood {
  border: 3px solid #B45309 !important;
  box-shadow: 0 0 10px rgba(180, 83, 9, 0.4) !important;
}
.avatar-frame-iron {
  border: 3px solid #94A3B8 !important;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.45) !important;
}
.avatar-frame-silver {
  border: 3px solid #60A5FA !important;
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.5) !important;
}
.avatar-frame-gold {
  border: 3px solid #EAB308 !important;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.6) !important;
}
.avatar-frame-obsidian {
  border: 3px solid #EC4899 !important;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.65) !important;
}
.avatar-frame-mythic {
  border: 3px solid #F59E0B !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.75), 0 0 8px #A855F7 !important;
  animation: mythic-frame-pulse 2.5s infinite ease-in-out;
}

@keyframes mythic-frame-pulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.7), 0 0 6px #A855F7;
  }
  50% {
    box-shadow: 0 0 24px rgba(217, 70, 239, 0.85), 0 0 12px #F59E0B;
  }
}

.player-rank-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.character-class-badge {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
}

/* ---------- 2. FLOATING XP CELEBRATION & PARTICLES ---------- */
.floating-xp-burst {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFC247;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 194, 71, 0.8);
  transform: translate(-50%, -50%);
  animation: float-xp-up 1.1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(26, 17, 69, 0.85);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 194, 71, 0.6);
  backdrop-filter: blur(6px);
}

@keyframes float-xp-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.6);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -90%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -130%) scale(0.85);
  }
}

.xp-spark-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFC247;
  box-shadow: 0 0 8px #FFC247;
  pointer-events: none;
  z-index: 9999;
  animation: spark-fly 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes spark-fly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

.xp-bar-shimmer {
  position: relative;
  overflow: hidden;
}
.xp-bar-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: bar-sweep 1s ease;
}
@keyframes bar-sweep {
  100% { left: 160%; }
}

/* ---------- 3. LIVING STREAK COUNTER ---------- */
.streak-living-flame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: flame-flicker 1.8s infinite alternate ease-in-out;
}

@keyframes flame-flicker {
  0% { transform: scale(1) rotate(-2deg); filter: drop-shadow(0 0 4px #F59E0B); }
  50% { transform: scale(1.12) rotate(2deg); filter: drop-shadow(0 0 8px #EF4444); }
  100% { transform: scale(1.05) rotate(-1deg); filter: drop-shadow(0 0 12px #F59E0B); }
}

.stat-card.streak-card:hover .streak-living-flame {
  transform: scale(1.3) rotate(5deg);
}

/* ---------- 4. HERO BANNER CITADEL ARTWORK ---------- */
.hero-art-citadel {
  width: 140px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 24px rgba(168, 85, 247, 0.35));
  animation: citadel-float 4s infinite ease-in-out;
}
@keyframes citadel-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- 5. QUEST CARD RARITY TIERS ---------- */
.quest-card {
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.quest-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.quest-card.difficulty-easy {
  border-left: 4px solid var(--green-success) !important;
}
.quest-card.difficulty-medium {
  border-left: 4px solid var(--blue-info) !important;
}
.quest-card.difficulty-hard {
  border-left: 4px solid var(--purple-accent) !important;
}
.quest-card.difficulty-epic {
  border-left: 4px solid var(--red-danger) !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.15);
}
.quest-card.difficulty-legendary {
  border-left: 4px solid #F59E0B !important;
  background: linear-gradient(135deg, rgba(81, 75, 145, 0.9), rgba(48, 36, 95, 0.95)), linear-gradient(90deg, #F59E0B, #EC4899, #8B5CF6, #F59E0B) !important;
  background-origin: border-box !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  border-left: 5px solid #F59E0B !important;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.25);
  position: relative;
  overflow: hidden;
}
.quest-card.difficulty-legendary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.12), transparent);
  animation: legendary-shimmer 4s infinite linear;
  pointer-events: none;
}
@keyframes legendary-shimmer {
  0% { left: -100%; }
  40%, 100% { left: 200%; }
}

/* ---------- 6. MUSIC VISUALIZER EQUALIZER BARS ---------- */
.music-visualizer-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  width: 14px;
}
.music-visualizer-bars .bar {
  flex: 1;
  background: var(--purple-accent);
  border-radius: 1px;
  transition: height 0.15s ease;
}
.music-toggle-btn.playing .music-visualizer-bars .bar-1 {
  animation: eq-1 0.65s infinite alternate ease-in-out;
}
.music-toggle-btn.playing .music-visualizer-bars .bar-2 {
  animation: eq-2 0.5s infinite alternate ease-in-out;
}
.music-toggle-btn.playing .music-visualizer-bars .bar-3 {
  animation: eq-3 0.75s infinite alternate ease-in-out;
}

@keyframes eq-1 { 0% { height: 3px; } 100% { height: 14px; } }
@keyframes eq-2 { 0% { height: 12px; } 100% { height: 4px; } }
@keyframes eq-3 { 0% { height: 5px; } 100% { height: 13px; } }

/* ---------- 7. QUICK QUEST PRESETS IN MODAL ---------- */
.quest-presets-section {
  background: rgba(26, 17, 69, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}
.presets-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--xp-gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-chip {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.preset-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--purple-accent);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* ---------- 8. DAILY RADAR & WEEKLY BOSS CHALLENGE ---------- */
.daily-radar-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.radar-circle-svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}
.radar-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}
.radar-progress-circle {
  fill: none;
  stroke: var(--purple-accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
  filter: drop-shadow(0 0 6px var(--purple-accent));
}
.radar-info {
  display: flex;
  flex-direction: column;
}
.radar-percent {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.radar-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Weekly Boss Challenge Card */
.boss-card {
  background: linear-gradient(135deg, rgba(81, 75, 145, 0.6), rgba(60, 20, 80, 0.7));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.boss-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.boss-avatar {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
  animation: boss-breathe 3s infinite ease-in-out;
}
@keyframes boss-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.boss-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFA39E;
  margin: 0;
}
.boss-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.boss-hp-wrapper {
  margin-top: 6px;
}
.boss-hp-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
}
.boss-hp-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 9999px;
  overflow: hidden;
}
.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #EF4444, #F59E0B);
  border-radius: 9999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* ---------- 9. CLASS SELECTOR IN SETTINGS ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.class-option-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.class-option-card:hover {
  border-color: var(--purple-accent);
  transform: translateY(-2px);
  background: rgba(168, 85, 247, 0.15);
}
.class-option-card.active {
  border-color: var(--xp-gold);
  background: rgba(255, 194, 71, 0.12);
  box-shadow: 0 0 14px rgba(255, 194, 71, 0.3);
}
.class-option-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.class-option-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.class-option-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}


