/* ==========================================================================
   Intellia360 Games — Official Dark Mode EdTech Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand Design Tokens (Dark Mode Default + Light Mode Support)
   -------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  /* Surfaces & Backgrounds */
  --bg-main: #0b0f19;
  --bg-surface: #121826;
  --bg-surface-elevated: #1a2337;
  --bg-surface-subtle: #161f31;

  --bg-header: rgba(11, 15, 25, 0.92);
  --bg-header-scrolled: rgba(14, 20, 33, 0.98);

  /* Legacy alias mappings mapped to rich dark surfaces */
  --bg-white: var(--bg-surface);
  --bg-light-surface: var(--bg-surface-elevated);
  --bg-soft-blue: var(--bg-surface-subtle);
  --bg-badge-blue: rgba(56, 189, 248, 0.12);

  /* Brand Accents */
  --intellia-blue: #38bdf8;
  --intellia-blue-hover: #60a5fa;
  --intellia-blue-light: rgba(56, 189, 248, 0.14);
  --intellia-blue-border: rgba(56, 189, 248, 0.35);

  --intellia-orange: #fb923c;
  --intellia-orange-hover: #f97316;
  --intellia-orange-light: rgba(251, 146, 60, 0.14);
  --intellia-orange-border: rgba(251, 146, 60, 0.35);

  /* Typography */
  --text-navy: #f8fafc;
  --text-dark: #f1f5f9;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  /* Borders */
  --border-light: #243049;
  --border-subtle: #1c263c;
  --border-highlight: rgba(56, 189, 248, 0.45);

  /* Font Families */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Sizing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-card-hover: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.25);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  --container-max-width: 1240px;
  --header-height: 110px;
}

/* Light Mode Overrides (when explicitly toggled) */
[data-theme="light"] {
  --bg-main: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-subtle: #f0f7ff;

  --bg-header: rgba(255, 255, 255, 0.96);
  --bg-header-scrolled: rgba(255, 255, 255, 0.99);

  --bg-white: #ffffff;
  --bg-light-surface: #f8fafc;
  --bg-soft-blue: #f0f7ff;
  --bg-badge-blue: #eff6ff;

  --intellia-blue: #0066ff;
  --intellia-blue-hover: #0052cc;
  --intellia-blue-light: #e0edff;
  --intellia-blue-border: #bfdbfe;

  --intellia-orange: #ff7a00;
  --intellia-orange-hover: #ea6c00;
  --intellia-orange-light: #fff4ea;
  --intellia-orange-border: #fed7aa;

  --text-navy: #0f172a;
  --text-dark: #1e293b;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-highlight: rgba(0, 102, 255, 0.4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-card-hover: 0 16px 36px rgba(0, 102, 255, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--intellia-blue);
}

::selection {
  background: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Mathematical & Geometric Background Elements (Glowing Dark Space)
   -------------------------------------------------------------------------- */
.light-math-field {
  position: absolute;
  inset: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.math-item {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #94a3b8;
  opacity: 0.38;
  user-select: none;
  transition: transform 0.5s ease;
}

.item-1  { top: 14%; left: 8%;  font-size: 2.2rem; color: #38bdf8; text-shadow: 0 0 16px rgba(56, 189, 248, 0.45); }
.item-2  { top: 25%; right: 9%; font-size: 2.5rem; color: #fbbf24; text-shadow: 0 0 16px rgba(251, 191, 36, 0.45); }
.item-3  { top: 46%; left: 4%;  font-size: 2rem;   color: #60a5fa; text-shadow: 0 0 16px rgba(96, 165, 250, 0.45); }
.item-4  { top: 18%; left: 45%; font-size: 2.6rem; color: #fb923c; text-shadow: 0 0 16px rgba(251, 146, 60, 0.45); }
.item-5  { top: 62%; right: 7%; font-size: 2.4rem; color: #38bdf8; text-shadow: 0 0 16px rgba(56, 189, 248, 0.45); }
.item-6  { top: 68%; left: 14%; font-size: 2.1rem; color: #a78bfa; text-shadow: 0 0 16px rgba(167, 139, 250, 0.45); }
.item-7  { top: 34%; right: 28%; font-size: 2.3rem; color: #2dd4bf; text-shadow: 0 0 16px rgba(45, 212, 191, 0.45); }
.item-8  { top: 82%; left: 32%; font-size: 2.5rem; color: #f472b6; text-shadow: 0 0 16px rgba(244, 114, 182, 0.45); }
.item-9  { top: 28%; left: 22%; font-size: 1.8rem; color: #38bdf8; text-shadow: 0 0 16px rgba(56, 189, 248, 0.45); }
.item-10 { top: 76%; right: 20%; font-size: 2.2rem; color: #fbbf24; text-shadow: 0 0 16px rgba(251, 191, 36, 0.45); }
.item-11 { top: 88%; right: 10%; font-size: 2rem; color: #c084fc; text-shadow: 0 0 16px rgba(192, 132, 252, 0.45); }
.item-12 { top: 52%; left: 88%; font-size: 2.2rem; color: #34d399; text-shadow: 0 0 16px rgba(52, 211, 153, 0.45); }

/* In Light Mode, revert math items to subtle pastel */
[data-theme="light"] .item-1  { color: #93c5fd; text-shadow: none; opacity: 0.4; }
[data-theme="light"] .item-2  { color: #fed7aa; text-shadow: none; opacity: 0.5; }
[data-theme="light"] .item-3  { color: #bfdbfe; text-shadow: none; opacity: 0.45; }
[data-theme="light"] .item-4  { color: #fed7aa; text-shadow: none; opacity: 0.45; }
[data-theme="light"] .item-5  { color: #93c5fd; text-shadow: none; opacity: 0.4; }
[data-theme="light"] .item-6  { color: #e2e8f0; text-shadow: none; opacity: 0.55; }
[data-theme="light"] .item-7  { color: #bfdbfe; text-shadow: none; opacity: 0.45; }
[data-theme="light"] .item-8  { color: #fed7aa; text-shadow: none; opacity: 0.4; }
[data-theme="light"] .item-9  { color: #cbd5e1; text-shadow: none; opacity: 0.5; }
[data-theme="light"] .item-10 { color: #93c5fd; text-shadow: none; opacity: 0.45; }
[data-theme="light"] .item-11 { color: #fed7aa; text-shadow: none; opacity: 0.45; }
[data-theme="light"] .item-12 { color: #cbd5e1; text-shadow: none; opacity: 0.4; }

.geo-decor {
  position: absolute;
  pointer-events: none;
  opacity: 0.28;
}

.circle-1 {
  top: 20%;
  right: 18%;
  width: 32px;
  height: 32px;
  border: 2px dashed var(--intellia-blue);
  border-radius: 50%;
}

.square-1 {
  top: 55%;
  left: 7%;
  width: 24px;
  height: 24px;
  border: 2px solid var(--intellia-orange);
  transform: rotate(25deg);
}

.dot-pattern {
  position: absolute;
  top: 10%;
  left: 2%;
  width: 140px;
  height: 140px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  opacity: 0.4;
}

[data-theme="light"] .dot-pattern {
  background-image: radial-gradient(#e2e8f0 1.5px, transparent 1.5px);
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Header / Sticky Brand Bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.site-header.scrolled {
  background: var(--bg-header-scrolled);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  border-bottom-color: var(--border-light);
}

.header-container {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left-spacer {
  width: 180px;
  visibility: hidden;
}

.header-right-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Brand Link & Logo */
.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.brand-link:hover {
  transform: scale(1.02);
  opacity: 0.96;
}

.brand-logo {
  height: 84px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* --------------------------------------------------------------------------
   Theme Toggle Button (Universal Dark / Light Switcher)
   -------------------------------------------------------------------------- */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-dark);
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  outline: none;
  user-select: none;
}

.theme-toggle-btn:hover {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue);
  color: var(--intellia-blue);
  transform: translateY(-1px) rotate(15deg);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

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

/* Display Moon in light mode, Sun in dark mode */
:root .theme-toggle-btn .moon-icon,
[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}
:root .theme-toggle-btn .sun-icon,
[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: inline-block;
}
[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: none;
}
[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Hamburger Menu Button (Universal Header Navigation)
   -------------------------------------------------------------------------- */
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.15rem;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-dark);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  outline: none;
  user-select: none;
}

.hamburger-btn:hover {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue);
  color: var(--intellia-blue);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

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

.hamburger-box {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2.2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Active animated Hamburger -> X */
.hamburger-btn.is-active {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue);
  color: var(--intellia-blue);
}

.hamburger-btn.is-active .hamburger-line.line-1 {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line.line-2 {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.is-active .hamburger-line.line-3 {
  transform: translateY(-5.8px) rotate(-45deg);
}

.hamburger-label {
  letter-spacing: 0.02em;
}

/* Header Group on Game Pages */
.game-header-right-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Games Navigation Slide-out Drawer & Backdrop
   -------------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.games-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  z-index: 999;
  box-shadow: -10px 0 45px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border-left: 1px solid var(--border-light);
}

.games-drawer.is-open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--intellia-blue);
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-navy);
  margin: 0;
}

.drawer-close-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-dark);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  transform: rotate(90deg);
}

/* Drawer Body Scroll Area */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

/* Drawer Home Link */
.drawer-home-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--intellia-blue-light);
  border: 1.5px solid var(--intellia-blue-border);
  border-radius: var(--radius-md);
  color: var(--intellia-blue);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.drawer-home-item:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--intellia-blue);
  transform: translateX(3px);
}

.drawer-home-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.drawer-home-text {
  display: flex;
  flex-direction: column;
}

.drawer-home-title {
  font-weight: 800;
  color: var(--intellia-blue);
}

.drawer-home-sub {
  font-size: 0.78rem;
  color: var(--text-body);
  font-weight: 500;
}

.drawer-section-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

/* Drawer Games List */
.drawer-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-game-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
  position: relative;
}

.drawer-game-link:hover {
  border-color: var(--intellia-blue);
  background: #1e2a42;
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.2);
}

.drawer-game-link.is-active {
  border-color: var(--intellia-blue);
  background: var(--intellia-blue-light);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2);
}

.drawer-game-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Vibrant glowing icons for Dark Mode */
.icon-amber  { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.16); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.icon-orange { background: rgba(249, 115, 22, 0.16); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.icon-cyan   { background: rgba(20, 184, 166, 0.16); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.3); }
.icon-blue   { background: rgba(56, 189, 248, 0.16); color: #60a5fa; border: 1px solid rgba(56, 189, 248, 0.3); }
.icon-indigo { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.icon-rose   { background: rgba(244, 63, 94, 0.16);  color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.icon-green  { background: rgba(34, 197, 94, 0.16);  color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.icon-pink   { background: rgba(236, 72, 153, 0.16); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.icon-emerald{ background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

[data-theme="light"] .icon-amber  { background: #fef3c7; color: #b45309; border: none; }
[data-theme="light"] .icon-purple { background: #f3e8ff; color: #7e22ce; border: none; }
[data-theme="light"] .icon-orange { background: #ffedd5; color: #c2410c; border: none; }
[data-theme="light"] .icon-cyan   { background: #ccfbf1; color: #0f766e; border: none; }
[data-theme="light"] .icon-blue   { background: #e0f2fe; color: #0369a1; border: none; }
[data-theme="light"] .icon-indigo { background: #e0e7ff; color: #4338ca; border: none; }
[data-theme="light"] .icon-rose   { background: #ffe4e6; color: #be123c; border: none; }
[data-theme="light"] .icon-green  { background: #dcfce7; color: #15803d; border: none; }
[data-theme="light"] .icon-pink   { background: #fce7f3; color: #be185d; border: none; }
[data-theme="light"] .icon-emerald{ background: #d1fae5; color: #065f46; border: none; }

.drawer-game-info {
  flex: 1;
  min-width: 0;
}

.drawer-game-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-navy);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-active-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--intellia-blue);
  color: #0b0f19;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

.drawer-game-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-game-arrow {
  color: var(--intellia-blue);
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform var(--transition-fast);
}

.drawer-game-link:hover .drawer-game-arrow {
  transform: translateX(3px);
}

/* Drawer Footer */
.drawer-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface-elevated);
  text-align: center;
}

.drawer-footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Game Arcade Section
   -------------------------------------------------------------------------- */
.games-section {
  position: relative;
  padding: 3.5rem 1.5rem 6.5rem;
  background-color: var(--bg-main);
  z-index: 10;
}

.games-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3.75rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--intellia-orange);
  background: var(--intellia-orange-light);
  border: 1px solid var(--intellia-orange-border);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-navy);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Game Cards Grid Layout
   Desktop: 3 cards per row, Row 2 centered
   Tablet: 2 cards per row
   Mobile: 1 card per row
   -------------------------------------------------------------------------- */
.games-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
}

/* Desktop: 3-column grid system with 10th card centered */
@media (min-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-card:nth-child(10):last-child {
    grid-column: 2 / span 1;
  }
}

/* Tablet: 2 cards per row */
@media (min-width: 641px) and (max-width: 1023px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
}

/* Mobile: 1 card per row */
@media (max-width: 640px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Game Card Design & Dark Styling
   -------------------------------------------------------------------------- */
.game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth);
}

/* Card Hover States */
.game-card:hover {
  transform: translateY(-6px);
}

.game-card:hover .card-inner {
  border-color: var(--intellia-blue);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-surface-elevated);
}

.game-card:focus-visible .card-inner {
  border-color: var(--intellia-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.45);
}

/* Game Image Box & Artwork */
.card-image-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-main);
}

.game-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-card:hover .game-thumbnail {
  transform: scale(1.04);
}

/* Category Badge on Thumbnail */
.game-category-tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.3rem 0.75rem;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .game-category-tag {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Card Content Area */
.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-navy);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
}

.game-card:hover .game-name {
  color: var(--intellia-blue);
}

.game-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Card Action / Play Now Button */
.card-action {
  margin-top: auto;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0066ff, #2563eb);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.4);
  transition: all var(--transition-smooth);
}

.play-btn .arrow {
  font-size: 1.15rem;
  transition: transform var(--transition-fast);
}

.game-card:hover .play-btn {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.5);
}

.game-card:hover .play-btn .arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Footer — Dark Styled Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding: 3rem 1.5rem 2.75rem;
  z-index: 10;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-brand {
  display: inline-block;
  text-decoration: none;
}

.footer-logo {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.footer-tagline {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-copyright {
  font-size: 0.9rem;
  color: var(--text-light);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-dark);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.back-to-top:hover {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue-border);
  color: var(--intellia-blue);
  transform: translateY(-2px);
}

.back-to-top .arrow-up {
  font-size: 0.95rem;
  color: var(--intellia-blue);
  transition: transform var(--transition-fast);
}

.back-to-top:hover .arrow-up {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 90px;
  }

  .header-container {
    padding: 0.75rem 1rem;
  }

  .brand-logo {
    height: 64px;
    max-width: 250px;
  }

  .games-section {
    padding: 2.5rem 1rem 4.5rem;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .card-content {
    padding: 1.25rem;
  }

  .game-name {
    font-size: 1.25rem;
  }

  .footer-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .footer-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* --------------------------------------------------------------------------
   Arcade Intro Section (Landing Page Write-up)
   -------------------------------------------------------------------------- */
.arcade-intro-section {
  position: relative;
  padding: 3.5rem 1.5rem 2.5rem;
  background: radial-gradient(circle at 50% -15%, #16243d 0%, var(--bg-main) 75%);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  z-index: 5;
}

[data-theme="light"] .arcade-intro-section {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 65%, #f4f8fe 100%);
}

.intro-container {
  max-width: 860px;
  margin: 0 auto;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: var(--intellia-blue-light);
  border: 1px solid var(--intellia-blue-border);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--intellia-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.intro-heading {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: var(--text-navy);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.intro-heading .highlight-blue {
  color: var(--intellia-blue);
  text-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
}

.intro-description {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--text-body);
  line-height: 1.7;
  max-width: 760px;
  margin: 0 auto 2rem;
}

.intro-meta-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Individual Game Pages: Header & Back Button Navigation
   -------------------------------------------------------------------------- */
.game-page-header {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 80px;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  z-index: 100;
  transition: all var(--transition-fast);
}

.game-header-container {
  max-width: var(--container-max-width);
  height: 80px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btn-back-arcade {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-navy);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-back-arcade .back-arrow-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--intellia-blue);
  transition: transform var(--transition-fast);
}

.btn-back-arcade:hover {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue);
  color: var(--intellia-blue);
  transform: translateX(-3px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

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

.game-header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.game-header-logo {
  height: 58px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  transition: transform var(--transition-fast);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.game-header-logo-link:hover .game-header-logo {
  transform: scale(1.02);
}

.btn-external-play {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, #0066ff, #2563eb);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 102, 255, 0.4);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-external-play:hover {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Individual Game Page: Content, Hero & Guide
   -------------------------------------------------------------------------- */
.game-detail-main {
  padding: 2.5rem 1.5rem 5.5rem;
  background-color: var(--bg-main);
}

.game-detail-container {
  max-width: 1140px;
  margin: 0 auto;
}

.game-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.game-breadcrumbs a {
  color: var(--intellia-blue);
  font-weight: 600;
}

.game-breadcrumbs a:hover {
  text-decoration: underline;
}

/* Game Title & Header Box */
.game-intro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2.25rem;
}

.game-intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.game-tag-pill {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Glowing Tag Pills in Dark Mode */
.tag-amber  { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.tag-purple { background: rgba(168, 85, 247, 0.16); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.tag-orange { background: rgba(249, 115, 22, 0.16); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.tag-cyan   { background: rgba(20, 184, 166, 0.16); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.35); }
.tag-blue   { background: rgba(56, 189, 248, 0.16); color: #60a5fa; border: 1px solid rgba(56, 189, 248, 0.35); }
.tag-indigo { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.tag-rose   { background: rgba(244, 63, 94, 0.16);  color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }
.tag-green  { background: rgba(34, 197, 94, 0.16);  color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.tag-pink   { background: rgba(236, 72, 153, 0.16); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.tag-emerald{ background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }

[data-theme="light"] .tag-amber  { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
[data-theme="light"] .tag-purple { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
[data-theme="light"] .tag-orange { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
[data-theme="light"] .tag-cyan   { background: #ccfbf1; color: #0f766e; border: 1px solid #99f6e4; }
[data-theme="light"] .tag-blue   { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
[data-theme="light"] .tag-indigo { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
[data-theme="light"] .tag-rose   { background: #ffe4e6; color: #be123c; border: 1px solid #fecdd3; }
[data-theme="light"] .tag-green  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
[data-theme="light"] .tag-pink   { background: #fce7f3; color: #be185d; border: 1px solid #fbcfe8; }
[data-theme="light"] .tag-emerald{ background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

.game-page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-navy);
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

.game-page-desc {
  font-size: 1.12rem;
  color: var(--text-body);
  line-height: 1.7;
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.game-features-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.game-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* --------------------------------------------------------------------------
   Game Arena & Interactive Player Container
   -------------------------------------------------------------------------- */
.game-player-section {
  margin-bottom: 3rem;
}

.game-player-frame-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.player-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.player-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #4ade80;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.75);
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-player-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-player-action:hover {
  background: var(--intellia-blue-light);
  border-color: var(--intellia-blue-border);
  color: var(--intellia-blue);
}

/* --------------------------------------------------------------------------
   Game Theme Definitions & Color Accents per Game
   -------------------------------------------------------------------------- */
.theme-amber   { --game-accent: #fbbf24; --game-accent-hover: #f59e0b; --game-border: rgba(251, 191, 36, 0.45); --game-bg: rgba(251, 191, 36, 0.12); --game-glow: rgba(251, 191, 36, 0.35); }
.theme-purple  { --game-accent: #c084fc; --game-accent-hover: #a855f7; --game-border: rgba(192, 132, 252, 0.45); --game-bg: rgba(192, 132, 252, 0.12); --game-glow: rgba(192, 132, 252, 0.35); }
.theme-orange  { --game-accent: #fb923c; --game-accent-hover: #f97316; --game-border: rgba(251, 146, 60, 0.45); --game-bg: rgba(251, 146, 60, 0.12); --game-glow: rgba(251, 146, 60, 0.35); }
.theme-cyan    { --game-accent: #22d3ee; --game-accent-hover: #06b6d4; --game-border: rgba(34, 211, 238, 0.45); --game-bg: rgba(34, 211, 238, 0.12); --game-glow: rgba(34, 211, 238, 0.35); }
.theme-blue    { --game-accent: #38bdf8; --game-accent-hover: #0284c7; --game-border: rgba(56, 189, 248, 0.45); --game-bg: rgba(56, 189, 248, 0.12); --game-glow: rgba(56, 189, 248, 0.35); }
.theme-indigo  { --game-accent: #a5b4fc; --game-accent-hover: #818cf8; --game-border: rgba(165, 180, 252, 0.45); --game-bg: rgba(165, 180, 252, 0.12); --game-glow: rgba(165, 180, 252, 0.35); }
.theme-rose    { --game-accent: #fb7185; --game-accent-hover: #f43f5e; --game-border: rgba(251, 113, 133, 0.45); --game-bg: rgba(251, 113, 133, 0.12); --game-glow: rgba(251, 113, 133, 0.35); }
.theme-green   { --game-accent: #4ade80; --game-accent-hover: #22c55e; --game-border: rgba(74, 222, 128, 0.45); --game-bg: rgba(74, 222, 128, 0.12); --game-glow: rgba(74, 222, 128, 0.35); }
.theme-pink    { --game-accent: #f472b6; --game-accent-hover: #ec4899; --game-border: rgba(244, 114, 182, 0.45); --game-bg: rgba(244, 114, 182, 0.12); --game-glow: rgba(244, 114, 182, 0.35); }
.theme-emerald { --game-accent: #34d399; --game-accent-hover: #10b981; --game-border: rgba(52, 211, 153, 0.45); --game-bg: rgba(52, 211, 153, 0.12); --game-glow: rgba(52, 211, 153, 0.35); }

[data-theme="light"] .theme-amber   { --game-accent: #b45309; --game-accent-hover: #92400e; --game-border: #fcd34d; --game-bg: #fef3c7; --game-glow: rgba(180, 83, 9, 0.2); }
[data-theme="light"] .theme-purple  { --game-accent: #7e22ce; --game-accent-hover: #6b21a8; --game-border: #d8b4fe; --game-bg: #f3e8ff; --game-glow: rgba(126, 34, 206, 0.2); }
[data-theme="light"] .theme-orange  { --game-accent: #c2410c; --game-accent-hover: #9a3412; --game-border: #fdba74; --game-bg: #ffedd5; --game-glow: rgba(194, 65, 12, 0.2); }
[data-theme="light"] .theme-cyan    { --game-accent: #0f766e; --game-accent-hover: #115e59; --game-border: #5eead4; --game-bg: #ccfbf1; --game-glow: rgba(15, 118, 110, 0.2); }
[data-theme="light"] .theme-blue    { --game-accent: #0369a1; --game-accent-hover: #075985; --game-border: #7dd3fc; --game-bg: #e0f2fe; --game-glow: rgba(3, 105, 161, 0.2); }
[data-theme="light"] .theme-indigo  { --game-accent: #4338ca; --game-accent-hover: #3730a3; --game-border: #a5b4fc; --game-bg: #e0e7ff; --game-glow: rgba(67, 56, 202, 0.2); }
[data-theme="light"] .theme-rose    { --game-accent: #be123c; --game-accent-hover: #9f1239; --game-border: #fda4af; --game-bg: #ffe4e6; --game-glow: rgba(190, 18, 60, 0.2); }
[data-theme="light"] .theme-green   { --game-accent: #15803d; --game-accent-hover: #166534; --game-border: #86efac; --game-bg: #dcfce7; --game-glow: rgba(21, 128, 61, 0.2); }
[data-theme="light"] .theme-pink    { --game-accent: #be185d; --game-accent-hover: #9d174d; --game-border: #f9a8d4; --game-bg: #fce7f3; --game-glow: rgba(190, 24, 93, 0.2); }
[data-theme="light"] .theme-emerald { --game-accent: #065f46; --game-accent-hover: #064e3b; --game-border: #6ee7b7; --game-bg: #d1fae5; --game-glow: rgba(6, 95, 70, 0.2); }

/* Themed Header Back Button */
.btn-back-arcade.theme-amber,
.btn-back-arcade.theme-purple,
.btn-back-arcade.theme-orange,
.btn-back-arcade.theme-cyan,
.btn-back-arcade.theme-blue,
.btn-back-arcade.theme-indigo,
.btn-back-arcade.theme-rose,
.btn-back-arcade.theme-green,
.btn-back-arcade.theme-pink,
.btn-back-arcade.theme-emerald {
  border-color: var(--game-border);
}

.btn-back-arcade.theme-amber .back-arrow-icon,
.btn-back-arcade.theme-purple .back-arrow-icon,
.btn-back-arcade.theme-orange .back-arrow-icon,
.btn-back-arcade.theme-cyan .back-arrow-icon,
.btn-back-arcade.theme-blue .back-arrow-icon,
.btn-back-arcade.theme-indigo .back-arrow-icon,
.btn-back-arcade.theme-rose .back-arrow-icon,
.btn-back-arcade.theme-green .back-arrow-icon,
.btn-back-arcade.theme-pink .back-arrow-icon,
.btn-back-arcade.theme-emerald .back-arrow-icon {
  color: var(--game-accent);
}

.btn-back-arcade.theme-amber:hover,
.btn-back-arcade.theme-purple:hover,
.btn-back-arcade.theme-orange:hover,
.btn-back-arcade.theme-cyan:hover,
.btn-back-arcade.theme-blue:hover,
.btn-back-arcade.theme-indigo:hover,
.btn-back-arcade.theme-rose:hover,
.btn-back-arcade.theme-green:hover,
.btn-back-arcade.theme-pink:hover,
.btn-back-arcade.theme-emerald:hover {
  border-color: var(--game-accent);
  color: var(--game-accent);
  background: var(--game-bg);
  box-shadow: 0 4px 14px var(--game-glow);
}

/* Themed Player Control Bar Small Back Button */
.btn-player-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--game-bg, var(--bg-surface-elevated));
  border: 1.5px solid var(--game-border, var(--border-light));
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--game-accent, var(--text-dark));
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-player-back .back-arrow-icon {
  font-size: 1rem;
  line-height: 1;
  color: var(--game-accent);
  transition: transform var(--transition-fast);
}

.btn-player-back:hover {
  background: var(--game-bg);
  border-color: var(--game-accent);
  color: var(--game-accent-hover);
  box-shadow: 0 4px 14px var(--game-glow);
  transform: translateX(-2px);
}

.btn-player-back:hover .back-arrow-icon {
  transform: translateX(-2px);
}

/* Themed Floating Small Back Button (Overlay on Game Frame) */
.floating-back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--game-border, rgba(255, 255, 255, 0.15));
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--game-accent, #ffffff);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: all var(--transition-fast);
  opacity: 0.92;
  user-select: none;
}

.floating-back-btn .back-arrow-icon {
  font-size: 0.95rem;
  line-height: 1;
  color: var(--game-accent, #ffffff);
  transition: transform var(--transition-fast);
}

.floating-back-btn:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--game-accent);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--game-glow, rgba(0, 0, 0, 0.6));
  transform: translateX(-2px);
}

.floating-back-btn:hover .back-arrow-icon {
  transform: translateX(-2px);
}

[data-theme="light"] .floating-back-btn {
  background: rgba(255, 255, 255, 0.92);
  color: var(--game-accent);
  border-color: var(--game-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .floating-back-btn:hover {
  background: #ffffff;
  color: var(--game-accent-hover);
}

.game-iframe-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 560px;
  background-color: #070a12;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Dedicated Launcher for Games where direct embedding is restricted (e.g. Math Runner) */
.game-launcher-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #070a12;
}

.launcher-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) blur(3px);
  transform: scale(1.05);
}

.launcher-overlay-card {
  position: relative;
  z-index: 2;
  background: rgba(18, 24, 38, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 580px;
  margin: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .launcher-overlay-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.launcher-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.launcher-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-navy);
  margin-bottom: 0.5rem;
}

.launcher-desc {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

.btn-launch-game {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.4rem;
  background: linear-gradient(135deg, #0066ff, #2563eb);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.45);
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-launch-game:hover {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.55);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Game Educational Guide & How to Play Grid
   -------------------------------------------------------------------------- */
.game-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.guide-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.guide-box-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-navy);
  margin-bottom: 1.25rem;
}

.guide-icon {
  font-size: 1.35rem;
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.guide-list li {
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.55;
}

.guide-list li strong {
  color: var(--text-navy);
}

.guide-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--intellia-blue);
  font-weight: 800;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Quick Other Games Strip
   -------------------------------------------------------------------------- */
.other-games-section {
  padding-top: 1rem;
}

.other-games-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.other-games-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-navy);
}

.other-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.mini-game-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
}

.mini-game-card:hover {
  transform: translateY(-4px);
  border-color: var(--intellia-blue);
  background: var(--bg-surface-elevated);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 15px rgba(56, 189, 248, 0.2);
}

.mini-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.mini-content {
  padding: 1rem;
}

.mini-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-navy);
  margin-bottom: 0.25rem;
}

.mini-cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--intellia-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   Responsive Updates for Game Pages & Header Navigation
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem 1rem;
  }

  .header-left-spacer {
    display: none;
  }

  .header-right-actions {
    width: auto;
  }

  .brand-logo {
    height: 58px;
    max-width: 200px;
  }

  .hamburger-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }

  .hamburger-btn .hamburger-label {
    display: inline;
  }

  .games-drawer {
    max-width: 86vw;
  }

  .game-header-container {
    height: 70px;
    padding: 0 0.85rem;
    gap: 0.5rem;
  }

  .btn-back-arcade {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
  }

  .game-header-logo {
    height: 42px;
    max-width: 140px;
  }

  .btn-external-play {
    display: none; /* Already available inside the player arena control bar */
  }

  .game-detail-main {
    padding: 1.5rem 1rem 4rem;
  }

  .game-intro-card {
    padding: 1.5rem 1.25rem;
  }

  .game-iframe-wrapper,
  .game-launcher-stage {
    min-height: 380px;
  }

  .launcher-overlay-card {
    padding: 1.75rem 1.25rem;
    margin: 1rem;
  }

  .intro-heading {
    font-size: 2rem;
  }

  .intro-description {
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Accessibility: Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
