/* Shared black/cyan palette. Filename retained for existing page references.
   Colour treatment only: layout, dimensions and typography stay intact. */
:root, html[data-theme], html[data-theme] body, body {
  color-scheme: dark;
  --bg: #08080b !important;
  --bg-soft: #0e1217 !important;
  --panel: #12161b !important;
  --panel-2: #19212a !important;
  --text: #ffffff !important;
  --muted: #ffffff !important;
  --muted-2: #ffffff !important;
  --brand: #65cfff !important;
  --brand-1: #65cfff !important;
  --brand-2: #65cfff !important;
  --brand-3: #38bdf8 !important;
  --home-accent: #65cfff !important;
  --home-muted: #ffffff !important;
  --line: #65cfff1a !important;
  --line-strong: #65cfff33 !important;
  --home-line: #65cfff1a !important;
  --grad: linear-gradient(115deg, #091933, #0e2447) !important;
  --grad-soft: #65cfff0e !important;
  --ring: 0 0 0 3px #65cfff33 !important;
  --glow: 0 8px 28px #65cfff12 !important;
  --glass-edge: inset 0 1px 0 #65cfff08 !important;
}
html, html[data-theme] body {
  background: #08080b !important;
  color: #ffffff !important;
}
html[data-theme] body .site-header-frame { background: transparent !important; }
#stars, .bg-nebula { opacity: 0 !important; }
/* Remove the old wallpaper, grid, stars and ambient colour layers. */
html[data-theme] body::before, html[data-theme] body::after,
body::before, body::after,
.home-hero-background, .home-hero-background::after,
.home-product-background, .bg-nebula, #stars {
  background: none !important;
  box-shadow: none !important;
}
html[data-theme] body .home-hero { background: #08080b !important; }
html[data-theme] body :is(.home-product, .home-about-card, .home-partner-panel,
  .home-footer-panel, .home-video, .home-video-placeholder, .auth__card, .card,
  .panel, .modal__card, .modal__dialog, dialog, .home-product-dropdown,
  .home-settings-panel, .public-account-panel, .market-card, .market-item, .config-card,
  .cheat-config-card, .loader-config-card, .ref-invite-card, .ref-chart-card,
  .ref-insights, .ref-stat, .config-game-option) {
  background: #12161b !important;
  border-color: #65cfff1a !important;
  color: #ffffff !important;
  box-shadow: 0 10px 32px #00000024 !important;
}
/* Keep intentionally open workspace sections open. */
html[data-theme] body.account-redesign .main :is(.ref-program-card,
  .dashboard-subscriptions.card, .dashboard-top) {
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme] body :is(.home-product::before, .home-product::after) {
  background: radial-gradient(ellipse at 50% 35%, #65cfff18, transparent 70%) !important;
  box-shadow: none !important;
}
html[data-theme] body .home .home-nav::before,
html[data-theme] body.home .home-nav::before { background: #65cfff05 !important; }
html[data-theme] body .home .home-nav::after,
html[data-theme] body.home .home-nav::after { background: #03050999 !important; }
html[data-theme] body :is(.home-header-surface, .home-settings-panel::before) { background: #12161bf5 !important; }
html[data-theme] body .home-header-surface path { stroke: #65cfff1a !important; }
html[data-theme] body :is(h1, h2, h3, h4, h5, h6, label,
  .auth__title, .public-account-name, .home-video-wordmark, .home-requirements strong) {
  color: #ffffff !important;
}
html[data-theme] body :is(.muted, .small.muted, .auth__subtitle, .auth__hint,
  .home-platform, .home-footer-description, .home-footer-bottom, .home-footer-pending,
  .home-section-kicker, .workspace-nav-label, .home-settings-label) { color: #ffffff !important; }
html[data-theme] body :is(.home p, .home li, .auth-page p) { color: #ffffff !important; }
html[data-theme] body :is(.home-nav-links > a, .home-auth-link,
  .home-settings-toggle, .home-products-toggle, .home-footer-column a,
  .home-footer-language, .home-settings-panel button, .workspace-nav .side__item) { color: #ffffff !important; }
html[data-theme] body :is(.home-nav-links > a, .home-footer-column a,
  .home-footer-language, .home-auth-link, .home-settings-panel button):hover {
   color: #ffffff !important;
  text-shadow: none !important;
}
html[data-theme] body :is(.ref-faq-list a, .auth__hint a, .legal-layout a,
  .config-subscription-notice a, #configSubscriptionNotice a) { color: #ffffff !important; }
html[data-theme] body :is(.market-kicker, .market-earned, .market-price, .market-item__price) { color: #ffffff !important; }
html[data-theme] body :is(input, textarea, select, .input) {
  background: #0e1217 !important;
  color: #ffffff !important;
  border-color: #65cfff26 !important;
  box-shadow: none !important;
}
html[data-theme] body ::placeholder { color: #ffffff !important; opacity: 1; }
html[data-theme] body :is(.btn, .home-button, .home-account-action, .ref-gear) {
  background: #091426 !important;
  color: #ffffff !important;
  border-color: #65cfff2e !important;
  box-shadow: none !important;
}
html[data-theme] body :is(.btn--primary, .home-button-primary,
  .home-account-action[href="/register"], .dashboard-wallet > .btn) {
  background: #091933 !important;
  color: #ffffff !important;
  border-color: #26456980 !important;
  box-shadow: 0 5px 22px #18335b12 !important;
}
html[data-theme] body :is(.btn--primary, .home-button-primary,
  .home-account-action[href="/register"], .dashboard-wallet > .btn):hover {
  background: #0e2447 !important;
  border-color: #365785 !important;
  color: #ffffff !important;
}
html[data-theme] body :is(.public-account-link, .home-account-action[href="/login"]) { background: transparent !important; }
html[data-theme] body :is(.workspace-nav .is-active, .config-game-option[aria-current=true],
  .config-tabs [aria-selected=true], .admin-tab.is-active,
  .ref-section-tabs [aria-selected=true], .ref-periods [aria-pressed=true],
  .ref-tier-card li[aria-current=step]) {
  color: #ffffff !important;
  border-color: #65cfff47 !important;
  background: #65cfff0e !important;
}
html[data-theme] body .ref-section-tabs [aria-selected=true] { background: transparent !important; }
html[data-theme] body .ref-dashboard { --ref-highlight: #65cfff; --ref-accent: #65cfff; }
html[data-theme] body :is(.ref-rate, .ref-tier-card li[aria-current=step] > span) {
  color: #ffffff !important;
  background: none !important;
  -webkit-text-fill-color: currentColor;
}
html[data-theme] body :is(.platform-minimal, .home-status, .home-status-soon) { color: #ffffff !important; }
html[data-theme] body .public-account-balance { color: #ffffff !important; }
html[data-theme] body .public-account-balance::after { color: #65cfff; background: #65cfff0a; border-color: #65cfff2e; }
html[data-theme] body .kusaka-intro { background: #08080b !important; }
html[data-theme] body .kusaka-intro-wordmark { color: #ffffff !important; }
html[data-theme] body.maintenance-page :is(.brand, .icon, .status) { color: #ffffff; border-color: #65cfff33; background: #65cfff0a; }
html[data-theme] body.maintenance-page .actions button { background: #091933; color: #ffffff; }
html[data-theme] body :is(.home-brand img, .kusaka-intro img, .workspace-brand img) { filter: none !important; }
html[data-theme] body :is(.home-product, .market-card, .market-item, .config-game-option):hover { border-color: #65cfff47 !important; box-shadow: 0 10px 36px #65cfff0a !important; }
html[data-theme] body :focus-visible { outline: 2px solid #38bdf8 !important; outline-offset: 3px; }
/* Explicit text policy also covers legacy hard-coded colours and hover states.
   Excluding SVG keeps status and action icons available as visual accents. */
html[data-theme]:is(html, #kusaka-text-palette) body :where(*):not(svg, svg *) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html[data-theme]:is(html, #kusaka-text-palette) body ::placeholder {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
/* Disable transparent text fills without altering headline typography. */
html[data-theme]:is(html, #kusaka-text-palette) body :where(h1, h2, h3, h4, h5, h6) {
  background-image: none !important;
}
::selection { color: #ffffff; background: #075985; }
/* Neon mist stays at the edges, leaving most of the viewport in black. */
html[data-theme] body {
  isolation: isolate;
  background: #020205 !important;
}
html[data-theme] body::before,
html[data-theme] body::after {
  content: "";
  position: fixed;
  inset: -4%;
  z-index: -1;
  pointer-events: none;
  mask: url('../img/neon-mist.png') center / 100% 100% no-repeat;
  mask-mode: luminance;
  animation: none;
  will-change: auto;
}
html[data-theme] body::before {
  background:
    radial-gradient(ellipse 17% 48% at 93% 63%, #244aff 0%, #132d8c99 45%, transparent 100%),
    radial-gradient(ellipse 15% 40% at 4% 78%, #a61465 0%, #650c4199 42%, transparent 100%) !important;
  opacity: .9;
}
html[data-theme] body::after {
  background:
    radial-gradient(ellipse 9% 42% at 92% 49%, #df237b 0%, #9a134fbb 28%, transparent 100%),
    radial-gradient(ellipse 10% 37% at 8% 84%, #125bff 0%, #123aafaa 35%, transparent 100%) !important;
  transform: scaleX(-1);
  opacity: .78;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-theme] body::before { animation: mist-far 22s ease-in-out infinite alternate; }
  html[data-theme] body::after { animation: mist-near 13s ease-in-out infinite alternate; }
}
@keyframes mist-far {
  from { transform: translate(-2%, 3%) scale(1.02); }
  to { transform: translate(2%, -5%) scale(1.06); }
}
@keyframes mist-near {
  from { transform: translate(2%, -5%) scale(-1.03, 1.03); opacity: .55; }
  to { transform: translate(-2%, 5%) scale(-1, 1); opacity: .94; }
}
html[data-theme] body .home-hero { background: transparent !important; }

@property --star-colour {
  syntax: "<color>";
  inherits: true;
  initial-value: #a72773;
}
.neon-starfall {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.neon-starfall > i {
  position: absolute;
  top: calc(0px - var(--star-length));
  left: var(--star-x);
  width: var(--star-width);
  height: var(--star-length);
  background: linear-gradient(transparent, var(--star-colour));
  opacity: 0;
}
.neon-starfall > i::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--star-head);
  height: var(--star-head);
  border-radius: 50%;
  background: var(--star-colour);
  box-shadow: 0 0 7px var(--star-colour);
}
@media (prefers-reduced-motion: no-preference) {
  .neon-starfall > i {
    animation:
      neon-star-fall var(--star-duration) linear var(--star-delay) infinite,
      neon-star-colour var(--star-colour-duration) ease-in-out var(--star-colour-delay) infinite alternate;
  }
}
@keyframes neon-star-fall {
  0% { transform: translateY(0); opacity: 0; }
  12%, 78% { opacity: .55; }
  100% { transform: translateY(calc(100vh + var(--star-length))); opacity: 0; }
}
@keyframes neon-star-colour {
  from { --star-colour: #a72773; }
  to { --star-colour: #354dcc; }
}
@media (max-width: 700px) {
  .neon-starfall > i:nth-child(even) { display: none; }
}

/* Let the shared atmosphere show through the homepage cards. */
html[data-theme] body.home :is(.home-product, .home-partner-panel, .home-requirements > div) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-theme] body.home :is(.home-product, .home-product-art, .home-partner-panel)::before,
html[data-theme] body.home .home-product::after,
html[data-theme] body.home .home-product-background {
  display: none !important;
}
html[data-theme] body :is(.home-support-toggle, .home-support-menu, .home-support-channel) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html[data-theme] body.home .home-platform-chip {
  background: transparent !important;
  box-shadow: none !important;
}
/* Configuration library surfaces share the account background. */
html[data-theme] body.account-redesign .config-library-workspace,
html[data-theme] body.account-redesign .config-library-workspace :is(
  .config-category, .config-game-option, .config-game-art, .config-tabs,
  .config-tabs [role=tab], .loader-config-banner, .loader-config-card,
  .cheat-config-card, .loader-config-empty, .loader-config-icon,
  .loader-banner-open, .cheat-config-selected, .cheat-share, .input),
html[data-theme] body.account-redesign .config-library-workspace .loader-import > div {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* Profile settings and account popups use the same transparent surfaces. */
html[data-theme] body.account-redesign :is(.profile-settings, .profile-settings__row,
  .modal__card, .modal__dialog, dialog),
html[data-theme] body.account-redesign :is(.profile-settings, .modal__card, .modal__dialog, dialog)
  :is(.input, input, textarea, select, .card, .panel, .account-tool-message) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
