/* Design System & Variables (Stabraq Exact Match) */
:root {
  /* Exact Stabraq Colors */
  --bg-body: #262a33;
  --bg-section: #1d2129;
  --bg-card: #262a33;
  --bg-card-hover: rgba(38, 42, 51, 0.8);

  --text-main: #ffffff;
  --text-primary: #ffffff;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.1);

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;

  /* Typography */
  --font-sans: 'Poppins', sans-serif;

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 20px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;

  /* Radii */
  --radius-card: 12px;
  --radius-section: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.8s ease-in-out;
  --transition-smooth: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-body);
  background-image: linear-gradient(rgba(38, 42, 51, 0.8), rgba(38, 42, 51, 0.95)), url('./img/bg_header.png');
  background-attachment: fixed;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-socials {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.social-icon {
  width: 20px;
  height: 20px;
  color: #fe6100;
  /* Stabraq Accent Orange */
  transition: transform var(--transition-fast);
}

.social-icon:hover {
  transform: translateY(-2px);
}

.social-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

/* Layout Utilities */
.container {
  max-width: 800px;
  /* Slightly wider for better desktop presence */
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

.align-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.mt-4 {
  margin-top: var(--spacing-md);
}

.mt-8 {
  margin-top: var(--spacing-lg);
}

/* Typography Utilities */
h1,
h2,
h3,
.logo {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 16px;
  max-width: 800px;
  z-index: 100;
  background: var(--bg-section);
  border-radius: var(--radius-full);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  /* Robust centering without transform to prevent fixed jitter */
  left: 16px;
  right: 16px;
  margin: 0 auto;
}

.nav-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--text-main);
  color: var(--bg-body);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Navbar Toggle Button (Hamburger) */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-nav-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Dropdown Menu Styles (Refined Structural Fix) */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 12px;
  /* Invisible bridge */
  min-width: 180px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  transition-delay: 0.3s;
}

.dropdown-menu {
  background: var(--bg-section);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.dropdown-menu a {
  color: var(--text-muted);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  padding-left: 20px;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
}

.dropdown:hover .nav-btn {
  opacity: 1;
}

/* Main Grid (Stabraq Style layout) */
.main-grid {
  margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-xl);
}

/* Stabraq Section Wrapper */
.glass-panel {
  background: var(--bg-section);
  border-radius: var(--radius-section);
  padding: 6px;
  /* Outer padding holding inner cards */
  transition: transform var(--transition-fast);
}

.glass-panel:hover {
  transform: translateY(-2px);
}

/* Inner Card (Stabraq cutout effect) */
.inner-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Base Bento Box without outer wrapper */
.bento-box {
  padding: var(--spacing-lg);
}

/* For elements inside rows */
.grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

.stack-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Responsive Grid */
.feature-item {
  background: var(--bg-section);
  padding: var(--spacing-md);
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition-fast);
}

.feature-item:hover {
  background: var(--bg-panel-hover);
}

@media (max-width: 600px) {
  .grid-row[style*="repeat(3"] {
    grid-template-columns: 1fr !important;
  }
}

/* Hero Section */
.hero {
  min-height: 50vh;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle glow behind hero text */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 150px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.2), transparent 70%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.sm {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.full-width {
  width: 100%;
}

.primary-btn {
  background-color: var(--accent-primary);
  color: #fff;
}

.primary-btn:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.secondary-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
}

.glass-btn {
  backdrop-filter: blur(8px);
}

/* Content Sections */
.section-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-md);
}

.lore p {
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  color: #4ade80;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-lg);
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #4ade80;
  border-radius: 50%;
}

.pulse {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.status-text {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Stats List */
.server-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.stats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  flex-grow: 1;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stats-list li:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 600;
  font-family: var(--font-sans);
}

/* Stabraq "Projects" style Servers Section */
.server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.server-card:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.server-icon {
  width: 50px;
  height: 50px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.server-info {
  flex-grow: 1;
}

.server-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.server-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-section);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background var(--transition-fast);
}

.server-card:hover .arrow-btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.arrow-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding-bottom: 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 100%;
}

.footer-left {
  justify-self: start;
}

.footer-left p {
  margin: 0;
  opacity: 0.6;
}

.footer-center {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 32px;
}

.footer-center a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 4px 0;
}

.footer-center a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width 0.2s ease;
}

.footer-center a:hover {
  color: #fff;
}

.footer-center a:hover::after,
.footer-center a.active::after {
  width: 100%;
}

.footer-center a.active {
  color: #fff;
}

.footer-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.footer-counter:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
  .footer-content {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
    text-align: center;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    justify-self: center;
  }

  .footer-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Streamer Refactor Layout */
.streamer-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--spacing-md);
  align-items: start;
}

.streamer-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.streamer-item {
  background: var(--bg-section);
  padding: 10px 12px;
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.streamer-item.active .mini-avatar {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.streamer-item .name {
  font-weight: 500;
  font-size: 0.9rem;
  flex-grow: 1;
}

.streamer-item .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #444;
}

.streamer-item.online .status-dot {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

/* Detail Card */
.streamer-detail {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.streamer-detail-content {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.8s ease;
}

.streamer-detail-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* General Responsiveness */
@media (max-width: 768px) {
  .streamer-layout {
    grid-template-columns: 1fr;
  }

  .grid-row {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 8px 16px;
  }

  .logo {
    font-size: 1.1rem;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: 16px;
    right: 16px;
    background: var(--bg-section);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    display: block;
    font-size: 1rem;
    padding: 8px 0;
    width: 100%;
    text-align: center;
  }

  .nav-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    position: static;
    display: block;
    width: 100%;
    padding-top: 8px;
    min-width: unset;
  }

  .dropdown-menu {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    box-shadow: none;
  }

  .dropdown-menu a {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 0.9rem;
  }

  .navbar {
    top: 8px;
    width: calc(100% - 16px);
  }
}

/* Entrance Animations */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.animate-in.reveal {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fade-in-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger indices for animation */
.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.delay-5 {
  animation-delay: 1.0s;
}

.delay-6 {
  animation-delay: 1.2s;
}

/* ── Click Crown Sparkle ── */
.click-crown {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: crown-pop 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  color: #ffd700;
  filter: drop-shadow(0 0 6px #ffd700aa);
}

@keyframes crown-pop {
  0% {
    transform: translate(-50%, -110%) scale(0);
    opacity: 1;
  }

  40% {
    transform: translate(-50%, -130%) scale(1.3);
    opacity: 1;
  }

  70% {
    transform: translate(-50%, -120%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -140%) scale(0.8);
    opacity: 0;
  }
}

.click-sparkle {
  position: fixed;
  z-index: 99998;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: sparkle-fly 0.6s ease-out forwards;
  box-shadow: 0 0 4px currentColor;
}

@keyframes sparkle-fly {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
    opacity: 0;
  }
}

/* -- Music Toggle Button -- */
.music-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.music-btn.music-muted {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.06);
}

.music-btn svg {
  display: block;
}

/* -- Circular Video Modal -- */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background 0.35s ease;
  padding: 20px;
}

.video-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.video-circle-wrap {
  position: relative;
  width: min(88vw, 560px);
  height: min(88vw, 560px);
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.35), 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.5);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  background: #000;
}

.video-modal-overlay.open .video-circle-wrap {
  transform: scale(1);
}

.video-circle-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.video-modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 40, 0.85);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 100000;
  backdrop-filter: blur(4px);
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.hero-avatar {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.4);
}

/* -- Visitor Counter -- */
.footer-counter {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  gap: 2px;
}

#visitor-count {
  font-weight: 600;
  color: var(--text-main);
}

/* -- Footer Counter Tooltip -- */
.footer-counter {
  position: relative;
  cursor: default;
}

.footer-counter::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(20, 23, 30, 0.97);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

.footer-counter::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(20, 23, 30, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
}

.footer-counter:hover::after,
.footer-counter:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* -- Server Click Count -- */
.server-clicks {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.server-click-count {
  font-weight: 600;
  color: var(--accent-primary);
}

/* -- Custom Poring Cursor -- */
*,
*::before,
*::after {
  cursor: none !important;
}

#poring-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  pointer-events: none;
  z-index: 2000000;
  image-rendering: pixelated;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.3s ease-out;
}

/* -- Cursor Selector UI -- */
.cursor-selector {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-right: 12px;
}

.cursor-option {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}

.cursor-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.cursor-option.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.cursor-option img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.cursor-option:hover img,
.cursor-option.active img {
  opacity: 1;
}

/* -- Disable Text Selection -- */
* {
  user-select: none;
  -webkit-user-select: none;
}


/* -- Right-Click Emote Effect -- */
.right-click-emote {
  position: fixed;
  pointer-events: none;
  z-index: 2000001;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px #fe6100);
  animation: floatFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes floatFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1);
  }
}

/* -- Magic Dust & Scroll Reveal -- */
#magic-dust-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -- Boss Mode (JABU) -- */
body.boss-mode {
  --accent-primary: #ffd700;
  --accent-primary-hover: #ffcc00;
}

/* Flash overlay moved to pseudo-element to protect layout containers */
body.boss-mode::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1999999;
  animation: bossFlash 0.8s ease-out;
}

body.boss-mode .social-icon {
  color: #ffd700 !important;
}

body.boss-mode .join-btn,
body.boss-mode .music-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00) !important;
  color: #000 !important;
}

body.boss-mode .logo,
body.boss-mode .splash-title {
  color: #ffd700 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

body.boss-mode .nav-link:hover,
body.boss-mode .nav-link.active {
  color: #ffd700 !important;
}

/* Cinematic Logo Swap */
body.boss-mode .logo img,
body.boss-mode .splash-logo,
body.boss-mode .hero-avatar img {
  content: url('./img/jabu2.png');
}

@keyframes bossFlash {
  0% {
    backdrop-filter: brightness(3) saturate(2);
    background: rgba(255, 215, 0, 0.1);
  }

  100% {
    backdrop-filter: brightness(1) saturate(1);
    background: transparent;
  }
}

/* -- Avatar Video Badge -- */
.hero-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto 20px;
}

.hero-avatar-wrap .hero-avatar {
  margin: 0;
}

.avatar-video-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 23, 30, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.avatar-video-badge svg {
  width: 14px;
  height: 14px;
  color: #fff;
  flex-shrink: 0;
  margin-left: 1px;
}

.avatar-video-badge:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.12);
}

/* -- Splash Screen -- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-section);
  transition: opacity 0.6s ease;
  pointer-events: none;
  /* Let touches hit the body beneath to unlock audio instantly */
}

#splash.splash-hide {
  opacity: 0;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: splash-rise 0.5s ease forwards;
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
}

.splash-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-main);
}

.splash-bar {
  width: 160px;
  height: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.splash-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: 4px;
  animation: splash-load 1.4s ease forwards;
}

@keyframes splash-load {
  0% {
    width: 0%;
  }

  100% {
    width: 100%;
  }
}

/* -- Screenshot Slider -- */
.slider-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.slider-slide {
  min-width: 100%;
  position: relative;
  aspect-ratio: 21 / 7;
  /* Reduced height */
  overflow: hidden;
  cursor: pointer;
}

.slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 23, 30, 0.75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s;
}

.slider-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-50%) scale(1.08);
}

.slider-prev {
  left: 10px;
}

.slider-next {
  right: 10px;
}

.slider-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.slider-dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
}

/* -- Jabu's Journey (Steps Counter) -- */
#jabu-steps-container {
  margin-top: 10px;
  overflow: hidden;
}

.step-counter-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.journey-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center horizontally */
  text-align: center;
  /* Center text */
  flex: 1;
}

.step-icon {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
  animation: float-jabu 4s ease-in-out infinite;
  margin-bottom: 10px;
}

#spinning-jabu {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

@keyframes float-jabu {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

.step-info {
  flex: 1;
}

.stats-grid {
  display: flex;
  gap: 80px;
  margin: 10px 0 15px;
}

.stats-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.step-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.count-number {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(to right, #fff, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
  letter-spacing: -2px;
}

.stats-row .count-number {
  font-size: 3.5rem;
}

.count-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.step-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 500px;
  margin-bottom: 0;
}

.poring-target-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

#poring-target {
  width: 60px;
  height: auto;
  image-rendering: pixelated;
  transition: all 0.1s ease;
}

#poring-target.crit-img {
  width: 120px;
  transform: translateX(25%);
}

.poring-target-wrap.attacked {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.hit-indicator {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: #ef4444;
  font-weight: 800;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.hit-indicator.crit {
  color: #fbbf24;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

.damage-info-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 5;
}

.damage-info-btn:hover {
  background: rgba(59, 130, 246, 0.6);
  color: #fff;
  transform: scale(1.1);
  border-color: rgba(59, 130, 246, 0.8);
}

.floating-damage-display {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.85);
  /* Match poring circle bg slightly darker */
  border: 1px solid rgba(59, 130, 246, 0.6);
  /* Blue border */
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  z-index: 10;
}

.floating-damage-display.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.floating-damage-display .count-number {
  font-size: 1.3rem;
  margin-bottom: 0px;
  background: none;
  /* Override gradient */
  -webkit-text-fill-color: #fca5a5;
  /* Light red */
  color: #fca5a5;
  text-shadow: 0 0 8px rgba(252, 165, 165, 0.4);
}

.floating-damage-display .count-label {
  font-size: 0.6rem;
}


.poring-target-wrap.attacked .hit-indicator {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.poring-target-wrap.attacked .hit-indicator.crit {
  transform: translateX(-50%) translateY(-15px) scale(1.2);
}

@media (max-width: 900px) {
  .stats-grid {
    gap: 20px;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .step-counter-card {
    flex-direction: column;
    text-align: left;
    gap: 40px;
    padding: 30px 20px !important;
  }

  .poring-target-wrap {
    order: -1;
  }

  .count-number {
    font-size: 2.8rem;
  }

  .step-text {
    margin: 0 auto;
  }
}

/* -- Screenshot Lightbox -- */
.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.screenshot-lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  z-index: 1;
  background: var(--bg-section);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  width: fit-content;
  height: fit-content;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: lightbox-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screenshot-lightbox.closing .lightbox-container {
  animation: lightbox-out 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screenshot-lightbox.closing .lightbox-overlay {
  opacity: 0;
  transition: opacity 0.8s ease;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes lightbox-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(38, 42, 51, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.zoom-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
}

.zoom-btn svg {
  width: 18px;
  height: 18px;
}

.zoom-indicator {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.div-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
}

.reset-text {
  width: auto;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 8px;
}

.lightbox-content {
  overflow: auto;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: grab;
}

.lightbox-nav {
  position: absolute;
  bottom: 20px;
  width: 40px;
  height: 40px;
  background: rgba(20, 23, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-content:active {
  cursor: grabbing;
}

.lightbox-content img {
  display: block;
  max-width: 800px;
  max-height: 600px;
  width: auto;
  height: auto;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
  position: relative;
  z-index: 1;
}

.lightbox-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.8s ease;
}

.lightbox-close:hover {
  background: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

/* -- Playable Novice Character -- */
#novice-player {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200000;
  pointer-events: none;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

#novice-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}


#wasd-hint {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 23, 30, 0.9);
  color: #fff;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

#wasd-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
}

.sit-emote {
  position: absolute;
  top: -24px;
  left: 25%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
  animation: sitEmotePop 1.5s ease forwards;
}

@keyframes sitEmotePop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }

  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(0px);
  }

  80% {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
}

.talk-emote {
  position: absolute;
  top: 5px;
  left: 85%;
  width: auto;
  height: auto;
  image-rendering: pixelated;
  pointer-events: none;
  animation: talkEmotePop 1.2s ease-out forwards;
}

@keyframes talkEmotePop {
  0% {
    opacity: 0;
    transform: scale(0.4) translateY(5px);
  }

  25% {
    opacity: 1;
    transform: scale(1.1) translateY(0);
  }

  70% {
    opacity: 1;
    transform: scale(1) translateY(-4px);
  }

  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
}

/* -- Keyboard Controls Icon & Modal -- */
.kbd-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 12px;
}

.kbd-toggle-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.kbd-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.kbd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kbd-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.kbd-modal {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.kbd-modal-overlay.active .kbd-modal {
  transform: scale(1) translateY(0);
}

.kbd-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.kbd-modal-header svg {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.kbd-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.kbd-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kbd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kbd-item:last-child {
  border-bottom: none;
}

.kbd-keys {
  display: flex;
  gap: 6px;
}

/* ──────────────────────────────────────────────────────────────────────────
   AI Chat Box (JABU Bot)
   ────────────────────────────────────────────────────────────────────────── */

#jabu-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 540px;
  max-height: calc(100vh - 100px);
  background: rgba(29, 33, 41, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
  /* High Z-index */
  overflow: hidden;
}

#jabu-chat-widget.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.chat-header {
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-bot-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  object-fit: cover;
}

.chat-bot-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.chat-bot-info p {
  font-size: 0.75rem;
  color: var(--accent-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-bot-info p::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.chat-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.chat-close:hover {
  color: #fff;
}

#jabu-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
#jabu-chat-body::-webkit-scrollbar {
  width: 5px;
}

#jabu-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.6;
  position: relative;
  animation: msgAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgAppear {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.bot {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-msg.user {
  background: var(--accent-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-footer {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.faq-btn::after {
  content: '→';
  opacity: 0.5;
  transition: transform 0.3s;
}

.faq-btn:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
  border-color: var(--accent-primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(59, 130, 246, 0.1);
}

.faq-btn:hover::after {
  transform: translateX(4px);
  opacity: 1;
}

.faq-btn:active {
  transform: translateY(0) scale(0.98);
}

.quick-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-input-area {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.3s ease;
}

.chat-input-area:focus-within {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

#jabu-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 4px 0;
  outline: none;
  resize: none;
  max-height: 100px;
  font-family: inherit;
  line-height: 1.4;
}

#jabu-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#jabu-chat-send {
  background: var(--accent-primary);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-end;
  color: #fff;
  flex-shrink: 0;
}

#jabu-chat-send:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

#jabu-chat-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  align-self: flex-start;
  margin-bottom: 8px;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-5px);
  }
}

.kbd-key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  min-width: 32px;
  text-align: center;
}

.kbd-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.kbd-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.kbd-modal-close:hover {
  color: #fff;
}

/* ── Custom Scrollbar ──────────────────────────────────────────────── */
/* Webkit (Chrome, Edge, Safari) */
:root {
  --scrollbar-thumb: rgba(59, 130, 246, 0.6);
  --scrollbar-thumb-hover: rgba(59, 130, 246, 1);
  --scrollbar-track: rgba(29, 33, 41, 0.5);
  --scrollbar-size: clamp(1px, 0.08vw, 1px);
}

body.boss-mode {
  --scrollbar-thumb: rgba(255, 215, 0, 0.7);
  --scrollbar-thumb-hover: rgba(255, 215, 0, 1);
  --scrollbar-track: rgba(15, 10, 0, 0.6);
}

/* Direct targeting so pseudo-elements actually pick up boss-mode colors */
body.boss-mode ::-webkit-scrollbar-thumb,
body.boss-mode::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.7);
}

body.boss-mode ::-webkit-scrollbar-thumb:hover,
body.boss-mode::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 1);
}

body.boss-mode ::-webkit-scrollbar-track,
body.boss-mode::-webkit-scrollbar-track {
  background: rgba(15, 10, 0, 0.6);
}

::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 99px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ── Mobile Game Controls ────────────────────────────────────────── */
#mobile-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
  z-index: 150000;
  display: none;
  /* Hidden by default */
}

/* Show only on touch devices or small screens */
@media (max-width: 1024px),
(pointer: coarse) {
  #mobile-controls {
    display: block;
  }

  /* Hide the WASD hint on mobile since they have buttons */
  #wasd-hint {
    display: none !important;
  }
}

#joystick-boundary {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
}

#joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  pointer-events: none;
}

#mobile-attack-btn {
  position: absolute;
  bottom: 40px;
  right: 40px;
  width: 80px;
  height: 80px;
  background: rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(8px);
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
  transition: transform 0.1s;
}

#mobile-attack-btn:active {
  transform: scale(0.9);
  background: var(--accent-primary);
}

#mobile-attack-btn svg {
  width: 32px;
  height: 32px;
}

/* Boss Mode Mobile Variations */
body.boss-mode #joystick-knob {
  background: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

body.boss-mode #mobile-attack-btn {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

body.boss-mode .move-target-marker {
  border-color: #ffd700;
}

/* Tap-to-move Marker */
.move-target-marker {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  animation: markerRipple 0.6s ease-out forwards;
}

@keyframes markerRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    border-width: 4px;
  }

  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
    border-width: 1px;
  }
}

/* Roadmap Endless Loop Styles */
.roadmap-container {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: hidden;
  perspective: 1000px;
  background-color: #0c0e12;
  /* Deep night base */
  border-radius: var(--radius-card);
  margin-top: 20px;
}

.sky-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    url('./img/clouds.png') repeat-x top/auto 40%,
    url('./img/moon-stars.png') no-repeat center center/cover;
  z-index: 1;
  animation: breathe 10s ease-in-out infinite, moveClouds 100s linear infinite;
}

@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes moveClouds {
  from {
    background-position: 0 0, center center;
  }

  to {
    background-position: -2000px 0, center center;
  }
}

/* Road background - separate to allow sky to breathe behind it */
.road-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110%;
  /* Extend 10% below container to guarantee no gap */
  background: url('./img/desert-road.png') no-repeat center bottom / 100% 100%;
  z-index: 2;
  pointer-events: none;
}

.roadmap-novice {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  /* Remove fixed width to restore default sprite size */
  max-width: 150px;
  /* Optional cap just in case */
  z-index: 10;
  transition: bottom 0.2s ease, transform 0.2s ease;
}

.milestone-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 3;
  /* Must be > road-background (2) */
}

.milestone-card {
  position: absolute;
  top: 55%;
  left: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-card);
  padding: 15px 20px;
  white-space: nowrap;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translate3d(-50%, -50%, -1000px);
  opacity: 0;
  z-index: 5;
}

.milestone-year {
  color: var(--accent-primary);
  font-size: 1.2rem;
  display: block;
  margin-bottom: 5px;
}

.milestone-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Realistic Road Particles & Texture */
.road-particle,
.road-speck {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
}

.road-particle {
  width: 3px;
  height: 3px;
}

.road-speck {
  position: absolute;
  top: 90%;
  /* Ground on road */
  left: 50%;
  width: 4px;
  /* Larger */
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  /* Brighter */
}

.roadside-object {
  position: absolute;
  top: 55%;
  /* Start at horizon */
  pointer-events: none;
  z-index: 3;
}

.fog-particle {
  background: radial-gradient(circle, rgba(200, 200, 220, 0.25) 0%, rgba(200, 200, 220, 0) 70%);
  border-radius: 50%;
  filter: blur(8px);
  transform-origin: center;
}



/* Moving Road Stripes - HIDDEN */
.road-stripe {
  display: none !important;
}

/* ── Boss Mode Novice Effects (index / streamers / team) ──────────── */
.novice-boss-fx {
  position: relative;
  display: inline-block;
}

/* Gold ground aura */
.nb-aura {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 200, 0, 0.55) 0%, rgba(255, 140, 0, 0.2) 60%, transparent 100%);
  filter: blur(3px);
  animation: nbAuraPulse 1.2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
  display: none;
}

.nb-outer-glow {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.28) 0%, transparent 70%);
  filter: blur(6px);
  animation: nbAuraPulse 1.8s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
  display: none;
}

@keyframes nbAuraPulse {
  from {
    opacity: 0.6;
    transform: translateX(-50%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
}

/* SVG lightning layer */
.nb-lightning-svg {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
  display: none;
}

/* Orbiting gold particles */
.nb-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe44d;
  box-shadow: 0 0 6px #ffd700, 0 0 12px #ff8c00;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  display: none;
}

/* Show all effects only in boss mode */
body.boss-mode .nb-aura,
body.boss-mode .nb-outer-glow,
body.boss-mode .nb-lightning-svg,
body.boss-mode .nb-particle {
  display: block;
}