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

:root {
  --color-primary: #f59e0b;
  --color-primary-rgb: 245, 158, 11;
  --color-bg: #09090b;
  --color-card-bg: #111113;
  --color-card-header-bg: #161619;
  --color-border: #1f1f23;
  --color-text-primary: #ffffff;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #52525b;
  --font-family: "Outfit", sans-serif;
  --glow-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  --glow-shadow-hover: 0 0 35px rgba(245, 158, 11, 0.5);

  /* Additional layout variables for theme toggling */
  --color-header-bg: rgba(17, 17, 19, 0.8);
  --color-dots: rgba(255, 255, 255, 0.025);
  --color-btn-sec-bg: rgba(31, 31, 35, 0.4);

  /* Newly added / mapped UI variables */
  --color-accent: #f59e0b;
  --color-accent-glow: rgba(245, 158, 11, 0.15);
  --color-primary-glow: rgba(245, 158, 11, 0.15);

  /* Alert / Variant colors */
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.03);
  --color-danger-border: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.03);
  --color-warning-border: rgba(245, 158, 11, 0.15);
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.03);
  --color-success-border: rgba(16, 185, 129, 0.2);

  --table-header-bg: #161619;
  --table-row-hover: rgba(255, 255, 255, 0.015);

  --card-border: var(--color-border);
  --sidebar-border: var(--color-border);
  --sidebar-bg: var(--color-card-bg);
  --text-muted: var(--color-text-muted);
  --text-main: var(--color-text-primary);
  --transition-normal: 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --font-heading: "Outfit", sans-serif;
  --toc-active: var(--color-primary);
}

body.light-theme {
  --color-bg: #f5f5f7;
  --color-card-bg: #ffffff;
  --color-card-header-bg: #fafafc;
  --color-border: #e2e2e8;
  --color-text-primary: #111115;
  --color-text-secondary: #52525b;
  --color-text-muted: #8b8b96;
  --color-header-bg: rgba(255, 255, 255, 0.85);
  --color-dots: rgba(0, 0, 0, 0.045);
  --color-btn-sec-bg: rgba(255, 255, 255, 0.8);
  --glow-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
  --glow-shadow-hover: 0 0 30px rgba(245, 158, 11, 0.35);

  /* Light theme mapping variables */
  --color-danger: #dc2626;
  --color-danger-bg: rgba(220, 38, 38, 0.04);
  --color-danger-border: rgba(220, 38, 38, 0.15);
  --color-warning: #d97706;
  --color-warning-bg: rgba(245, 158, 11, 0.04);
  --color-warning-border: rgba(245, 158, 11, 0.15);
  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.04);
  --color-success-border: rgba(5, 150, 105, 0.15);

  --table-header-bg: #fafafc;
  --table-row-hover: rgba(0, 0, 0, 0.015);

  --sidebar-bg: var(--color-card-bg);
  --sidebar-border: var(--color-border);
  --card-border: var(--color-border);
  --text-muted: var(--color-text-muted);
  --text-main: var(--color-text-primary);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Dotted grid background matching game aesthetic */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  background-image: radial-gradient(var(--color-dots) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.8;
}

/* Vignette glow overlay */
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(circle at 50% 30%,
      transparent 10%,
      var(--color-bg) 85%);
  pointer-events: none;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* Header container */
header {
  width: 100%;
  max-width: 800px;
  margin: clamp(12px, 3vw, 24px) auto 0;
  padding: 0 16px;
  z-index: 10;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  height: clamp(28px, 4vw, 36px);
  width: auto;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.logo-section:hover .logo-img {
  transform: scale(1.05) rotate(3deg);
}

.logo-text {
  font-weight: 800;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  text-transform: uppercase;
}

/* Main content limits */
main {
  width: 100%;
  max-width: 800px;
  padding: clamp(10px, 3vw, 20px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 30px);
  z-index: 5;
}

/* Hero elements */
.hero {
  text-align: center;
  padding: clamp(30px, 8vw, 60px) 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle,
      rgba(245, 158, 11, 0.07) 0%,
      transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-icon {
  width: clamp(220px, 35vw, 280px);
  height: clamp(70px, 12vw, 90px);
  object-fit: cover;
  padding: 8px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  background-color: #111113;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(245, 158, 11, 0.25);
  border: 2px solid rgba(245, 158, 11, 0.3);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hero-icon:hover {
  transform: scale(1.06) rotate(-2deg);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(245, 158, 11, 0.5);
  border-color: var(--color-primary);
}

.hero h1 {
  font-size: clamp(2.2rem, 7.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(to bottom, #ffffff 60%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 span {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}

.hero h1 span::after {
  content: "Ø";
  position: absolute;
  right: -20px;
  top: -6px;
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  color: var(--color-primary);
  font-weight: 700;
  opacity: 0.85;
}

.hero-tagline {
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  color: var(--color-text-secondary);
  max-width: 500px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Call-to-action buttons */
.cta-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn {
  font-family: var(--font-family);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 700;
  padding: 12px clamp(24px, 4vw, 32px);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #000000;
  border: 1px solid var(--color-primary);
  box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
  background-color: #fbbf24;
  border-color: #fbbf24;
  box-shadow: var(--glow-shadow-hover);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background-color: var(--color-btn-sec-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background-color: rgba(245, 158, 11, 0.05);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

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

/* Dashed divider styling */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  position: relative;
}

.section-divider-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-text-muted);
  font-weight: 700;
  background-color: var(--color-bg);
  padding: 0 16px;
  z-index: 2;
  position: relative;
}

.section-divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background-image: linear-gradient(to right,
      var(--color-border) 50%,
      transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
  z-index: 1;
}

/* Card Styling mimicking the dashboard look */
.overview-container {
  width: 100%;
}

.dashboard-card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-header {
  padding: 14px 20px;
  background-color: var(--color-card-header-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 span.tag {
  font-size: 0.7rem;
  font-weight: 800;
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  text-transform: uppercase;
}

.card-body {
  padding: clamp(16px, 3.5vw, 24px);
  flex: 1;
  line-height: 1.6;
}

/* About/Overview styling */
.doc-section h2 {
  font-size: clamp(1.2rem, 3.5vw, 1.4rem);
  color: var(--color-primary);
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.doc-section p {
  color: var(--color-text-secondary);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.doc-section p strong {
  color: var(--color-text-primary);
}

/* Footer Section */
footer {
  width: 100%;
  max-width: 800px;
  margin: 40px auto 20px;
  padding: 20px 16px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  z-index: 10;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

#footer-copyright {
  text-align: left;
}

#footer-copyright a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

#footer-copyright a:hover {
  color: var(--color-primary);
}

/* Responsiveness helper for very small mobile screens */
@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* Theme Toggle Button Styles */
.theme-toggle {
  background: rgba(31, 31, 35, 0.4);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  position: absolute;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s;
}

/* In dark theme (default), show sun, hide moon */
body:not(.light-theme) .toggle-sun {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

body:not(.light-theme) .toggle-moon {
  transform: translateY(30px) rotate(90deg);
  opacity: 0;
}

/* In light theme, show moon, hide sun */
body.light-theme .toggle-sun {
  transform: translateY(-30px) rotate(-90deg);
  opacity: 0;
}

body.light-theme .toggle-moon {
  transform: translateY(0) rotate(0);
  opacity: 1;
}

/* Dotted grid background */
.dotted-bg {
  background-image: radial-gradient(var(--bg-grid-color) 1.5px,
      transparent 1.5px);
  background-size: 24px 24px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  z-index: 100;
  transition:
    background-color var(--transition-normal),
    border-color var(--transition-normal);
}

.header-container {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  transition: transform var(--transition-fast);
}

.header-logo-link:hover {
  transform: translateY(-1px);
}

.header-logo-img {
  height: 84px;
  width: auto;
  object-fit: contain;
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--card-border);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--card-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sun-icon {
  display: block;
}

.moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: block;
}

/* Menu Toggle Button (Mobile) */
.menu-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: none;
  /* Desktop only hidden */
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.menu-toggle-btn:hover {
  background: var(--card-border);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.layout-container {
  max-width: 1440px;
  margin: 64px auto 0 auto;
  display: flex;
  position: relative;
}

.main-content {
  flex: 1;
  padding: 40px 24px;
  max-width: 900px;
  margin-right: auto;
  overflow-y: auto;
}

/* Left/Right Sidebar Drawer */
.sidebar-right {
  width: 280px;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  right: 0;
  border-left: 1px solid var(--sidebar-border);
  background-color: var(--sidebar-bg);
  padding: 32px 24px;
  overflow-y: auto;
  z-index: 90;
  transition:
    background-color var(--transition-normal),
    border-color var(--transition-normal);
}

.sidebar-sticky {
  position: sticky;
  top: 0;
}

/* ==========================================================================
   Table of Contents (TOC) Styles
   ========================================================================== */
.toc-title {
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc-nav {
  position: relative;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px solid var(--card-border);
}

.toc-link {
  display: block;
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 4px 0 4px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--text-main);
  border-left-color: var(--text-muted);
}

.toc-link.active {
  color: var(--toc-active);
  font-weight: 600;
  border-left-color: var(--toc-active);
}

/* Overlay for Mobile Menu */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 0 64px 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 48px;
}

.hero-logo-container {
  margin-bottom: 2px;
  /* background-color: red; */
  margin-top: -40px;
}

.hero-logo {
  max-height: 100px;
  width: 100%;
  /* object-fit: contain; */
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  margin-top: -20px;
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 40px;
  font-weight: 400;
  line-height: 1.7;
}

/* Gameplay GIF area */
.gameplay-container {
  width: 100%;
  max-width: 700px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
  margin-bottom: 40px;
  position: relative;
  background-color: #080808;
}

.gameplay-gif {
  width: 100%;
  height: auto;
  display: none;
  /* Hidden until loaded in JS */
}

.gameplay-fallback {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, #141419 0%, #08080a 100%);
}

.fallback-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: var(--color-primary-glow);
  filter: blur(60px);
  border-radius: var(--radius-circle);
  pointer-events: none;
}

.fallback-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: float 4s ease-in-out infinite;
}

.gameplay-fallback h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.gameplay-fallback p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 420px;
}

/* Play button */
.play-button-container {
  display: flex;
  justify-content: center;
}

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background-color: var(--color-primary);
  color: #000000;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  /* box-shadow:
    0 4px 20px var(--color-primary-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3); */
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.play-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  /* background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  ); */
  transform: skewX(-25deg);
  transition: 0.75s ease;
  pointer-events: none;
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
  background-color: #ffb300;
}

.play-button:hover::before {
  left: 120%;
}

.play-button:active {
  transform: translateY(0);
}

.btn-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

/* ==========================================================================
   Documentation Sections
   ========================================================================== */

.doc-section:last-of-type {
  border-bottom: none;
}

.doc-section h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-section h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--card-border);
}

.doc-section p {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 18px;
  line-height: 1.7;
}

.doc-section ul,
.doc-section ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.doc-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.sub-section {
  margin-top: 32px;
  padding-bottom: 16px;
}

.sub-section h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.sub-section h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 10px 0;
}

/* ==========================================================================
   Tables & Badges
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  background-color: var(--color-card-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

th {
  background-color: var(--table-header-bg);
  color: var(--color-text-primary);
  font-weight: 700;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-heading);
}

td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: background-color var(--transition-fast);
  vertical-align: middle;
}

td strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--table-row-hover);
}

.table-caption {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 16px;
  margin-bottom: 24px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .table-caption {
    white-space: normal;
  }
}

.text-center {
  text-align: center;
}

.narrow-table {
  max-width: 480px;
}

.table-container:has(.narrow-table) {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-blue {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-orange {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-red {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stars-gold {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 6px var(--color-primary-glow);
}

/* ==========================================================================
   Alerts and Notices
   ========================================================================== */
.alert-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.danger-alert {
  background-color: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
}

.danger-alert .alert-icon {
  color: var(--color-danger);
}

.info-alert {
  background-color: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
}

.info-alert .alert-icon {
  color: var(--color-warning);
}

.alert-content {
  color: var(--color-text-secondary);
}

.alert-content strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.quote-box {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: var(--color-card-bg);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  margin: 24px 0;
}

.quote-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.quote-box p {
  margin-bottom: 0;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.quote-box p strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.formula-box {
  background-color: var(--code-bg);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-primary);
  text-align: center;
  margin: 16px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Game Mode Cards
   ========================================================================== */
.modes-showcase {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin: 32px 0;
}

.mode-showcase-item {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: stretch;
  position: relative;
}

@media (min-width: 900px) {
  .mode-showcase-item {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }

  .mode-showcase-item:nth-child(even) {
    flex-direction: row-reverse;
  }

  .mode-info-col {
    flex: 1.2;
  }

  .mode-features-col {
    flex: 1;
    min-width: 320px;
  }
}

.mode-info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-info-col p {
  font-size: 0.96rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.mode-features-col {
  display: flex;
  flex-direction: column;
}

.features-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px 28px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Localized radial background glows */
.mode-showcase-item.casual .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(245, 158, 11, 0.04),
      rgba(22, 22, 25, 0.4) 75%);
  border-left: 4px solid var(--color-primary);
}

.mode-showcase-item.competitive .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(239, 68, 68, 0.04),
      rgba(22, 22, 25, 0.4) 75%);
  border-left: 4px solid var(--color-danger);
}

.mode-showcase-item.custom .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(59, 130, 246, 0.04),
      rgba(22, 22, 25, 0.4) 75%);
  border-left: 4px solid #3b82f6;
}

/* Hover effects */
.mode-showcase-item:hover .mode-icon-box {
  transform: scale(1.08);
}

.mode-showcase-item.casual:hover .mode-titles h3 {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.mode-showcase-item.competitive:hover .mode-titles h3 {
  color: var(--color-danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.mode-showcase-item.custom:hover .mode-titles h3 {
  color: #3b82f6;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.mode-showcase-item.casual:hover .features-panel {
  border-color: rgba(245, 158, 11, 0.2);
  background: radial-gradient(circle at bottom right,
      rgba(245, 158, 11, 0.08),
      rgba(22, 22, 25, 0.45) 75%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(245, 158, 11, 0.12);
}

.mode-showcase-item.competitive:hover .features-panel {
  border-color: rgba(239, 68, 68, 0.2);
  background: radial-gradient(circle at bottom right,
      rgba(239, 68, 68, 0.08),
      rgba(22, 22, 25, 0.45) 75%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(239, 68, 68, 0.12);
}

.mode-showcase-item.custom:hover .features-panel {
  border-color: rgba(59, 130, 246, 0.2);
  background: radial-gradient(circle at bottom right,
      rgba(59, 130, 246, 0.08),
      rgba(22, 22, 25, 0.45) 75%);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(59, 130, 246, 0.12);
}

.features-panel strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  color: var(--color-text-primary);
  font-weight: 700;
}

.mode-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.mode-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.casual .mode-icon-box {
  color: var(--color-primary);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}

.competitive .mode-icon-box {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
}

.custom .mode-icon-box {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

.mode-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-titles h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.mode-badge {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.casual .mode-badge {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-primary);
  border-color: rgba(245, 158, 11, 0.2);
}

.competitive .mode-badge {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.custom .mode-badge {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.mode-xp-note {
  font-size: 0.85rem !important;
  line-height: 1.5;
  color: var(--color-text-secondary);
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.015);
  border-left: 3px solid transparent;
}

.casual .mode-xp-note {
  border-left-color: var(--color-primary);
  background: rgba(245, 158, 11, 0.02);
}

.competitive .mode-xp-note {
  border-left-color: var(--color-danger);
  background: rgba(239, 68, 68, 0.02);
}

.custom .mode-xp-note {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.02);
}

#game-modes .features-panel ul {
  list-style: none !important;
  list-style-type: none !important;
  padding-left: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

#game-modes .features-panel li {
  list-style: none !important;
  list-style-type: none !important;
  font-size: 0.88rem !important;
  color: var(--color-text-secondary) !important;
  position: relative !important;
  padding-left: 18px !important;
  line-height: 1.4 !important;
}

#game-modes .features-panel li::before {
  content: "" !important;
  position: absolute !important;
  left: 4px !important;
  top: 7px !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
}

#game-modes .casual .features-panel li::before {
  background-color: var(--color-primary) !important;
  box-shadow: 0 0 6px var(--color-primary) !important;
}

#game-modes .competitive .features-panel li::before {
  background-color: var(--color-danger) !important;
  box-shadow: 0 0 6px var(--color-danger) !important;
}

#game-modes .custom .features-panel li::before {
  background-color: #3b82f6 !important;
  box-shadow: 0 0 6px #3b82f6 !important;
}

body.light-theme .features-panel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
}

body.light-theme .mode-showcase-item.casual .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(245, 158, 11, 0.04),
      rgba(255, 255, 255, 0.8) 75%);
}

body.light-theme .mode-showcase-item.competitive .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(239, 68, 68, 0.04),
      rgba(255, 255, 255, 0.8) 75%);
}

body.light-theme .mode-showcase-item.custom .features-panel {
  background: radial-gradient(circle at bottom right,
      rgba(59, 130, 246, 0.04),
      rgba(255, 255, 255, 0.8) 75%);
}

body.light-theme .mode-showcase-item.casual:hover .features-panel {
  border-color: rgba(245, 158, 11, 0.3);
  background: radial-gradient(circle at bottom right,
      rgba(245, 158, 11, 0.1),
      rgba(255, 255, 255, 0.95) 75%);
  box-shadow:
    0 12px 30px rgba(245, 158, 11, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.02);
}

body.light-theme .mode-showcase-item.competitive:hover .features-panel {
  border-color: rgba(239, 68, 68, 0.3);
  background: radial-gradient(circle at bottom right,
      rgba(239, 68, 68, 0.1),
      rgba(255, 255, 255, 0.95) 75%);
  box-shadow:
    0 12px 30px rgba(239, 68, 68, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.02);
}

body.light-theme .mode-showcase-item.custom:hover .features-panel {
  border-color: rgba(59, 130, 246, 0.3);
  background: radial-gradient(circle at bottom right,
      rgba(59, 130, 246, 0.1),
      rgba(255, 255, 255, 0.95) 75%);
  box-shadow:
    0 12px 30px rgba(59, 130, 246, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.02);
}

body.light-theme .mode-xp-note {
  color: var(--color-text-secondary);
}

body.light-theme .casual .mode-xp-note {
  background: rgba(245, 158, 11, 0.04);
}

body.light-theme .competitive .mode-xp-note {
  background: rgba(239, 68, 68, 0.04);
}

body.light-theme .custom .mode-xp-note {
  background: rgba(59, 130, 246, 0.04);
}

body.light-theme .hero-icon {
  background-color: #111113;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 0 12px rgba(245, 158, 11, 0.15);
}

/* ==========================================================================
   Game Types & Board UI Elements
   ========================================================================== */
.types-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0;
}

.type-box {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.type-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-title h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.type-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.type-icon-box svg {
  display: block;
}

.type-icon-box.arcade-icon {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-primary);
}

.type-icon-box.classic-icon {
  background-color: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-primary);
}

.type-box p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
}

.type-box ul {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-box li {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.type-box li strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.info-note {
  font-size: 0.875rem !important;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--color-border);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: auto;
}

.info-note.success {
  border-color: var(--color-success-border);
  background-color: var(--color-success-bg);
  color: rgba(255, 255, 255, 0.9);
}

body.light-theme .info-note.success {
  color: #047857;
  background-color: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.2);
}

.info-note.warning {
  border-color: var(--color-warning-border);
  background-color: var(--color-warning-bg);
  color: rgba(255, 255, 255, 0.9);
}

body.light-theme .info-note.warning {
  color: #b45309;
  background-color: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   Board Grid Representation
   ========================================================================== */
.board-grid-example {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  background-color: #0d0d12;
  border: 1px solid var(--card-border);
  padding: 12px;
  border-radius: var(--radius-md);
  margin: 16px auto;
  box-shadow: var(--shadow-sm);
}

.board-example-row {
  display: flex;
  gap: 6px;
}

.board-example-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.board-example-row span.null-tile {
  color: var(--color-primary);
  background-color: var(--color-primary-glow);
  border-color: rgba(255, 179, 0, 0.2);
}

/* Example Math items */
.example-boxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0;
}

.example-item {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.example-math {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.example-item p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.example-item p strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.example-item ul {
  padding-left: 20px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-item li {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.example-item li strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* Null features */
.null-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.feature-bullet {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  padding: 16px 20px;
  border-radius: 8px;
}

.bullet-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-bullet strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.feature-bullet div {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Interactive Simulator Styles
   ========================================================================== */
.simulator-card {
  border: 1px solid rgba(255, 179, 0, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: rgba(20, 20, 26, 0.85);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 179, 0, 0.05);
  margin: 40px 0;
  transition: border-color var(--transition-normal);
}

.sim-header {
  background-color: rgba(255, 179, 0, 0.05);
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 179, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-primary);
  border-radius: var(--radius-circle);
  box-shadow: 0 0 8px var(--color-primary);
}

.sim-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--text-main);
}

.sim-badge {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(255, 179, 0, 0.15);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.sim-body {
  padding: 24px;
}

.sim-desc {
  font-size: 0.9rem !important;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.sim-grid-container {
  display: flex;
  gap: 32px;
  flex-direction: row;
  align-items: flex-start;
  margin-bottom: 24px;
}

/* Simulator Grid */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  flex-shrink: 0;
  width: 250px;
  height: 250px;
}

.sim-cell {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.sim-cell:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.03);
}

/* Selected active tile styling */
.sim-cell.selected {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  box-shadow: 0 0 12px rgba(255, 111, 0, 0.2);
  background-color: rgba(255, 111, 0, 0.05);
  color: var(--color-accent);
}

/* Selected tile adjacent highlight options */
.sim-cell.selectable-adj {
  border-color: rgba(255, 179, 0, 0.4);
  background-color: rgba(255, 179, 0, 0.03);
}

.sim-cell.selectable-adj:hover {
  background-color: rgba(255, 179, 0, 0.08);
  border-color: rgba(255, 179, 0, 0.6);
}

/* Null Tile (Ø) */
.sim-cell.null-cell {
  color: var(--color-primary);
  background-color: rgba(255, 179, 0, 0.08);
  border-color: rgba(255, 179, 0, 0.25);
  text-shadow: 0 0 6px rgba(255, 179, 0, 0.15);
}

/* Locked Zero Tile */
.sim-cell.locked-cell {
  background-color: rgba(128, 128, 128, 0.05);
  border-color: transparent;
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

.sim-cell.locked-cell:hover {
  transform: none;
  background-color: rgba(128, 128, 128, 0.05);
}

/* Simulator Stats and Logs */
.sim-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 250px;
}

.stat-row {
  display: flex;
  gap: 16px;
}

.stat-item {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.sim-log-box {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--card-border);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.log-entries {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  color: var(--text-main);
  animation: fadeIn 0.2s ease;
}

.system-log {
  color: var(--text-muted);
  font-style: italic;
}

.move-log {
  color: #57b3ff;
}

.null-log {
  color: var(--color-primary);
  font-weight: 700;
}

.swap-log {
  color: #bf5eff;
}

.error-log {
  color: var(--color-danger);
}

.reset-btn {
  background-color: var(--card-border);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.reset-btn:hover {
  background-color: var(--card-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sim-tips {
  margin-top: 20px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.sim-tips>strong {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-primary);
  font-weight: 700;
}

.sim-tips strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.sim-tips ul {
  padding-left: 20px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-tips li {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* ==========================================================================
   Economy and Store Cards
   ========================================================================== */
.currency-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0;
}

.currency-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition-normal);
}

.currency-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-border-hover);
}

.bits-card:hover {
  --card-border-hover: rgba(255, 111, 0, 0.3);
}

.nulls-card:hover {
  --card-border-hover: rgba(255, 179, 0, 0.3);
}

.currency-icon-box {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
}

.bits-card .currency-icon-box {
  background-color: var(--color-accent-glow);
  color: var(--color-accent);
  box-shadow: 0 0 16px var(--color-accent-glow);
}

.nulls-card .currency-icon-box {
  background-color: var(--color-primary-glow);
  color: var(--color-primary);
  box-shadow: 0 0 16px var(--color-primary-glow);
}

.currency-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.currency-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.currency-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 300px;
  margin-bottom: 20px;
}

.currency-details {
  width: 100%;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
}

.currency-details strong {
  color: var(--text-main);
}

/* Store Cards */
.store-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0;
}

.store-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.store-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-primary);
}

.store-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Daily streak rules */
.rewards-rules {
  list-style: none !important;
  padding-left: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.rewards-rules li {
  position: relative;
  padding-left: 24px;
  font-size: 0.9375rem;
}

.rewards-rules li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: bold;
}

/* Powerup headers in table */
.powerup-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.power-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.power-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ==========================================================================
   Leaderboard Box (Dashboard mimic)
   ========================================================================== */
.leaderboard-filters {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.filter-label {
  color: var(--text-muted);
  margin-right: 12px;
}

.filter-switches {
  display: flex;
  gap: 8px;
}

.filter-switches span {
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.filter-switches span.active-filter {
  color: var(--color-primary);
  font-weight: 600;
}

.leaderboard-box {
  background-color: #0b0b0f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.leaderboard-header {
  background-color: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 20px;
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.leaderboard-rows {
  display: flex;
  flex-direction: column;
}

.leader-row {
  display: grid;
  grid-template-columns: 60px 1fr 100px;
  padding: 12px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background-color var(--transition-fast);
}

.leader-row:last-child {
  border-bottom: none;
}

.leader-row:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.leader-row.current-user {
  background-color: rgba(255, 179, 0, 0.05);
  border-left: 2px solid var(--color-primary);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.875rem;
}

.xp-val {
  text-align: right;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
}

/* ==========================================================================
   App Info Grid
   ========================================================================== */
/* .app-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-top: 24px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 10px;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.875rem;
    font-weight: 600;
} */

/* ==========================================================================
   Footer Styles
   ========================================================================== */
.doc-footer {
  padding: 64px 0 24px 0;
  text-align: center;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-footer p:first-child {
  font-weight: 600;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Up to Tablet (Landscape) */
@media (max-width: 1279px) {
  .sidebar-right {
    position: fixed;
    top: 64px;
    right: 0;
    width: 280px;
    height: calc(100vh - 64px);
    background-color: var(--bg-color);
    border-left: 1px solid var(--card-border);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-right.open {
    transform: translateX(0);
  }

  .menu-toggle-btn {
    display: flex;
    /* Show Hamburger menu button on header */
  }

  .main-content {
    margin-right: 0;
    max-width: 100%;
  }
}

/* Desktop and up layout tweaks */
@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .types-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .currency-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .store-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-title {
    font-size: 4.5rem;
  }
}

/* Mobile & Small screens */
@media (max-width: 767px) {
  .main-content {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-tagline {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .play-button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  .doc-section {
    padding: 32px 0;
  }

  .doc-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
  }

  .sub-section {
    margin-top: 24px;
  }

  .sim-grid-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .sim-grid {
    width: 260px;
    height: 260px;
  }

  .sim-controls {
    width: 100%;
    height: auto;
  }

  .sim-log-box {
    height: 120px;
  }
}

/* ==========================================================================
   Innovative Hero Features & Animations
   ========================================================================== */
.hero-glow-accent {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 250px;
  background: radial-gradient(circle,
      rgba(255, 179, 0, 0.07) 0%,
      rgba(255, 111, 0, 0.02) 50%,
      transparent 70%);
  border-radius: var(--radius-circle);
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}

/* Floating background tiles */
@keyframes float-slow {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(4deg);
  }
}

@keyframes float-medium {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(-4deg);
  }
}

.floating-tile {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-muted);
  opacity: 0.15;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.tile-1 {
  left: 6%;
  top: 12%;
  color: var(--color-primary);
  border-color: rgba(255, 179, 0, 0.15);
  animation: float-slow 8s ease-in-out infinite;
}

.tile-2 {
  right: 8%;
  top: 16%;
  color: var(--color-accent);
  border-color: rgba(255, 111, 0, 0.15);
  animation: float-medium 6s ease-in-out infinite;
}

.tile-3 {
  left: 8%;
  bottom: 16%;
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.15);
  animation: float-medium 7s ease-in-out infinite 0.5s;
}

.tile-4 {
  right: 10%;
  bottom: 12%;
  opacity: 0.08;
  animation: float-slow 9s ease-in-out infinite 1s;
}

/* Interactive collapsing concept card */
.hero-concept-card {
  background: rgba(20, 20, 26, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 500px;
  width: 100%;
  margin: 0 auto 36px auto;
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(255, 179, 0, 0.02);
  text-align: center;
  position: relative;
  z-index: 2;
}

.concept-header {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.tile-merge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 52px;
  margin-bottom: 12px;
  position: relative;
}

.concept-tile {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}

.concept-tile.select-tile {
  border-color: var(--color-accent);
  background-color: rgba(255, 111, 0, 0.06);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(255, 111, 0, 0.1);
}

.concept-tile.target-tile {
  border-color: rgba(255, 255, 255, 0.1);
}

.concept-operator,
.concept-arrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.result-tiles {
  display: flex;
  gap: 16px;
  position: absolute;
}

.concept-tile.origin-locked {
  background-color: rgba(128, 128, 128, 0.05);
  border-color: transparent;
  color: var(--text-muted);
  opacity: 0.4;
}

.concept-tile.concept-tile.result-null {
  color: var(--color-primary);
  background-color: var(--color-primary-glow);
  border-color: rgba(255, 179, 0, 0.25);
  text-shadow: 0 0 6px rgba(255, 179, 0, 0.25);
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.1);
}

.concept-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.concept-caption strong {
  color: var(--color-primary);
}

/* Animations for concept collapse card */
@keyframes select-anim {

  0%,
  25% {
    transform: translateX(0);
    opacity: 1;
  }

  32% {
    transform: translateX(34px);
    opacity: 0.5;
  }

  36%,
  100% {
    transform: translateX(34px);
    opacity: 0;
  }
}

@keyframes target-anim {

  0%,
  25% {
    transform: translateX(0);
    opacity: 1;
  }

  32% {
    transform: translateX(-34px);
    opacity: 0.5;
  }

  36%,
  100% {
    transform: translateX(-34px);
    opacity: 0;
  }
}

@keyframes op-anim {

  0%,
  22% {
    opacity: 1;
    transform: scale(1);
  }

  28%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes arrow-anim {

  0%,
  32% {
    opacity: 0;
    transform: translateX(-8px);
  }

  38%,
  88% {
    opacity: 1;
    transform: translateX(0);
  }

  92%,
  100% {
    opacity: 0;
  }
}

@keyframes result-anim {

  0%,
  32% {
    opacity: 0;
    transform: scale(0.92);
  }

  38%,
  88% {
    opacity: 1;
    transform: scale(1);
  }

  92%,
  100% {
    opacity: 0;
  }
}

.animate-select {
  animation: select-anim 4.5s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

.animate-target {
  animation: target-anim 4.5s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

.animate-op {
  animation: op-anim 4.5s infinite ease;
}

.animate-arrow {
  animation: arrow-anim 4.5s infinite ease;
}

.result-tiles {
  animation: result-anim 4.5s infinite ease;
}

/* Light Theme tweaks */
[data-theme="light"] .hero-title {
  text-shadow: none;
}

[data-theme="light"] .hero-glow-accent {
  background: radial-gradient(circle,
      rgba(245, 158, 11, 0.08) 0%,
      rgba(245, 158, 11, 0.02) 60%,
      transparent 80%);
}

[data-theme="light"] .floating-tile {
  opacity: 0.04;
  background: rgba(0, 0, 0, 0.01);
}

[data-theme="light"] .hero-concept-card {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .concept-tile.origin-locked {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Hide floating tiles on very small screens to keep layout tidy */
@media (max-width: 900px) {
  .floating-tile {
    display: none !important;
  }
}

/* ==========================================================================
   Header Actions & Menu Toggle Styles
   ========================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  background: rgba(31, 31, 35, 0.4);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.menu-toggle:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  transform: scale(1.05);
}

.menu-toggle:active {
  transform: scale(0.95);
}

.menu-icon {
  font-size: 1.25rem;
  line-height: 1;
}

body.light-theme .menu-toggle {
  background: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Quick Navigation Card Grid
   ========================================================================== */
.quick-nav-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.light-theme .quick-nav-card {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.quick-nav-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.15em;
  margin-bottom: 16px;
  text-transform: uppercase;
  text-align: center;
}

.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.quick-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: center;
}

.quick-nav-item:hover {
  background: rgba(245, 158, 11, 0.05);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

body.light-theme .quick-nav-item {
  background: rgba(0, 0, 0, 0.02);
}

body.light-theme .quick-nav-item:hover {
  background: rgba(245, 158, 11, 0.08);
}

/* ==========================================================================
   Centered Sidebar Drawer Layout
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-right {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--color-card-bg);
  border-left: 1px solid var(--color-border);
  padding: 40px 24px;
  overflow-y: auto;
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.sidebar-right.open {
  transform: translateX(0);
}

body.light-theme .sidebar-right {
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.08);
}

/* Floating back to top button or layout tweaks to make sure the header is sticky */
header {
  position: sticky;
  top: 12px;
  width: 100%;
  max-width: 800px;
  margin: clamp(12px, 3vw, 24px) auto 0;
  padding: 0 16px;
  z-index: 100;
}

/* Fixes for Simulator selected cells */
.sim-cell.selected {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: -2px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
  background-color: rgba(245, 158, 11, 0.08) !important;
  color: var(--color-primary) !important;
}

.sim-cell.selectable-adj {
  border-color: rgba(245, 158, 11, 0.3) !important;
  background-color: rgba(245, 158, 11, 0.03) !important;
}

/* Light Theme tweaks and fixes for Hero Title and Mini-Simulator */
body.light-theme #hero-title,
body.light-theme #hero-title span {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  color: #000000;
}

body.light-theme .simulator-card {
  background-color: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.02);
}

body.light-theme .sim-header {
  background-color: rgba(245, 158, 11, 0.04);
  border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

body.light-theme .sim-header h3 {
  color: #111115;
}

body.light-theme .sim-desc {
  color: #52525b;
}

body.light-theme .sim-grid {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
}

body.light-theme .sim-cell {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .sim-cell:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

body.light-theme .sim-cell.selected {
  outline: 2px solid #ea580c !important;
  outline-offset: -2px;
  background-color: rgba(234, 88, 12, 0.08) !important;
  color: #ea580c !important;
}

body.light-theme .sim-cell.selectable-adj {
  border-color: rgba(245, 158, 11, 0.5) !important;
  background-color: rgba(245, 158, 11, 0.05) !important;
}

body.light-theme .sim-cell.selectable-adj:hover {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.7) !important;
}

body.light-theme .sim-cell.null-cell {
  color: #b45309;
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

body.light-theme .sim-cell.locked-cell {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  opacity: 0.5;
}

body.light-theme .stat-item {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .stat-label {
  color: #64748b;
}

body.light-theme .stat-value {
  color: #d97706;
}

body.light-theme .sim-log-box {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .log-title {
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

body.light-theme .log-entry {
  color: #1e293b;
}

body.light-theme .system-log {
  color: #64748b;
}

body.light-theme .move-log {
  color: #0284c7;
}

body.light-theme .swap-log {
  color: #7c3aed;
}

body.light-theme .null-log {
  color: #b45309;
}

body.light-theme .error-log {
  color: #dc2626;
}

body.light-theme .reset-btn {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .reset-btn:hover {
  background-color: #e2e8f0;
  border-color: #d97706;
  color: #d97706;
}

body.light-theme .sim-tips {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .sim-tips>strong,
body.light-theme .sim-tips strong {
  color: #0f172a;
}

body.light-theme .sim-tips li {
  color: #334155;
}

/* ==========================================================================
   Header Navbar UI & Visual Enhancements
   ========================================================================== */
.logo-text {
  font-weight: 800;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff !important;
  transition: color var(--transition-normal);
}

.logo-text span {
  color: #ffffff !important;
  font-weight: 800;
}

.logo-img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s;
}

.logo-section:hover .logo-img {
  transform: scale(1.1) rotate(-5deg) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.header-container {
  background: rgba(10, 10, 12, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  padding: 16px 24px !important;
  transition: all var(--transition-normal);
}

body.light-theme .header-container {
  background: rgba(10, 10, 12, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.theme-toggle,
.menu-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover,
.menu-toggle:hover {
  transform: scale(1.08) !important;
  border-color: var(--color-primary) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--color-primary) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25) !important;
}

.theme-toggle:hover svg {
  transform: scale(1.1) rotate(12deg);
}

body.light-theme .theme-toggle,
body.light-theme .menu-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

body.light-theme .theme-toggle:hover,
body.light-theme .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

/* ==========================================================================
   Responsive Improvements for Mobile Viewports
   ========================================================================== */
@media (max-width: 480px) {
  .header-container {
    padding: 12px 16px !important;
  }

  .theme-toggle,
  .menu-toggle {
    width: 36px !important;
    height: 36px !important;
  }

  .logo-img {
    height: 28px !important;
  }

  .logo-text {
    font-size: 1.1rem !important;
  }

  .game-mode-card {
    padding: 20px !important;
  }

  .hero-concept-card {
    padding: 16px 14px !important;
  }

  .tile-merge-container {
    gap: 8px !important;
  }

  .concept-tile {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
  }

  .sim-body {
    padding: 16px !important;
  }

  .sim-grid {
    width: 230px !important;
    height: 230px !important;
    padding: 8px !important;
    gap: 8px !important;
  }

  .sim-cell {
    font-size: 1.15rem !important;
  }
}

@media (max-width: 380px) {
  .quick-nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)) !important;
    gap: 8px !important;
  }

  .quick-nav-item {
    font-size: 0.75rem !important;
    padding: 8px 10px !important;
  }

  .logo-text {
    font-size: 0.95rem !important;
  }

  .logo-img {
    height: 24px !important;
  }

  .theme-toggle,
  .menu-toggle {
    width: 32px !important;
    height: 32px !important;
  }

  .theme-toggle svg,
  .menu-toggle svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Ensure drawer matches small screen sizes */
.sidebar-right {
  width: min(300px, 85vw) !important;
}

/* Store details list styling */
.store-details-list {
  margin-top: 12px;
  list-style: none !important;
  padding-left: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-details-list li {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

body.light-theme .store-details-list li {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}