/* Shared store theme. Page-specific styles load first; these rules own theme switching. */
:root {
  color-scheme: dark;
  --ui-font: 'Segoe UI Variable', 'Segoe UI', Arial, sans-serif;
  --control-radius: 8px;
  --panel-radius: 12px;
  --status-success: #74d6ab;
  --status-warning: #eed17e;
  --status-error: #f09f9f;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4ed;
  --page: #f3f4ed;
  --page-soft: #e9ebe2;
  --sidebar: #eceee5;
  --surface: #fbfcf7;
  --surface-soft: #f5f6ef;
  --surface-raised: #ffffff;
  --surface-accent: #eceee3;
  --surface-strong: #e7e9df;
  --surface-2: #e7e9df;
  --surface-3: #dde0d4;
  --line: rgba(35, 38, 27, 0.13);
  --line-strong: rgba(111, 113, 21, 0.42);
  --text: #202219;
  --muted: #626654;
  --quiet: #777b68;
  --accent: #777916;
  --accent-strong: #5f610f;
  --accent-ink: #fbfcf5;
  --shadow: 0 28px 74px rgba(42, 45, 32, 0.14);
  --status-success: #186747;
  --status-warning: #77580d;
  --status-error: #a12b36;
}

.theme-toggle {
  width: 72px;
  height: 46px;
  min-width: 72px;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease;
}

.theme-toggle:hover .theme-toggle-scene { transform: translateY(-1px); }

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

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Adapted from rishichawda/fluffy-robin-48 on Uiverse (MIT). */
.theme-toggle-scene {
  width: 70px;
  height: 44px;
  display: block;
  overflow: visible;
  fill: none;
  stroke: none;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.22));
  transition: transform 180ms ease, filter 180ms ease;
}

.theme-toggle-scene * {
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    fill 250ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-sky { fill: #2b4360; }
.theme-toggle-stars { fill: #def8ff; opacity: 1; }
.theme-toggle-cloud { fill: #fff; opacity: 0; }
.theme-toggle-knob { transform: translateX(30px); }
.theme-toggle-sun { opacity: 0; }
.theme-toggle-sun-outer { fill: #f8e664; }
.theme-toggle-sun-inner { fill: #fcf4b9; }
.theme-toggle-moon { opacity: 1; }
.theme-toggle-moon-disc { fill: #cce6ee; }
.theme-toggle-moon-crater { fill: #a6cad0; }

.theme-toggle[aria-pressed="true"] .theme-toggle-sky { fill: #83cbd8; }
.theme-toggle[aria-pressed="true"] .theme-toggle-stars { opacity: 0; }
.theme-toggle[aria-pressed="true"] .theme-toggle-cloud { opacity: 1; }
.theme-toggle[aria-pressed="true"] .theme-toggle-knob { transform: translateX(0); }
.theme-toggle[aria-pressed="true"] .theme-toggle-sun { opacity: 1; }
.theme-toggle[aria-pressed="true"] .theme-toggle-moon { opacity: 0; }

.theme-controls,
.policy-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main storefront */
html[data-theme="light"] body {
  background-color: var(--bg);
  color: var(--text);
}

html[data-theme="light"] body.policy-page {
  background:
    radial-gradient(circle at 74% -8%, rgba(119, 121, 22, 0.09), transparent 34rem),
    linear-gradient(180deg, #f7f8f2 0%, var(--bg) 42%);
}

html[data-theme="light"] body.storefront-page {
  background:
    radial-gradient(circle at 62% -12%, rgba(119, 121, 22, 0.09), transparent 34rem),
    var(--bg);
}

html[data-theme="light"] .workspace,
html[data-theme="light"] .product-dossier,
html[data-theme="light"] .dossier-content {
  background: var(--bg);
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .topbar {
  background: rgba(243, 244, 237, 0.94);
}

html[data-theme="light"] .sidebar-logo img,
html[data-theme="light"] .policy-home img {
  box-shadow: 0 12px 28px rgba(42, 45, 32, 0.16);
}

html[data-theme="light"] .nav-item { color: #727765; }
html[data-theme="light"] .nav-item:hover { background: rgba(32, 34, 25, 0.045); }
html[data-theme="light"] .nav-item.active { background: rgba(119, 121, 22, 0.09); }

html[data-theme="light"] .product-tab {
  background: #e9ebe2;
  color: #626654;
}

html[data-theme="light"] .product-tab::after {
  background: linear-gradient(90deg, rgba(247, 248, 241, 0.94), rgba(247, 248, 241, 0.62) 60%, rgba(247, 248, 241, 0.9));
}

html[data-theme="light"] .product-tab.active::after {
  background: linear-gradient(90deg, rgba(244, 245, 237, 0.9), rgba(244, 245, 237, 0.46) 64%, rgba(244, 245, 237, 0.8));
}

html[data-theme="light"] .product-tab small,
html[data-theme="light"] .product-copy p,
html[data-theme="light"] .product-tags span,
html[data-theme="light"] .hero-price-row,
html[data-theme="light"] .crypto-button,
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .interactive-demo-header p,
html[data-theme="light"] .module-card ul,
html[data-theme="light"] .footer-policy-link,
html[data-theme="light"] .footer-cheatglobal {
  color: var(--muted);
}

html[data-theme="light"] .language-switch,
html[data-theme="light"] .language-switcher {
  background: rgba(251, 252, 247, 0.88);
}

html[data-theme="light"] .lang-button.active {
  background: var(--accent);
  box-shadow: none;
}

html[data-theme="light"] .product-hero {
  background: #eff1e8;
}

html[data-theme="light"] .hero-backdrop {
  opacity: 0.13;
  filter: grayscale(0.7) saturate(0.35) contrast(0.9);
}

html[data-theme="light"] .hero-backdrop::after {
  background:
    linear-gradient(90deg, #eff1e8 0%, rgba(239, 241, 232, 0.91) 32%, rgba(239, 241, 232, 0.64) 70%, #eff1e8 100%),
    linear-gradient(0deg, #eff1e8 0%, transparent 58%);
}

html[data-theme="light"] .product-tags span,
html[data-theme="light"] .hero-status-grid,
html[data-theme="light"] .hero-license-panel,
html[data-theme="light"] .crypto-button,
html[data-theme="light"] .secondary-button {
  background: rgba(251, 252, 247, 0.84);
}

html[data-theme="light"] .hero-license-panel {
  box-shadow: 0 24px 54px rgba(42, 45, 32, 0.12);
}

html[data-theme="light"] .hero-price-row,
html[data-theme="light"] .footer-cheatglobal {
  background: #f3f4ed;
}

html[data-theme="light"] .hero-price-row strong { color: #34372a; }
html[data-theme="light"] .hero-price-row.active { background: rgba(119, 121, 22, 0.09); }

html[data-theme="light"] .mobile-purchase-bar {
  background: rgba(243, 244, 237, 0.96);
  box-shadow: 0 -16px 34px rgba(42, 45, 32, 0.13);
}

html[data-theme="light"] .interactive-demo,
html[data-theme="light"] .dossier-tabs,
html[data-theme="light"] .dossier-tab {
  background: #eceee5;
}

html[data-theme="light"] .mw-demo-app,
html[data-theme="light"] .mw-demo-topline,
html[data-theme="light"] .mw-demo-sidebar,
html[data-theme="light"] .mw-demo-workspace,
html[data-theme="light"] .mw-demo-group,
html[data-theme="light"] .mw-demo-tab-icon,
html[data-theme="light"] .demo-select-row select,
html[data-theme="light"] .demo-color-row input,
html[data-theme="light"] .demo-profile-name input,
html[data-theme="light"] .demo-action,
html[data-theme="light"] .dossier-tab:hover,
html[data-theme="light"] .product-dossier .requirement-item,
html[data-theme="light"] .module-card,
html[data-theme="light"] .media-card {
  background: var(--surface);
}

html[data-theme="light"] .mw-demo-search,
html[data-theme="light"] .mw-demo-search kbd,
html[data-theme="light"] .demo-switch,
html[data-theme="light"] .tab-icon {
  background: var(--surface-2);
}

html[data-theme="light"] .mw-demo-group h3,
html[data-theme="light"] .module-group h4,
html[data-theme="light"] .demo-action.primary {
  color: var(--text);
}

html[data-theme="light"] .mw-demo-app,
html[data-theme="light"] .media-card:hover {
  box-shadow: 0 26px 66px rgba(42, 45, 32, 0.13);
}

html[data-theme="light"] .mw-preview-stage {
  /* The live game preview remains dark so ESP colors retain their intended contrast. */
  color-scheme: dark;
}

html[data-theme="light"] .mw-preview-help,
html[data-theme="light"] .mw-preview-profile,
html[data-theme="light"] .media-play-icon {
  background: rgba(20, 22, 17, 0.82);
}

html[data-theme="light"] .media-dialog,
html[data-theme="light"] .media-dialog img,
html[data-theme="light"] .media-dialog video {
  background: #11120f;
}

/* Policy */
html[data-theme="light"] .policy-header {
  background: rgba(243, 244, 237, 0.9);
}

html[data-theme="light"] .policy-summary {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(231, 233, 223, 0.94));
  box-shadow: 0 24px 60px rgba(42, 45, 32, 0.11);
}

html[data-theme="light"] .policy-nav a:hover,
html[data-theme="light"] .policy-nav .policy-nav__store:hover {
  background: rgba(119, 121, 22, 0.08);
}

html[data-theme="light"] .policy-chapter--support {
  background: linear-gradient(135deg, rgba(119, 121, 22, 0.06), transparent 58%), var(--surface);
}

/* Instructions */
html[data-theme="light"] body.instructions-page::before {
  background: linear-gradient(115deg, transparent 0 58%, rgba(32, 34, 25, 0.025) 58% 59%, transparent 59% 100%);
}

html[data-theme="light"] body.policy-page::before {
  background-image:
    linear-gradient(rgba(32, 34, 25, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 34, 25, 0.025) 1px, transparent 1px);
}

html[data-theme="light"] body.download-page::before {
  background:
    radial-gradient(circle at 76% 24%, rgba(119, 121, 22, 0.08), transparent 25rem),
    linear-gradient(135deg, transparent 0 61%, rgba(32, 34, 25, 0.022) 61% 61.3%, transparent 61.3%);
}

html[data-theme="light"] .manual-rail,
html[data-theme="light"] .manual-content,
html[data-theme="light"] .step-card,
html[data-theme="light"] .notice-card,
html[data-theme="light"] .resource-card,
html[data-theme="light"] .cfg-card {
  background-color: var(--surface);
}

/* Download pages */
html[data-theme="light"] .button-secondary,
html[data-theme="light"] .file-console {
  background: rgba(251, 252, 247, 0.94);
}

html[data-theme="light"] .file-console {
  box-shadow: 0 30px 80px rgba(42, 45, 32, 0.15);
}

html[data-theme="light"] .hero-character {
  filter: saturate(0.7) contrast(1.02) drop-shadow(0 28px 35px rgba(42, 45, 32, 0.22));
}

@media (max-width: 720px) {
  .theme-toggle {
    width: 64px;
    height: 40px;
    min-width: 64px;
    min-height: 40px;
    padding: 0;
  }

  .theme-toggle-scene { width: 62px; height: 39px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle-scene,
  .theme-toggle-scene * { transition-duration: 0.01ms !important; }
}

/* Common controls and semantic colors across the store, downloads and documentation. */
body.storefront-page, body.instructions-page, body.download-page, body.policy-page, body.check-key-page {
  font-family: var(--ui-font);
}
.storefront-page button, .download-page button, .instructions-page button, .policy-page button { font-family: var(--ui-font); }
.brand, .policy-home { color: var(--text); }
.brand img, .policy-home img, .sidebar-logo img { border-radius: var(--panel-radius); }
.button, .button-secondary, .footer-link, .primary-button, .secondary-button { border-radius: var(--control-radius); }
.language-switch, .language-switcher { border-radius: var(--control-radius); }
.storefront-page :is(a, button, summary, input, select):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.storefront-page .hero-price-row span, .storefront-page .hero-price-row strong { font-size: 14px; }
.storefront-page .undetected-status[data-state="undetected"],
.storefront-page .stock-status[data-state="ready"] { color: var(--status-success) !important; }
.storefront-page .undetected-status[data-state="undetected"] i { color: var(--bg); background: var(--status-success); }
.storefront-page .undetected-status[data-state="detected"],
.storefront-page .undetected-status[data-state="offline"],
.storefront-page .stock-status[data-state="empty"] { color: var(--status-error) !important; }
.storefront-page .undetected-status[data-state="maintenance"] { color: var(--status-warning) !important; }
.storefront-page .undetected-status[data-state="unknown"],
.storefront-page .undetected-status[data-state="loading"],
.storefront-page .stock-status[data-state="unknown"] { color: var(--muted) !important; }
.storefront-page .undetected-status:not([data-state="undetected"]) i { display: none; }
html[data-theme="light"] .mw-demo-group > summary,
html[data-theme="light"] .crypto-payment > summary { color: var(--text); }
html[data-theme="light"] .hero-status-grid small,
html[data-theme="light"] .hero-status-grid small time,
html[data-theme="light"] .mw-demo-search input::placeholder,
html[data-theme="light"] .module-count { color: var(--muted); }
