/* ==========================================================================
   ZPLAYBOX - Core Design System & Layout Styles
   Canonical Domain: https://zplaybox.in
   Brand Accent: #10B981 (Emerald Green)
   ========================================================================== */

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

/* Fallback protection for mobile page search in desktop */
.mobile-page-search-container {
  display: none;
}
.mobile-search-input-wrapper svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
}

:root {
  /* Spacing System Tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* Color Palette - Refined Clean Gaming Platform Theme */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-dark-player: #090d16;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #10b981;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Brand Green */
  --brand-primary: #10b981;
  --brand-primary-hover: #059669;
  --brand-primary-light: #ecfdf5;
  --brand-primary-glow: rgba(16, 185, 129, 0.18);
  --brand-accent: #047857;
  
  /* Status Colors */
  --color-gold: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Typography - Clean Modern UI Font */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-logo: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Layout Dimensions */
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 72px;
  --header-height: 68px;
  --mobile-nav-height: 62px;
  --container-max-width: 1400px;
  
  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 6px 14px -2px rgba(15, 23, 42, 0.06), 0 3px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 28px -4px rgba(15, 23, 42, 0.08), 0 6px 12px -4px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 12px 24px -4px rgba(16, 185, 129, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.06);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS Reset & Defaults */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-body);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  user-select: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Accessibility: Focus visible */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link */
.skip-to-content {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 9999;
  background: var(--brand-primary);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-to-content:focus {
  top: 15px;
}

/* App Shell Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Desktop Sidebar
   -------------------------------------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition-normal), transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-logo);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.3));
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}

.sidebar-logo:hover .brand-logo-img,
.header-brand-logo:hover .brand-logo-img {
  transform: scale(1.06) rotate(10deg);
}

.logo-badge {
  display: none;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-logo);
  font-weight: 800;
  letter-spacing: -0.035em;
  user-select: none;
}
.brand-text .brand-name {
  color: var(--text-primary);
  font-weight: 800;
}
.brand-text .brand-box {
  color: var(--brand-primary);
  font-weight: 800;
}

.sidebar-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 14px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-link:hover svg {
  color: var(--brand-primary);
  transform: scale(1.05);
}

.nav-link.active {
  background: var(--brand-primary-light);
  color: var(--brand-accent);
}

.nav-link.active svg {
  color: var(--brand-primary);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.nav-link.active .nav-badge {
  background: var(--brand-primary);
  color: #ffffff;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.surprise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all var(--transition-fast);
}

.surprise-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  filter: brightness(1.04);
}

.surprise-btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.app-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-normal);
}

/* --------------------------------------------------------------------------
   Sticky Header & Top Bar Navigation
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 30;
  gap: 16px;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

@media (max-width: 1024px) {
  .sidebar-toggle-btn {
    display: flex;
  }
}

.sidebar-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--brand-primary);
}

.sidebar-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-only-brand {
  display: none !important;
}

@media (max-width: 1024px) {
  .mobile-only-brand {
    display: flex !important;
  }
}

.header-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-logo);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  text-decoration: none;
}

.header-top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.top-nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.top-nav-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.top-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.top-nav-link:hover svg {
  color: var(--brand-primary);
}

.top-nav-link.active {
  color: var(--brand-accent);
  background: var(--brand-primary-light);
}

.top-nav-link.active svg {
  color: var(--brand-primary);
}

.top-nav-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.top-nav-link.active .top-nav-badge {
  background: var(--brand-primary);
  color: #ffffff;
}

.header-search-container {
  flex-grow: 1;
  max-width: 480px;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 14px;
  height: 42px;
  gap: 10px;
  transition: all var(--transition-fast);
}

.search-brand-icon {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.search-brand-badge {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.search-input-wrapper:focus-within {
  background: var(--bg-surface);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.search-input-wrapper svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  display: none;
  padding: 4px;
  color: var(--text-muted);
  border-radius: var(--radius-full);
}
.search-clear-btn:hover {
  color: var(--text-primary);
}
.search-clear-btn.visible {
  display: flex;
}

.mobile-search-close-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  flex-shrink: 0;
}

.mobile-search-close-btn:hover {
  color: var(--text-primary);
}

/* Live Search Suggestions Dropdown */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  max-height: 440px;
  overflow-y: auto;
  z-index: 60;
  display: none;
  flex-direction: column;
  padding: 6px;
  -webkit-overflow-scrolling: touch;
}

.search-suggestions-dropdown.active {
  display: flex;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: 52px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.suggestion-item:hover, 
.suggestion-item.selected,
.suggestion-item:active {
  background: var(--bg-subtle);
}

.suggestion-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-hover);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.suggestion-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestion-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.suggestion-footer-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  min-height: 44px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.suggestion-footer-action:hover,
.suggestion-footer-action:active {
  background: var(--brand-primary-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all var(--transition-fast);
}

.mobile-search-btn {
  display: none;
}

.header-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-icon-btn svg {
  width: 19px;
  height: 19px;
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* --------------------------------------------------------------------------
   Brand Intro / Loading Screen Overlay
   -------------------------------------------------------------------------- */
.brand-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #090d16;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 280ms cubic-bezier(0.4, 0, 0.2, 1), transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: all;
}

.brand-intro-overlay.intro-fading {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.intro-content-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  gap: 16px;
  padding: 24px;
}

.intro-icon-box {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-glow-ring {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, rgba(16, 185, 129, 0.05) 65%, transparent 80%);
  filter: blur(8px);
  animation: introGlowPulse 1.2s ease-in-out infinite;
}

.intro-brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(16, 185, 129, 0.4));
  animation: introLogoSpin 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-wordmark {
  font-family: var(--font-logo);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  display: flex;
  align-items: baseline;
  animation: introTextSlide 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.intro-wordmark .brand-name {
  color: #ffffff;
}

.intro-wordmark .brand-box {
  color: #10b981;
}

.intro-tagline {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
  animation: introTextSlide 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.48s both;
}

@keyframes introLogoSpin {
  0% {
    opacity: 0;
    transform: scale(0.65) rotate(-30deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.06) rotate(360deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(360deg);
  }
}

@keyframes introGlowPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

@keyframes introTextSlide {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Page View & Container
   -------------------------------------------------------------------------- */
.content-wrapper {
  flex-grow: 1;
  padding: 28px;
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Mobile Bottom Navigation
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  z-index: 45;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
  justify-content: space-around;
  align-items: center;
  padding-left: 6px;
  padding-right: 6px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color var(--transition-fast);
  position: relative;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 28px 28px;
}

.footer-inner {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 340px;
}

.footer-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  max-width: var(--container-max-width);
  margin: 36px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  animation: toastSlideIn 240ms ease forwards;
  max-width: 340px;
  border-left: 4px solid var(--brand-primary);
}

.toast.toast-error {
  border-left-color: var(--color-danger);
}

/* --------------------------------------------------------------------------
   Banner Image Button Section
   -------------------------------------------------------------------------- */
.banner-button-section {
  margin-bottom: 32px;
  width: 100%;
}

.image-banner-btn {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
  background: var(--bg-surface);
}

.image-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 380px;
  aspect-ratio: 16 / 5.5;
}

/* --------------------------------------------------------------------------
   Sidebar Badges & Close Button
   -------------------------------------------------------------------------- */
.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg-subtle);
}

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

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

.nav-badge-pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--brand-primary-light);
  color: var(--brand-accent);
}

.nav-badge-hot {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 48;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Product Modals (Tools, Marketplace, Cloud, SDK, Community)
   -------------------------------------------------------------------------- */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal-overlay.active {
  display: flex;
}

.product-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  animation: modalScaleIn 200ms ease forwards;
}

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

.product-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.product-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-primary-light);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-icon-badge svg {
  width: 24px;
  height: 24px;
}

.product-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.product-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: var(--bg-subtle);
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

/* Tools Grid inside modal */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tool-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.tool-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

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

.tool-metric-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tool-metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-accent);
  font-family: var(--font-display);
}

.tool-metric-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tool-run-btn {
  padding: 8px 14px;
  background: var(--brand-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  transition: all var(--transition-fast);
}

.tool-run-btn:hover {
  background: var(--brand-accent);
}

.reaction-test-box {
  height: 90px;
  border-radius: var(--radius-md);
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  text-align: center;
  padding: 10px;
  transition: background 150ms ease;
}

.reaction-test-box.waiting {
  background: #ef4444;
}

.reaction-test-box.ready {
  background: #10b981;
}

.reaction-test-box.error {
  background: #f59e0b;
}

.gamepad-status-display {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 54px;
}

/* Marketplace styles */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.market-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.market-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.market-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.market-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
  flex-grow: 1;
}

.market-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.market-price {
  font-weight: 800;
  color: #10b981;
  font-size: 0.9rem;
}

.market-btn {
  padding: 6px 12px;
  background: var(--brand-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
}

.market-btn:hover {
  background: var(--brand-accent);
}

.cloud-info-box, .sdk-guide-box, .community-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.cloud-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-accent);
  background: var(--brand-primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.sdk-steps {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
}

/* ==========================================================================
   Wallpapers Page & Feature Showcase
   ========================================================================== */
.wallpapers-hero {
  background: linear-gradient(135deg, #090d16 0%, #0f172a 100%);
  border-radius: var(--radius-xl);
  padding: 36px 30px;
  color: #ffffff;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.wallpapers-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.wallpapers-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.wallpapers-hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: #ffffff;
}

.wallpapers-hero-desc {
  font-size: 0.96rem;
  color: #94a3b8;
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.wallpapers-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all var(--transition-fast);
}

.wallpapers-cta-btn:hover {
  background: var(--brand-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
  color: #ffffff;
}

.wallpapers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.wallpaper-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.wallpaper-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-card-hover);
}

.wallpaper-cover-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #090d16;
  overflow: hidden;
}

.wallpaper-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.wallpaper-card:hover .wallpaper-img {
  transform: scale(1.05);
}

.wallpaper-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wallpaper-res-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.wallpaper-content {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

.wallpaper-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.wallpaper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wallpaper-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.wallpaper-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.wallpaper-download-btn {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.wallpaper-download-btn:hover {
  background: var(--brand-accent);
  color: #ffffff;
}

.wallpaper-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.wallpaper-preview-btn:hover {
  background: var(--bg-hover);
  color: var(--brand-primary);
}

.wallpapers-explore-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .wallpapers-hero {
    padding: 24px 18px;
  }
  .wallpapers-hero-title {
    font-size: 1.5rem;
  }
  .wallpapers-grid {
    grid-template-columns: 1fr;
  }
}

