/* Golden Fox night palette. Loaded last because several page styles use fixed light colours. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
    color-scheme: dark;
    --nv-background: #110d19;
    --nv-foreground: #f7f2ff;
    --nv-card: #efe6fa;
    --nv-helper: #251c32;
    --nv-muted: #c8bdd7;
    --nv-border: #4b3d5b;
    --nv-primary: #c9a9ff;
    --nv-primary-hover: #e0caff;
    --nv-secondary: #f6cd5d;
    --night-surface: #1c1527;
    --night-raised: #2b2139;
    --night-action: #7132b5;
    --night-error: #ffd0d0;
}

html[data-theme="dark"] ::selection { background: #c9a9ff; color: #160d22; }
html[data-theme="dark"] :focus-visible { outline-color: #f6cd5d; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #b9abc9; opacity: 1; }
html[data-theme="dark"] :is(input, select, textarea) { caret-color: #f6cd5d; }
html[data-theme="dark"] { scrollbar-color: #67547d #110d19; }

/* Shared navigation, overlays and controls. */
html[data-theme="dark"] :is(.figma-utility, .figma-header, .figma-footer, .figma-search, .figma-mobile-menu, .cookie-banner, .toast) {
    background: var(--night-surface);
    color: var(--nv-foreground);
    border-color: var(--nv-border);
}
html[data-theme="dark"] :is(.figma-utility__inner, .figma-brand, .figma-header__links a, .figma-signin, .figma-footer address) { color: var(--nv-foreground); }
html[data-theme="dark"] .figma-utility__inner strong { background: #443751; color: var(--nv-foreground); }
html[data-theme="dark"] .figma-header__links :is(a:hover, a[aria-current="page"]),
html[data-theme="dark"] .figma-footer :is(a:hover, button:hover) { color: var(--nv-primary); }
html[data-theme="dark"] .figma-search-button > span { border-color: var(--nv-foreground); }
html[data-theme="dark"] .figma-search-button > span::after { background: var(--nv-foreground); }
html[data-theme="dark"] .figma-search__control input,
html[data-theme="dark"] .nv-faq-search input { background: var(--night-raised); color: var(--nv-foreground); }
html[data-theme="dark"] .figma-balance { background: var(--night-raised); }
html[data-theme="dark"] .figma-coin { color: #271b08; }
html[data-theme="dark"] .figma-avatar { background: #443456; color: var(--nv-foreground); }
html[data-theme="dark"] .figma-theme-toggle { border-color: #746085; background: #33263f; color: #f6cd5d; }
html[data-theme="dark"] .figma-theme-toggle:hover { background: #463452; }
html[data-theme="dark"] .figma-theme-toggle__moon { display: none; }
html[data-theme="dark"] .figma-theme-toggle__sun { display: block; }
html[data-theme="dark"] .figma-launch,
html[data-theme="dark"] .figma-menu-button,
html[data-theme="dark"] .nv-button--primary { background: var(--night-action); color: #fff; }
html[data-theme="dark"] .nv-button--primary:hover { background: #8746cd; }
html[data-theme="dark"] .nv-button--secondary { color: #25182e; }
html[data-theme="dark"] .figma-footer__age { background: #493857; color: #fff; }
html[data-theme="dark"] .account-verification-notice { background: #322442; color: #f0e3ff; }
html[data-theme="dark"] .account-verification-notice a { color: var(--nv-primary); }
html[data-theme="dark"] .cookie-banner .eyebrow { color: var(--nv-primary); }

/* Homepage sections and cards. */
html[data-theme="dark"] .nv-hero { background: #4d227c; }
html[data-theme="dark"] .nv-feature-band { background: #0b0810; }
html[data-theme="dark"] .nv-fact-grid article.is-outlined,
html[data-theme="dark"] .nv-community,
html[data-theme="dark"] .nv-review-rail article { background: var(--night-surface); }
html[data-theme="dark"] .nv-review-rail article:nth-child(odd) { background: var(--nv-helper); }
html[data-theme="dark"] :is(.nv-earn-panel, .nv-streak, .nv-pack.is-selected, .nv-faq-notice, .nv-game-card.is-featured) {
    background: #55258a;
    color: #fff;
}
html[data-theme="dark"] .nv-pack__top em { background: var(--night-surface); color: var(--nv-foreground); }
html[data-theme="dark"] .nv-streak li.is-complete { color: #25182e; }
html[data-theme="dark"] .nv-feature-card:nth-child(6) { background: #16101f; }
html[data-theme="dark"] .nv-faq-notice .nv-button--secondary { color: #25182e; }

/* Account and profile. */
html[data-theme="dark"] :is(.page-account, .page-profile) .site-main,
html[data-theme="dark"] .nv-account { background: var(--nv-background); color: var(--nv-foreground); }
html[data-theme="dark"] :is(.nv-account-card, .nv-account-guest, .nv-profile-card, .nv-profile-shortcuts, .nv-profile-details, .nv-profile-features article) {
    border-color: var(--nv-border);
    background: var(--night-surface);
    color: var(--nv-foreground);
    box-shadow: none;
}
html[data-theme="dark"] .nv-account-guest--dark { background: var(--night-surface); }
html[data-theme="dark"] :is(.nv-account-identity__copy h2, .nv-account-identity__meta dd, .nv-account-card__heading h2,
    .nv-account-safety h2, .nv-account-empty h3, .nv-account-guest h1, .nv-profile-card h2,
    .nv-profile-card__facts dd, .nv-profile-heading h1, .nv-profile-details, .nv-profile-details__grid dd,
    .nv-profile-features, .nv-profile-section-heading h2, .nv-profile-features h3, .nv-account-activity__table td strong) {
    color: var(--nv-foreground);
}
html[data-theme="dark"] :is(.nv-account-identity__copy > p[data-account-email], .nv-account-identity__meta dt,
    .nv-account-card__heading p:not(.nv-account-kicker), .nv-account-empty p, .nv-account-safety p:last-child,
    .nv-account-guest > p:not(.nv-account-kicker), .nv-profile-card__email, .nv-profile-card__facts dt,
    .nv-profile-heading > p:last-child, .nv-profile-details__grid dt, .nv-profile-details__help,
    .nv-profile-features p, .nv-profile-edit > p, .nv-account-menu small) { color: var(--nv-muted); }
html[data-theme="dark"] :is(.nv-account-menu > a, .nv-account-menu__logout button, .nv-profile-shortcuts > a, .nv-profile-shortcuts button) { color: var(--nv-foreground); }
html[data-theme="dark"] :is(.nv-account-menu > a:hover, .nv-account-menu__logout button:hover, .nv-account-menu > a.is-active,
    .nv-profile-shortcuts > a:hover, .nv-profile-shortcuts button:hover) { background: #38254f; color: #e4ccff; }
html[data-theme="dark"] :is(.nv-account-menu__icon, .nv-profile-features article > span, .nv-account-safety__mark) { background: #3b2b51; color: #d9b9ff; }
html[data-theme="dark"] :is(.nv-account-kicker, .nv-account-text-link, .nv-account-flair, .nv-profile-card__label,
    .nv-profile-heading .nv-account-kicker, .nv-profile-section-heading .nv-account-kicker, .nv-profile-details__help a) { color: var(--nv-primary); }
html[data-theme="dark"] :is(.nv-account-identity__meta, .nv-account-menu > a + a, .nv-account-menu__logout,
    .nv-account-activity__table-wrap, .nv-account-activity__table th, .nv-account-activity__table td,
    .nv-account-empty, .nv-account-inline-notice, .nv-profile-card__facts, .nv-profile-card__facts > div,
    .nv-profile-shortcuts > a + a, .nv-profile-shortcuts form, .nv-profile-details__grid,
    .nv-profile-details__grid > div) { border-color: var(--nv-border); }
html[data-theme="dark"] .nv-account-activity__table { color: var(--nv-muted); }
html[data-theme="dark"] .nv-account-activity__table th { background: var(--night-raised); color: var(--nv-muted); }
html[data-theme="dark"] .nv-account-inline-notice { background: #3d321d; color: #fbe3a1; }
html[data-theme="dark"] .nv-account-empty__coin { background: #42351e; color: #f6cd5d; }
html[data-theme="dark"] .nv-profile-status { border-color: var(--nv-border); background: #3b2b51; color: var(--nv-foreground); }
html[data-theme="dark"] .nv-account-amount.is-positive { color: #8de3b5; }
html[data-theme="dark"] .nv-account-amount.is-negative { color: #ffacba; }

/* Store and payment return. */
html[data-theme="dark"] :is(.page-store, .page-legal) .page-hero,
html[data-theme="dark"] :is(.fp-page-hero, .fp-responsible-hero, .catalog-mobile-intro) { background: #4d227c; }
html[data-theme="dark"] :is(.page-store, .page-payment-return) .store-section { background: var(--nv-background); color: var(--nv-foreground); }
html[data-theme="dark"] :is(.page-store .store-balance, .page-store .store-package, .page-store .store-billing,
    .page-payment-return .store-billing) { border-color: var(--nv-border); background: var(--night-surface); color: var(--nv-foreground); }
html[data-theme="dark"] .page-store .store-package--popular { border-color: #a97bea; background: #55258a; color: #fff; }
html[data-theme="dark"] .page-store :is(.store-balance h2, .store-heading h2, .store-package h3,
    .store-trust-grid h3, .store-package__price strong, .store-package__coins, .store-billing h3),
html[data-theme="dark"] .page-payment-return .store-billing h2 { color: var(--nv-foreground); }
html[data-theme="dark"] .page-store .store-package--popular :is(h3, .store-package__price strong, .store-package__coins) { color: #fff; }
html[data-theme="dark"] .page-store :is(.store-balance p, .store-heading > p, .store-package__bonus,
    .store-package__price span, .store-trust-grid p, .store-billing__intro p, .store-billing__note,
    .store-billing__country) { color: var(--nv-muted); }
html[data-theme="dark"] .page-store .store-package--popular :is(.store-package__bonus, .store-package__price span) { color: #f1e8ff; }
html[data-theme="dark"] .page-store .store-package .button { border-color: var(--nv-primary); color: var(--nv-foreground); }
html[data-theme="dark"] .page-store .store-package--popular .button,
html[data-theme="dark"] .page-store .store-package__radio:checked + .store-package__choice .store-package__action { border-color: #f6cd5d; background: #f6cd5d; color: #25182e; }
html[data-theme="dark"] .page-store .store-billing__fields input { border-color: #77678a; background: var(--night-raised); color: var(--nv-foreground); }
html[data-theme="dark"] .page-store .store-billing__alert { background: #49282d; color: var(--night-error); }
html[data-theme="dark"] .page-store .store-trust-grid { border-color: var(--nv-border); }
html[data-theme="dark"] .page-store .store-section .eyebrow,
html[data-theme="dark"] .page-store .store-trust-grid article > span { color: var(--nv-primary); }
html[data-theme="dark"] .page-store .store-package__price { border-color: var(--nv-border); }
html[data-theme="dark"] .page-store .responsible-callout { background: #20172d; }

/* Public forms, FAQ and information pages. */
html[data-theme="dark"] :is(.age-gate, .fp-auth-card, .fp-contact, .fp-faq, .fp-not-found,
    .fp-responsible-intro, .fp-responsible-controls, .fp-responsible-signs, .fp-responsible-partners) {
    background: var(--nv-background);
    color: var(--nv-foreground);
}
html[data-theme="dark"] .age-gate,
html[data-theme="dark"] .fp-auth-card { background: var(--night-surface); border-color: var(--nv-border); }
html[data-theme="dark"] .fp-auth { background: var(--nv-background); }
html[data-theme="dark"] :is(.fp-contact-card, .fp-faq-categories button, .fp-faq-item, .fp-faq-toggle,
    .fp-faq-empty, .fp-control-card, .fp-partner-grid article) { background: var(--night-surface); border-color: var(--nv-border); color: var(--nv-foreground); }
html[data-theme="dark"] .fp-partner-grid article:nth-child(2) { background: var(--night-raised); border-color: #9d73d0; }
html[data-theme="dark"] :is(.fp-auth h1, .fp-contact h2, .fp-not-found h1,
    .fp-responsible-intro h2, .fp-responsible-controls h2, .fp-responsible-signs h2,
    .fp-responsible-partners h2, .fp-control-card h3, .fp-partner-grid h3,
    .fp-support-item a, .fp-support-item strong, .fp-field, .fp-field > span:first-child,
    .fp-faq-search > span:first-child,
    .fp-check, .fp-faq-categories button, .fp-faq-item h2 button, .fp-professional-support dt) { color: var(--nv-foreground); }
html[data-theme="dark"] :is(.age-gate__note, .fp-auth-heading p, .fp-auth-switch,
    .fp-field input::placeholder, .fp-field textarea::placeholder, .fp-support-item p,
    .fp-faq-answer, .fp-responsible-intro .fp-lead, .fp-responsible-intro .fp-lead + p,
    .fp-responsible-heading > p:last-child, .fp-control-card p, .fp-signs-grid > div > p,
    .fp-signs-grid ul, .fp-professional-support > p, .fp-partner-grid p) { color: var(--nv-muted); }
html[data-theme="dark"] :is(.age-gate__brand, .age-gate__policy, .fp-auth-switch a,
    .fp-auth-help a, .fp-consents a, .fp-support-item h3, .fp-kicker,
    .fp-professional-support a, .fp-partner-grid a) { color: var(--nv-primary); }
html[data-theme="dark"] :is(.fp-field input, .fp-field select, .fp-field textarea,
    .fp-contact-form .fp-field input, .fp-contact-form .fp-field select,
    .fp-contact-form .fp-field textarea, .fp-faq-search input) {
    border-color: var(--nv-border);
    background: var(--night-raised);
    color: var(--nv-foreground);
}
html[data-theme="dark"] .fp-faq-list { border-color: var(--nv-border); }
html[data-theme="dark"] .fp-faq-toggle::before,
html[data-theme="dark"] .fp-faq-toggle::after { background: var(--nv-foreground); }
html[data-theme="dark"] .fp-faq-categories button.is-active { background: #f6cd5d; color: #25182e; }
html[data-theme="dark"] .fp-form-alert { border-color: #9e5d64; background: #49282d; color: var(--night-error); }
html[data-theme="dark"] .fp-form-alert.is-success { border-color: #4a9672; background: #1c3a2d; color: #bcf4d3; }

/* Catalogue, game shell and legal text. */
html[data-theme="dark"] :is(.figma-catalog, .figma-game-page) {
    --catalog-ink: #f7f2ff;
    --catalog-muted: #c8bdd7;
    --catalog-border: #4b3d5b;
    --catalog-soft: #251c32;
    --catalog-purple: #7132b5;
    --catalog-yellow: #f6cd5d;
}
html[data-theme="dark"] :is(.catalog-browse, .catalog-picks, .catalog-popular, .figma-game-details) { background: var(--nv-background); }
html[data-theme="dark"] :is(.catalog-status, .catalog-filters, .catalog-filters input, .catalog-filters select,
    .catalog-pick-card__body > span, .figma-game-shell, .figma-rule-list .accordion-item,
    .figma-rule-list button) { background: var(--night-surface); color: var(--nv-foreground); }
html[data-theme="dark"] .catalog-filters :is(input, select) { background: var(--night-raised); }
html[data-theme="dark"] .catalog-section-heading--popular > div:first-child > span,
html[data-theme="dark"] .figma-game-shell__help a { color: var(--nv-primary); }
html[data-theme="dark"] .catalog-popular-card.is-featured { background: #55258a; }
html[data-theme="dark"] .catalog-secondary,
html[data-theme="dark"] :is(.figma-game-title__actions .is-yellow, .figma-game-chip.is-yellow,
    .figma-how-play li::before) { color: #25182e; }
html[data-theme="dark"] .catalog-section-heading .catalog-secondary { color: #25182e; }
html[data-theme="dark"] .figma-game-stage-section { background: #4d227c; }

/* Fox Circuit and Style Vault. */
html[data-theme="dark"] .page-circuit { background: var(--nv-background); }
html[data-theme="dark"] .fc-hero { background: radial-gradient(circle at 78% 30%, #7444ac 0, transparent 33%), linear-gradient(125deg, #1d102b, #4d227c 68%, #69349c); }
html[data-theme="dark"] :is(.fc-notice, .fc-overview > div, .fc-goal, .fc-style, .fc-table-wrap, .fc-empty) {
    border-color: var(--nv-border);
    background: var(--night-surface);
    color: var(--nv-foreground);
    box-shadow: none;
}
html[data-theme="dark"] :is(.fc-notice strong, .fc-heading h2, .fc-overview strong,
    .fc-goal h3, .fc-style h3, .fc-style__bottom strong) { color: var(--nv-foreground); }
html[data-theme="dark"] :is(.fc-notice p, .fc-heading > p, .fc-dates, .fc-overview span,
    .fc-overview small, .fc-overview strong small, .fc-goal p, .fc-style p,
    .fc-table th, .fc-empty, .fc-footnote) { color: var(--nv-muted); }
html[data-theme="dark"] .fc-kicker { color: var(--nv-primary); }
html[data-theme="dark"] .fc-hero .fc-kicker { color: #ffe27c; }
html[data-theme="dark"] .fc-button--outline { border-color: #a67ccf; color: #e3c8ff; }
html[data-theme="dark"] .fc-hero .fc-button--outline { color: #fff; }
html[data-theme="dark"] .fc-goal__icon { background: #39264c; color: #dfbbff; }
html[data-theme="dark"] .fc-style__symbol { background: #38244b; color: #dfbbff; }
html[data-theme="dark"] .fc-style--royal .fc-style__symbol { background: #fff1b8; color: #815700; }
html[data-theme="dark"] .fc-style--midnight .fc-style__symbol { background: #261446; color: #d8a7ff; }
html[data-theme="dark"] .fc-style__bottom,
html[data-theme="dark"] .fc-table :is(th, td) { border-color: var(--nv-border); }
html[data-theme="dark"] .fc-table .is-self { background: #3b2b51; }
html[data-theme="dark"] :is(.fc-overview progress, .fc-goal progress)::-webkit-progress-bar { background: #463554; }
html[data-theme="dark"] .fc-action-error { border-color: #9e5d64; background: #49282d; color: var(--night-error); }

html[data-theme="dark"] .page-legal .legal-section { background: var(--nv-background); color: var(--nv-foreground); }
html[data-theme="dark"] .page-legal .legal-nav { background: var(--night-surface); border-color: var(--nv-border); }
html[data-theme="dark"] .page-legal :is(.legal-content, .prose, .legal-content h2) { color: var(--nv-foreground); }
html[data-theme="dark"] .page-legal :is(.legal-nav a, .legal-nav > p:last-child) { border-color: var(--nv-border); color: var(--nv-muted); }
html[data-theme="dark"] .page-legal .legal-content section + section { border-color: var(--nv-border); }
html[data-theme="dark"] .page-legal :is(.legal-nav .eyebrow, .legal-nav a:hover, .prose a) { color: var(--nv-primary); }
html[data-theme="dark"] .page-loading .site-main { background: var(--nv-background); }

@media (max-width: 900px) {
    html[data-theme="dark"] .figma-theme-toggle--menu { width: 100%; border-radius: 10px; }
}
