/* ==========================================================================================
   Nighttide Arcane — shared theme tokens + base components for DOM menus.

   Loaded BEFORE style.css / hud-layout.css (see apps/web/game/index.html), so any modal can
   read these tokens. New/restyled menu CSS should take every color, font, radius and shadow
   from a --nn-* token here instead of a raw literal. Direction chosen 2026-10-02 (see
   BACKLOG.md's "Menu Visual Theme Pass" entry and the Forge Restyle Study mockup).

   Migration status: ForgeModal (+ its Configure / Legend / Sell-confirm overlays) is the
   first, reference consumer; ReservoirModal (Claim / Etchings / Emberwatch tabs + help
   overlay) is the second, in the .nn-theme-gold variant below; EventsModal (+ embedded
   World Boss / Dungeon panels) is the third, in .nn-theme-sky. The Leaderboard swaps variants
   per tab (gold / blood / default violet), and the Shop per market (gold / blood / sky). The Dreadfort (all of its panels and
   dialogs) uses .nn-theme-copper, and the Professions scene and the Pets modal .nn-theme-moss.
   The "While You Were Away" catch-up summary popup is gold, like the Reservoir it claims into.
   The World Boss battle replay HUD is sky (like its Events panel) and the AFK Boss replay gold
   (like the Rewards modal it is claimed from). The title screen (TitleScene) is default violet,
   the logo's own hue; only its dev-only test-accounts dialog is gold. The Syndicate modal
   and the Active Skills, Talents and Ascendancy modals are on the default
   violet. So is the whole PlayScene chrome (HUD, Settings, Information, World Chat, toasts,
   Energy Saver veil); its onboarding takeover is gold, and each HUD icon tile carries the variant
   class of the menu it opens. The Extract Essence scene is default violet too, with its tile
   kinds on the --nn-ore / --nn-gold / --nn-danger hues, and so is Augment Attunement (pair hues
   --nn-attune-*). The Skirmish scene and the PvP battle scene are .nn-theme-blood, and the
   Sundered Vault battle scene and queue banner .nn-theme-sky. The cinematic intro is default
   violet. Other menus still use their own bespoke
   colors until migrated —
   see BACKLOG.md.
   ========================================================================================== */

/* Fonts are self-hosted (not Google-hosted) so the desktop/Android builds work offline.
   Latin subset only — every shipped locale is English. Licenses: fonts/OFL-*.txt. */
@font-face {
  font-family: 'Marcellus SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/marcellus-sc-latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('./fonts/mulish-latin-variable.woff2') format('woff2');
}

:root {
  /* Type */
  --nn-font-display: 'Marcellus SC', Georgia, serif;
  --nn-font-body: 'Mulish', 'Trebuchet MS', 'Segoe UI', sans-serif;
  /* Symbol glyphs on round icon buttons (the close "×"). Pinned rather than inherited: Mulish
     draws × ~1.6px below center at the close button's size, Trebuchet MS within 0.25px. */
  --nn-font-glyph: 'Trebuchet MS', Arial, sans-serif;

  /* Surfaces: 0 = panel ground, 1 = rows/cards/inputs, 2 = raised/hover */
  --nn-surface-0: #120e1f;
  --nn-surface-1: #1a1430;
  --nn-surface-2: #221a3d;
  --nn-scrim: rgba(7, 5, 14, 0.82);
  /* Guided-tour spotlight dimming (guideSpotlight.js): a touch lighter than the modal scrim, so
     the screen behind a tour still reads while the glowing control stands out. */
  --nn-spotlight-scrim: rgba(7, 5, 14, 0.7);
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(154, 116, 232, 0.16), transparent 70%);

  /* Lines: default dividers/row borders vs. the moonlit-silver frame line */
  --nn-line: #392d5c;
  --nn-line-soft: rgba(189, 181, 224, 0.4);
  --nn-line-strong: #bdb5e0;

  /* Text */
  --nn-text: #ece8f8;
  --nn-text-dim: #a59dc6;
  --nn-title: #e6e0ff;
  --nn-title-glow: 0 0 18px rgba(154, 116, 232, 0.55);

  /* Accent + semantic colors (semantic colors are not the accent) */
  --nn-accent: #9a74e8;
  --nn-accent-soft: rgba(154, 116, 232, 0.35);
  --nn-accent-ink: #ffffff;
  --nn-danger: #e0708a;
  --nn-danger-soft: rgba(224, 112, 138, 0.18);
  --nn-danger-line: rgba(224, 112, 138, 0.45);
  --nn-success: #8ee0b4;
  --nn-success-soft: rgba(142, 224, 180, 0.16);
  --nn-negative: #f08aa0;
  --nn-gold: #e8c46a;
  --nn-gold-soft: rgba(232, 196, 106, 0.42);
  --nn-success-line: rgba(142, 224, 180, 0.45);
  --nn-text-faint: #8a82a8;
  --nn-track: rgba(255, 255, 255, 0.08);
  --nn-scrim-inner: rgba(8, 5, 12, 0.65);
  --nn-accent-glow: rgba(154, 116, 232, 0.5);

  /* Ember: Crucible Heat's own hue. Crucible / Eclipse Anvil use it as their primary accent
     (spending Heat is the panel's lead action) instead of the violet primary, and the
     Reservoir's Emberwatch tab uses it for its Claim action + claim bar (the system's name). */
  --nn-ember: #e0a45a;
  --nn-ember-text: #ffe4bd;
  --nn-ember-line: rgba(240, 179, 90, 0.5);
  --nn-ember-soft: rgba(90, 52, 24, 0.35);
  --nn-heat: #fff1b8;
  --nn-heat-fill: linear-gradient(90deg, #7a3b12, #f0b35a, #fff1b8);
  --nn-btn-ember-bg: linear-gradient(180deg, #5a3418 0%, #351e0c 100%);
  --nn-shadow-btn-ember: inset 0 1px 0 rgba(255, 228, 189, 0.35), 0 0 16px rgba(240, 179, 90, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Gear stat categories (Crucible recipe lines, Anvil range bars). */
  --nn-stat-offensive: #ff9f7a;
  --nn-stat-defensive: #7cc4ff;
  --nn-stat-utility: #f0c75e;
  --nn-stat-tertiary: #c59bff;

  /* Stats modal section headings (StatsModal.js addSectionHeader), one hue per section so the
     long breakdown is easy to scan. Same in every menu variant. */
  --nn-stats-section-effective: #6fc0ff;
  --nn-stats-section-breakdown: #9be8d4;
  --nn-stats-section-augments: #d8b6ff;
  --nn-stats-section-build: #b8f0c9;
  --nn-stats-section-alchemy: #8fd7a2;
  --nn-stats-section-score: #ffd700;
  --nn-stats-section-archivist: #c9a8f5;
  --nn-stats-section-ascendancy: #9adba0;
  --nn-stats-section-passive: #f1c98e;
  --nn-stats-section-pipeline: #ffcf9f;

  /* Stat identity icons (statIconLabel.js). Same hue in every menu variant. The nine hues are
     spread around the wheel so no two stats share a color: red Power, orange Force, gold
     Velocity, green Health, cyan Agility, blue Defence, steel Armor, violet Ability Damage,
     pink Negate. */
  --nn-stat-power: #ff6b6b;
  --nn-stat-defence: #6fa8ff;
  --nn-stat-health: #6fe0a0;
  --nn-stat-force: #ff9a4d;
  --nn-stat-velocity: #ffd257;
  --nn-stat-ability-damage: #c08cff;
  --nn-stat-armor: #b4c2d8;
  --nn-stat-agility: #5fd8e8;
  --nn-stat-negate: #ff82c8;

  /* Augment tertiary-roll glows (equipped augment slots), one hue per tertiary stat. */
  --nn-aug-crit-rate: #ff6a2b;
  --nn-aug-splash-mobs-hit: #2fd6c6;
  --nn-aug-siphon: #e0264a;
  --nn-aug-attack-speed: #ffd23f;
  --nn-aug-shear: #b46cff;
  --nn-aug-cooldown-reduction: #4d9dff;
  --nn-aug-health-regen: #5ee07a;
  --nn-aug-duskthorn: #ff5fb4;
  --nn-aug-woundrot: #a8b83a;
  --nn-aug-cauterize: #cfd6e4;
  --nn-aug-accuracy: #8c8cff;
  --nn-aug-mirrorbreak: #7fe3d6;
  --nn-aug-truestrike: #ffa94d;

  /* Relic stat glows (relic slot rows + Stat Filter swatches), one hue per relic stat. Stats an
     augment tertiary also rolls reuse that tertiary's hue so the two panels read the same. */
  --nn-relic-power: #ff8a3d;
  --nn-relic-defence: #9fb8d8;
  --nn-relic-health: #5ee07a;
  --nn-relic-siphon: var(--nn-aug-siphon);
  --nn-relic-attack-speed: var(--nn-aug-attack-speed);
  --nn-relic-shear: var(--nn-aug-shear);
  --nn-relic-woundrot: var(--nn-aug-woundrot);
  --nn-relic-cauterize: var(--nn-aug-cauterize);
  --nn-relic-accuracy: var(--nn-aug-accuracy);
  --nn-relic-mirrorbreak: var(--nn-aug-mirrorbreak);
  --nn-relic-truestrike: var(--nn-aug-truestrike);
  --nn-relic-cooldown-reduction: var(--nn-aug-cooldown-reduction);

  /* Premium (paid) track: the Season Pass paid column, Nighttide Pass. Not re-pointed by the
     .nn-theme-* variants, so it stays violet inside gold/sky menus. */
  --nn-premium: #b58cff;
  --nn-premium-soft: rgba(181, 140, 255, 0.1);
  --nn-premium-line: rgba(181, 140, 255, 0.42);

  /* Mythic curio reveal (orange, hotter than ember). */
  --nn-mythic: #ff9d2e;
  --nn-mythic-glow: rgba(255, 157, 46, 0.55);
  --nn-mythic-soft: rgba(255, 157, 46, 0.22);

  /* Gloam Crystals price chips. */
  --nn-gloam: #7cc4ff;
  --nn-gloam-line: rgba(124, 196, 255, 0.5);

  /* Leaderboard podium (top-3 rows): gold / silver / bronze. Not re-pointed by the variants,
     so the podium reads the same in every leaderboard tab. */
  --nn-podium-1: #f0cd73;
  --nn-podium-2: #cfd6e4;
  --nn-podium-3: #d9975f;
  --nn-podium-1-soft: rgba(240, 205, 115, 0.12);
  --nn-podium-2-soft: rgba(207, 214, 228, 0.09);
  --nn-podium-3-soft: rgba(217, 151, 95, 0.12);

  /* Notification badge: the amber count / "!" bubble on HUD and sidebar buttons and tabs. Not
     re-pointed by the variants, so it reads the same on every button whatever menu it opens. */
  --nn-notif-bg: radial-gradient(circle at 30% 30%, #ffdf90 0%, #cc7d3f 100%);
  --nn-notif-ink: #2a1405;
  --nn-notif-line: rgba(255, 238, 184, 0.86);
  --nn-notif-shadow: 0 0 0 1px rgba(92, 41, 13, 0.32), 0 0 6px rgba(223, 157, 85, 0.2);

  /* Close X: the round red button every panel shares (style.css's global
     button[class*='close-button'] rule). Not re-pointed by the variants, so closing reads the
     same in every menu. */
  --nn-close-line: #edb3a4;
  --nn-close-bg: linear-gradient(180deg, rgba(84, 42, 42, 0.98), rgba(46, 22, 22, 0.98));
  --nn-close-ink: #ffe2da;
  --nn-close-shadow: 0 1px 8px rgba(160, 72, 72, 0.28);
  --nn-close-focus: rgba(255, 226, 218, 0.75);

  /* HUD text drawn straight over the game canvas, with no panel behind it. */
  --nn-hud-text-shadow: 0 1px 2px #050309, 0 0 4px rgba(0, 0, 0, 0.9);
  --nn-hud-text-shadow-strong: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.95);
  --nn-hud-stroke: #050309; /* -webkit-text-stroke on stage text over the canvas */
  --nn-hud-icon-shadow: drop-shadow(0 1px 2px #050309);

  /* HUD currency rows: each currency's own hue (Gloam Crystals use --nn-gloam, Dusk Marks
     --nn-gold). */
  --nn-currency-sigil: #ffd8d3;
  --nn-currency-ash: #ffb27a;

  /* Extract Essence mining tiles: each tile kind keeps its own hue in every mode (gem uses
     --nn-gold, fracture --nn-danger, plain rock the theme's own line color). */
  --nn-ore: #73d3c4;
  --nn-ore-text: #ccfff3;
  --nn-ore-line: rgba(115, 211, 196, 0.8);
  --nn-gem-text: #fff5d8;
  /* Fracture Reading adjacency numerals (1-8), the classic one-hue-per-count read. */
  --nn-mine-adjacent-1: #8ec7ff;
  --nn-mine-adjacent-2: #8ef0a0;
  --nn-mine-adjacent-3: #ff9a9a;
  --nn-mine-adjacent-4: #c99aff;
  --nn-mine-adjacent-5: #ffb56b;
  --nn-mine-adjacent-6: #7fe0e0;
  --nn-mine-adjacent-7: #f5f5f5;
  --nn-mine-adjacent-8: #b0b0b0;

  /* Augment Attunement pair hues (one per anchor pair, config/augmentAttunementConfig.js) and
     its instability tile. */
  --nn-attune-ember: #ff7a4a;
  --nn-attune-frost: #5fd1ff;
  --nn-attune-verdant: #6fe86f;
  --nn-attune-void: #b06bff;
  --nn-attune-storm: #ffe066;
  --nn-attune-umbral: #ff6ba8;
  --nn-attune-radiant: #f7e98e;
  --nn-attune-bloom: #4adfc0;
  --nn-attune-instability: #ffcf4a;
  --nn-attune-instability-line: rgba(255, 140, 60, 0.5);
  --nn-attune-zap: rgba(255, 140, 40, 0.9);
  --nn-attune-track-ink: rgba(10, 4, 18, 0.85);

  /* Energy Saver veil backdrop (opaque: it rests the screen). */
  --nn-veil: radial-gradient(ellipse at center, #120e1f 0%, #000 70%);

  /* Page ground behind the canvas and menus (html/body/#app/canvas), and the root backdrop. */
  --nn-page-bg: #05070d;
  --nn-page-text: #f8f1e7;
  --nn-page-backdrop:
    radial-gradient(circle at 20% 20%, rgba(253, 175, 93, 0.16), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(95, 121, 173, 0.12), transparent 25%),
    linear-gradient(180deg, #05070d 0%, #0d1322 45%, #1a1220 100%);
  /* Pure black, for drop shadows and fades: alpha via color-mix(in srgb, var(--nn-black) N%, transparent). */
  --nn-black: #000;

  /* EXP bar fill. */
  --nn-exp-fill: linear-gradient(90deg, #3fae74 0%, #8ee0b4 100%);

  /* Invulnerability window (Nighttide Bulwark on the HUD cooldown dock). */
  --nn-invuln: #99ecff;
  --nn-invuln-glow: rgba(120, 228, 255, 0.55);
  --nn-invuln-badge: linear-gradient(180deg, rgba(212, 245, 255, 0.98), rgba(121, 198, 233, 0.98));

  /* Battle HP bars (PvP duel): the player's side reads blue (--nn-stat-defensive), the
     opponent's red; an absorb shield is a pale-blue striped overlay; an invulnerability window
     rims the bar in pale gold. */
  --nn-hp-player-fill: linear-gradient(90deg, #2d7ed6 0%, #5eb8ff 100%);
  --nn-hp-opponent-fill: linear-gradient(270deg, #c94040 0%, #ff6b5e 100%);
  --nn-shield-light: rgba(153, 230, 255, 0.65);
  --nn-shield-mid: rgba(95, 193, 255, 0.8);
  --nn-shield-deep: rgba(89, 187, 255, 0.8);
  --nn-shield-pale: rgba(180, 238, 255, 0.92);
  --nn-shield-glow: rgba(78, 173, 255, 0.2);
  --nn-invuln-rim: rgba(255, 245, 168, 0.85);
  --nn-invuln-rim-soft: rgba(255, 245, 168, 0.4);

  /* Gear rarity text colors, lifted for contrast on dark surfaces. The canonical swatch colors
     in state/forgeMathSystem.js's GEAR_RARITIES stay as-is (Phaser/art use them); tiers 8-10
     there are too dark to read as text, hence these. */
  --nn-tier-1: #e9e6df;
  --nn-tier-2: #6fd68a;
  --nn-tier-3: #6fa2ff;
  --nn-tier-4: #f0c75e;
  --nn-tier-5: #ff6f6f;
  --nn-tier-6: #a988ff;
  --nn-tier-7: #ff74dc;
  --nn-tier-8: #aaa4ba;
  --nn-tier-9: #b77fe8;
  --nn-tier-10: #d4aaff;
  /* Astrolabe socket tiers (AstrolabeModal.js), on the same rarity ladder the gear tiers read:
     Common white, Uncommon green, Rare blue, Epic violet, Legendary gold, Mythic orange. The
     reveal tints the white VFX sheets with these. */
  --nn-astro-common: var(--nn-tier-1);
  --nn-astro-uncommon: var(--nn-tier-2);
  --nn-astro-rare: var(--nn-tier-3);
  --nn-astro-epic: var(--nn-tier-6);
  --nn-astro-legendary: var(--nn-tier-4);
  --nn-astro-mythic: var(--nn-mythic);
  /* Tier 10 glows gold (not violet) so it stays clearly distinct from violet tier 6. */
  --nn-tier-8-glow: rgba(188, 184, 201, 0.55);
  --nn-tier-9-glow: rgba(124, 77, 255, 0.6);
  --nn-tier-10-glow: rgba(255, 211, 107, 0.6);

  /* Buttons */
  --nn-btn-bg: linear-gradient(180deg, #261d44 0%, #1a1430 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #a585f0 0%, #7a54d6 60%, #5b3aae 100%);
  --nn-btn-primary-border: #4a2f8f;
  --nn-btn-gold-bg: linear-gradient(180deg, #3b3020 0%, #261e14 100%);

  /* Shape */
  --nn-radius-s: 4px;
  --nn-radius-m: 6px;
  --nn-radius-l: 8px;
  --nn-radius-pill: 999px; /* only for chips wrapping a round icon */

  /* Elevation */
  --nn-shadow-panel: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --nn-shadow-btn: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.35);
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(154, 116, 232, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
  --nn-shadow-pressed: inset 0 2px 6px rgba(0, 0, 0, 0.55);

  /* Four-point star studs on panel corners, painted as fixed (non-scrolling) backgrounds so they
     work on scrollable containers. SVG fill is the --nn-line-strong value (data URIs can't read
     custom properties — keep the two in sync). */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23bdb5e0' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23bdb5e0' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23bdb5e0' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23bdb5e0' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
  /* Select caret, fill = --nn-text-dim. */
  --nn-select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23a59dc6'/%3E%3C/svg%3E");

  /* Motion */
  --nn-duration-fast: 0.15s;
}

/* ------------------------------------------------------------------------------------------
   Gold theme variant. Add .nn-theme-gold to a menu's root (and to any overlay it appends to
   <body>) to re-skin every token-driven rule inside it in gold instead of violet: same frame,
   type and button hierarchy, warm surfaces, gold lines/accent/primary. Used by the Eventide
   Reservoir (ReservoirModal) and the Rewards modal (RewardBoxesModal), whose identity is
   "treasury"/claimed earnings. Semantic colors (danger/success/ember/tiers/premium) are
   deliberately not overridden.

   The shared reward-grant popup (.sp-reward-grant-overlay — Season Pass, Reservoir claim,
   Syndicate missions, curio, pet, Steward valuables, onboarding milestones) is ALWAYS gold
   whichever system raises it, so it is listed here directly rather than relying on each of its
   seven callers to add the class. (The level-up cinematic carries .nn-theme-gold itself.)
   ------------------------------------------------------------------------------------------ */
.nn-theme-gold,
.sp-reward-grant-overlay {
  --nn-surface-0: #17120b;
  --nn-surface-1: #221a0f;
  --nn-surface-2: #2c2215;
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(232, 196, 106, 0.15), transparent 70%);

  --nn-line: #4a3b20;
  --nn-line-soft: rgba(232, 196, 106, 0.42);
  --nn-line-strong: #e8c46a;

  --nn-text: #f6efe2;
  --nn-text-dim: #c9b68f;
  --nn-text-faint: #9a8a66;
  --nn-title: #ffe7a8;
  --nn-title-glow: 0 0 18px rgba(232, 196, 106, 0.5);

  --nn-accent: #e8c46a;
  --nn-accent-soft: rgba(232, 196, 106, 0.35);
  --nn-accent-glow: rgba(232, 196, 106, 0.5);
  --nn-accent-ink: #2a1c05;

  --nn-btn-bg: linear-gradient(180deg, #2f2514 0%, #1f180d 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #f4d68c 0%, #d6a84a 60%, #a67a28 100%);
  --nn-btn-primary-border: #7a5a1c;
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(232, 196, 106, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Same four-point studs as :root, filled with the gold --nn-line-strong value. */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e8c46a' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e8c46a' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e8c46a' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e8c46a' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
}

/* ------------------------------------------------------------------------------------------
   Sky theme variant — same contract as .nn-theme-gold above, in sky blue. Used by the Events
   modal (EventsModal + its embedded World Boss / Dungeon queue panels), which has been the
   game's "pale blue" menu since its sidebar button was introduced.
   ------------------------------------------------------------------------------------------ */
.nn-theme-sky {
  --nn-surface-0: #0d1320;
  --nn-surface-1: #131c2d;
  --nn-surface-2: #1a2639;
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(123, 192, 242, 0.16), transparent 70%);

  --nn-line: #2a3a55;
  --nn-line-soft: rgba(140, 200, 245, 0.42);
  --nn-line-strong: #8cc8f5;

  --nn-text: #eaf3fc;
  --nn-text-dim: #a3b9d2;
  --nn-text-faint: #7d90a8;
  --nn-title: #d6ecff;
  --nn-title-glow: 0 0 18px rgba(123, 192, 242, 0.5);

  --nn-accent: #7bc0f2;
  --nn-accent-soft: rgba(123, 192, 242, 0.3);
  --nn-accent-glow: rgba(123, 192, 242, 0.5);
  --nn-accent-ink: #061322;

  --nn-btn-bg: linear-gradient(180deg, #1d2b42 0%, #131d2e 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #a6d9fb 0%, #6cb2e8 60%, #3f80bd 100%);
  --nn-btn-primary-border: #2a5a88;
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 18px rgba(123, 192, 242, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Same four-point studs as :root, filled with the sky --nn-line-strong value. */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%238cc8f5' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%238cc8f5' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%238cc8f5' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%238cc8f5' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
}

/* ------------------------------------------------------------------------------------------
   Blood (crimson) theme variant — same contract as .nn-theme-gold / .nn-theme-sky. Used by the
   PvP modal (Nighttide Arena + Blackwater Tournament, Bloodtide Sigils), which has been the
   game's crimson menu since launch. The accent is a deeper, warmer crimson than --nn-danger
   (rose), and danger controls stay outline-only, so the two remain distinguishable.
   ------------------------------------------------------------------------------------------ */
.nn-theme-blood {
  --nn-surface-0: #170c10;
  --nn-surface-1: #22121a;
  --nn-surface-2: #2d1822;
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(214, 84, 96, 0.16), transparent 70%);

  --nn-line: #4a2530;
  --nn-line-soft: rgba(232, 120, 128, 0.42);
  --nn-line-strong: #e58a8f;

  --nn-text: #f6ece9;
  --nn-text-dim: #c9a3a6;
  --nn-text-faint: #957478;
  --nn-title: #ffd9d6;
  --nn-title-glow: 0 0 18px rgba(226, 96, 104, 0.5);

  --nn-accent: #e8656f;
  --nn-accent-soft: rgba(232, 101, 111, 0.3);
  --nn-accent-glow: rgba(232, 101, 111, 0.5);
  --nn-accent-ink: #ffffff;

  --nn-btn-bg: linear-gradient(180deg, #3a1c25 0%, #24121a 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #ef7a82 0%, #c8414e 60%, #8e2532 100%);
  --nn-btn-primary-border: #6a1a24;
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 18px rgba(232, 101, 111, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Same four-point studs as :root, filled with the crimson --nn-line-strong value. */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e58a8f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e58a8f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e58a8f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23e58a8f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
}

/* ------------------------------------------------------------------------------------------
   Copper theme variant — same contract as the variants above. Used by the Dreadfort
   (DreadfortScene's DOM overlay, so every panel modal and dialog appended inside it inherits it),
   which has been the game's warm "fortress" menu since launch. The Dreadspire's combat HUD and
   forfeit dialog (DreadspireScene) stay on the default violet: the tower is its own place. Copper sits between --nn-ember (more
   yellow) and the blood accent (more red), and is well clear of the gold variant.
   ------------------------------------------------------------------------------------------ */
.nn-theme-copper {
  --nn-surface-0: #160f0b;
  --nn-surface-1: #21160f;
  --nn-surface-2: #2c1d14;
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(222, 150, 104, 0.15), transparent 70%);

  --nn-line: #4a3022;
  --nn-line-soft: rgba(217, 160, 120, 0.42);
  --nn-line-strong: #d9a47c;

  --nn-text: #f7ede4;
  --nn-text-dim: #c9ab92;
  --nn-text-faint: #977c68;
  --nn-title: #ffdcc0;
  --nn-title-glow: 0 0 18px rgba(222, 140, 88, 0.5);

  --nn-accent: #e39b68;
  --nn-accent-soft: rgba(227, 155, 104, 0.3);
  --nn-accent-glow: rgba(227, 155, 104, 0.5);
  --nn-accent-ink: #2a1306;

  --nn-btn-bg: linear-gradient(180deg, #3a2619 0%, #24170e 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #f2bc90 0%, #d0875a 60%, #9b5a32 100%);
  --nn-btn-primary-border: #6e3d1c;
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 0 18px rgba(227, 155, 104, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Select caret, fill = the copper --nn-text-dim. */
  --nn-select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23c9ab92'/%3E%3C/svg%3E");

  /* Same four-point studs as :root, filled with the copper --nn-line-strong value. */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23d9a47c' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23d9a47c' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23d9a47c' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23d9a47c' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
}

/* ------------------------------------------------------------------------------------------
   Moss (green) theme variant — same contract as the variants above. Used by the Professions
   scene (ProfessionScene's DOM overlay: Gathering / Alchemy / Archivist / Steward tabs + its
   guide overlay), which has been the game's green "herbalist" menu since launch. A cool,
   sage-leaning green so it reads apart from --nn-success (mint) and the tier-2 rarity green.
   ------------------------------------------------------------------------------------------ */
.nn-theme-moss {
  --nn-surface-0: #0e1510;
  --nn-surface-1: #142017;
  --nn-surface-2: #1b2b1f;
  --nn-panel-wash: radial-gradient(120% 60% at 50% 0%, rgba(136, 200, 120, 0.15), transparent 70%);

  --nn-line: #2c4231;
  --nn-line-soft: rgba(156, 210, 140, 0.42);
  --nn-line-strong: #a3d18f;

  --nn-text: #edf5e7;
  --nn-text-dim: #a9c29f;
  --nn-text-faint: #7f9878;
  --nn-title: #ddf3cd;
  --nn-title-glow: 0 0 18px rgba(136, 200, 120, 0.5);

  --nn-accent: #92cf7c;
  --nn-accent-soft: rgba(146, 207, 124, 0.3);
  --nn-accent-glow: rgba(146, 207, 124, 0.5);
  --nn-accent-ink: #0c1a08;

  --nn-btn-bg: linear-gradient(180deg, #213325 0%, #152118 100%);
  --nn-btn-primary-bg: linear-gradient(180deg, #bfe6a8 0%, #84c46c 60%, #528f40 100%);
  --nn-btn-primary-border: #2f5a24;
  --nn-shadow-btn-primary: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(146, 207, 124, 0.38), 0 2px 6px rgba(0, 0, 0, 0.5);

  /* Select caret, fill = the moss --nn-text-dim. */
  --nn-select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23a9c29f'/%3E%3C/svg%3E");

  /* Same four-point studs as :root, filled with the moss --nn-line-strong value. */
  --nn-panel-corners:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3d18f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3d18f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px top 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3d18f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") left 5px bottom 5px / 10px 10px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3d18f' d='M6 0l1.4 4.6L12 6 7.4 7.4 6 12 4.6 7.4 0 6l4.6-1.4z'/%3E%3C/svg%3E") right 5px bottom 5px / 10px 10px no-repeat;
}

/* ------------------------------------------------------------------------------------------
   Base components. Opt in by class; nothing here restyles existing markup on its own.
   ------------------------------------------------------------------------------------------ */

/* Framed panel: overlays and sidebar modals. */
.nn-panel {
  color: var(--nn-text);
  font-family: var(--nn-font-body);
  background: var(--nn-panel-corners), var(--nn-panel-wash), var(--nn-surface-0);
  border: 1px solid var(--nn-line-strong);
  border-radius: var(--nn-radius-l);
  box-shadow: var(--nn-shadow-panel);
}

.nn-panel-title {
  font-family: var(--nn-font-display);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--nn-title);
  text-shadow: var(--nn-title-glow);
}

/* Modal open: a short fade + settle on every panel modal's root container. Each modal shows by
   going from display:none to shown (or by being created), which restarts the animation, so no
   JS is needed. Animates `scale`, not `transform`, so it composes with the containers' own
   centering transforms, and only opacity/scale, which the compositor handles (Pixel 7 safe).
   :where() keeps specificity at 0, so a modal with its own animation keeps it. */
@keyframes nn-modal-enter {
  from {
    opacity: 0;
    scale: 0.98;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

:where(
  #active-skills-modal-container, #ascendancy-modal-container, #augments-modal-container,
  #bug-report-modal, #class-info-modal, #class-selection-modal-container,
  #class-tree-modal-container, #dungeon-queue-modal-container, #events-modal,
  #forge-modal-container, #gear-modal-container, #grim-etchings-modal-container,
  #information-modal-container, #leaderboard-modal-container, #pets-modal-container,
  #pvp-modal-container, #quests-modal-container, #relics-modal-container,
  #reservoir-modal-container, #reward-boxes-modal-container, #settings-modal-container,
  #shop-modal-container, #stats-modal-container, #syndicate-management-modal-container,
  #talents-modal-container, #training-modal, #world-boss-modal-container,
  #world-chat-modal-container
) {
  animation: nn-modal-enter var(--nn-duration-fast) ease-out;
}

@media (prefers-reduced-motion: reduce) {
  :where(
    #active-skills-modal-container, #ascendancy-modal-container, #augments-modal-container,
    #bug-report-modal, #class-info-modal, #class-selection-modal-container,
    #class-tree-modal-container, #dungeon-queue-modal-container, #events-modal,
    #forge-modal-container, #gear-modal-container, #grim-etchings-modal-container,
    #information-modal-container, #leaderboard-modal-container, #pets-modal-container,
    #pvp-modal-container, #quests-modal-container, #relics-modal-container,
    #reservoir-modal-container, #reward-boxes-modal-container, #settings-modal-container,
    #shop-modal-container, #stats-modal-container, #syndicate-management-modal-container,
    #talents-modal-container, #training-modal, #world-boss-modal-container,
    #world-chat-modal-container
  ) {
    animation: none;
  }
}

/* Buttons: secondary (default), primary, danger. */
.nn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 14px;
  font-family: var(--nn-font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--nn-text);
  background: var(--nn-btn-bg);
  border: 1px solid var(--nn-line-soft);
  border-radius: var(--nn-radius-m);
  box-shadow: var(--nn-shadow-btn);
  cursor: pointer;
  transition: filter var(--nn-duration-fast), transform 0.08s, box-shadow var(--nn-duration-fast);
}

/* The display above would otherwise beat the [hidden] attribute. */
.nn-btn[hidden] {
  display: none;
}

.nn-btn:hover {
  filter: brightness(1.18);
}

.nn-btn:active {
  transform: translateY(1px);
  box-shadow: var(--nn-shadow-pressed);
}

.nn-btn:disabled {
  filter: grayscale(0.85) brightness(0.75);
  cursor: not-allowed;
  transform: none;
}

.nn-btn:focus-visible {
  outline: 2px solid var(--nn-line-strong);
  outline-offset: 2px;
}

.nn-btn--primary {
  color: var(--nn-accent-ink);
  background: var(--nn-btn-primary-bg);
  border-color: var(--nn-btn-primary-border);
  box-shadow: var(--nn-shadow-btn-primary);
}

.nn-btn--danger {
  color: var(--nn-danger);
  border-color: var(--nn-danger);
}

/* Ember primary: a panel whose lead action is themed by its own currency (see --nn-ember). */
.nn-btn--ember {
  color: var(--nn-ember-text);
  background: var(--nn-btn-ember-bg);
  border-color: var(--nn-ember);
  box-shadow: var(--nn-shadow-btn-ember);
}

/* Panel help (i) button: circular, beside the close X. Each panel's own class keeps only its
   placement (position/top/right/z-index) and, where it differs, its size. `.active` marks an
   open help panel. */
.nn-info-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nn-line-soft);
  border-radius: 50%;
  background: var(--nn-btn-bg);
  color: var(--nn-text);
  font-family: var(--nn-font-body);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--nn-shadow-btn);
  cursor: pointer;
  transition: filter var(--nn-duration-fast), transform 0.1s;
}

.nn-info-btn[hidden] {
  display: none;
}

/* Pinned header controls (utils/pinnedPanelControls.js). A zero-height sticky layer, first child
   of a scrolling panel, that holds the panel's close X / info / swap buttons so they stay on
   screen while the content scrolls. The negative margins, upward shift and sticky offset
   (0 when the panel itself scrolls, see the helper's header) (from --nn-pin-* vars the helper reads off the panel's computed padding and gap) make the
   layer cover the panel's padding box, so each button's own absolute top/right rules still land
   where they did before. The !important box rules guard against panel-wide `div` rules (such as
   `#forge-modal-container div { padding }`) reaching the layer. */
.nn-pinned-controls {
  position: sticky !important;
  top: var(--nn-pin-sticky-top, 0px);
  z-index: var(--nn-pin-z, 10);
  display: block !important;
  flex: none !important;
  align-self: stretch !important;
  width: auto !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 calc(-1 * var(--nn-pin-pad-right, 0px)) calc(-1 * var(--nn-pin-gap, 0px))
    calc(-1 * var(--nn-pin-pad-left, 0px)) !important;
  transform: translateY(calc(-1 * var(--nn-pin-pad-top, 0px)));
  overflow: visible !important;
  pointer-events: none;
}

.nn-pinned-controls > * {
  pointer-events: auto;
}

/* Set by pinPanelControls() on a panel that scrolls vertically. Such a panel already clips its
   sides, so this only stops sideways scrolling (iOS Safari let players drag a few stray px). */
.nn-pin-host-scroll-y {
  overflow-x: hidden !important;
}

.nn-info-btn:hover,
.nn-info-btn.active {
  filter: brightness(1.2);
}

.nn-info-btn.active {
  border-color: var(--nn-accent);
}

.nn-info-btn:active {
  transform: scale(0.95);
}

.nn-info-btn:focus-visible {
  outline: 2px solid var(--nn-line-strong);
  outline-offset: 2px;
}

/* Tab: a plate with an accent underline when selected (Gear, Events, Reservoir, Training,
   Settings, World Chat, Rewards, PvP, Syndicate, Pets, Shop, Leaderboard, Professions and its
   Archivist sub-tabs). Each family's own class keeps only layout and size (flex, padding, font
   size, wrapping). The selected state is whichever class that family already toggles. */
.nn-tab {
  position: relative;
  padding: 8px 12px;
  border: 1px solid var(--nn-line);
  border-radius: var(--nn-radius-m);
  background: var(--nn-surface-1);
  color: var(--nn-text-dim);
  font-family: var(--nn-font-display);
  font-weight: 400;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--nn-duration-fast), border-color var(--nn-duration-fast), background var(--nn-duration-fast), box-shadow var(--nn-duration-fast);
}

.nn-tab:hover {
  color: var(--nn-text);
  border-color: var(--nn-line-soft);
}

.nn-tab.active,
.nn-tab.is-active {
  color: var(--nn-title);
  border-color: var(--nn-line-soft);
  background: var(--nn-surface-2);
  box-shadow: inset 0 -2px 0 var(--nn-accent), 0 0 10px var(--nn-accent-soft);
}

.nn-tab:focus-visible {
  outline: 2px solid var(--nn-line-strong);
  outline-offset: 2px;
}

.nn-tab:active {
  transform: scale(0.98);
}

.nn-tab:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Collapsible section header: "▼ Label" in the display font, followed by a rule to the right
   edge. Keeps the ▼/▶ text-arrow convention; the arrow stays in the button's own text. */
.nn-section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 2px;
  border: none;
  background: transparent;
  color: var(--nn-title);
  font-family: var(--nn-font-display);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: left;
  cursor: pointer;
}

.nn-section-toggle::after {
  content: '';
  flex: 1 1 auto;
  min-width: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--nn-line-soft), transparent);
}

.nn-section-toggle:hover {
  color: var(--nn-text);
}

.nn-section-toggle:focus-visible {
  outline: 2px solid var(--nn-line-strong);
  outline-offset: 2px;
}

/* Range slider: a thin track with an accent fill up to the thumb. WebKit has no fill
   pseudo-element, so utils/rangeFill.js keeps --nn-range-pct in sync with the value (bind every
   .nn-range with bindRangeFill); Firefox paints the fill itself with ::-moz-range-progress. */
.nn-range {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.nn-range::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid var(--nn-line);
  border-radius: var(--nn-radius-pill);
  background: linear-gradient(90deg, var(--nn-accent) 0 var(--nn-range-pct, 0%), var(--nn-track) var(--nn-range-pct, 0%) 100%);
}

.nn-range::-moz-range-track {
  height: 6px;
  border: 1px solid var(--nn-line);
  border-radius: var(--nn-radius-pill);
  background: var(--nn-track);
}

.nn-range::-moz-range-progress {
  height: 6px;
  border-radius: var(--nn-radius-pill);
  background: var(--nn-accent);
}

.nn-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 1px solid var(--nn-line-strong);
  border-radius: 50%;
  background: var(--nn-btn-primary-bg);
  box-shadow: 0 0 8px var(--nn-accent-glow);
}

.nn-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid var(--nn-line-strong);
  border-radius: 50%;
  background: var(--nn-btn-primary-bg);
  box-shadow: 0 0 8px var(--nn-accent-glow);
}

.nn-range:focus-visible {
  outline: 2px solid var(--nn-line-strong);
  outline-offset: 2px;
}

.nn-range:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Number input: drop the native spinner arrows. The box itself is styled by each panel. */
.nn-number {
  -moz-appearance: textfield;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}

.nn-number::-webkit-inner-spin-button,
.nn-number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Scrollbars: the one rule in this file that restyles existing markup on its own, since every
   scrolling menu should match. scrollbar-color inherits, so it's set on <body> and re-set on each
   variant root, where the tokens resolve to that variant's hue. scrollbar-width doesn't inherit;
   :where() keeps it at zero specificity so a panel that hides its scrollbar still wins. */
body,
.nn-theme-gold,
.nn-theme-sky,
.nn-theme-blood,
.nn-theme-copper,
.nn-theme-moss,
.sp-reward-grant-overlay {
  scrollbar-color: var(--nn-line-soft) transparent;
}

:where(*) {
  scrollbar-width: thin;
}

@media (prefers-reduced-motion: reduce) {
  .nn-btn,
  .nn-info-btn,
  .nn-tab {
    transition: none;
  }
}
