/* Dark mode, loaded LAST on every public page. The shared colour tokens (light + dark) live at the top of styles.css.
   Her rule (19 Nov 2026): dark mode looks the SAME as the light design - same layout, cards, borders and buttons, only
   dark. This file holds the page-level colour sets (Wiki sections, fansite-kit circles, news topics) and the places
   whose light colours are written in the CSS or the page itself, each with its dark twin.
   Every rule is scoped to :root[data-theme="dark"], so light mode is untouched. */

/* ---------- home + shared ---------- */
:root[data-theme="dark"] .hero-badge { color: #7dd3fc; background: rgba(14, 165, 233, 0.16); }
:root[data-theme="dark"] .bento-card.bg-dark { background: var(--bg-dark); border-color: var(--border-color); }
/* art drawn on white paper keeps its white page (slightly dimmed) instead of a white strip on a dark box */
:root[data-theme="dark"] .hl-card.art .hl-picture { background: #fff; filter: brightness(0.88); }
/* line-art drawn for a white page: a faint light rim keeps the dark outlines readable */
:root[data-theme="dark"] .hero-char img,
:root[data-theme="dark"] .hero-char-sm img,
:root[data-theme="dark"] .page-fig img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3)); }
/* the fansite-kit figures stand on a coloured circle: the same colours, deep and muted */
:root[data-theme="dark"] {
  --fun-cream: #3b3222;
  --fun-sky: #1a3346;
  --fun-leaf: #253a22;
  --fun-peach: #432a20;
  --fun-shadow: rgba(0, 0, 0, 0.55);
}
:root[data-theme="dark"] .acct2 { --fun-cream: #3b3222; --fun-sky: #1a3346; --fun-leaf: #253a22; --fun-peach: #432a20; }
:root[data-theme="dark"] .header-discord:hover, :root[data-theme="dark"] .footer-link a:hover svg { color: #8f9bff; }

/* ---------- news ---------- */
:root[data-theme="dark"] .news-item { --topic: #9ca3af; --topic-bg: #1f2530; }
:root[data-theme="dark"] .news-item p.news-cta { background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.35); color: #bfdbfe; }
:root[data-theme="dark"] .news-item.news-ptr { border-color: rgba(74, 222, 128, 0.4); border-left-color: #4ade80; }
:root[data-theme="dark"] .news-realm { background: rgba(74, 222, 128, 0.15); color: #86efac; }
:root[data-theme="dark"] .news-item p.news-realm-note { color: #86efac; }
:root[data-theme="dark"] .topic-quests { --topic: #fbbf24; --topic-bg: rgba(251, 191, 36, 0.14); }
:root[data-theme="dark"] .topic-skills { --topic: #c4b5fd; --topic-bg: rgba(196, 181, 253, 0.14); }
:root[data-theme="dark"] .topic-monsters { --topic: #fca5a5; --topic-bg: rgba(252, 165, 165, 0.14); }
:root[data-theme="dark"] .topic-world, :root[data-theme="dark"] .topic-maps { --topic: #6ee7b7; --topic-bg: rgba(110, 231, 183, 0.14); }
:root[data-theme="dark"] .topic-items, :root[data-theme="dark"] .topic-mail { --topic: #5eead4; --topic-bg: rgba(94, 234, 212, 0.14); }
:root[data-theme="dark"] .topic-client, :root[data-theme="dark"] .topic-launcher, :root[data-theme="dark"] .topic-website { --topic: #93c5fd; --topic-bg: rgba(147, 197, 253, 0.14); }
:root[data-theme="dark"] .topic-recovery { --topic: #f9a8d4; --topic-bg: rgba(249, 168, 212, 0.14); }
:root[data-theme="dark"] .roadmap-item.stage-in_progress { border-left-color: #60a5fa; }
:root[data-theme="dark"] .roadmap-item.stage-done { border-left-color: #4ade80; }
:root[data-theme="dark"] .server-status.online::before { background: #4ade80; }

/* ---------- forms, notices, pills (sign in, request, account, status) ---------- */
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #8b93a1; }
:root[data-theme="dark"] .field-error { color: #fca5a5; }
:root[data-theme="dark"] .notice.ok { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
:root[data-theme="dark"] .notice.warn { border-color: rgba(252, 211, 77, 0.45); background: rgba(252, 211, 77, 0.08); }
:root[data-theme="dark"] .pill.pending { background: rgba(252, 211, 77, 0.18); }
:root[data-theme="dark"] .pill.approved { background: rgba(74, 222, 128, 0.18); }
:root[data-theme="dark"] .pill.denied { background: rgba(252, 165, 165, 0.2); }
:root[data-theme="dark"] .site-notice { background: #2a2111; border-bottom-color: rgba(252, 211, 77, 0.45); color: #fcd34d; }

/* ---------- Wiki ---------- */
/* each section keeps its colour (blue, green, brown, violet), brightened for a dark page */
:root[data-theme="dark"] .wiki-page { --wiki-accent: #7fb6e6; --wiki-tint: rgba(127, 182, 230, 0.10); --wiki-line: rgba(127, 182, 230, 0.22); --wiki-ink: #d3e5f6; }
:root[data-theme="dark"] .wiki-page[data-wiki-section=monsters], :root[data-theme="dark"] .wiki-page[data-wiki-section=quests],
:root[data-theme="dark"] .wiki-page[data-wiki-section=maps], :root[data-theme="dark"] .wiki-theme-world { --wiki-accent: #63c7b1; --wiki-tint: rgba(99, 199, 177, 0.10); --wiki-line: rgba(99, 199, 177, 0.22); --wiki-ink: #cdeee6; }
:root[data-theme="dark"] .wiki-page[data-wiki-section=items-and-drops], :root[data-theme="dark"] .wiki-page[data-wiki-section=shops],
:root[data-theme="dark"] .wiki-theme-equipment { --wiki-accent: #d9b06b; --wiki-tint: rgba(217, 176, 107, 0.10); --wiki-line: rgba(217, 176, 107, 0.22); --wiki-ink: #f0dcb4; }
:root[data-theme="dark"] .wiki-theme-server { --wiki-accent: #b3a9ec; --wiki-tint: rgba(179, 169, 236, 0.10); --wiki-line: rgba(179, 169, 236, 0.22); --wiki-ink: #e0dcf7; }
:root[data-theme="dark"] .wiki-intro { color: var(--text-2); }
:root[data-theme="dark"] .wiki-snapshot { color: var(--text-3); }
:root[data-theme="dark"] .wiki-controls input[type=search], :root[data-theme="dark"] .wiki-controls select,
:root[data-theme="dark"] .wiki-hub-search input, :root[data-theme="dark"] .wiki-hub-search select,
:root[data-theme="dark"] .wiki-home-search input, :root[data-theme="dark"] .wiki-bar-search input,
:root[data-theme="dark"] .wiki-global-search input, :root[data-theme="dark"] .wiki-filter-area select { border-color: var(--border-strong); }
:root[data-theme="dark"] .wiki-search-button:hover { filter: brightness(1.1); background: var(--wiki-accent); }
:root[data-theme="dark"] .wiki-more-links, :root[data-theme="dark"] .wiki-bar-search .wiki-search-panel { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .wiki-notice { background: rgba(252, 211, 77, 0.08); border-left-color: #d9a441; }
:root[data-theme="dark"] .wiki-notes { background: rgba(217, 176, 107, 0.06); border-color: rgba(217, 176, 107, 0.25); border-left-color: #c9a25a; }
:root[data-theme="dark"] .wiki-table th { background: #1a2029; }
:root[data-theme="dark"] .wiki-table tbody tr:nth-child(even) { background: #10151c; }
:root[data-theme="dark"] .wiki-search-status, :root[data-theme="dark"] .wiki-search-section,
:root[data-theme="dark"] .wiki-relation-note, :root[data-theme="dark"] .wiki-game-prose summary { color: var(--text-3); }
:root[data-theme="dark"] .wiki-search-results ul, :root[data-theme="dark"] .wiki-search-results li { border-color: var(--border-color); }
:root[data-theme="dark"] .wiki-report:hover, :root[data-theme="dark"] .wiki-report:focus-visible { color: var(--text-main); }
:root[data-theme="dark"] .wiki-home-picture { background: #10151c; }
:root[data-theme="dark"] .wiki-home-hero { background: linear-gradient(120deg, rgba(127, 182, 230, 0.12) 0%, rgba(99, 199, 177, 0.07) 100%); }
:root[data-theme="dark"] .wiki-home-hero-figure { background: var(--fun-sky); }
:root[data-theme="dark"] .wiki-home-figure { background: var(--figure-colour-dark, var(--fun-sky)); }
:root[data-theme="dark"] .wiki-home-letter { color: rgba(243, 244, 246, 0.6); }
:root[data-theme="dark"] .wiki-home-level { background: rgba(217, 176, 107, 0.08); }
:root[data-theme="dark"] .wiki-home-level h2 { color: #f0dcb4; }
:root[data-theme="dark"] .wiki-home-chip { border-color: rgba(217, 176, 107, 0.28); }
:root[data-theme="dark"] .wiki-page[data-wiki-section=maps] .wiki-card-picture { background: rgba(99, 199, 177, 0.08); }
:root[data-theme="dark"] .wiki-card-map-initial { background: rgba(99, 199, 177, 0.16); color: #cdeee6; }
:root[data-theme="dark"] .wiki-job-hero { background: linear-gradient(120deg, var(--wiki-tint), rgba(179, 169, 236, 0.08)); }
:root[data-theme="dark"] .wiki-job-figure, :root[data-theme="dark"] .wiki-job-figure-2 { background: #1a3346; }
:root[data-theme="dark"] .wiki-job-figure-1 { background: #253a22; }
:root[data-theme="dark"] .wiki-job-figure-3 { background: #432a20; }
:root[data-theme="dark"] .wiki-job-figure-4 { background: #2e2846; }
:root[data-theme="dark"] .wiki-job-figure-5 { background: #3b3222; }
:root[data-theme="dark"] .wiki-job-figure-6 { background: #452634; }
:root[data-theme="dark"] .wiki-mon-tiers { background: var(--bg-dark); border: 1px solid var(--border-color); }
:root[data-theme="dark"] .wiki-mon-tier { background: #1a2029; }
:root[data-theme="dark"] .wiki-primary-stat, :root[data-theme="dark"] .wiki-combat-group { background: var(--surface); border-color: #2f2b24; }
:root[data-theme="dark"] .wiki-stat-symbol { background: #2c271d; color: #e8cf9e; }
:root[data-theme="dark"] .wiki-stat-purpose, :root[data-theme="dark"] .wiki-stat-calculator-note,
:root[data-theme="dark"] .wiki-combat-preview, :root[data-theme="dark"] .wiki-stat-background { color: var(--text-3); }
:root[data-theme="dark"] .wiki-stat-open { color: #e3c68c; }
:root[data-theme="dark"] .wiki-stat-card-detail, :root[data-theme="dark"] .wiki-combat-stat { border-top-color: #2f2b24; }
:root[data-theme="dark"] .wiki-stat-try { background: #17150f; border-color: #2f2b24; }
:root[data-theme="dark"] .wiki-stat-try-controls select { background: var(--bg-main); border-color: #4a4335; color: var(--text-main); }
:root[data-theme="dark"] .wiki-stat-try-controls input[type="range"] { accent-color: #c9a25a; }
:root[data-theme="dark"] .wiki-stat-try select:focus-visible, :root[data-theme="dark"] .wiki-stat-try input:focus-visible { outline-color: #c9a25a; }
:root[data-theme="dark"] .wiki-calc-points.wiki-calc-over { background: rgba(252, 165, 165, 0.16); color: #fca5a5; }
:root[data-theme="dark"] .wiki-calc-warn { background: rgba(252, 211, 77, 0.12); color: #fcd34d; }
:root[data-theme="dark"] .wiki-item-common { background: rgba(74, 222, 128, 0.15); color: #86efac; }
:root[data-theme="dark"] .wiki-item-uncommon { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
:root[data-theme="dark"] .wiki-item-rare { background: rgba(196, 181, 253, 0.16); color: #c4b5fd; }
:root[data-theme="dark"] .wiki-item-very-rare { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }
:root[data-theme="dark"] .wiki-item-price, :root[data-theme="dark"] .wiki-person-price { background: rgba(217, 176, 107, 0.16); color: #e8cf9e; }
:root[data-theme="dark"] .wiki3d-card model-viewer { background: radial-gradient(circle at 50% 40%, #252c38 0%, #10141b 72%); }
:root[data-theme="dark"] .wiki3d-toggle { background: #10151c; }
:root[data-theme="dark"] .wiki3d-toggle button[aria-pressed="true"] { color: var(--on-accent); }
:root[data-theme="dark"] .prof-alpha { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
:root[data-theme="dark"] .prof-alpha strong { color: #fde68a; }
:root[data-theme="dark"] .wiki-map-way b { color: #e8cf9e; }
:root[data-theme="dark"] .wiki-wmap-figure { background: #2a2416; }

/* ---------- page colours written in the pages themselves (style="--accent: ..."): brighter in the dark ----------
   An !important custom property in a stylesheet wins over the page's own inline value, so the pages stay as they are. */
:root[data-theme="dark"] [style*="--accent: #1d4ed8"], :root[data-theme="dark"] [style*="--group: #1d4ed8"], :root[data-theme="dark"] [style*="--area: #1d4ed8"] { --accent: #7ea8f6 !important; --group: #7ea8f6 !important; --area: #7ea8f6 !important; }
:root[data-theme="dark"] [style*="--accent: #7c3aed"], :root[data-theme="dark"] [style*="--group: #7c3aed"], :root[data-theme="dark"] [style*="--area: #7c3aed"] { --accent: #b39af7 !important; --group: #b39af7 !important; --area: #b39af7 !important; }
:root[data-theme="dark"] [style*="--accent: #047857"], :root[data-theme="dark"] [style*="--group: #047857"] { --accent: #4fcf9f !important; --group: #4fcf9f !important; }
:root[data-theme="dark"] [style*="--accent: #b45309"], :root[data-theme="dark"] [style*="--group: #b45309"] { --accent: #f0a254 !important; --group: #f0a254 !important; }
:root[data-theme="dark"] [style*="--group: #be185d"] { --group: #f28bbd !important; }
:root[data-theme="dark"] [style*="--area: #9f1239"] { --area: #f2899d !important; --area-soft: rgba(242, 137, 157, 0.10) !important; }
:root[data-theme="dark"] [style*="--area: #92400e"] { --area: #eaa45c !important; --area-soft: rgba(234, 164, 92, 0.10) !important; }
:root[data-theme="dark"] [style*="--area: #7c3aed"] { --area-soft: rgba(179, 154, 247, 0.10) !important; }
:root[data-theme="dark"] [style*="--area: #6b21a8"] { --area: #c49af2 !important; }
:root[data-theme="dark"] [style*="--area: #57534e"] { --area: #bdb6aa !important; }
:root[data-theme="dark"] [style*="--area: #3f6212"] { --area: #a3cf5f !important; }
:root[data-theme="dark"] [style*="--area: #374151"] { --area: #d1d5db !important; }
:root[data-theme="dark"] [style*="--area: #111827"] { --area: #f3f4f6 !important; }
:root[data-theme="dark"] [style*="--area: #0f766e"] { --area: #5fd3c6 !important; --area-soft: rgba(95, 211, 198, 0.10) !important; }
:root[data-theme="dark"] [style*="--c: #ede9fe"] { --c: #2e2846 !important; }
:root[data-theme="dark"] [style*="--c: #fce7f3"] { --c: #452634 !important; }
:root[data-theme="dark"] [style*="color: #7c3aed"] { color: #b39af7 !important; }
/* the Wiki home's job circles (generated: style="--figure-colour:...") */
:root[data-theme="dark"] [style*="--figure-colour:#d6eef8"] { --figure-colour-dark: #1a3346; }
:root[data-theme="dark"] [style*="--figure-colour:#ffeecb"] { --figure-colour-dark: #3b3222; }
:root[data-theme="dark"] [style*="--figure-colour:#ffd9c4"] { --figure-colour-dark: #432a20; }
:root[data-theme="dark"] [style*="--figure-colour:#e6e0f8"] { --figure-colour-dark: #2e2846; }
:root[data-theme="dark"] [style*="--figure-colour:#e2f1c4"] { --figure-colour-dark: #253a22; }

/* ---------- Features, Client, Story ---------- */
:root[data-theme="dark"] .fx-page { --group: var(--text-main); --group-soft: #1f2530; }
/* the closing card is a dark block on the white page: in the dark it is a lighter card with a border */
:root[data-theme="dark"] .fx-cta { background: #161c26; border: 1px solid var(--border-color); }
:root[data-theme="dark"] .fx-job .ghost { border-color: #8b5cf6; color: #b39af7; background: rgba(255, 255, 255, 0.03); }
:root[data-theme="dark"] .client-page { --client-copy: var(--text-2); }
:root[data-theme="dark"] .client-platform li::before { color: var(--on-accent); }
:root[data-theme="dark"] .story-page { --area: var(--text-main); --area-soft: #1a2029; }
:root[data-theme="dark"] .sp-spoiler > summary::before { color: var(--on-accent); }

/* ---------- My account (player.css) ---------- */
:root[data-theme="dark"] .char2.on { border-color: rgba(74, 222, 128, 0.5); }
:root[data-theme="dark"] .char2 .where.on, :root[data-theme="dark"] .kv .ok { color: #86efac; }
:root[data-theme="dark"] .char2 .where.on::before { background: #4ade80; }
:root[data-theme="dark"] .chip.on { background: var(--text-main); border-color: var(--text-main); color: var(--text-inverse); }
:root[data-theme="dark"] .rep2 .ans-mark { color: #86efac; background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.35); }
:root[data-theme="dark"] .rep-body .answer, :root[data-theme="dark"] .report .answer { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); }
:root[data-theme="dark"] .rep-body .answer b, :root[data-theme="dark"] .report .answer b { color: #86efac; }
:root[data-theme="dark"] .rep-body .player-answer { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.32); }
:root[data-theme="dark"] .rep-body .player-answer b { color: #93c5fd; }
:root[data-theme="dark"] .pill.new { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
:root[data-theme="dark"] .pill.seen { background: rgba(252, 211, 77, 0.18); color: #fcd34d; }
:root[data-theme="dark"] .pill.fixed { background: rgba(74, 222, 128, 0.18); color: #86efac; }
:root[data-theme="dark"] .kv .warn { color: #fbbf24; }
:root[data-theme="dark"] .notice.err { border-color: rgba(252, 165, 165, 0.45); background: rgba(252, 165, 165, 0.08); color: #fca5a5; }
:root[data-theme="dark"] .overlay { background: rgba(0, 0, 0, 0.6); }
/* buttons that sit on a painted picture stay as they are in light mode */
:root[data-theme="dark"] .client-actions .btn-primary { background: #ffffff; border-color: #ffffff; color: #111827; }
/* the Story page's drawings are on white paper: their picture areas stay white, as in light mode (slightly dimmed) */
:root[data-theme="dark"] .sp-monster img, :root[data-theme="dark"] .sp-person img,
:root[data-theme="dark"] .sp-with-art img, :root[data-theme="dark"] .sp-chapters .sp-chapter-cast img { background: #ffffff; filter: brightness(0.9); }
