/* ==========================================================================
   Astra Study - Cosmic Space Theme Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #060814;
  --bg-card: rgba(13, 17, 38, 0.65);
  --bg-card-hover: rgba(22, 28, 60, 0.75);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-glow: rgba(167, 139, 250, 0.45);
  
  --primary-accent: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --secondary-accent: #06b6d4;
  --secondary-glow: rgba(6, 182, 212, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  /* Dynamic Cosmic Theme Engine Variables (Default: Violet Nebula) */
  --accent-primary: #8b5cf6;
  --accent-secondary: #c084fc;
  --accent-tertiary: #6366f1;
  --theme-glow: rgba(168, 85, 247, 0.55);
  --theme-glow-subtle: rgba(168, 85, 247, 0.18);
  --theme-border-glow: rgba(168, 85, 247, 0.45);
  --theme-btn-gradient: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --theme-btn-hover-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --theme-btn-shadow: rgba(124, 58, 237, 0.5);
  --theme-orb-gradient: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
  --theme-toggle-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(6, 182, 212, 0.18) 100%);
  --theme-xp-gradient: linear-gradient(90deg, #a855f7, #38bdf8);
  --theme-ambient-bg: radial-gradient(ellipse at 50% -10%, rgba(139, 92, 246, 0.25) 0%, rgba(99, 102, 241, 0.08) 45%, transparent 75%);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Space Background Canvas */
#cosmic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none !important;
}

/* Vignette / Edge Shadow */
.space-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, transparent 40%, rgba(4, 5, 12, 0.75) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Navigation */
.navbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(6, 8, 20, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.logo-orb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.8), inset 0 0 4px #ffffff;
  animation: pulseOrb 3s infinite alternate ease-in-out;
}

@keyframes pulseOrb {
  0% { transform: scale(0.9); box-shadow: 0 0 10px rgba(168, 85, 247, 0.6); }
  100% { transform: scale(1.15); box-shadow: 0 0 20px rgba(56, 189, 248, 0.9); }
}

.logo-accent {
  color: #38bdf8;
  font-weight: 400;
  margin-left: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #34d399;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: blink 2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Nav Controls */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-main);
}

.theme-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.theme-btn.active {
  background: rgba(139, 92, 246, 0.3);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   Cosmic Modules Dropdown Launcher & Animations
   ========================================================================== */
#cosmic-modules-dropdown:not(.hidden) {
  display: block !important;
  animation: cosmicModulesPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cosmicModulesPop {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#settings-theme-palette .theme-btn {
  position: relative;
  overflow: hidden;
}

#settings-theme-palette .theme-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

#settings-theme-palette .theme-btn.active {
  border-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5) !important;
  background: rgba(168, 85, 247, 0.3) !important;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  font-family: var(--font-main);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.control-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

/* Main Hero Section */
.hero-container {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  gap: 3rem;
}

.hero-glass-card {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 3.5rem 3rem;
  text-align: center;
  box-shadow: 
    0 20px 60px -15px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(139, 92, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  animation: floatCard 6s ease-in-out infinite alternate;
}

@keyframes floatCard {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

.hero-glass-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 
    0 25px 70px -15px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(139, 92, 246, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c084fc;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  margin-bottom: 1.8rem;
  text-transform: uppercase;
}

.badge-sparkle {
  color: #f43f5e;
  animation: rotateSparkle 4s linear infinite;
}

@keyframes rotateSparkle {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* User's Desired Welcome Headline */
.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 1.4rem;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 20%, #c4b5fd 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 45px rgba(167, 139, 250, 0.35);
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

/* CTA Group */
.cta-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 2rem;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  font-family: var(--font-main);
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 10px 25px -5px rgba(124, 58, 237, 0.5),
    0 0 20px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 15px 35px -5px rgba(124, 58, 237, 0.7),
    0 0 35px rgba(56, 189, 248, 0.5);
}

.primary-btn:active {
  transform: translateY(1px);
}

.arrow-icon {
  transition: transform 0.25s ease;
}

.primary-btn:hover .arrow-icon {
  transform: translateX(4px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 10px #38bdf8;
}

/* Feature Modules Preview Grid */
.modules-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  text-align: left;
}

.module-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 1.4rem 1.25rem;
  transition: all 0.3s var(--ease-spring);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.module-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(167, 139, 250, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
}

.module-card:hover::before {
  opacity: 1;
}

.module-icon {
  font-size: 1.8rem;
  margin-bottom: 0.85rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.module-card:hover .module-icon {
  transform: scale(1.15) rotate(6deg);
}

.module-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.module-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Footer / Interaction Tip */
.space-footer {
  position: relative;
  z-index: 10;
  padding: 1.25rem 2rem;
  text-align: center;
}

.tip-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 0.55rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tip-banner strong {
  color: #38bdf8;
}

.tip-icon {
  font-size: 1rem;
}

/* Modal Popup Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

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

.modal-card {
  background: #0d1226;
  border: 1px solid rgba(167, 139, 250, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 50px rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s var(--ease-spring);
}

.modal-overlay.open .modal-card,
.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-icon {
  font-size: 2.2rem;
  background: rgba(139, 92, 246, 0.15);
  padding: 0.6rem;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #ffffff;
}

.modal-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* Responsiveness */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-glass-card {
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
  }

  .modules-preview {
    grid-template-columns: 1fr;
  }

  .tip-banner {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Explore the Stars & Celestial Constellation Game Styles
   ========================================================================== */

/* Front Page "Explore the Stars" CTA Button */
.stars-cta-btn {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #a855f7 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 10px 30px -5px rgba(99, 102, 241, 0.6),
    0 0 25px rgba(56, 189, 248, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.stars-cta-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.stars-cta-btn:hover::before {
  opacity: 1;
}

.stars-cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 
    0 15px 40px -5px rgba(99, 102, 241, 0.8),
    0 0 35px rgba(56, 189, 248, 0.7);
}

.btn-icon {
  font-size: 1.15rem;
}

.btn-sparkle {
  color: #fde047;
  animation: rotateSparkle 3s linear infinite;
}

/* Fullscreen Star Explorer View */
.star-explorer-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, rgba(10, 14, 38, 0.6) 0%, rgba(4, 6, 18, 0.95) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease, transform 0.5s var(--ease-spring);
}

.star-explorer-view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  display: none;
}

/* Star Explorer Header */
.star-explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(6, 9, 26, 0.65);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.explorer-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.return-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.return-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateX(-3px);
}

.explorer-title-box h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* View Level Pill */
.view-level-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Cluster Carousel Selector Tray */
.cluster-pills-tray {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  max-width: 58vw;
  padding: 3px 0;
  scrollbar-width: none;
}

.cluster-pills-tray::-webkit-scrollbar {
  display: none;
}

.cluster-nav-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 0.38rem 0.8rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  flex-shrink: 0;
}

.cluster-nav-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.cluster-nav-pill.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(139, 92, 246, 0.28));
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

/* Cluster Linking Game HUD */
.cluster-game-hud {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-25px);
  opacity: 0;
  pointer-events: none;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(8, 12, 32, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 18px;
  padding: 0.75rem 1.6rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(56, 189, 248, 0.25);
  transition: all 0.35s var(--ease-spring);
}

.cluster-game-hud.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.hud-objective-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud-pill-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fde047;
}

.game-cluster-prompt {
  font-size: 0.92rem;
  color: #ffffff;
  font-weight: 500;
}

.game-cluster-prompt strong {
  color: #38bdf8;
}

.hud-progress-wrapper {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hud-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
}

.hud-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #fde047);
  box-shadow: 0 0 10px #38bdf8;
  border-radius: 9999px;
  transition: width 0.35s ease;
}

.hud-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  border: 1px solid transparent;
}

.hud-hint-btn {
  background: rgba(253, 224, 71, 0.15);
  border-color: rgba(253, 224, 71, 0.35);
  color: #fde047;
}

.hud-hint-btn:hover {
  background: rgba(253, 224, 71, 0.28);
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.3);
}

.hud-clear-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

.hud-clear-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Canvas Wrapper */
.star-canvas-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #03040a;
}

#star-chart-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.canvas-help-banner {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 32, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 0.55rem 1.6rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  z-index: 20;
}

.canvas-help-banner strong {
  color: #38bdf8;
}

/* Floating Star Dossier Card */
.cluster-star-card {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  width: 390px;
  max-width: calc(100vw - 3rem);
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  background: rgba(8, 12, 32, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 24px;
  padding: 1.75rem 1.6rem;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 0 45px rgba(56, 189, 248, 0.25);
  z-index: 35;
  transform: translateX(25px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
}

.cluster-star-card.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.card-close-btn {
  position: absolute;
  top: 1.15rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.card-close-btn:hover {
  color: #ffffff;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.15rem;
}

.card-star-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.8);
  border: 2px solid #ffffff;
  flex-shrink: 0;
  animation: pulseAvatar 2.5s infinite alternate ease-in-out;
}

.card-title-box h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
}

.card-cluster-name {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

.card-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

/* Card Game CTA Group */
.card-game-cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
}

.play-cluster-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);
  color: #ffffff;
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    0 10px 25px -5px rgba(124, 58, 237, 0.6),
    0 0 25px rgba(6, 182, 212, 0.45);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.play-cluster-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 15px 35px -5px rgba(124, 58, 237, 0.8),
    0 0 35px rgba(6, 182, 212, 0.7);
}

.card-secondary-link-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 0.6rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.card-secondary-link-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

/* Card Details Accordion */
.card-details-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  margin-bottom: 1.25rem;
}

.card-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.card-lore-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.card-study-box {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.5;
}

/* Card Footer */
.card-footer {
  display: flex;
  justify-content: flex-end;
}

.card-tone-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.45rem 0.95rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.card-tone-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Constellation Reveal Banner */
.cluster-reveal-banner {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  background: rgba(10, 16, 42, 0.95);
  border: 2px solid #fde047;
  box-shadow: 
    0 0 50px rgba(253, 224, 71, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.9);
  padding: 1.75rem 2.5rem;
  border-radius: 24px;
  text-align: center;
  z-index: 50;
  transition: all 0.4s var(--ease-spring);
  max-width: 520px;
  width: 90%;
}

.cluster-reveal-banner.active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.reveal-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fde047;
  margin-bottom: 0.45rem;
}

.cluster-reveal-banner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #ffffff 0%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cluster-reveal-banner p {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.55;
}

/* Responsiveness for Explorer */
@media (max-width: 860px) {
  .star-explorer-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .explorer-nav-right {
    width: 100%;
  }

  .cluster-pills-tray {
    max-width: 100%;
  }

  .canvas-help-banner {
    display: none;
  }

  .cluster-star-card {
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }

  .cluster-game-hud {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    width: 90%;
  }

  .hud-progress-wrapper {
    width: 100%;
  }
}


/* ==========================================================================
   Linking Challenge Feedback, Check Button & Hint Styles
   ========================================================================== */

/* 4- Button that pops up saying "Check Linking" */
.hud-check-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 
    0 0 25px rgba(16, 185, 129, 0.7),
    0 8px 20px rgba(5, 150, 105, 0.5) !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  padding: 0.55rem 1.25rem !important;
  border-radius: 12px !important;
  animation: pulsePopCheck 1.2s infinite alternate ease-in-out;
}

@keyframes pulsePopCheck {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
  100% { transform: scale(1.06); box-shadow: 0 0 30px rgba(52, 211, 153, 0.9); }
}

.hud-play-btn {
  background: linear-gradient(135deg, #7c3aed, #2563eb) !important;
  color: #ffffff !important;
  font-size: 0.85rem !important;
  padding: 0.5rem 1.15rem !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}

.hud-peek-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}

.hud-peek-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Hint Notice in HUD */
.hud-hint-notice {
  display: none;
  font-size: 0.78rem;
  color: #fde047;
  background: rgba(253, 224, 71, 0.14);
  border: 1px solid rgba(253, 224, 71, 0.35);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  animation: fadeIn 0.3s ease;
}

.hud-hint-notice.active {
  display: block;
}

/* 5- Feedback Modal (Correct Symbol / Try Again / Hint) */
.feedback-card {
  text-align: center;
  max-width: 440px;
  padding: 2.75rem 2.25rem;
  border-radius: 28px;
  background: #090e24;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 45px rgba(56, 189, 248, 0.25);
}

.feedback-symbol {
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 1rem;
  display: inline-block;
  animation: popSymbol 0.5s var(--ease-spring);
}

@keyframes popSymbol {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.feedback-symbol.correct {
  color: #10b981;
  text-shadow: 0 0 35px #10b981, 0 0 60px rgba(16, 185, 129, 0.6);
}

.feedback-symbol.incorrect {
  color: #ef4444;
  text-shadow: 0 0 35px #ef4444, 0 0 60px rgba(239, 68, 68, 0.6);
  animation: shakeSymbol 0.45s ease-in-out;
}

@keyframes shakeSymbol {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.feedback-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

.title-correct {
  background: linear-gradient(135deg, #ffffff 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-incorrect {
  background: linear-gradient(135deg, #ffffff 0%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feedback-message {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.feedback-hint-badge {
  margin-top: 1.25rem;
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.35);
  color: #fde047;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.shake-error {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%) !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.8) !important;
  animation: shakeBtn 0.45s ease-in-out !important;
}

@keyframes shakeBtn {
  0%, 100% { transform: scale(1) translateX(0); }
  20%, 60% { transform: scale(1.04) translateX(-8px); }
  40%, 80% { transform: scale(1.04) translateX(8px); }
}

/* ==========================================================================
   Main Study Hub & Station Navigation
   ========================================================================== */

.main-study-hub {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  padding: 2.25rem 2.25rem 3rem 2.25rem;
  box-shadow: 
    0 25px 70px -15px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(56, 189, 248, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
}

/* Primary Station Switcher Navigation */
.station-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  width: fit-content;
  margin: 0 auto 0.5rem auto;
}

.station-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 0.75rem 1.6rem;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.station-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.station-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.75), rgba(56, 189, 248, 0.65));
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 8px 25px -4px rgba(124, 58, 237, 0.5),
    0 0 20px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.study-station-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeIn 0.35s ease;
}

/* ==========================================================================
   Focus Orbit & Timer Station Styles
   ========================================================================== */

.focus-station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.focus-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.focus-title-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.focus-badge-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.6));
}

.focus-station-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.focus-subject-active-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  margin-top: 0.25rem;
}

/* Subject & Category Picker */
.focus-subject-picker-box, .fc-category-filter-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 250px;
}

.picker-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.subject-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.focus-subject-select, .fc-deck-select, .creator-category-select-wrapper select {
  flex: 1;
  background: rgba(13, 20, 50, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.focus-subject-select:focus, .fc-deck-select:focus, .creator-category-select-wrapper select:focus {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #38bdf8;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.mini-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

/* Presets Bar */
.focus-presets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.5rem 0 1rem 0;
  flex-wrap: wrap;
}

.focus-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 0.55rem 1.15rem;
  min-width: 95px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  color: #cbd5e1;
}

.focus-preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.focus-preset-btn.active {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.7);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
  color: #ffffff;
}

.focus-preset-btn.break-preset.active {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.35);
}

.preset-time {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
}

.preset-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 0.1rem;
}

/* Orbital Timer Container & SVG Ring */
.focus-timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.75rem 0 2rem 0;
}

.focus-timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.25rem 0 1rem 0;
}

.focus-ring-wrapper {
  position: relative;
  width: 290px;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.focus-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.focus-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

.focus-ring-stroke {
  fill: none;
  stroke: url(#focusGradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 754;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.85s linear;
}

.focus-ring-wrapper.running .focus-ring-stroke {
  animation: pulseGlow 2s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5)); }
  100% { filter: drop-shadow(0 0 25px rgba(124, 58, 237, 0.85)); }
}

.focus-ring-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  gap: 0.45rem;
  max-width: 230px;
}

.focus-timer-digital {
  font-family: var(--font-display);
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 0 35px rgba(56, 189, 248, 0.5);
  margin: 0.2rem 0;
}

.focus-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.8rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-focus {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.badge-break {
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
}

.badge-paused {
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

.focus-ring-ambient-note {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* Primary Timer Action Controls */
.focus-controls-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

#focus-btn-toggle {
  min-width: 170px;
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  font-weight: 700;
}

.pause-btn {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 25px -4px rgba(245, 158, 11, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.resume-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 25px -4px rgba(16, 185, 129, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.focus-break-actions {
  display: flex;
  gap: 0.65rem;
}

.break-action-btn {
  background: rgba(52, 211, 153, 0.1) !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
  color: #34d399 !important;
  font-weight: 600;
}

.break-action-btn:hover {
  background: rgba(52, 211, 153, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  color: #ffffff !important;
}

.stop-action-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
  font-weight: 600;
}

.stop-action-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
}

/* Focus Stats Tray */
.focus-stats-tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.focus-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.15rem;
  text-align: center;
  transition: all 0.2s ease;
}

.focus-stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-title {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Category Creator Mini Modal */
.mini-modal-card {
  max-width: 460px !important;
  padding: 2.25rem !important;
}

.new-category-input-box {
  animation: fadeIn 0.25s ease;
}

/* ==========================================================================
   Nebula Flashcards Generator & 3D Study Deck Section (Flowing)
   ========================================================================== */

/* Header Bar */
.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 5;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.fc-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.fc-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fc-icon-orbit {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.6));
}

.fc-main-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.fc-sub-status {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.fc-count-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* Center Navigation Tabs */
.fc-tabs-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem;
  border-radius: 14px;
  gap: 0.35rem;
}

.fc-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-main);
}

.fc-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.fc-tab-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(56, 189, 248, 0.45));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Header Right Actions */
.fc-header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Inactive Auto Flashcard Button */
.auto-flashcard-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px dashed rgba(168, 85, 247, 0.5) !important;
  color: #cbd5e1 !important;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: 12px;
  transition: all 0.25s ease !important;
  opacity: 0.85;
}

.auto-flashcard-btn:hover {
  background: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.8) !important;
  color: #ffffff !important;
  opacity: 1;
}

.fc-soon-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

/* Auto Flashcard Coming Soon Floating Toast */
.fc-toast-notice {
  position: fixed;
  top: 5rem;
  right: 2rem;
  max-width: 420px;
  background: rgba(15, 23, 50, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(168, 85, 247, 0.3);
  padding: 1rem 1.35rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 99;
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
}

.fc-toast-notice.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.fc-toast-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.fc-toast-content {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.fc-toast-content strong {
  color: #c084fc;
}

/* Content Area */
.fc-content-area {
  flex: 1;
  padding: 1.5rem 0 1rem 0;
  display: flex;
  flex-direction: column;
}

.fc-view-panel {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Filter & Search Toolbar */
.fc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.fc-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-lens {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #64748b;
  pointer-events: none;
}

.fc-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.25s ease;
}

.fc-search-input:focus {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.fc-filter-wrapper {
  min-width: 220px;
}

.fc-deck-select {
  width: 100%;
  background: rgba(13, 20, 50, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-family: var(--font-main);
  outline: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.fc-deck-select:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.fc-deck-select option {
  background: #090e24;
  color: #ffffff;
  padding: 0.5rem;
}

/* Stored Cards Grid */
.fc-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.stored-card-item {
  background: rgba(15, 23, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.3s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.stored-card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #38bdf8);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.stored-card-item:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(56, 189, 248, 0.15);
}

.stored-card-item:hover::before {
  opacity: 1;
}

.stored-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stored-card-deck-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #c084fc;
}

.stored-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.stored-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stored-card-preview-side {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.side-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #38bdf8;
  display: inline-block;
}

.side-badge.badge-answer {
  color: #34d399;
}

.stored-mini-thumb {
  max-height: 110px;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.25rem;
}

.stored-snippet {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stored-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.2rem 0;
}

.stored-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stored-date {
  font-size: 0.72rem;
  color: #64748b;
}

.btn-study-single {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.btn-study-single:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #ffffff;
  transform: translateX(3px);
}

/* Empty State */
.fc-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 520px;
  margin: 2rem auto;
}

.fc-empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.fc-empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.fc-empty-state p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ==========================================================================
   3D STUDY SESSION MODE & 3D ROTATION ANIMATION
   ========================================================================== */

.study-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.study-progress-container {
  flex: 1;
  min-width: 260px;
}

.study-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.study-counter-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.04em;
}

.study-keyboard-hint {
  font-size: 0.75rem;
  color: #64748b;
}

.study-keyboard-hint strong {
  color: #cbd5e1;
}

.study-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #38bdf8);
  border-radius: 9999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.study-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* 3D Scene Wrapper */
.study-card-scene {
  perspective: 1400px;
  -webkit-perspective: 1400px;
  width: 100%;
  max-width: 680px;
  min-height: 440px;
  margin: 1.5rem auto;
  display: flex;
  align-items: stretch;
  cursor: pointer;
}

/* 3D Rotating Inner Card */
.flashcard-3d-inner {
  position: relative;
  width: 100%;
  min-height: 440px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 28px;
}

/* Flipped State */
.flashcard-3d-inner.flipped {
  transform: rotateY(180deg);
}

/* Faces Shared Properties */
.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(124, 58, 237, 0.2);
  user-select: none;
  overflow-y: auto;
}

/* Front Face */
.flashcard-front {
  background: radial-gradient(circle at 50% 20%, rgba(20, 28, 70, 0.95) 0%, rgba(10, 14, 40, 0.98) 100%);
  border: 2px solid rgba(56, 189, 248, 0.35);
  transform: rotateY(0deg);
}

.flashcard-front:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.8),
    0 0 45px rgba(56, 189, 248, 0.3);
}

/* Back Face */
.flashcard-back {
  background: radial-gradient(circle at 50% 20%, rgba(28, 20, 70, 0.95) 0%, rgba(12, 9, 40, 0.98) 100%);
  border: 2px solid rgba(168, 85, 247, 0.45);
  transform: rotateY(180deg);
}

.flashcard-back:hover {
  border-color: rgba(168, 85, 247, 0.75);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.8),
    0 0 45px rgba(168, 85, 247, 0.35);
}

/* Card Header & Badges */
.card-face-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.fc-face-deck-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.fc-face-deck-badge.badge-answer-side {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.fc-face-prompt-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
}

.fc-face-prompt-badge.badge-answer-side {
  color: #34d399;
}

/* Card Content Area */
.card-face-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 1rem 0;
}

.study-card-img,
.study-card-image {
  max-height: 240px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  margin: 8px auto;
  display: block;
}

.study-card-text {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  color: #ffffff;
  white-space: pre-line;
}

/* Card Footer */
.card-face-footer {
  text-align: center;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fc-flip-prompt {
  font-size: 0.8rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.fc-flip-prompt strong {
  color: #ffffff;
}

/* ==========================================================================
   Flashcard Creator / Editor Modal Styles
   ========================================================================== */

.fc-creator-card {
  max-width: 780px !important;
  width: 95% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 2.25rem !important;
  background: #0a0f28 !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 50px rgba(168, 85, 247, 0.2) !important;
}

.fc-creator-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fc-creator-sides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.fc-side-builder {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-builder-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.side-title-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.side-title-badge.badge-answer-side {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.side-title-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.form-input, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* File Upload Dropzone */
.file-upload-zone {
  position: relative;
}

.file-input-hidden {
  display: none;
}

.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 0.7rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.img-preview-container {
  position: relative;
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-remove-img {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-remove-img:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* Responsiveness for Flashcards */
@media (max-width: 900px) {
  .fc-header {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 1rem;
  }

  .fc-header-left, .fc-tabs-container, .fc-header-right {
    justify-content: center;
  }

  .fc-creator-sides-grid {
    grid-template-columns: 1fr;
  }

  .study-card-scene, .flashcard-3d-inner {
    min-height: 400px;
  }

  .flashcard-face {
    padding: 1.5rem;
  }

  .study-card-text {
    font-size: 1.05rem;
  }
}

@media (max-width: 768px) {
  .main-study-hub {
    padding: 1.5rem 1.15rem;
    border-radius: 22px;
  }

  .station-tabs-nav {
    width: 100%;
    flex-direction: column;
    gap: 0.4rem;
  }

  .station-tab-btn {
    width: 100%;
    justify-content: center;
  }

  .focus-station-header {
    flex-direction: column;
    align-items: stretch;
  }

  .focus-subject-picker-box, .fc-category-filter-box {
    width: 100%;
  }

  .focus-timer-digital {
    font-size: 3.4rem;
  }

  .focus-controls-wrapper {
    flex-direction: column;
    width: 100%;
  }

  #focus-btn-toggle, .stop-action-btn {
    width: 100%;
  }

  .focus-break-actions {
    width: 100%;
    flex-direction: column;
  }

  .focus-break-actions button {
    width: 100%;
  }
}

/* ==========================================================================
   Fullscreen Dedicated Study Stations (Focus Orbit & Nebula Flashcards)
   ========================================================================== */

.fullscreen-study-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, rgba(13, 20, 50, 0.96) 0%, rgba(5, 7, 20, 0.99) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow-y: auto;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-spring);
}

.fullscreen-study-view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  display: none !important;
}

.fullscreen-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.view-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.view-header-title-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-icon-glow {
  font-size: 1.85rem;
  filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.6));
}

.view-header-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.subject-active-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  margin-top: 0.2rem;
}

.view-header-center {
  display: flex;
  align-items: center;
}

.subject-dropdown-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-mini-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

.dropdown-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.styled-dropdown {
  background: rgba(13, 20, 50, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0.6rem 0.95rem;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  min-width: 170px;
  transition: all 0.2s ease;
}

.styled-dropdown:focus {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.styled-dropdown option {
  background: #0d1432;
  color: #ffffff;
}

.manage-btn {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.manage-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.6);
  color: #ffffff;
}

.view-header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.fullscreen-view-body {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.focus-station-card {
  background: rgba(13, 20, 50, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 750px;
}

/* ==========================================================================
   Category Manager & Deleter Modal
   ========================================================================== */

.category-manager-card {
  max-width: 540px !important;
  width: 100%;
}

.category-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.category-manager-list::-webkit-scrollbar {
  width: 6px;
}

.category-manager-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
}

.category-manager-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

.category-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.category-manager-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

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

.cat-row-icon {
  font-size: 1.15rem;
}

.cat-row-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.95rem;
}

.cat-row-count {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-radius: 9999px;
}

.cat-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-delete-cat {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-delete-cat:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
  transform: scale(1.02);
}

.protected-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.manager-quick-add-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .fullscreen-view-header {
    padding: 0.85rem 1rem;
    gap: 1rem;
  }
  .fullscreen-view-body {
    padding: 1.25rem 0.75rem;
  }
  .focus-station-card {
    padding: 1.5rem 1rem;
  }
  .view-header-right {
    width: 100%;
    justify-content: flex-start;
  }
  .fc-tabs-container {
    width: 100%;
    justify-content: center;
  }
  .dropdown-actions-row {
    flex-wrap: wrap;
  }
  .styled-dropdown {
    width: 100%;
  }
}

/* ==========================================================================
   Dedicated Focus Second Meter Panel (Accumulates seconds studied!)
   ========================================================================== */

.focus-second-meter-panel {
  width: 100%;
  max-width: 440px;
  background: rgba(13, 20, 50, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.12);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  margin: 0.85rem 0 1.85rem 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.3s ease;
}

.focus-second-meter-panel:hover {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.2);
}

.meter-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meter-label-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meter-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.meter-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

.meter-value-group {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.meter-total-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #34d399;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.5);
  line-height: 1;
}

.meter-sub-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
}

.meter-track-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.meter-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
  border-radius: 9999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.meter-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.meter-credit-tag {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.meter-credit-tag.highlight {
  background: rgba(52, 211, 153, 0.35);
  border-color: rgba(52, 211, 153, 0.75);
  color: #ffffff;
  transform: scale(1.08);
}

/* Stat card second meter */
.focus-stat-seconds-meter .stat-number {
  color: #34d399 !important;
}

.second-meter-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.second-meter-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  border-radius: 9999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Second Credit Toast */
.focus-second-credit-toast {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(13, 20, 50, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(52, 211, 153, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 0.8rem 1.6rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
}

.focus-second-credit-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.focus-second-credit-toast strong {
  color: #34d399;
  font-weight: 700;
}

@keyframes meterPulse {
  0% { box-shadow: 0 0 12px rgba(52, 211, 153, 0.2); }
  50% { box-shadow: 0 0 24px rgba(52, 211, 153, 0.45); }
  100% { box-shadow: 0 0 12px rgba(52, 211, 153, 0.2); }
}

/* ==========================================================================
   Cosmic Portal Transition Overlay & Dimensional Warping
   ========================================================================== */

.portal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(3, 5, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow: hidden;
}

.portal-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.portal-overlay.portal-active {
  opacity: 1;
  pointer-events: all;
}

.portal-scene {
  position: relative;
  width: 480px;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-vortex {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-energy-disc {
  position: absolute;
  border-radius: 50%;
  border: 2px dashed;
  box-shadow: 0 0 40px;
  transform: scale(0.2) rotate(0deg);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.disc-outer {
  width: 420px;
  height: 420px;
  opacity: 0.8;
  animation: portalSpinClockwise 3s linear infinite;
}

.disc-mid {
  width: 280px;
  height: 280px;
  opacity: 0.9;
  border-width: 3px;
  animation: portalSpinCounter 2s linear infinite;
}

.disc-inner {
  width: 160px;
  height: 160px;
  opacity: 0.95;
  border-width: 4px;
  animation: portalSpinClockwise 1.2s linear infinite;
}

.portal-core {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(6px);
  animation: portalCorePulse 0.6s ease-in-out infinite alternate;
}

.portal-light-flare {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(40px);
  pointer-events: none;
}

.portal-teleport-hud {
  position: absolute;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  background: rgba(8, 12, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: hudFloat 1s ease-in-out infinite alternate;
}

.portal-hud-icon {
  font-size: 1.15rem;
  animation: iconSpin 0.7s ease infinite;
}

/* Animations */
@keyframes portalSpinClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes portalSpinCounter {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes portalCorePulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

@keyframes hudFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

@keyframes iconSpin {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.2); }
  100% { transform: scale(0.9); }
}

/* DESTINATION 1: FLASHCARDS (Nebula Violet & Magenta Swirl) */
.portal-to-flashcards {
  background: radial-gradient(circle at center, rgba(35, 10, 65, 0.85) 0%, rgba(4, 5, 16, 0.96) 100%);
}
.portal-to-flashcards .portal-energy-disc {
  border-color: #c084fc;
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.75), inset 0 0 30px rgba(236, 72, 153, 0.5);
}
.portal-to-flashcards .portal-core {
  background: radial-gradient(circle, #f472b6 0%, #a855f7 60%, transparent 100%);
  box-shadow: 0 0 60px rgba(236, 72, 153, 0.9);
}
.portal-to-flashcards .portal-light-flare {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, rgba(236, 72, 153, 0.3) 50%, transparent 70%);
}
.portal-to-flashcards .portal-teleport-hud {
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

/* DESTINATION 2: FOCUS ORBIT (Electric Cyan & Emerald Hyper-Tunnel) */
.portal-to-focus {
  background: radial-gradient(circle at center, rgba(6, 40, 50, 0.85) 0%, rgba(3, 8, 20, 0.96) 100%);
}
.portal-to-focus .portal-energy-disc {
  border-color: #38bdf8;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.75), inset 0 0 30px rgba(52, 211, 153, 0.5);
}
.portal-to-focus .portal-core {
  background: radial-gradient(circle, #34d399 0%, #06b6d4 60%, transparent 100%);
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.9);
}
.portal-to-focus .portal-light-flare {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.6) 0%, rgba(16, 185, 129, 0.3) 50%, transparent 70%);
}
.portal-to-focus .portal-teleport-hud {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
}

/* DESTINATION 3: STAR EXPLORER (Celestial Gold & Diamond Warp) */
.portal-to-stars {
  background: radial-gradient(circle at center, rgba(45, 30, 10, 0.85) 0%, rgba(4, 6, 18, 0.96) 100%);
}
.portal-to-stars .portal-energy-disc {
  border-color: #fbbf24;
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.75), inset 0 0 30px rgba(245, 158, 11, 0.5);
}
.portal-to-stars .portal-core {
  background: radial-gradient(circle, #ffffff 0%, #fbbf24 60%, transparent 100%);
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.9);
}
.portal-to-stars .portal-light-flare {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.6) 0%, rgba(245, 158, 11, 0.3) 50%, transparent 70%);
}
.portal-to-stars .portal-teleport-hud {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.4);
}

/* RETURN TO HOME: INWARD RE-ENTRY SINGULARITY & CALMING DAWN WASH (COMPLETELY DIFFERENT!) */
.portal-return-home {
  background: radial-gradient(circle at center, rgba(15, 23, 60, 0.92) 0%, rgba(2, 4, 12, 0.99) 100%);
}
.portal-return-home .portal-energy-disc {
  border-color: #818cf8;
  border-style: solid;
  border-width: 3px;
  box-shadow: 0 0 60px rgba(129, 140, 248, 0.8), inset 0 0 40px rgba(192, 132, 252, 0.6);
  animation: portalContractInward 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.portal-return-home .portal-core {
  background: radial-gradient(circle, #ffffff 0%, #818cf8 40%, transparent 100%);
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.9);
  animation: portalSingularityCollapse 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.portal-return-home .portal-light-flare {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.7) 0%, rgba(56, 189, 248, 0.4) 50%, transparent 80%);
}
.portal-return-home .portal-teleport-hud {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 25px rgba(129, 140, 248, 0.5);
}

@keyframes portalContractInward {
  0% { transform: scale(1.6) rotate(180deg); opacity: 0.9; }
  60% { transform: scale(0.6) rotate(0deg); opacity: 1; }
  100% { transform: scale(0.05) rotate(-90deg); opacity: 0; }
}

@keyframes portalSingularityCollapse {
  0% { transform: scale(1.8); opacity: 1; }
  50% { transform: scale(2.4); filter: blur(2px); }
  100% { transform: scale(0.1); opacity: 0; }
}

/* ==========================================================================
   Gamification System Styles: Profile, Avatars, XP, Friends & AFK Checks
   ========================================================================== */

/* Navbar User Profile Pill */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  background: rgba(13, 20, 50, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.user-profile-pill:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(168, 85, 247, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
}

.user-avatar-badge {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 90px;
}

.user-pill-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.user-pill-username {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-level-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.08rem 0.35rem;
  border-radius: 9999px;
  line-height: 1.1;
}

.user-pill-xp-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
}

.user-pill-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Focus Mode Switcher: Standard vs Competitive */
.focus-mode-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 0 1.25rem 0;
  flex-wrap: wrap;
  width: 100%;
}

.focus-mode-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 1.1rem;
  border-radius: 14px;
  color: #cbd5e1;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.focus-mode-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.focus-mode-toggle-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.focus-mode-toggle-btn.competitive-btn.active {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.25), rgba(245, 158, 11, 0.25));
  border-color: rgba(245, 158, 11, 0.7);
  color: #ffffff;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}

.mode-icon {
  font-size: 1.1rem;
}

.mode-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.mode-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.boost-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   Profile Modal & XP Ledger
   ========================================================================== */

.profile-modal-card {
  max-width: 680px !important;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem 2.25rem !important;
}

.profile-identity-banner {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-big-avatar {
  font-size: 3.8rem;
  line-height: 1;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.3) 0%, rgba(13, 20, 50, 0.8) 100%);
  border: 2px solid rgba(168, 85, 247, 0.5);
  border-radius: 24px;
  padding: 0.75rem;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
}

.profile-avatar-level-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: linear-gradient(135deg, #7c3aed, #38bdf8);
  border: 2px solid #0d1226;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.profile-identity-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-username {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.profile-rank-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #c084fc;
}

.profile-total-xp-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.2rem;
}

/* XP Progression Bar */
.profile-xp-progress-section {
  margin: 1.25rem 0 1.5rem 0;
}

.progress-bar-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.profile-xp-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7 0%, #38bdf8 50%, #34d399 100%);
  border-radius: 9999px;
  transition: width 0.5s ease;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

/* Profile Navigation Tabs */
.profile-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.6rem;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.profile-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.profile-tab-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.6), rgba(56, 189, 248, 0.5));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

/* XP Source Summary Cards */
.xp-source-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.xp-summary-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.xp-summary-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.source-icon {
  font-size: 1.6rem;
}

.source-info {
  display: flex;
  flex-direction: column;
}

.source-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: uppercase;
}

.source-xp-number {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #38bdf8;
}

/* Detailed XP Ledger */
.ledger-section-heading {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.profile-xp-ledger-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.xp-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.xp-ledger-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.ledger-row-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ledger-icon {
  font-size: 1.15rem;
}

.ledger-details-box {
  display: flex;
  flex-direction: column;
}

.ledger-source-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.ledger-sub-text {
  font-size: 0.72rem;
  color: #94a3b8;
}

.ledger-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.ledger-xp-pill {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 0.12rem 0.55rem;
  border-radius: 9999px;
}

.ledger-time {
  font-size: 0.65rem;
  color: #64748b;
}

/* ==========================================================================
   Space Friends List Styles
   ========================================================================== */

.add-friend-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.profile-friends-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.friend-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.friend-avatar-wrapper {
  position: relative;
}

.friend-avatar {
  font-size: 1.6rem;
  line-height: 1;
}

.friend-status-dot {
  position: absolute;
  bottom: 0;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #0d1226;
}

.friend-status-dot.online {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.friend-status-dot.offline {
  background: #64748b;
}

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

.friend-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.friend-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.friend-level-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.friend-activity {
  font-size: 0.72rem;
  color: #94a3b8;
}

.friend-card-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.friend-xp-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #c084fc;
}

.btn-friend-kudos {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-friend-kudos:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: rgba(168, 85, 247, 0.8);
  color: #ffffff;
  transform: scale(1.04);
}

.btn-remove-friend {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-remove-friend:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Avatar Picker Grid (Login Modal)
   ========================================================================== */

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.avatar-option {
  font-size: 2.2rem;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.avatar-option.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   Anti-AFK Checkpoint Modal & Level Up Celebration
   ========================================================================== */

.afk-modal-card {
  max-width: 440px !important;
  text-align: center;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.3) !important;
}

.afk-symbol {
  font-size: 4rem;
  animation: afkPulse 1s ease-in-out infinite alternate;
}

@keyframes afkPulse {
  0% { transform: scale(0.9); filter: drop-shadow(0 0 10px #38bdf8); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 25px #34d399); }
}

.afk-countdown-display {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: #fbbf24;
  margin: 0.85rem 0;
  text-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
}

.level-up-card {
  max-width: 440px !important;
  text-align: center;
  border-color: rgba(168, 85, 247, 0.6) !important;
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.4) !important;
}

.level-up-burst {
  font-size: 4.5rem;
  line-height: 1;
  animation: levelBurst 0.8s var(--ease-spring);
}

.level-up-banner {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fbbf24 0%, #ec4899 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.4rem 0 0.2rem 0;
}

.level-up-num-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.level-up-title-text {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 0.2rem;
}

.level-up-subtext {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-top: 0.6rem;
}

@keyframes levelBurst {
  0% { transform: scale(0.2) rotate(-45deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Floating Cosmic XP Toast */
.cosmic-xp-toast {
  position: fixed;
  top: 5.5rem;
  right: 2rem;
  background: rgba(13, 20, 50, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 99999;
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
}

.cosmic-xp-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.xp-toast-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.xp-toast-body {
  display: flex;
  flex-direction: column;
}

.xp-toast-body strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: #34d399;
}

.xp-toast-body span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.feedback-xp-pill {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.25);
}

/* 5- Reset Total Study Time Button (Focus Stat Card) */
.focus-stat-time-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-stat-reset {
  margin-top: 0.45rem;
  padding: 0.22rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-stat-reset:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.15);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
}

.btn-stat-reset:active {
  transform: scale(0.96);
}

/* 2- Real Friend Request List & Mutual Companions */
.friends-section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.incoming-req-card {
  border-color: rgba(56, 189, 248, 0.45) !important;
  background: rgba(14, 165, 233, 0.09) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18) !important;
}

.outgoing-req-card {
  opacity: 0.88;
  border-style: dashed !important;
}

.friend-pending-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
}

.friend-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-friend-accept {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #059669, #10b981);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-friend-accept:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
}

.btn-friend-decline {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fda4af;
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-friend-decline:hover {
  background: rgba(225, 29, 72, 0.35);
  color: #ffffff;
}

.btn-cancel-req {
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-req:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
}

@media (max-width: 768px) {
  .user-profile-pill {
    padding: 0.3rem 0.6rem;
  }
  .user-pill-username {
    display: none;
  }
  .xp-source-summary-cards {
    grid-template-columns: 1fr;
  }
  .profile-identity-banner {
    flex-direction: column;
    text-align: center;
  }
  .profile-name-row {
    justify-content: center;
  }
  .profile-total-xp-tag {
    align-self: center;
  }
}

/* ==========================================================================
   Focus Seconds Meter, Friend XP Dossier, & Flashcards Hub Styles
   ========================================================================== */

.focus-live-seconds-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.2rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.2);
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

.focus-stat-seconds-card {
  border-color: rgba(52, 211, 153, 0.3) !important;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.12) !important;
}

.focus-stat-seconds-card .stat-number {
  color: #34d399 !important;
  text-shadow: 0 0 18px rgba(52, 211, 153, 0.45);
}

.btn-inspect-friend {
  padding: 0.32rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-inspect-friend:hover {
  background: rgba(56, 189, 248, 0.26);
  border-color: rgba(56, 189, 248, 0.75);
  color: #ffffff;
  transform: scale(1.04);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.tab-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 9999px;
  background: #06b6d4;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

.shared-hub-header,
.community-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: rgba(13, 20, 50, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  margin-bottom: 1rem;
}

.community-hub-header {
  border-color: rgba(168, 85, 247, 0.25);
}

.shared-by-pill,
.community-author-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.community-author-pill {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

.shared-card-item {
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.community-card-item {
  border-color: rgba(168, 85, 247, 0.3) !important;
}

.shared-card-footer,
.community-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-import-shared,
.btn-clone-community {
  padding: 0.4rem 0.85rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.btn-import-shared:hover,
.btn-clone-community:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.55);
}

.btn-dismiss-shared {
  padding: 0.4rem 0.55rem;
  font-size: 0.74rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dismiss-shared:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-like-community {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-like-community.liked {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.btn-like-community:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   Celestial Admin Command Deck & Account Security Styles
   ========================================================================== */

.admin-modal-card {
  background: radial-gradient(circle at top left, rgba(20, 30, 70, 0.95), rgba(7, 10, 25, 0.98)) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 60px rgba(56, 189, 248, 0.25) !important;
}

.admin-user-row,
.admin-post-row {
  transition: all 0.2s ease;
}

.admin-user-row:hover,
.admin-post-row:hover {
  border-color: rgba(56, 189, 248, 0.5) !important;
  background: rgba(30, 41, 79, 0.7) !important;
}

.btn-admin-reset-xp:hover {
  background: rgba(251, 191, 36, 0.25) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
  transform: translateY(-1px);
}

.btn-admin-demote:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: rgba(244, 63, 94, 0.6) !important;
  transform: translateY(-1px);
}

.btn-admin-promote:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  transform: translateY(-1px);
}

.btn-admin-delete-post:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  transform: translateY(-1px);
}

.btn-delete-community:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  transform: scale(1.1);
}

.profile-account-management {
  background: rgba(15, 23, 42, 0.4);
  padding: 1rem 1.25rem;
  border-radius: 14px;
}

/* ==========================================================================
   Cluster HUD Close & Return Buttons + Zoom Controls
   ========================================================================== */

.hud-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(239, 68, 68, 0.5);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 40;
}

.hud-close-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.hud-map-btn {
  background: rgba(56, 189, 248, 0.16) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: 12px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.hud-map-btn:hover {
  background: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-2px);
}

/* Floating Space Map Zoom & Pan Controls */
.space-zoom-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(8, 12, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 0.35rem 0.65rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.15);
}

.zoom-hud-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zoom-hud-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: scale(1.08);
}

.zoom-hud-btn.reset-btn {
  width: auto;
  padding: 0 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.zoom-level-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  min-width: 44px;
  text-align: center;
  user-select: none;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Audio & System Settings Modal
   ========================================================================== */

.settings-modal-card {
  background: #090e24;
  border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 50px rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  padding: 2.2rem;
}

.audio-channel-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.audio-channel-card:hover {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.audio-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.25);
  outline: none;
  transition: background 0.2s ease;
}

.audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transition: transform 0.15s ease;
}

.audio-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #7dd3fc;
}

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

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

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(100, 116, 139, 0.4);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

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

/* ==========================================================================
   AI Flashcard Generator Styles (Groq Cloud & PDF Extraction)
   ========================================================================== */

.preview-flashcard-item {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  perspective: 1000px;
}

.preview-flashcard-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.2);
}

.preview-flashcard-item.flipped-preview {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.35) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  border-color: rgba(52, 211, 153, 0.65) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(52, 211, 153, 0.25) !important;
}

.preview-flashcard-item.flipped-preview .card-face-front {
  opacity: 0.65;
}

.preview-flashcard-item.flipped-preview .card-face-back {
  opacity: 1;
}

.card-faces-wrapper {
  transition: all 0.3s ease;
}

.fc-ai-banner {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.3) 0%, rgba(30, 27, 75, 0.4) 50%, rgba(15, 23, 42, 0.7) 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fc-ai-banner:hover {
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 8px 30px rgba(147, 51, 234, 0.15);
}





/* ==========================================================================
   STUDY SUMMARIZER MODULE — Styles
   ========================================================================== */

/* Style selector buttons */
.summarizer-style-btn {
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: all 0.2s var(--ease-spring);
}

.summarizer-style-btn:hover {
  transform: translateY(-2px);
}

.summarizer-style-btn.style-btn-active {
  border-color: rgba(167, 139, 250, 0.7) !important;
  background: rgba(139, 92, 246, 0.18) !important;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.25), 0 0 0 1px rgba(167, 139, 250, 0.3);
  transform: translateY(-2px);
}

.summarizer-style-btn.style-btn-active span:nth-child(2) {
  color: #c4b5fd !important;
}

/* Specific active styles per button */
#summarizer-style-bullets.style-btn-active {
  border-color: rgba(56, 189, 248, 0.7) !important;
  background: rgba(14, 165, 233, 0.15) !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.2), 0 0 0 1px rgba(56, 189, 248, 0.3);
}
#summarizer-style-bullets.style-btn-active span:nth-child(2) {
  color: #67e8f9 !important;
}

#summarizer-style-feynman.style-btn-active {
  border-color: rgba(168, 85, 247, 0.7) !important;
  background: rgba(168, 85, 247, 0.15) !important;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2), 0 0 0 1px rgba(168, 85, 247, 0.3);
}
#summarizer-style-feynman.style-btn-active span:nth-child(2) {
  color: #d8b4fe !important;
}

#summarizer-style-definitions.style-btn-active {
  border-color: rgba(52, 211, 153, 0.7) !important;
  background: rgba(52, 211, 153, 0.12) !important;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.2), 0 0 0 1px rgba(52, 211, 153, 0.3);
}
#summarizer-style-definitions.style-btn-active span:nth-child(2) {
  color: #6ee7b7 !important;
}

#summarizer-style-exam.style-btn-active {
  border-color: rgba(251, 191, 36, 0.7) !important;
  background: rgba(251, 191, 36, 0.12) !important;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.2), 0 0 0 1px rgba(251, 191, 36, 0.3);
}
#summarizer-style-exam.style-btn-active span:nth-child(2) {
  color: #fde68a !important;
}

/* Copy button success state */
.summarizer-copy-btn {
  transition: all 0.2s ease;
}

.summarizer-copy-btn.btn-copy-success {
  background: rgba(52, 211, 153, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  color: #6ee7b7 !important;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

/* Output scroll area */
.summarizer-output-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.summarizer-output-scroll::-webkit-scrollbar {
  width: 5px;
}

.summarizer-output-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.summarizer-output-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 99px;
}

/* ==========================================================================
   SUMMARIZER MARKDOWN BODY — clean cosmic typography
   ========================================================================== */

.summarizer-markdown-body {
  font-family: var(--font-main);
  font-size: 0.875rem;
  line-height: 1.75;
  color: #e2e8f0;
  user-select: text;
  -webkit-user-select: text;
}

/* Headings */
.summarizer-markdown-body .summarizer-h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #c4b5fd;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 1.25rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.25);
}

.summarizer-markdown-body .summarizer-h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #a78bfa;
  font-family: var(--font-display);
  margin: 1.1rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.summarizer-markdown-body .summarizer-h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #818cf8;
  margin: 0.9rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.summarizer-markdown-body .summarizer-h4 {
  font-size: 0.825rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 0.75rem 0 0.35rem;
  font-style: italic;
}

/* Paragraphs */
.summarizer-markdown-body .summarizer-para {
  margin: 0.5rem 0;
  color: #cbd5e1;
}

/* Lists */
.summarizer-markdown-body .summarizer-ul,
.summarizer-markdown-body .summarizer-ol {
  margin: 0.5rem 0 0.75rem 0;
  padding-left: 1.4rem;
}

.summarizer-markdown-body .summarizer-li {
  margin: 0.3rem 0;
  color: #cbd5e1;
  position: relative;
}

.summarizer-markdown-body .summarizer-ul .summarizer-li::marker {
  color: #7c3aed;
}

.summarizer-markdown-body .summarizer-ol .summarizer-li::marker {
  color: #0ea5e9;
  font-weight: 700;
}

.summarizer-markdown-body .summarizer-li-nested {
  margin-left: 1rem;
  font-size: 0.84rem;
  color: #94a3b8;
}

.summarizer-markdown-body .summarizer-li-nested::marker {
  color: #475569;
}

/* Bold & Italic */
.summarizer-markdown-body strong {
  font-weight: 700;
  color: #f1f5f9;
}

.summarizer-markdown-body em {
  color: #c084fc;
  font-style: italic;
}

/* Horizontal rule */
.summarizer-markdown-body .summarizer-hr {
  border: none;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  margin: 1rem 0;
}

/* Code */
.summarizer-markdown-body .summarizer-inline-code {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #67e8f9;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

.summarizer-markdown-body .summarizer-code-block {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.summarizer-markdown-body .summarizer-code-block code {
  color: #67e8f9;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Emoji preservation */
.summarizer-markdown-body .summarizer-emoji {
  font-style: normal;
}

/* First child margin reset */
.summarizer-markdown-body > *:first-child {
  margin-top: 0;
}

/* Action bar layout */
#summarizer-action-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}


/* ==========================================================================
   COSMIC TOOLS SECTION — Sci-Fi Styles & Animations
   ========================================================================== */

/* DESTINATION 4: COSMIC TOOLS PORTAL (Electric Cyan & Purple Orbital Singularity) */
.portal-to-tools {
  background: radial-gradient(circle at center, rgba(6, 40, 60, 0.88) 0%, rgba(3, 7, 24, 0.98) 100%);
}
.portal-to-tools .portal-energy-disc {
  border-color: #38bdf8;
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.75), inset 0 0 30px rgba(168, 85, 247, 0.55);
}
.portal-to-tools .portal-core {
  background: radial-gradient(circle, #38bdf8 0%, #a855f7 65%, transparent 100%);
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.9);
}
.portal-to-tools .portal-light-flare {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.6) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 70%);
}
.portal-to-tools .portal-teleport-hud {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.45);
}

/* DESTINATION 5: COSMIC EXAMS (Celestial Indigo & Stellar Cyan Rift) */
.portal-to-exams {
  background: radial-gradient(circle at center, rgba(30, 20, 60, 0.88) 0%, rgba(3, 7, 24, 0.98) 100%);
}
.portal-to-exams .portal-energy-disc {
  border-color: #818cf8;
  box-shadow: 0 0 50px rgba(129, 140, 248, 0.75), inset 0 0 30px rgba(6, 182, 212, 0.55);
}
.portal-to-exams .portal-core {
  background: radial-gradient(circle, #818cf8 0%, #06b6d4 65%, transparent 100%);
  box-shadow: 0 0 60px rgba(129, 140, 248, 0.9);
}
.portal-to-exams .portal-light-flare {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.6) 0%, rgba(6, 182, 212, 0.3) 50%, transparent 70%);
}
.portal-to-exams .portal-teleport-hud {
  border-color: rgba(129, 140, 248, 0.65);
  box-shadow: 0 0 25px rgba(129, 140, 248, 0.45);
}

/* Cosmic Workstation Station Card */
.tools-station-card {
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.8), 0 0 35px rgba(56, 189, 248, 0.12);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tools-station-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 25px 70px rgba(2, 6, 23, 0.9), 0 0 45px rgba(56, 189, 248, 0.18);
}

/* Orbital Glowing Ring inside Dropzones */
.slicer-orbit-ring,
.pptx-orbit-ring {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(56, 189, 248, 0.15) 60deg, transparent 120deg, rgba(168, 85, 247, 0.15) 240deg, transparent 300deg);
  animation: orbitSpin 12s linear infinite;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}

.group:hover .slicer-orbit-ring,
.group:hover .pptx-orbit-ring {
  opacity: 1;
  animation-duration: 8s;
}

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Quick Action Slicer Preset Buttons */
.slicer-preset-btn {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.slicer-preset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.slicer-preset-btn:active {
  transform: translateY(0);
}

/* Planetary Ring Cosmic Loader */
.cosmic-planetary-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cosmic-planetary-ring .planet-core {
  font-size: 2.2rem;
  z-index: 2;
  animation: planetPulse 2.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.7));
}

.cosmic-planetary-ring .planet-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.cosmic-planetary-ring .planet-ring.ring-1 {
  width: 72px;
  height: 28px;
  border: 2px solid rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.6), inset 0 0 10px rgba(56, 189, 248, 0.4);
  transform: rotate(-25deg);
  animation: ringSpin 6s linear infinite;
}

.cosmic-planetary-ring .planet-ring.ring-2 {
  width: 86px;
  height: 34px;
  border: 1px dashed rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
  transform: rotate(35deg);
  animation: ringSpinReverse 9s linear infinite;
}

@keyframes planetPulse {
  0% { transform: scale(0.92); filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 24px rgba(56, 189, 248, 0.9)); }
}

@keyframes ringSpin {
  0% { transform: rotate(-25deg) scale(1); }
  50% { transform: rotate(-25deg) scale(1.06); }
  100% { transform: rotate(-25deg) scale(1); }
}

@keyframes ringSpinReverse {
  0% { transform: rotate(35deg) scale(1.05); }
  50% { transform: rotate(35deg) scale(0.95); }
  100% { transform: rotate(35deg) scale(1.05); }
}

/* Fade in animation */
.animate-fadeIn {
  animation: toolsFadeIn 0.35s ease-out forwards;
}

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

/* ==========================================================================
   Cosmic Theme Engine - Dynamic UI Color Harmonization & Ambient Glow
   ========================================================================== */

/* Ambient Glowing Atmosphere Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: var(--theme-ambient-bg);
  transition: background 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modals High Stacking */
#cosmic-publish-modal {
  z-index: 100000 !important;
}

/* Dynamic Primary Buttons */
.primary-btn,
.cta-btn.primary-btn {
  background: var(--theme-btn-gradient, linear-gradient(135deg, #7c3aed, #2563eb)) !important;
  border-color: var(--theme-border-glow, rgba(255, 255, 255, 0.25)) !important;
  box-shadow: 0 10px 25px -5px var(--theme-btn-shadow, rgba(124, 58, 237, 0.5)), 0 0 20px var(--theme-glow-subtle, rgba(59, 130, 246, 0.3)) !important;
  color: #ffffff !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.4s !important;
}

.primary-btn:hover,
.cta-btn.primary-btn:hover {
  background: var(--theme-btn-hover-gradient, var(--theme-btn-gradient)) !important;
  box-shadow: 0 15px 35px -5px var(--theme-btn-shadow, rgba(124, 58, 237, 0.7)), 0 0 35px var(--theme-glow, rgba(56, 189, 248, 0.5)) !important;
}

/* Dynamic Logo Orb */
.logo-orb {
  background: var(--theme-orb-gradient, linear-gradient(135deg, #38bdf8, #a855f7)) !important;
  box-shadow: 0 0 14px var(--theme-glow, rgba(168, 85, 247, 0.8)), inset 0 0 4px #ffffff !important;
}

/* Dynamic Modules Dropdown Trigger & Shelf */
#btn-modules-toggle {
  border-color: var(--theme-border-glow, rgba(168, 85, 247, 0.5)) !important;
  background: var(--theme-toggle-bg, linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(6, 182, 212, 0.18) 100%)) !important;
  box-shadow: 0 0 16px var(--theme-glow-subtle, rgba(168, 85, 247, 0.25)) !important;
}

#btn-modules-toggle.active {
  border-color: var(--accent-secondary, #c084fc) !important;
  box-shadow: 0 0 22px var(--theme-glow, rgba(168, 85, 247, 0.5)) !important;
}

#modules-chevron {
  color: var(--accent-secondary, #c084fc) !important;
}

#cosmic-modules-dropdown {
  border: 1px solid var(--theme-border-glow, rgba(168, 85, 247, 0.45)) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px var(--theme-glow-subtle, rgba(168, 85, 247, 0.25)) !important;
}

/* User Level Badge & XP Track */
.user-level-tag {
  background: var(--theme-glow-subtle, rgba(168, 85, 247, 0.25)) !important;
  border: 1px solid var(--theme-border-glow, rgba(168, 85, 247, 0.45)) !important;
  color: var(--accent-secondary, #c084fc) !important;
}

.user-pill-xp-bar-fill {
  background: var(--theme-xp-gradient, linear-gradient(90deg, #a855f7, #38bdf8)) !important;
  box-shadow: 0 0 8px var(--theme-glow, rgba(168, 85, 247, 0.6)) !important;
}

/* Focus Orbit Ring & Active Status */
.focus-ring-stroke {
  stroke: var(--accent-primary, #38bdf8) !important;
}

.focus-ring-wrapper.running .focus-ring-stroke {
  filter: drop-shadow(0 0 14px var(--theme-glow, rgba(56, 189, 248, 0.6))) !important;
}

.focus-status-badge {
  background: var(--theme-glow-subtle, rgba(56, 189, 248, 0.15)) !important;
  border-color: var(--theme-border-glow, rgba(56, 189, 248, 0.4)) !important;
  color: var(--accent-secondary, #38bdf8) !important;
}

.subject-active-tag {
  background: var(--theme-glow-subtle, rgba(168, 85, 247, 0.2)) !important;
  border: 1px solid var(--theme-border-glow, rgba(168, 85, 247, 0.4)) !important;
  color: var(--accent-secondary, #e9d5ff) !important;
}

/* Active Filter Pills, Mode Tabs, and Presets */
.exam-filter-pill.active,
.study-mode-tab.active,
.timer-preset-btn.active,
.focus-preset-btn.active,
.focus-mode-toggle-btn.active {
  background: var(--theme-glow-subtle, rgba(168, 85, 247, 0.25)) !important;
  border-color: var(--theme-border-glow, rgba(168, 85, 247, 0.55)) !important;
  color: var(--accent-secondary, #c084fc) !important;
  box-shadow: 0 0 14px var(--theme-glow-subtle, rgba(168, 85, 247, 0.25)) !important;
}

/* Interactive Control Hover & Active States */
.control-btn.active {
  background: var(--theme-glow-subtle, rgba(56, 189, 248, 0.18)) !important;
  border-color: var(--theme-border-glow, rgba(56, 189, 248, 0.5)) !important;
  color: var(--accent-secondary, #38bdf8) !important;
  box-shadow: 0 0 15px var(--theme-glow, rgba(56, 189, 248, 0.35)) !important;
}

.control-btn:hover,
.interactive-control:hover {
  border-color: var(--theme-border-glow, rgba(255, 255, 255, 0.25));
}

.hero-badge {
  background: var(--theme-glow-subtle, rgba(139, 92, 246, 0.15)) !important;
  border: 1px solid var(--theme-border-glow, rgba(139, 92, 246, 0.35)) !important;
  color: var(--accent-secondary, #c084fc) !important;
}

.badge-purple {
  background: var(--theme-glow-subtle, rgba(168, 85, 247, 0.2)) !important;
  color: var(--accent-secondary, #e9d5ff) !important;
  border-color: var(--theme-border-glow, rgba(168, 85, 247, 0.4)) !important;
}

/* Hover Glow for Cards */
.card:hover,
.stat-card:hover,
.glow-on-hover:hover {
  border-color: var(--theme-border-glow, rgba(168, 85, 247, 0.45));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 20px var(--theme-glow-subtle, rgba(168, 85, 247, 0.2));
}

/* Active Theme Selection in Settings Modal */
.theme-btn.active {
  border-color: #ffffff !important;
  box-shadow: 0 0 16px var(--theme-glow, rgba(168, 85, 247, 0.6)) !important;
}

/* ==========================================================================
   Cosmic Arcade Mini-Games Styles
   ========================================================================== */
.rw-input-box {
  width: 100%;
  background: rgba(4, 6, 16, 0.7);
  border: 2px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 0.12em;
  color: #f8fafc;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.rw-input-box:focus {
  border-color: #34d399;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.rw-input-success {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

.rw-input-error {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.rw-input-shake {
  animation: rwShake 0.4s ease;
}

@keyframes rwShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.arcade-choice-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.arcade-choice-btn:hover:not(:disabled) {
  border-color: #38bdf8;
  background: rgba(6, 182, 212, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25);
}

.ao-choice-key {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #67e8f9;
  flex-shrink: 0;
}

.ao-choice-correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
}

.ao-choice-wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.ao-choice-dim {
  opacity: 0.45;
}

.st-option-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #f1f5f9;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.st-option-btn:hover:not(:disabled) {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.15);
  transform: translateY(-2px);
}

.st-option-letter {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #d8b4fe;
  flex-shrink: 0;
}

.st-option-correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
}

.st-option-wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.st-option-dim {
  opacity: 0.45;
}

.st-diff-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.st-diff-easy {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.st-diff-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.st-diff-hard {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.arcade-result-box {
  border-radius: 16px;
  padding: 1.15rem;
  text-align: center;
}

.arcade-result-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.arcade-result-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ==============================================================================
   STELLAR ANALYTICS & GLOBAL LEADERBOARD STYLING
   ============================================================================== */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.analytics-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.analytics-card,
.analytics-stat-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(11, 15, 25, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.analytics-stat-card.glow-cyan {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.08);
}

.analytics-stat-card.glow-purple {
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(168, 85, 247, 0.08);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: monospace;
  margin: 0.35rem 0 0.2rem 0;
}

.stat-sub {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.empty-telemetry-notice {
  padding: 1.75rem 1rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

/* Skeleton Loading Pulse */
.skeleton-pulse {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.8) 50%, rgba(15, 23, 42, 0.6) 100%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.6s ease-in-out infinite;
  border-radius: 14px;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==============================================================================
   LEADERBOARD PODIUM & ROWS
   ============================================================================== */

.podium-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.podium-card {
  position: relative;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(11, 15, 25, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.25rem 0.75rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

.podium-gold {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, rgba(11, 15, 25, 0.95) 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.2);
}

.podium-silver {
  border-color: rgba(148, 163, 184, 0.4);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12) 0%, rgba(11, 15, 25, 0.95) 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(148, 163, 184, 0.12);
}

.podium-bronze {
  border-color: rgba(217, 119, 6, 0.4);
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.12) 0%, rgba(11, 15, 25, 0.95) 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(217, 119, 6, 0.12);
}

.podium-badge {
  position: absolute;
  top: -12px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  color: #0b0f19;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.podium-avatar-box {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.75rem 0 0.5rem 0;
  position: relative;
}

.podium-callsign {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.podium-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.25rem 0 0.5rem 0;
}

.podium-xp {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.you-pill {
  position: absolute;
  bottom: -4px;
  background: #38bdf8;
  color: #0b0f19;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

/* Subtle Pulsing for Solar Champion */
@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(245, 158, 11, 0.25);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 45px rgba(245, 158, 11, 0.45);
    transform: translateY(-2px);
  }
}

.animate-subtle-pulse {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* Leaderboard List Rows */
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.leaderboard-row:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.12);
}

.leaderboard-row-me {
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.rank-counter {
  width: 2.25rem;
  font-size: 0.85rem;
  text-align: center;
  flex-shrink: 0;
}

/* Pinned Rank Bar */
.pinned-rank-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 640px) {
  .podium-layout {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .podium-card {
    min-height: auto !important;
  }
}

/* ==============================================================================
   MOBILE & TABLET TOUCH FIXES & VISIBILITY PROTECTION
   ============================================================================== */

/* Disable native mobile tap highlight overlay that flickers / blanks UI */
* {
  -webkit-tap-highlight-color: transparent !important;
}

/* Ensure background canvas stays strictly in the background and NEVER intercepts touches */
canvas#starfield, 
canvas#space-canvas, 
canvas#cosmic-canvas,
.background-canvas, 
.particles-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  pointer-events: none !important; /* CRITICAL: Never let canvas capture touches */
}

/* Ensure the main application content stays above the canvas */
#app, main, #hero-view, .hero-sanctuary, .main-container, .dashboard, .dashboard-container, .deck-container, .modules-grid, .navbar, header {
  position: relative !important;
  z-index: 10 !important;
}

/* Fix mobile & tablet modal/panel visibility so they stay solid and visible on touch */
@media (max-width: 1024px) {
  /* Force all content, cards, and text to remain permanently visible */
  [data-aos], 
  .reveal, 
  .fade-in, 
  .animate-on-scroll,
  .hero-title,
  .hero-subtitle,
  .welcome-title,
  .hero-badge,
  .hero-badge *,
  .hero-glass-card,
  .card,
  .feature-card,
  .panel,
  .dashboard-card,
  .deck-card,
  .modal-content,
  .focus-container,
  .cta-btn,
  .cta-group,
  .module-card,
  .modal-card,
  .analytics-card,
  .analytics-stat-card,
  .podium-card,
  .leaderboard-row {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
  }

  /* Prevent hero card from floating/repainting continuously on mobile GPUs */
  .hero-glass-card {
    animation: none !important;
  }

  /* Fix welcome title rendering on touch/mobile to prevent transparent text glyphs */
  .welcome-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    text-shadow: none !important;
  }

  /* Ensure all CTA buttons and their children (icons/spans) stay visible */
  .cta-btn,
  .cta-btn span,
  .cta-btn .btn-icon,
  .cta-btn .btn-sparkle {
    opacity: 1 !important;
    visibility: visible !important;
    color: #ffffff !important;
  }

  .hero-badge {
    color: #c084fc !important;
    background: rgba(139, 92, 246, 0.2) !important;
  }

  .hero-badge span {
    color: #c084fc !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .hero-badge .badge-sparkle {
    color: #f43f5e !important;
  }

  /* Prevent mobile tap highlight overlay from causing container flashing */
  * {
    -webkit-tap-highlight-color: transparent !important;
  }
}

/* ==============================================================================
   MOBILE-ONLY PERFORMANCE OPTIMIZATION & GPU SMOOTHING (<= 768px)
   ============================================================================== */

@media (max-width: 768px) {
  /* 1. Replace expensive transparent glass with solid semi-transparent dark layers */
  .glass, .glass-panel, .modal-content, .card-surface, .nav-bar, header,
  .modal-card, .module-card, .deck-card, .fullscreen-study-view, .arcade-modal-card,
  .analytics-card, .analytics-stat-card, .podium-card, .leaderboard-row,
  .hero-glass-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(15, 17, 26, 0.96) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  }

  /* 2. Simplify text shadows */
  * {
    text-shadow: none !important;
  }

  /* 3. Enable hardware acceleration for smooth card flips and scrolling */
  .flashcard, .card-inner, .card-face, .study-container,
  .study-card-3d, .study-card-inner, .study-card-face, .study-card-front, .study-card-back,
  .study-view-container {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
  }

  /* 4. Ensure smooth touch scrolling */
  body, .scroll-area, .deck-list, .fullscreen-view-body, .modal-card, .fc-storage-grid {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

