/* PMP Exam Simulator - Minimalist Corporate Style Sheet
   Aesthetic: Ultra-clean, modern, flat ed-tech platform with generous whitespace.
   Color Palette:
     - Default (Light Mode): Background #FAFAFA, Pure White cards, Navy Blue (#1A365D) accents, Sapphire Blue (#3182CE) indicators, Charcoal (#2D3748) text.
     - Dark Mode option: Background #0F172A, Slate 800 cards, Crisp Blue (#60A5FA) indicators, Slate 100 text.
   Flat design: High-contrast, rounded corners, subtle light gray borders, absolutely no heavy gradients or complex shadows. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Default: Light Corporate Minimalist Theme */
  --bg-deep: #FAFAFA;
  --bg-card: #FFFFFF;
  --border-subtle: #E2E8F0;
  
  --primary: #1A365D;          /* Corporate Navy */
  --primary-hover: #2A4365;
  --primary-glow: rgba(26, 54, 93, 0.08);
  
  --accent: #3182CE;           /* Sapphire Blue selection indicator */
  --accent-hover: #2B6CB0;
  --accent-glow: rgba(49, 130, 206, 0.15);
  
  --text-primary: #2D3748;     /* Deep Charcoal */
  --text-secondary: #4A5568;   /* Slate Gray */
  --text-muted: #718096;
  
  --success: #38A169;          /* Balanced Green */
  --success-glow: rgba(56, 161, 105, 0.08);
  --error: #E53E3E;            /* Balanced Red */
  --error-glow: rgba(229, 62, 62, 0.08);
  --warning: #DD6B20;
  
  --easy-color: #3182CE;       /* Sapphire */
  --medium-color: #DD6B20;     /* Ochre */
  --hard-color: #E53E3E;       /* Crimson */
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 30px;
  
  --transition: all 0.2s ease-in-out;
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --header-height: 70px;
  --shadow-flat: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Corporate Minimalist Overrides */
body:not(.light-theme) {
  --bg-deep: #0F172A;          /* Deep Slate */
  --bg-card: #1E293B;          /* Slate 800 */
  --border-subtle: #334155;    /* Slate 700 */
  
  --primary: #F8FAFC;          /* Clean white for high contrast headers */
  --primary-hover: #E2E8F0;
  --primary-glow: rgba(248, 250, 252, 0.08);
  
  --accent: #60A5FA;           /* Bright Sapphire Blue */
  --accent-hover: #93C5FD;
  --accent-glow: rgba(96, 165, 250, 0.2);
  
  --text-primary: #F1F5F9;     /* Very Light Slate */
  --text-secondary: #94A3B8;   /* Muted Slate */
  --text-muted: #64748B;
  
  --success: #4ADE80;
  --success-glow: rgba(74, 222, 128, 0.1);
  --error: #F87171;
  --error-glow: rgba(248, 113, 113, 0.1);
  --warning: #FB923C;
  
  --shadow-flat: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Base Elements */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family-sans);
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 60px; /* space for footer/mobile nav */
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hide glowing decorative orbs since they contradict the flat corporate design */
.glowing-orbs {
  display: none;
}

/* Base Container & Header Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

body:not(.light-theme) .logo-icon {
  background: var(--accent);
}

.logo-icon i {
  color: var(--bg-deep);
  font-size: 1.25rem;
}

body:not(.light-theme) .logo-icon i {
  color: var(--bg-deep);
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
}

body:not(.light-theme) .logo-text h1 {
  color: var(--primary);
}

.logo-text span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}

/* Top bar actions button & Auth widget */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-select-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-flat);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--primary);
  color: var(--bg-card);
  font-weight: 700;
}

body:not(.light-theme) .lang-btn.active {
  background: var(--accent);
  color: var(--bg-deep);
}

/* Theme Switch Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--border-subtle);
  transform: translateY(-1px);
}

/* Authentication Badges & Modals */
.auth-section-header {
  position: relative;
}

.btn-auth-trigger {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
}

.btn-auth-trigger:hover {
  background: var(--border-subtle);
}

.user-badge-profile {
  background: var(--primary-glow);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.user-badge-profile i {
  color: var(--accent);
}

/* Dropdown Profile Menu */
.profile-dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-modal);
  border-radius: var(--radius-md);
  padding: 0.4rem 0;
  width: 190px;
  z-index: 50;
  display: none;
  animation: slideDropdown 0.15s ease-out forwards;
}

.profile-dropdown-menu.active {
  display: block;
}

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

.dropdown-item {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-deep);
  color: var(--text-primary);
}

.dropdown-item.text-danger {
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.3rem 0;
}

/* Main Section Blocks */
.app-section {
  display: none;
  animation: fadeIn 0.2s ease-out forwards;
}

.app-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Landing Page Configuration Styles */
.config-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  margin-top: 1.5rem;
  align-items: start;
}

.config-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.config-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.setup-card {
  padding: 2rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-flat);
}

.setup-group {
  margin-bottom: 1.75rem;
}

.setup-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: block;
}

/* Count selection grid */
.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.grid-option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  box-shadow: var(--shadow-flat);
}

.grid-option-btn span {
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.75;
}

.grid-option-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-deep);
}

.grid-option-btn.active {
  border-color: var(--accent);
  background: var(--selection-bg, rgba(49, 130, 206, 0.08));
  color: var(--accent);
}

/* Beautiful Toggle Container */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-container:hover {
  border-color: var(--text-muted);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toggle-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-subtle);
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--bg-card);
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Flat Core Buttons */
.btn-primary {
  width: 100%;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-flat);
}

body:not(.light-theme) .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

body:not(.light-theme) .btn-primary:hover {
  background: var(--accent-hover);
}

/* Resume Banner */
.resume-banner {
  background: var(--success-glow);
  border: 1.5px dashed var(--success);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resume-info i {
  color: var(--success);
  font-size: 1.25rem;
}

.resume-details h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
  font-weight: 700;
}

.resume-details p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-accent {
  background: var(--success);
  border: none;
  color: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow-flat);
}

.btn-accent:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* Config features list */
.features-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-flat);
}

.feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.feature-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.feature-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   ACTIVE SIMULATOR LAYOUT (Ultra-clean, minimalist structural specification)
   ========================================================================== */
.exam-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar navigation is placed completely on the left */
.exam-nav-panel {
  grid-column: 1;
}

/* Question workspace is placed on the right */
.exam-main-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Elegant Thin Top Bar Header */
.exam-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-flat);
}

.question-stats {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 40%;
}

.question-index {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

/* Thin progress indicator bar */
.exam-progress-bar-container {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.exam-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease-out;
}

/* Timer and flag side-by-side in header */
.exam-bar-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.timer-section {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.timer-section i {
  color: var(--text-muted);
}

/* Minimalist Flag Button inside top header */
.flag-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.flag-btn:hover {
  background: var(--bg-deep);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.flag-btn.flagged {
  border-color: var(--warning);
  background: rgba(221, 107, 32, 0.08);
  color: var(--warning);
  font-weight: 700;
}

/* Left Sidebar Question Navigation Card */
.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-flat) !important;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

/* Question Navigation Grid container */
.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

/* Gamification Widget on left sidebar */
.gamification-widget {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-flat);
}

.gamify-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.gamify-rank-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gamify-level-tag {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--accent);
  color: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

body:not(.light-theme) .gamify-level-tag {
  color: var(--bg-deep);
}

.gamify-rank-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gamify-xp-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.gamify-xp-bar-container {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.gamify-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
  width: 0%;
  transition: width 0.4s ease-out;
}

/* Navigation button item styling */
.nav-grid-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.nav-grid-btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-deep);
}

.nav-grid-btn.current {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-card);
}

body:not(.light-theme) .nav-grid-btn.current {
  color: var(--bg-deep);
}

.nav-grid-btn.answered {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

body:not(.light-theme) .nav-grid-btn.answered {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.nav-grid-btn.flagged {
  border-color: var(--warning);
  background: rgba(221, 107, 32, 0.08);
  color: var(--warning);
}

.nav-grid-btn.answered.flagged {
  border-color: var(--warning);
  background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(221, 107, 32, 0.08) 100%);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-sidebar-pause, .btn-sidebar-submit {
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-sidebar-pause {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-sidebar-pause:hover {
  background: var(--bg-deep);
  color: var(--text-primary);
}

.btn-sidebar-submit {
  background: var(--success);
  border: 1px solid var(--success);
  color: var(--bg-card);
  box-shadow: var(--shadow-flat);
}

.btn-sidebar-submit:hover {
  opacity: 0.95;
  box-shadow: var(--shadow-hover);
}

/* Workspace main question card styles */
.question-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  padding: 2.25rem !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-flat) !important;
}

/* Badge labels row */
.badge-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.badge-domain {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge-difficulty.easy {
  background: rgba(49, 130, 206, 0.08);
  color: var(--easy-color);
}

.badge-difficulty.medium {
  background: rgba(221, 107, 32, 0.08);
  color: var(--medium-color);
}

.badge-difficulty.hard {
  background: rgba(229, 62, 62, 0.08);
  color: var(--hard-color);
}

/* Main workspace question text in highly legible dark charcoal font */
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

/* spacious clickable card choices styling */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.15rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
  text-align: left;
}

.choice-option:hover {
  border-color: var(--text-muted);
  background: var(--bg-deep);
  transform: translateY(-0.5px);
}

/* Subtle sapphire blue highlight on selection */
.choice-option.selected {
  border-color: var(--accent);
  background: var(--selection-bg, rgba(49, 130, 206, 0.06));
}

.choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.choice-option.selected .choice-letter {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-card);
}

body:not(.light-theme) .choice-option.selected .choice-letter {
  color: var(--bg-deep);
}

.choice-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.choice-option.selected .choice-text {
  color: var(--text-primary);
  font-weight: 600;
}

/* Clean Footer Actions Navigation Row aligned to the right */
.action-row {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

.nav-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-deep);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Practice mode assistant (Hints) */
.practice-info-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-flat);
}

.hint-trigger-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.hint-trigger-btn:hover {
  color: var(--accent-hover);
}

.hint-box {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-left: 2.5px solid var(--accent);
  padding-left: 0.75rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   RESULTS DASHBOARD & PERFORMANCE METRICS
   ========================================================================== */
.results-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.results-title-group h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
}

.results-title-group p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-actions {
  display: flex;
  gap: 0.6rem;
}

.score-summary-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.score-radial-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-flat) !important;
  padding: 2rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radial-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.radial-progress {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1.25rem;
}

.radial-progress svg {
  width: 180px;
  height: 180px;
  transform: rotate(-90deg);
}

.radial-progress circle {
  fill: none;
  stroke-width: 10px;
}

.radial-progress .radial-bg {
  stroke: var(--bg-deep);
}

.radial-progress .radial-fill {
  stroke: var(--accent);
  stroke-dasharray: 527.7;
  stroke-dashoffset: 527.7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.radial-content {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radial-score {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
}

/* Horizontal details grid */
.analytics-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-flat) !important;
  padding: 2rem !important;
}

.analytics-grids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.analytics-column h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 0.4rem;
}

.chart-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.chart-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-bar-container {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.chart-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.chart-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Improvement areas */
.areas-to-improve-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.improvement-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(229, 62, 62, 0.04);
  border: 1px solid var(--border-subtle);
  border-left: 3.5px solid var(--error);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}

.improvement-card i {
  color: var(--error);
  font-size: 1.1rem;
  margin-top: 0.1rem;
}

.improvement-details h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.improvement-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Detailed review exam-style layout */
.review-layout-minimal {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.review-nav-panel {
  grid-column: 1;
}

.review-main-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Review Navigation Grid Overrides */
#results-review-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

#results-review-nav-grid .nav-grid-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

#results-review-nav-grid .nav-grid-btn.correct {
  background: rgba(56, 161, 105, 0.08);
  border-color: var(--success);
  color: var(--success);
}

body:not(.light-theme) #results-review-nav-grid .nav-grid-btn.correct {
  background: rgba(56, 161, 105, 0.15);
}

#results-review-nav-grid .nav-grid-btn.incorrect {
  background: rgba(229, 62, 62, 0.08);
  border-color: var(--error);
  color: var(--error);
}

body:not(.light-theme) #results-review-nav-grid .nav-grid-btn.incorrect {
  background: rgba(229, 62, 62, 0.15);
}

#results-review-nav-grid .nav-grid-btn.unanswered {
  background: var(--bg-deep);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

#results-review-nav-grid .nav-grid-btn.current {
  box-shadow: 0 0 0 2px var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

/* Detailed review scroll lists */
.review-board-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.results-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-flat);
}

.results-review-card .badge-row {
  margin-bottom: 0.75rem;
}

.results-review-card .review-q-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

/* Review choices card grid */
.review-choices-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.review-choice-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.review-choice-card.correct-answer {
  border-color: var(--success);
  background: rgba(56, 161, 105, 0.05);
}

.review-choice-card.incorrect-answer {
  border-color: var(--error);
  background: rgba(229, 62, 62, 0.05);
}

.review-choice-card .letter-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.review-choice-card.correct-answer .letter-badge {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-card);
}

body:not(.light-theme) .review-choice-card.correct-answer .letter-badge {
  color: var(--bg-deep);
}

.review-choice-card.incorrect-answer .letter-badge {
  background: var(--error);
  border-color: var(--error);
  color: var(--bg-card);
}

body:not(.light-theme) .review-choice-card.incorrect-answer .letter-badge {
  color: var(--bg-deep);
}

.review-choice-card .text-span {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.review-explanations-box {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.5rem;
  margin-top: 1rem;
}

.review-explanations-box h6 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.review-explanations-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.explanation-line {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.explanation-line strong {
  color: var(--text-primary);
}

/* ==========================================================================
   PERSONAL HISTORY LIST
   ========================================================================== */
.history-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.15rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
}

.history-card:hover {
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-hover);
}

.history-details-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-title-row h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-subtitle-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.history-score-col {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.history-score-col .percentage-badge {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  width: 65px;
  text-align: right;
}

/* Table and KPI Metrics in Admin Dash */
.admin-subnav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.admin-subnav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.admin-subnav-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.admin-subnav-btn.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}

body:not(.light-theme) .admin-subnav-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.admin-panel {
  display: none;
  animation: fadeIn 0.2s ease-out forwards;
}

.admin-panel.active {
  display: block;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stats-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-flat) !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.stats-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

body:not(.light-theme) .stats-num {
  color: var(--accent);
}

.stats-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* SVG Line Chart styling */
.chart-svg-container {
  width: 100%;
  height: 240px;
  position: relative;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.chart-svg-container svg {
  width: 100%;
  height: 100%;
}

.grid-line {
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.trend-line {
  stroke: var(--accent);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  fill: var(--accent-glow);
  opacity: 0.4;
}

.chart-dot {
  fill: var(--bg-card);
  stroke: var(--accent);
  stroke-width: 2.5;
  cursor: pointer;
  transition: r 0.1s ease;
}

.chart-dot:hover {
  r: 6;
}

.axis-text {
  font-size: 10px;
  fill: var(--text-muted);
  font-weight: 500;
}

/* Simple Data tables */
.data-table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  background: var(--bg-deep);
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
  color: var(--text-primary);
}

/* Question browse grid */
.admin-questions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-q-row-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.admin-q-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 80%;
}

.admin-q-info-col p {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.btn-action {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-action:hover {
  background: var(--bg-deep);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-action.text-danger {
  color: var(--error);
  border-color: rgba(229, 62, 62, 0.2);
}

.btn-action.text-danger:hover {
  background: rgba(229, 62, 62, 0.05);
}

/* Flagged auditing */
.threshold-config-card {
  background: var(--primary-glow);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body:not(.light-theme) .threshold-config-card {
  background: var(--accent-glow);
}

.threshold-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.number-input-modern {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 70px;
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

/* Modern Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  padding: 1rem;
}

.modal-overlay button {
  justify-content: center;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  max-width: 440px;
  width: 100%;
  transform: translateY(8px);
  transition: transform 0.15s ease-out;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-body {
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 1.5px solid var(--border-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

/* Authentication Fields */
.auth-form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.auth-form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--accent);
  outline: none;
}

.auth-switch-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  margin-top: 1rem;
  display: block;
}

.auth-switch-link:hover {
  text-decoration: underline;
}

/* Custom animated coffee visualizer */
.coffee-visualizer {
  width: 60px;
  height: 50px;
  position: relative;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

.coffee-cup {
  width: 50px;
  height: 38px;
  border: 3.5px solid var(--text-primary);
  border-top: none;
  border-radius: 0 0 16px 16px;
  position: absolute;
  bottom: 0; left: 5px;
  overflow: hidden;
}

.coffee-cup:after {
  content: "";
  position: absolute;
  width: 12px;
  height: 18px;
  border: 3px solid var(--text-primary);
  border-left: none;
  border-radius: 0 10px 10px 0;
  top: 6px; right: -13px;
}

.coffee-liquid {
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 60%;
  background: #7B3F00;
  animation: waveCoffee 3s infinite ease-in-out alternate;
}

@keyframes waveCoffee {
  0% { transform: skewY(-2deg) translateY(1px); }
  100% { transform: skewY(2deg) translateY(-1px); }
}

.coffee-steam {
  position: absolute;
  top: 0; left: 10px; width: 30px; height: 12px;
  display: flex; justify-content: space-around;
}

.steam-line {
  width: 2px; height: 10px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.6;
  animation: steamRise 1.5s infinite linear;
}

.steam-line:nth-child(2) { animation-delay: 0.5s; }
.steam-line:nth-child(3) { animation-delay: 0.2s; }

@keyframes steamRise {
  0% { transform: translateY(2px) scaleY(0.5); opacity: 0; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-8px) scaleY(1.2); opacity: 0; }
}

/* donation card grid */
.coffee-donation-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.coffee-option-box {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.coffee-option-box:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.coffee-option-box.active {
  border-color: var(--warning);
  background: rgba(221, 107, 32, 0.08);
  color: var(--warning);
}

/* Floating widgets */
.coffee-btn-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 80;
}

.btn-coffee {
  background: var(--warning);
  border: none;
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-coffee:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: #ED8936;
}

/* Toast Notifications */
#toast-notifications-root {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-notification {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--success);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  min-width: 280px;
  max-width: 360px;
  animation: slideToast 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-content-box h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.toast-content-box p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Page Footer styling */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4rem;
}

/* Mobile Bottom Navigation (screens <= 600px width) */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  height: 56px;
  z-index: 90;
  grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Adjust columns if admin option is active */
.mobile-nav-bar.admin-nav {
  grid-template-columns: repeat(5, 1fr);
}

.mobile-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  gap: 0.2rem;
  transition: var(--transition);
}

.mobile-nav-item i {
  font-size: 1.15rem;
}

.mobile-nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
}

.mobile-nav-item.active {
  color: var(--accent);
}

/* Responsive stacks */
@media screen and (max-width: 900px) {
  .config-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .exam-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .exam-nav-panel {
    grid-column: 1;
    margin-top: 1.5rem;
  }
  
  .exam-main-panel {
    grid-column: 1;
  }
  
  .score-summary-grid {
    grid-template-columns: 1fr;
  }
  
  .review-layout-minimal {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .review-nav-panel {
    grid-column: 1;
  }
  
  .review-main-panel {
    grid-column: 1;
  }
}

/* ==========================================================================
   PMP DUOLINGO-STYLE PATH OF LEARNING STYLES
   ========================================================================== */
.learning-path-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
}

.learning-path-road-container {
  width: 100%;
  padding: 2rem 0;
  position: relative;
  background-image: radial-gradient(var(--border-subtle) 1px, transparent 0);
  background-size: 24px 24px;
  background-position: center;
  border-radius: var(--radius-lg);
  background-color: rgba(0, 0, 0, 0.01);
  border: 1px dashed var(--border-subtle);
}

/* Sinuous serpentine path layout grid */
.learning-path-road {
  position: relative;
  display: grid;
  grid-template-columns: 80px 100px 100px 100px 80px;
  gap: 3.5rem 1.5rem;
  justify-content: center;
  z-index: 5;
  width: 100%;
}

/* Sinuous SVG timeline connection line placed behind nodes */
.learning-path-road::before {
  display: none;
}

.path-node-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.path-node {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  z-index: 10;
}

.path-node:hover {
  transform: scale(1.1) translateY(-2px);
}

.node-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 4px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-flat);
  transition: var(--transition);
  z-index: 12;
}

/* SVG circular progress ring */
.node-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
  z-index: 11;
  pointer-events: none;
}

.ring-fill {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 6;
  stroke-dasharray: 201; /* 2 * PI * 32 */
  stroke-dashoffset: 201;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

.node-status-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  z-index: 15;
  box-shadow: var(--shadow-flat);
}

/* Active & Unlocked State styling */
.path-node.active .node-circle {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-glow) 100%);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.12);
}

.path-node.active .ring-fill {
  stroke: var(--primary);
}

.path-node.active .node-status-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-card);
}

/* Mastered State styling (Duolingo Golden Node!) */
.path-node.mastered .node-circle {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  border-color: #D97706;
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
  animation: gold-pulse 2s infinite alternate;
}

.path-node.mastered .ring-fill {
  stroke: #F59E0B;
}

.path-node.mastered .node-status-badge {
  background: #F59E0B;
  border-color: #D97706;
  color: #FFFFFF;
}

@keyframes gold-pulse {
  0% {
    box-shadow: 0 0 0 0.5px #FBBF24, 0 6px 16px rgba(245, 158, 11, 0.25);
  }
  100% {
    box-shadow: 0 0 10px 4px rgba(245, 158, 11, 0.4), 0 6px 20px rgba(245, 158, 11, 0.4);
  }
}

/* Locked Node styling */
.path-node.locked {
  opacity: 0.65;
  filter: grayscale(0.8);
}

.path-node.locked:hover {
  transform: none;
}

.path-node.locked .node-circle {
  background: var(--bg-deep);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

/* Duolingo Popover Card details styling */
.path-details-card {
  position: absolute;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), var(--shadow-flat);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  animation: popover-fade 0.2s ease-out;
}

@keyframes popover-fade {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.card-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  transform: rotate(-45deg);
  z-index: 51;
}

/* Popover card styling details */
.path-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 1.25rem;
}

.path-details-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.path-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.path-card-stats-row {
  display: flex;
  justify-content: space-between;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  gap: 0.5rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.path-card-advice {
  font-size: 0.75rem;
  background: rgba(49, 130, 206, 0.05);
  border: 1px solid rgba(49, 130, 206, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 500;
}

/* Mobile positioning of the serpentine line and road rules */
@media screen and (max-width: 600px) {
  .learning-path-road {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 2.5rem 0.5rem !important;
  }
  .path-node-wrapper {
    grid-column: span 1 !important;
  }
  /* Serpentine pattern for span columns on mobile */
  .path-node-wrapper[data-module="1"] { grid-column: 3 !important; }
  .path-node-wrapper[data-module="2"] { grid-column: 4 !important; }
  .path-node-wrapper[data-module="3"] { grid-column: 2 !important; }
  .path-node-wrapper[data-module="4"] { grid-column: 4 !important; }
  .path-node-wrapper[data-module="5"] { grid-column: 3 !important; }
}

@media screen and (max-width: 600px) {
  header {
    height: auto;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .logo-text h1 {
    font-size: 1.25rem;
  }
  
  .config-title {
    font-size: 1.75rem;
  }
  
  .setup-card {
    padding: 1.25rem;
  }
  
  .option-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Show bottom navigation bar and hide floating widgets */
  .mobile-nav-bar {
    display: grid;
  }
  
  .coffee-btn-container {
    display: none !important;
  }
  
  .app-container {
    padding: 1rem 1rem 4rem 1rem;
  }
  
  .analytics-grids {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   PMP QUEST ELITE THREE-REALM STYLES & THEMATIC OVERRIDES
   ========================================================================== */

/* Active Game Mode Body background & overall styles */
body.game-mode-active {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  transition: background 0.5s ease, color 0.3s ease;
}

body.mode-duolingo {
  background-color: #E0F2FE !important;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(88, 204, 2, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(88, 204, 2, 0.05) 0%, transparent 40%),
    linear-gradient(135deg, #E0F2FE 0%, #DCFCE7 100%) !important;
  color: #1F2937 !important;
}

/* ==========================================================================
   THEMATIC HEADINGS & TYPOGRAPHY
   ========================================================================== */
body.mode-westeros,
body.mode-westeros h1,
body.mode-westeros h2,
body.mode-westeros h3,
body.mode-westeros h4,
body.mode-westeros .logo-text h1,
body.mode-westeros .config-title {
  font-family: 'Cinzel', 'Georgia', serif !important;
  letter-spacing: 0.5px;
}

body.mode-darksouls,
body.mode-darksouls h1,
body.mode-darksouls h2,
body.mode-darksouls h3,
body.mode-darksouls h4,
body.mode-darksouls .logo-text h1,
body.mode-darksouls .config-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
  letter-spacing: 1px;
}

/* Realm Selection Dashboard styling */
.realm-selector-container {
  width: 100%;
  margin-bottom: 3rem;
  text-align: center;
  box-sizing: border-box;
}

.realm-selector-heading {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

body.mode-westeros .realm-selector-heading {
  color: #D4AF37 !important;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3) !important;
}

body.mode-darksouls .realm-selector-heading {
  color: #EF4444 !important;
  text-shadow: 0 2px 15px rgba(239, 68, 68, 0.4) !important;
}

.realm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}

.realm-card {
  background: #FFFFFF;
  border: 3px solid #E5E7EB;
  border-bottom: 8px solid #D1D5DB;
  border-radius: 28px;
  padding: 2.25rem 1.75rem;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.realm-card:hover {
  transform: scale(1.04) translateY(-6px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.realm-card.active {
  border-color: #58CC02 !important;
  border-bottom-color: #46A302 !important;
  box-shadow: 0 0 25px rgba(88, 204, 2, 0.2);
}

.realm-badge {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: #F3F4F6;
  color: #4B5563;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.realm-badge.gold {
  background: #FEF3C7;
  color: #D97706;
}

.realm-badge.red {
  background: #FEE2E2;
  color: #EF4444;
}

.realm-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.realm-card:hover .realm-icon-wrap {
  transform: scale(1.1) rotate(6deg);
}

.card-duolingo .realm-icon-wrap {
  background: #F0FDF4;
  color: #58CC02;
}

.card-westeros .realm-icon-wrap {
  background: #FFFDF5;
  color: #D97706;
}

.card-darksouls .realm-icon-wrap {
  background: #FFF1F1;
  color: #EF4444;
}

.realm-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #1F2937;
  margin: 0 0 0.8rem 0;
}

body.mode-westeros .card-westeros .realm-title,
body.mode-westeros .realm-title {
  color: #D4AF37 !important;
}

body.mode-darksouls .card-darksouls .realm-title,
body.mode-darksouls .realm-title {
  color: #EF4444 !important;
}

.realm-description {
  font-size: 0.8rem;
  color: #6B7280;
  line-height: 1.55;
  margin: 0 0 1.75rem 0;
  flex-grow: 1;
}

.btn-realm-select {
  background-color: #E5E7EB;
  color: #4B5563;
  border: none;
  border-bottom: 3px solid #D1D5DB;
  border-radius: 12px;
  padding: 0.65rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  width: 100%;
  cursor: pointer;
  transition: all 0.1s ease;
}

.realm-card.active .btn-realm-select {
  background-color: #58CC02;
  color: #FFFFFF;
  border-bottom-color: #46A302;
}

.realm-card.active.card-westeros {
  border-color: #D4AF37 !important;
  border-bottom-color: #AA8417 !important;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
}

.realm-card.active.card-westeros .btn-realm-select {
  background-color: #D4AF37;
  color: #FFFFFF;
  border-bottom-color: #AA8417;
}

.realm-card.active.card-darksouls {
  border-color: #EF4444 !important;
  border-bottom-color: #991B1B !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.realm-card.active.card-darksouls .btn-realm-select {
  background-color: #EF4444;
  color: #FFFFFF;
  border-bottom-color: #991B1B;
}

/* ==========================================================================
   DUOLINGO MODE STYLES
   ========================================================================== */
body.mode-duolingo .glass-card,
body.mode-duolingo .setup-card,
body.mode-duolingo .path-details-card {
  background: #FFFFFF !important;
  border: 3px solid #E5E7EB !important;
  border-bottom: 6px solid #D1D5DB !important;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.03) !important;
  border-radius: 20px !important;
}

body.mode-duolingo header {
  background: #FFFFFF !important;
  border-bottom: 3px solid #E5E7EB !important;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.02);
}

body.mode-duolingo .btn-primary,
body.mode-duolingo #start-exam-btn,
body.mode-duolingo #btn-path-practice {
  background-color: #58CC02 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-bottom: 4px solid #46A302 !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05) !important;
}

body.mode-duolingo .btn-primary:hover,
body.mode-duolingo #start-exam-btn:hover {
  background-color: #61E002 !important;
  transform: translateY(1px);
  border-bottom-width: 3px;
}

body.mode-duolingo .path-node.active .node-circle {
  background: #FFFFFF !important;
  border-color: #58CC02 !important;
  color: #58CC02 !important;
  box-shadow: 0 6px 0 #46A302 !important;
}

body.mode-duolingo .path-node.active .node-status-badge {
  background: #58CC02 !important;
  border-color: #46A302 !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   WESTEROS THRONES MODE (Mode 2) - Aged Parchment & Royal Gold
   ========================================================================== */
body.mode-westeros {
  background-color: #0E0C0A !important;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.12) 0px, rgba(0, 0, 0, 0.12) 2px, transparent 2px, transparent 10px),
    linear-gradient(135deg, #181512 0%, #090807 100%) !important;
  color: #E2E8F0 !important;
}

body.mode-westeros header {
  background: #12100E !important;
  border-bottom: 3px solid #D4AF37 !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

body.mode-westeros .logo-icon {
  background: #D4AF37 !important;
  color: #12100E !important;
}

body.mode-westeros .logo-text span {
  color: #AA8417 !important;
}

body.mode-westeros .glass-card,
body.mode-westeros .setup-card,
body.mode-westeros .path-details-card,
body.mode-westeros .gold-league-card,
body.mode-westeros .game-hud-bar {
  background: #12100E !important;
  border: 3px solid #D4AF37 !important;
  border-bottom: 7px solid #AA8417 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
  border-radius: 20px !important;
  color: #F1F5F9 !important;
}

/* Westeros Gold Connectors */
body.mode-westeros #path-connector-line {
  stroke: #D4AF37 !important;
  filter: drop-shadow(0 0 5px rgba(212,175,55,0.4)) !important;
}

/* Westeros Thematic Shields */
body.mode-westeros .node-circle {
  background: #1C1A17 !important;
  border: 4px double #D4AF37 !important;
  color: #D4AF37 !important;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2) !important;
  border-radius: 12px !important;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%) !important;
  width: 62px !important;
  height: 62px !important;
}

body.mode-westeros .path-node {
  border-radius: 12px !important;
  width: 76px !important;
  height: 76px !important;
}

body.mode-westeros .node-ring {
  display: none !important;
}

body.mode-westeros .path-node.mastered .node-circle {
  background: linear-gradient(135deg, #443B2A 0%, #12100E 100%) !important;
  border: 4px double #E2C044 !important;
  box-shadow: 0 0 20px rgba(226,192,68,0.5) !important;
}

body.mode-westeros .path-node.locked {
  filter: grayscale(0.9) opacity(0.4) !important;
}

body.mode-westeros .path-node.locked .node-circle {
  background: #23201B !important;
  border-color: #4A4035 !important;
}

body.mode-westeros .path-node.active .node-status-badge {
  background: #D4AF37 !important;
  border-color: #AA8417 !important;
  color: #12100E !important;
}

body.mode-westeros .btn-primary,
body.mode-westeros #start-exam-btn,
body.mode-westeros #btn-path-practice {
  background-color: #D4AF37 !important;
  color: #12100E !important;
  border: none !important;
  border-bottom: 4px solid #AA8417 !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

body.mode-westeros .btn-primary:hover,
body.mode-westeros #start-exam-btn:hover {
  background-color: #E2C044 !important;
  transform: translateY(1px);
  border-bottom-width: 3px;
}

body.mode-westeros .leaderboard-item {
  background: #1C1916 !important;
  border-color: #2F2A24 !important;
}

body.mode-westeros .leaderboard-item.me-pinned {
  background: #2D2517 !important;
  border-color: #D4AF37 !important;
}

body.mode-westeros .leaderboard-item.me-pinned .user-name,
body.mode-westeros .leaderboard-item.me-pinned .xp-count {
  color: #D4AF37 !important;
}

body.mode-westeros .leaderboard-item.me-pinned .avatar-circle {
  background: #D4AF37 !important;
  color: #12100E !important;
}

/* Mascot Crown Overlay inside Westeros */
body.mode-westeros .mascot-crown-overlay {
  display: block !important;
}

.mascot-crown-overlay {
  display: none;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 1.6rem;
  color: #EAB308;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  animation: crown-shimmer 1.5s infinite alternate;
  z-index: 25;
}

@keyframes crown-shimmer {
  0% { transform: translateX(-50%) rotate(-4deg) scale(0.95); }
  100% { transform: translateX(-50%) rotate(4deg) scale(1.1); }
}

/* ==========================================================================
   DARK SOULS MODE OVERRIDES (Mode 3) - Obsidian & Embers
   ========================================================================== */
body.mode-darksouls {
  background-color: #030101 !important;
  background-image: 
    radial-gradient(circle at 50% -20%, rgba(239, 68, 68, 0.08) 0%, transparent 50%),
    radial-gradient(circle at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%),
    repeating-radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.015) 0px, rgba(239, 68, 68, 0.015) 4px, transparent 4px, transparent 12px),
    linear-gradient(135deg, #070707 0%, #150303 100%) !important;
  color: #CBD5E1 !important;
}

body.mode-darksouls header {
  background: #080404 !important;
  border-bottom: 3px solid #991B1B !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8);
}

body.mode-darksouls .logo-icon {
  background: #991B1B !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 10px rgba(153,27,27,0.5);
}

body.mode-darksouls .logo-text span {
  color: #EF4444 !important;
}

body.mode-darksouls .glass-card,
body.mode-darksouls .setup-card,
body.mode-darksouls .path-details-card,
body.mode-darksouls .gold-league-card,
body.mode-darksouls .game-hud-bar {
  background: #080404 !important;
  border: 3px solid #991B1B !important;
  border-bottom: 7px solid #7F1D1D !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8) !important;
  border-radius: 20px !important;
  color: #E2E8F0 !important;
}

/* Dark Souls Blood Trails */
body.mode-darksouls #path-connector-line {
  stroke: #991B1B !important;
  filter: drop-shadow(0 0 8px rgba(153,27,27,0.7)) !important;
}

/* Dark Souls Gothic Gravestones */
body.mode-darksouls .node-circle {
  background: #140C0C !important;
  border: 3px solid #7F1D1D !important;
  border-top-left-radius: 22px !important;
  border-top-right-radius: 22px !important;
  border-bottom-left-radius: 4px !important;
  border-bottom-right-radius: 4px !important;
  color: #EF4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15) !important;
  width: 58px !important;
  height: 66px !important;
}

body.mode-darksouls .node-ring {
  display: none !important;
}

body.mode-darksouls .path-node {
  height: 80px !important;
}

body.mode-darksouls .path-node.active .node-circle {
  border-color: #EF4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45) !important;
  animation: souls-pulse 1.5s infinite alternate;
}

@keyframes souls-pulse {
  0% { filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.3)); }
  100% { filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.7)); }
}

body.mode-darksouls .path-node.mastered .node-circle {
  background: linear-gradient(135deg, #3A1010 0%, #080404 100%) !important;
  border-color: #EF4444 !important;
  box-shadow: 0 0 25px rgba(239,68,68,0.6) !important;
}

body.mode-darksouls .path-node.locked {
  filter: grayscale(1) opacity(0.3) !important;
}

body.mode-darksouls .path-node.active .node-status-badge {
  background: #EF4444 !important;
  border-color: #991B1B !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 8px #EF4444;
}

body.mode-darksouls .btn-primary,
body.mode-darksouls #start-exam-btn,
body.mode-darksouls #btn-path-practice {
  background-color: #991B1B !important;
  color: #FFFFFF !important;
  border: none !important;
  border-bottom: 4px solid #7F1D1D !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  box-shadow: 0 4px 12px rgba(153, 27, 27, 0.3) !important;
}

body.mode-darksouls .btn-primary:hover,
body.mode-darksouls #start-exam-btn:hover {
  background-color: #B91C1C !important;
  transform: translateY(1px);
  border-bottom-width: 3px;
}

body.mode-darksouls .leaderboard-item {
  background: #110808 !important;
  border-color: #210E0E !important;
}

body.mode-darksouls .leaderboard-item.me-pinned {
  background: #2A0B0B !important;
  border-color: #EF4444 !important;
}

body.mode-darksouls .leaderboard-item.me-pinned .user-name,
body.mode-darksouls .leaderboard-item.me-pinned .xp-count {
  color: #EF4444 !important;
}

body.mode-darksouls .leaderboard-item.me-pinned .avatar-circle {
  background: #EF4444 !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   DARK SOULS ANIMATED CSS BONFIRE
   ========================================================================== */
body.mode-darksouls .mascot-bonfire-overlay {
  display: block !important;
}

.mascot-bonfire-overlay {
  display: none;
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 50px;
  z-index: 26;
}

.bonfire-wood {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 10px;
  background: #4A2511;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.bonfire-wood::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 8px;
  width: 28px;
  height: 8px;
  background: #3B1C0B;
  transform: rotate(15deg);
  border-radius: 4px;
}

.bonfire-flame {
  position: absolute;
  bottom: 8px;
  border-radius: 50% 50% 20% 20%;
  transform-origin: bottom center;
}

.flame-1 {
  left: 20px;
  width: 20px;
  height: 35px;
  background: linear-gradient(0deg, #EA580C 20%, #F97316 60%, #FBBF24 100%);
  animation: flicker 0.6s infinite alternate;
  filter: blur(1px);
  z-index: 2;
}

.flame-2 {
  left: 14px;
  width: 16px;
  height: 28px;
  background: linear-gradient(0deg, #DC2626 20%, #EA580C 60%, #F97316 100%);
  animation: flicker 0.4s infinite alternate-reverse;
  filter: blur(1.5px);
  z-index: 1;
  opacity: 0.8;
}

.flame-3 {
  left: 26px;
  width: 14px;
  height: 24px;
  background: linear-gradient(0deg, #F97316 20%, #FBBF24 60%, #FEF08A 100%);
  animation: flicker 0.5s infinite alternate;
  filter: blur(0.5px);
  z-index: 3;
  opacity: 0.9;
}

@keyframes flicker {
  0% { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

/* ==========================================================================
   ACTIVE EXAM OVERRIDES FOR GOT & DARK SOULS
   ========================================================================== */
body.mode-westeros .question-card,
body.mode-darksouls .question-card {
  background: #12100E !important;
  border: 3px solid #D4AF37 !important;
  border-bottom: 7px solid #AA8417 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
}

body.mode-darksouls .question-card {
  background: #080404 !important;
  border-color: #991B1B !important;
  border-bottom-color: #7F1D1D !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8) !important;
}

body.mode-westeros .choice-option,
body.mode-darksouls .choice-option {
  background: #1C1916 !important;
  border: 2px solid #2F2A24 !important;
  color: #CBD5E1 !important;
}

body.mode-darksouls .choice-option {
  background: #110808 !important;
  border-color: #210E0E !important;
}

body.mode-westeros .choice-option.selected {
  border-color: #D4AF37 !important;
  background: #2D2517 !important;
}

body.mode-darksouls .choice-option.selected {
  border-color: #EF4444 !important;
  background: #2A0B0B !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

body.mode-westeros .timer-section {
  color: #D4AF37 !important;
}

body.mode-darksouls .timer-section {
  color: #EF4444 !important;
}

/* ==========================================================================
   CINEMA-GRADE DARK SOULS FAIL STATE (YOU DIED) OVERLAY
   ========================================================================== */
.darksouls-death-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(20,5,5,0.4) 0%, rgba(0,0,0,0.98) 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.death-content-wrap {
  text-align: center;
}

.death-title-text {
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
  font-size: 6rem;
  font-weight: 900;
  color: #990000;
  letter-spacing: 12px;
  margin: 0 0 1rem 0;
  text-shadow: 0 0 30px rgba(153, 0, 0, 0.8);
  animation: death-zoom-in 4s forwards cubic-bezier(0.1, 0.8, 0.1, 1);
  opacity: 0;
}

.death-subtitle-text {
  font-family: 'Cinzel', serif !important;
  font-size: 1.25rem;
  color: #888888;
  margin: 0 0 3rem 0;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: subtitle-fade-in 1.2s forwards ease-out 1.8s;
}

.btn-respawn {
  background-color: #110505 !important;
  color: #990000 !important;
  border: 2px solid #990000 !important;
  border-bottom: 5px solid #660000 !important;
  padding: 0.95rem 2.8rem !important;
  font-size: 1.05rem !important;
  font-family: 'Cinzel', serif !important;
  letter-spacing: 3px !important;
  font-weight: 800 !important;
  opacity: 0;
  animation: subtitle-fade-in 1.2s forwards ease-out 2.8s;
  box-shadow: 0 0 15px rgba(153, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  cursor: pointer;
}

.btn-respawn:hover {
  background-color: #990000 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
}

@keyframes death-zoom-in {
  0% { transform: scale(0.85); opacity: 0; filter: blur(3px); }
  35% { opacity: 1; filter: blur(0); }
  100% { transform: scale(1.04); opacity: 1; }
}

@keyframes subtitle-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 600px) {
  .death-title-text {
    font-size: 3.5rem !important;
    letter-spacing: 5px !important;
  }
  .death-subtitle-text {
    font-size: 0.9rem !important;
  }
}

/* ==========================================================================
   AAA EXPERIENCE: AMBIENT PARTICLE CONTAINERS & ANIMATIONS
   ========================================================================== */
.ambient-particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Duolingo Quest (Soft Floating Bubbly Gems) */
.duolingo-particle {
  position: absolute;
  background: rgba(88, 204, 2, 0.22);
  border-radius: 50%;
  bottom: -20px;
  animation: float-up-bubble 7s linear infinite;
}

@keyframes float-up-bubble {
  0% { transform: translateY(0) translateX(0) scale(0.8) rotate(0deg); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translateY(-115vh) translateX(40px) scale(1.1) rotate(180deg); opacity: 0; }
}

/* Westeros Thrones (Majestic Descending Gold Leaves) */
.westeros-particle {
  position: absolute;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.8) 0%, rgba(212, 175, 55, 0) 70%);
  border-radius: 50%;
  top: -20px;
  animation: drift-down-gold 11s linear infinite;
}

@keyframes drift-down-gold {
  0% { transform: translateY(0) translateX(0) scale(0.6) rotate(0deg); opacity: 0; }
  12% { opacity: 0.9; }
  88% { opacity: 0.9; }
  100% { transform: translateY(115vh) translateX(-60px) scale(1.1) rotate(270deg); opacity: 0; }
}

/* Dark Souls (Prepare To Die Floating Ash Embers) */
.darksouls-particle {
  position: absolute;
  background: #EF4444;
  box-shadow: 0 0 6px #EF4444, 0 0 10px #F97316;
  border-radius: 2px;
  bottom: -20px;
  animation: embers-float 8s ease-in infinite;
}

@keyframes embers-float {
  0% { transform: translateY(0) translateX(0) scale(0.8) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translateY(-50vh) translateX(25px) scale(1.2) rotate(180deg); }
  85% { opacity: 0.8; }
  100% { transform: translateY(-115vh) translateX(-25px) scale(0.6) rotate(360deg); opacity: 0; }
}

/* ==========================================================================
   MASCOT ACCESSORIES
   ========================================================================== */
.mascot-shield-overlay {
  display: none;
  position: absolute;
  bottom: 0px;
  left: 0px;
  background: linear-gradient(135deg, #2D2721 0%, #171512 100%);
  border: 2px solid #D4AF37;
  color: #D4AF37;
  border-radius: 4px 4px 16px 16px;
  width: 20px;
  height: 24px;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
  z-index: 27;
  transform: rotate(-12deg);
}

body.mode-westeros .mascot-shield-overlay {
  display: flex !important;
  animation: shield-sway 1.4s infinite alternate;
}

@keyframes shield-sway {
  0% { transform: rotate(-12deg) translateY(0); }
  100% { transform: rotate(-6deg) translateY(-2px); }
}

/* Bonfire dynamic sparks flow inside mascot */
.bonfire-sparks {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 100%;
  height: 20px;
  pointer-events: none;
}

.bonfire-sparks::before,
.bonfire-sparks::after {
  content: '';
  position: absolute;
  background: #F97316;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  box-shadow: 0 0 5px #EF4444;
  animation: bonfire-spark-animation 1.5s infinite linear;
}

.bonfire-sparks::before {
  left: 30%;
  animation-delay: 0.3s;
}

.bonfire-sparks::after {
  left: 60%;
  animation-delay: 0.8s;
}

@keyframes bonfire-spark-animation {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0.2); opacity: 0; }
}

/* ==========================================================================
   CONFIG CARD OVERRIDES - THEMATIC INPUTS
   ========================================================================== */

/* WESTEROS MODE (Medieval Slate & Gold Options) */
body.mode-westeros .grid-option-btn {
  background: #1C1916 !important;
  border: 2px solid #5C4A37 !important;
  color: #C5B499 !important;
  font-family: 'Cinzel', serif !important;
  border-radius: 12px !important;
  transition: all 0.2s ease;
}

body.mode-westeros .grid-option-btn span {
  color: #8C7C66 !important;
}

body.mode-westeros .grid-option-btn:hover {
  background: #25211D !important;
  border-color: #AA8417 !important;
}

body.mode-westeros .grid-option-btn.active {
  background: #2A2215 !important;
  border-color: #D4AF37 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4) !important;
}

body.mode-westeros .switch .slider {
  background-color: #2D2721 !important;
  border: 2px solid #5C4A37 !important;
}

body.mode-westeros .switch input:checked + .slider {
  background-color: #D4AF37 !important;
  border-color: #AA8417 !important;
}

/* DARK SOULS MODE (Obsidian & Crimson Options) */
body.mode-darksouls .grid-option-btn {
  background: #0D0606 !important;
  border: 2px solid #501515 !important;
  color: #9C8585 !important;
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
  border-radius: 10px !important;
  transition: all 0.2s ease;
}

body.mode-darksouls .grid-option-btn span {
  color: #724D4D !important;
}

body.mode-darksouls .grid-option-btn:hover {
  background: #170909 !important;
  border-color: #991B1B !important;
}

body.mode-darksouls .grid-option-btn.active {
  background: #200808 !important;
  border-color: #EF4444 !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5) !important;
}

body.mode-darksouls .switch .slider {
  background-color: #1A0D0D !important;
  border: 2px solid #501515 !important;
}

body.mode-darksouls .switch input:checked + .slider {
  background-color: #EF4444 !important;
  border-color: #991B1B !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   DEATH SCREEN SENSATIONAL UPGRADES
   ========================================================================== */
.blood-drip-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(153, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 65%);
  pointer-events: none;
  z-index: -1;
}

.darksouls-death-overlay.active {
  display: flex !important;
  animation: death-fade-in 1.4s forwards ease-in-out;
}

@keyframes death-fade-in {
  from { background: radial-gradient(circle, rgba(20,5,5,0) 0%, rgba(0,0,0,0) 100%); }
  to { background: radial-gradient(circle, rgba(20,5,5,0.4) 0%, rgba(0,0,0,0.98) 100%); }
}

@keyframes death-shake {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-3px, -2px) rotate(-0.5deg); }
  20% { transform: translate(3px, 2px) rotate(0.5deg); }
  30% { transform: translate(-2px, 3px) rotate(-0.2deg); }
  40% { transform: translate(2px, -2px) rotate(0.2deg); }
  50% { transform: translate(0, 0); }
}

body.mode-darksouls .death-title-text {
  animation: death-zoom-in 4s forwards cubic-bezier(0.1, 0.8, 0.1, 1), death-shake 0.5s ease-out 1s !important;
}

/* ==========================================================================
   REALM CARD COLOR FIXES (PREVENT WHITE CARDS CLASHING ON DARK THEMES)
   ========================================================================== */

/* Westeros Mode - Aged Slate / Medieval Parchment Cards */
body.mode-westeros .realm-card {
  background: #151310 !important;
  border-color: #3D3328 !important;
  border-bottom-color: #2F271E !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  color: #E2E8F0 !important;
}

body.mode-westeros .realm-card:hover {
  border-color: #AA8417 !important;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15) !important;
}

body.mode-westeros .realm-card.active {
  border-color: #D4AF37 !important;
  border-bottom-color: #AA8417 !important;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25) !important;
}

body.mode-westeros .realm-title {
  color: #FFFFFF !important;
}

body.mode-westeros .realm-description {
  color: #C5B499 !important;
}

body.mode-westeros .btn-realm-select {
  background-color: #2A251E !important;
  color: #C5B499 !important;
  border-bottom-color: #AA8417 !important;
}

body.mode-westeros .realm-card.active .btn-realm-select {
  background-color: #D4AF37 !important;
  color: #FFFFFF !important;
  border-bottom-color: #AA8417 !important;
}

body.mode-westeros .realm-badge {
  background: #2A251E !important;
  color: #D4AF37 !important;
}

/* Dark Souls Mode - Gothic Obsidian / Dark Crimson Cards */
body.mode-darksouls .realm-card {
  background: #0A0505 !important;
  border-color: #3A0F0F !important;
  border-bottom-color: #2D0B0B !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7) !important;
  color: #CBD5E1 !important;
}

body.mode-darksouls .realm-card:hover {
  border-color: #991B1B !important;
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.15) !important;
}

body.mode-darksouls .realm-card.active {
  border-color: #EF4444 !important;
  border-bottom-color: #991B1B !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3) !important;
}

body.mode-darksouls .realm-title {
  color: #FFFFFF !important;
}

body.mode-darksouls .realm-description {
  color: #9C8585 !important;
}

body.mode-darksouls .btn-realm-select {
  background-color: #1A0D0D !important;
  color: #9C8585 !important;
  border-bottom-color: #991B1B !important;
}

body.mode-darksouls .realm-card.active .btn-realm-select {
  background-color: #EF4444 !important;
  color: #FFFFFF !important;
  border-bottom-color: #991B1B !important;
}

body.mode-darksouls .realm-badge {
  background: #1A0D0D !important;
  color: #EF4444 !important;
}

/* Home Screen Button styles */
.btn-sidebar-home {
  transition: all 0.2s ease;
  color: var(--text-primary) !important;
}

.btn-sidebar-home:hover {
  background: rgba(0,0,0,0.1) !important;
  transform: translateY(-1px);
}

body.mode-westeros .btn-sidebar-home {
  background: #1C1916 !important;
  border-color: #5C4A37 !important;
  color: #C5B499 !important;
  font-family: 'Cinzel', serif !important;
}

body.mode-westeros .btn-sidebar-home:hover {
  background: #25211D !important;
  border-color: #AA8417 !important;
  color: #FFFFFF !important;
}

body.mode-darksouls .btn-sidebar-home {
  background: #0D0606 !important;
  border-color: #501515 !important;
  color: #9C8585 !important;
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
}

body.mode-darksouls .btn-sidebar-home:hover {
  background: #170909 !important;
  border-color: #EF4444 !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
   GLOBAL DESIGN FIX: SPACING, SYMMETRIES, AND PAD ALIGNMENTS
   ========================================================================== */

/* 1. Global Game HUD Bar Layout */
.game-hud-bar {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.85);
  border: 3px solid #E5E7EB;
  border-bottom: 7px solid #D1D5DB;
  border-radius: 20px;
  padding: 0.85rem 1.5rem;
  max-width: 800px;
  margin: 0 auto 2.5rem auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.hud-item.goal-hud {
  flex: 1.8;
  border-left: 2px solid rgba(0,0,0,0.08);
  padding-left: 1.5rem;
}

.hud-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

.flame-animated {
  color: #EF4444;
  animation: flame-pulse 1s infinite alternate;
}

@keyframes flame-pulse {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 2px #F97316); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 8px #EF4444); }
}

.gem-sparkle {
  animation: gem-spin 3s infinite linear;
}

@keyframes gem-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.hud-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 900;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hud-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: #1F2937;
}

.hud-details-full {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hud-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hud-goal-text {
  font-size: 0.75rem;
  font-weight: 800;
  color: #4B5563;
}

.hud-progress-container {
  position: relative;
  background: #E5E7EB;
  border-radius: 8px;
  height: 10px;
  width: 100%;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.hud-progress-fill {
  background: #58CC02;
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-stars {
  display: none;
}

/* Westeros HUD Bar */
body.mode-westeros .game-hud-bar {
  background: #12100E !important;
  border: 3px solid #D4AF37 !important;
  border-bottom: 7px solid #AA8417 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
}
body.mode-westeros .hud-label {
  color: #8C7C66 !important;
  font-family: 'Cinzel', serif !important;
}
body.mode-westeros .hud-value,
body.mode-westeros .hud-goal-text {
  color: #D4AF37 !important;
  font-family: 'Cinzel', serif !important;
}
body.mode-westeros .hud-progress-container {
  background: #1C1916 !important;
  border: 1px solid #5C4A37 !important;
}
body.mode-westeros .hud-progress-fill {
  background: #D4AF37 !important;
}
body.mode-westeros .hud-item.goal-hud {
  border-left-color: rgba(212, 175, 55, 0.2) !important;
}

/* Dark Souls HUD Bar */
body.mode-darksouls .game-hud-bar {
  background: #080404 !important;
  border: 3px solid #991B1B !important;
  border-bottom: 7px solid #7F1D1D !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8) !important;
}
body.mode-darksouls .hud-label {
  color: #724D4D !important;
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
}
body.mode-darksouls .hud-value,
body.mode-darksouls .hud-goal-text {
  color: #EF4444 !important;
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
}
body.mode-darksouls .hud-progress-container {
  background: #140C0C !important;
  border: 1px solid #501515 !important;
}
body.mode-darksouls .hud-progress-fill {
  background: #EF4444 !important;
  box-shadow: 0 0 10px #EF4444;
}
body.mode-darksouls .hud-item.goal-hud {
  border-left-color: rgba(153, 27, 27, 0.3) !important;
}

/* 2. Global Path Mascot Widget Layout & Perfect Scaling */
.path-mascot-widget {
  position: absolute;
  width: 80px;
  height: 80px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  box-sizing: border-box;
}

.path-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.level-up-badge {
  position: absolute;
  top: -14px;
  right: -24px;
  background: #EAB308;
  color: #1F2937;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: badge-pulse 0.8s infinite alternate;
  white-space: nowrap;
}

@keyframes badge-pulse {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.1); }
}

.mascot-crown-overlay {
  display: none;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  font-size: 1.15rem;
  color: #EAB308;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  animation: crown-shimmer 1.5s infinite alternate;
  z-index: 28;
}

.mascot-shield-overlay {
  display: none;
  position: absolute;
  bottom: 2px;
  left: -4px;
  background: linear-gradient(135deg, #2D2721 0%, #171512 100%);
  border: 1.5px solid #D4AF37;
  color: #D4AF37;
  border-radius: 4px 4px 10px 10px;
  width: 18px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  z-index: 29;
  transform: rotate(-12deg);
}

.mascot-bonfire-overlay {
  display: none;
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 38px;
  z-index: 26;
}

.bonfire-wood {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 8px;
  background: #4A2511;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.bonfire-flame {
  position: absolute;
  bottom: 6px;
  border-radius: 50% 50% 20% 20%;
  transform-origin: bottom center;
}

.flame-1 {
  left: 14px;
  width: 16px;
  height: 28px;
  background: linear-gradient(0deg, #EA580C 20%, #F97316 60%, #FBBF24 100%);
  animation: flicker 0.6s infinite alternate;
  filter: blur(0.5px);
  z-index: 2;
}

.flame-2 {
  left: 9px;
  width: 13px;
  height: 22px;
  background: linear-gradient(0deg, #DC2626 20%, #EA580C 60%, #F97316 100%);
  animation: flicker 0.4s infinite alternate-reverse;
  filter: blur(1px);
  z-index: 1;
  opacity: 0.8;
}

.flame-3 {
  left: 19px;
  width: 11px;
  height: 18px;
  background: linear-gradient(0deg, #F97316 20%, #FBBF24 60%, #FEF08A 100%);
  animation: flicker 0.5s infinite alternate;
  filter: blur(0.2px);
  z-index: 3;
  opacity: 0.9;
}

/* 3. Global Gold League Leaderboard Layout & Perfect Padding */
.gold-league-card {
  background: #FFFFFF;
  border: 3px solid #E5E7EB;
  border-bottom: 7px solid #D1D5DB;
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  box-sizing: border-box;
  width: 100%;
}

.league-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #F3F4F6;
  padding-bottom: 0.75rem;
}

.league-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 1.05rem;
  color: #1F2937;
}

.yellow-trophy {
  color: #EAB308;
  filter: drop-shadow(0 2px 4px rgba(234, 179, 8, 0.2));
}

.league-week-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #9CA3AF;
  background: #F3F4F6;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #F9FAFB;
  border: 2px solid #E5E7EB;
  border-radius: 14px;
  transition: transform 0.2s ease;
  box-sizing: border-box;
}

.leaderboard-item:hover {
  transform: translateX(4px);
}

.leaderboard-item.me-pinned {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.rank-badge {
  font-weight: 900;
  font-size: 0.85rem;
  color: #9CA3AF;
  width: 20px;
}

.leaderboard-item.me-pinned .rank-badge {
  color: #22C55E;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  font-size: 0.8rem;
}

.leaderboard-item.me-pinned .avatar-circle {
  background: #22C55E;
  color: #FFFFFF;
}

.user-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #374151;
}

.leaderboard-item.me-pinned .user-name {
  color: #15803D;
}

.user-score {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.xp-count {
  font-weight: 900;
  font-size: 0.85rem;
  color: #4B5563;
}

.leaderboard-item.me-pinned .xp-count {
  color: #15803D;
}

.trend-indicator {
  font-size: 0.75rem;
}

.trend-indicator.up { color: #22C55E; }
.trend-indicator.down { color: #EF4444; }
.trend-indicator.neutral { color: #9CA3AF; }

/* 4. High-Contrast Text Overrides for Node Labels */
body.mode-duolingo .node-label {
  color: #2D3748 !important;
}

body.mode-westeros .node-label {
  color: #C5B499 !important;
  font-family: 'Cinzel', serif !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

body.mode-darksouls .node-label {
  color: #EF4444 !important;
  font-family: 'Cinzel Decorative', 'Cinzel', serif !important;
  text-shadow: 0 1px 5px rgba(0,0,0,0.9);
}




