/* Repoints map.css onto the shared theme and adapts it to the site shell.
   Load after map.css. Tokens are set on body, not :root, because the theme
   tokens they reference live on body.bico-nocturne. */

body.bico-nocturne {
  --map-parchment:      var(--text-primary);
  --map-parchment-dark: var(--text-secondary);
  --map-parchment-glow: #f4ecda;

  /* card surfaces and ink are set further down, where the cards became
     dark; these used to be parchment. */

  --map-gold:           var(--gold);
  --map-gold-bright:    #f0c877;
  --map-gold-deep:      var(--gold-soft);
  --map-border:         var(--gold-soft);

  --map-teal:           var(--src-guild);
  --map-red:            var(--src-army);

  --map-font-display:   var(--font-display);
  --map-font-body:      var(--font-prose);

  --header-h: 56px;
}

/* The shared shell owns the page frame now. */
body.bico-nocturne .bico-main.is-wide {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-shell { flex: 1; min-height: 0; }

/* ---- slim bar where the old hero used to be ---- */
.geo-bar {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  flex-wrap: wrap;
  padding: 9px 22px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.geo-bar__titles { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 0; }
.geo-bar__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.geo-bar__note {
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text-muted);
}

.geo-bar__cmd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 5px 15px;
  cursor: pointer;
  white-space: nowrap;
}
.geo-bar__cmd:hover { border-color: var(--gold-soft); color: var(--gold); }
.geo-bar__cmd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

/* ---- Leaflet chrome ---- */
.leaflet-container {
  font-family: var(--font-ui);
  background: var(--surface-0);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--map-card-bg);
  color: var(--map-ink);
  border: 1px solid var(--map-gold-deep);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.leaflet-popup-tip { border-radius: 0; }
.leaflet-popup-content { margin: 12px 15px; font-size: 14px; line-height: 1.55; }
.leaflet-popup-content h1, .leaflet-popup-content h2, .leaflet-popup-content h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--map-ink);
}
.leaflet-popup-close-button { color: var(--map-ink-soft) !important; }
.leaflet-popup-close-button:hover { color: var(--map-ink) !important; }

.leaflet-control-attribution {
  background: rgba(20, 17, 13, 0.78) !important;
  color: #a1937a !important;
  font-family: var(--font-ui);
  font-size: 11px;
  border-radius: var(--radius-sm) 0 0 0;
}
.leaflet-control-attribution a { color: var(--gold-soft) !important; }

.leaflet-bar a,
.leaflet-bar a:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-bottom-color: var(--border);
}
.leaflet-bar a:hover { color: var(--gold); }

.leaflet-tooltip {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.leaflet-tooltip-top:before { border-top-color: var(--border-strong); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--border-strong); }
.leaflet-tooltip-left:before { border-left-color: var(--border-strong); }
.leaflet-tooltip-right:before { border-right-color: var(--border-strong); }

/* Guild chips in popups resolve to the Codex, which now shares this palette. */
.leaflet-popup-content .guild-chip,
.leaflet-popup-content .guild-name {
  color: var(--map-gold-deep);
  border-bottom: 1px dotted var(--map-gold-deep);
}

@media (max-width: 760px) {
  .geo-bar { padding: 8px var(--pad-md); }
  .geo-bar__note { display: none; }
}
/* ============================================================
   SOURCE BADGES

   geopo was on Tailwind's defaults while the feed, codex and terrain
   map were on the site's eight tuned categories - and two of them
   disagreed outright: domain read orange here and green everywhere
   else, poi read green here and orange everywhere else. The same
   entity changed category colour when you clicked through.

   These are the site's dark-surface set, which is what white badge
   text needs; the nocturne set is for coloured text ON dark and would
   give 1.6:1 to 3.4:1 here. Contrast with white, measured:

     mage 6.9   army 6.8   domain 5.0   ship 6.0
     poi  5.1   gp   5.4   guild  4.6   faction 7.0

   poi is #a85a06 rather than the site's #c26a08, which is 3.9:1 with
   white - the one value in the dark set that misses on a badge.
   ============================================================ */
body.bico-nocturne .bico-card[data-source="mage"]      .bico-card__source { background: #6d2fd6; }
body.bico-nocturne .bico-card[data-source="army"]      .bico-card__source { background: #b02036; }
body.bico-nocturne .bico-card[data-source="domain"]    .bico-card__source { background: #3f7d20; }
body.bico-nocturne .bico-card[data-source="ship"]      .bico-card__source { background: #176b8c; }
body.bico-nocturne .bico-card[data-source="poi"]       .bico-card__source { background: #a85a06; }
body.bico-nocturne .bico-card[data-source="gp"]        .bico-card__source { background: #5a6b8c; }
body.bico-nocturne .bico-card[data-source="guild"]     .bico-card__source { background: #1f8377; }
body.bico-nocturne .bico-card[data-source="faction"]   .bico-card__source { background: #a3216f; }
body.bico-nocturne .bico-card[data-source="occultist"] .bico-card__source { background: #7f1d1d; }

/* The secondary "+ Maître-Occultiste" line is text on the dark card, not a
   badge, so it cannot reuse the badge colours above: #7f1d1d measured
   1.36:1 against the card and #6d2fd6 not much better. These are the light
   variants, 5.4:1 (mage) and 7.0:1 (occultist) on the card's inner panel. */
body.bico-nocturne .bico-card__source--alt[data-source="mage"]      { color: #b18cff !important; }
body.bico-nocturne .bico-card__source--alt[data-source="occultist"] { color: #fca5a5 !important; }

/* friend / foe / npc rings, off Tailwind and onto the site's status colours */
body.bico-nocturne .perk-ring--friend,
body.bico-nocturne .ff-row__ring--friend { border-color: #3f7d20; box-shadow: 0 0 5px rgba(63,125,32,.6); }
body.bico-nocturne .perk-ring--foe,
body.bico-nocturne .ff-row__ring--foe    { border-color: #b02036; box-shadow: 0 0 5px rgba(176,32,54,.6); }
body.bico-nocturne .perk-ring--npc,
body.bico-nocturne .ff-row__ring--npc    { border-color: #a85a06; box-shadow: 0 0 5px rgba(168,90,6,.6); }

/* ============================================================
   THE HEX CARDS ARE DARK - FINISH THE JOB

   map.css was written for parchment cards: cream surfaces, dark ink.
   bico-theme.css then styles `.bico-card` at (0,2,1) - the atmosphere
   block added in Phase 4 - which outranks map.css's (0,1,0) and paints
   these cards dark. The two halves have disagreed ever since: dark ink
   on a dark card.

   The class name is the collision. geopo's map.css uses `.bico-card`
   for its hex items and the site theme uses it for its own cards; they
   were written independently and Phase 4 put them in the same room.

   Rather than drag geopo back to parchment, this finishes the move to
   dark, which is what the rest of the site is. The map's semantic
   tokens flip in one place and the 97 text rules, 27 secondary rules
   and 16 inner surfaces follow automatically.

   The seven places --map-ink is used as a background rather than as
   text are restored below, since those want to stay dark.
   ============================================================ */
body.bico-nocturne {
  --map-card-bg:        #1b2340;
  --map-card-inner-bg:  #232c4e;

  --map-ink:            #f2e7cb;   /* 12.5:1 on the card */
  --map-ink-mid:        #cfc0a0;   /* 8.6:1  */
  --map-ink-soft:       #ab9d84;   /* 5.8:1  */

  --map-chip-bg:        #131a33;   /* the dark chips that used --map-ink */
}

/* --- the seven chips and tooltips that used ink as a surface --------- */
body.bico-nocturne .bico-badge,
body.bico-nocturne .bico-distance-popup .leaflet-popup-content-wrapper,
body.bico-nocturne .bico-distance-popup .leaflet-popup-tip,
body.bico-nocturne .bico-spellcheck__caster-distance,
body.bico-nocturne .bico-detail__badge--oor,
body.bico-nocturne .leaflet-tooltip.bico-caster-label,
body.bico-nocturne .bico-marker__count {
  background: var(--map-chip-bg);
  color: var(--text-primary);
}

/* --- accents belong light again, now that the ground is dark --------- */
body.bico-nocturne .bico-card__option-icon,
body.bico-nocturne a.bico-card__guild--link,
body.bico-nocturne a.bico-card__guild--link:focus-visible,
body.bico-nocturne .bico-card__totals-num,
body.bico-nocturne .bico-card__fortstr-num,
body.bico-nocturne .bico-card__qt,
body.bico-nocturne .bico-card__buildings-summary,
body.bico-nocturne .bico-card__buildings-chev,
body.bico-nocturne .bico-card__spells-summary,
body.bico-nocturne .bico-card__spells-chev,
body.bico-nocturne .bico-card__spell-tradition,
body.bico-nocturne .bico-card__note > summary,
body.bico-nocturne .bico-multi-popup__count,
body.bico-nocturne .bico-spellcheck__spinner,
body.bico-nocturne .bico-spellcheck__eyebrow,
body.bico-nocturne .bico-spellcheck__stats strong,
body.bico-nocturne .bico-spellcheck__caster summary::before,
body.bico-nocturne .bico-spellcheck__caster-tradition,
body.bico-nocturne .bico-spellcheck__caster--gp .bico-spellcheck__caster-tradition,
body.bico-nocturne .bico-spellcheck__toggle-icon,
body.bico-nocturne .bico-spellcheck__schools-label,
body.bico-nocturne .bico-spellcheck__caster-name:hover,
body.bico-nocturne .bico-spellcheck__caster-name--active,
body.bico-nocturne .bico-spellcheck__section-label,
body.bico-nocturne .bico-caster-label strong,
body.bico-nocturne .bico-spell-detail__eyebrow,
body.bico-nocturne .bico-spell__foc,
body.bico-nocturne .bico-detail__badge--foc,
body.bico-nocturne .bico-detail__label {
  color: var(--gold);           /* 9.4:1 on the card, 8.3:1 on inner boxes */
}

/* --- KEY INSIGHT ---------------------------------------------------- */
/* Was an amber wash with a hairline rule, carrying body text in the old
   dark ink - unreadable on a dark card, and visually the loudest thing
   in the panel for what is a footnote. Now a recessed well: darker than
   the card rather than brighter, gold rule down the left, and the label
   small and quiet above the text. */
body.bico-nocturne .bico-card__insight {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: rgba(9, 13, 28, .55);
  border-left: 2px solid var(--gold-soft);
  border-radius: 0 4px 4px 0;
  box-shadow: inset 0 1px 0 rgba(255, 214, 140, .06);
}
body.bico-nocturne .bico-card__insight-label {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .17em;
  color: var(--gold-soft);
  margin-bottom: 5px;
}
body.bico-nocturne .bico-card__insight-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);   /* 8.8:1 in the well */
}

/* --- more room in the panels (about +20%) ---------------------------- */
body.bico-nocturne .bico-single-popup .leaflet-popup-content-wrapper { min-width: 359px; }
body.bico-nocturne .bico-multi-popup  .leaflet-popup-content-wrapper { min-width: 966px; }

@media (max-width: 1040px) {
  body.bico-nocturne .bico-multi-popup .leaflet-popup-content-wrapper { min-width: 0; }
}
@media (max-width: 420px) {
  body.bico-nocturne .bico-single-popup .leaflet-popup-content-wrapper { min-width: 0; }
}

/* --- the popup shell itself, to match the cards --------------------- */
body.bico-nocturne .leaflet-popup-content-wrapper,
body.bico-nocturne .leaflet-popup-tip {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--gold-soft);
}

/* ============================================================
   THE CONTROL PANEL

   map.css paints the sidebar as an embossed gold plaque: a
   #f0d99a-to-#d9b25a gradient, #5a3e10 borders, dark brown labels and
   white text-shadows. That was coherent when the whole site was
   parchment. Against the navy the rest of the site now wears, it is the
   loudest object on the page and reads as a different material bolted
   to the side of the map.

   Same panel, same shapes, same affordances - inverted onto the site's
   palette. The plaque becomes a dark console with gold engraving, and
   the emphasis flips: an inactive layer button is quiet and outlined,
   an active one is filled gold. Before, every button was loud and only
   the active one went dark, which is backwards.

   All measured against the panel, not eyeballed:
     gold on the panel            10.9:1
     parchment label on the panel 14.1:1
     dark text on the gold fill    8.4:1
   ============================================================ */
body.bico-nocturne .map-sidebar {
  background:
    /* the same two hatchings, cooled to the navy */
    repeating-linear-gradient(105deg, rgba(232,198,112,.030) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(15deg,  rgba(232,198,112,.022) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, rgba(255,240,200,.05), transparent 200px),
    radial-gradient(ellipse at 50% 0%,   rgba(232,198,112,.10), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(10,14,32,.55),    transparent 60%),
    linear-gradient(180deg, #131c3a 0%, #0e1530 52%, #0a1024 100%);
  border-left: 2px solid var(--gold-soft);
  color: var(--text-primary);
  box-shadow:
    inset 6px 0 14px -8px rgba(0, 0, 0, .6),
    inset 0 0 70px rgba(6, 10, 24, .5);
}
body.bico-nocturne .map-sidebar::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
}

/* --- section headings ------------------------------------------------ */
body.bico-nocturne .sidebar__title {
  color: var(--gold);
  text-shadow: none;
}
/* the little chevron chip that sits on the divider rule */
body.bico-nocturne .sidebar__section + .sidebar__section::before {
  background: linear-gradient(180deg, #131c3a 0%, #0e1530 100%);
  color: var(--gold-soft);
}

/* --- layer buttons --------------------------------------------------- */
/* quiet when off, gold when on - the opposite of what it was doing */
body.bico-nocturne .sidebar__buttons button {
  background: linear-gradient(180deg, #1a2445 0%, #131c3a 100%);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 214, 140, .05);
}
body.bico-nocturne .sidebar__buttons button:hover {
  background: linear-gradient(180deg, #222d55 0%, #18224a 100%);
  border-color: var(--gold-soft);
  color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 214, 140, .08),
              0 2px 10px rgba(232, 198, 112, .12);
}
body.bico-nocturne .sidebar__buttons button.active {
  background: linear-gradient(180deg, #f0d18a 0%, #d9ae56 100%);
  border-color: var(--gold);
  color: #14192e;
  font-weight: 700;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35),
              0 0 0 1px rgba(232, 198, 112, .35),
              0 2px 12px rgba(232, 198, 112, .22);
}

/* --- marker groups --------------------------------------------------- */
body.bico-nocturne .marker-type {
  background: var(--surface-2);
  border-color: var(--border);
}
body.bico-nocturne .marker-type__head { color: var(--text-primary); }
body.bico-nocturne .marker-type__head:hover { background: var(--surface-3); }
body.bico-nocturne .marker-type__chev { color: var(--gold-soft); }
body.bico-nocturne .marker-tool__label { color: var(--gold); }
body.bico-nocturne .marker-tools__empty { color: var(--text-muted); }

/* --- the nerd tools and the tradition filter ------------------------- */
body.bico-nocturne .trad-filter__bulk-btn {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
body.bico-nocturne .trad-filter__bulk-btn:hover {
  background: var(--surface-3);
  border-color: var(--gold-soft);
  color: var(--gold);
}

/* --- the zoom / reset controls sitting on the map -------------------- */
body.bico-nocturne .map-controls button {
  background: rgba(13, 20, 42, .88);
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  backdrop-filter: blur(3px);
}
body.bico-nocturne .map-controls button:hover {
  background: var(--gold);
  color: #14192e;
}

/* --- seat the map in the page rather than butting it against the edge - */
body.bico-nocturne .map-shell { position: relative; }
body.bico-nocturne .map-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  box-shadow: inset 0 0 90px rgba(5, 8, 20, .45);
}

/* --- the last light surfaces in the panel ---------------------------- */
/* Found by walking the live sidebar and flagging every computed
   background above 0.35 luminance: nine marker-group bodies, two search
   inputs and the drawer close button were still on --map-parchment,
   which is the site's light TEXT colour being used as a surface.
   The 56 toggle knobs that also came back light are left alone - a pale
   handle on a dark track is the affordance, not an oversight. */
body.bico-nocturne .marker-type__body,
body.bico-nocturne .marker-type__body--parent {
  background: var(--surface-3);
  color: var(--text-primary);
}
body.bico-nocturne .marker-type__head,
body.bico-nocturne .marker-type__head:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
body.bico-nocturne .marker-type__head:hover { background: var(--surface-3); }

body.bico-nocturne .spell-cov__search,
body.bico-nocturne .map-sidebar input[type="text"],
body.bico-nocturne .map-sidebar input[type="search"] {
  background: var(--surface-1);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
body.bico-nocturne .spell-cov__search::placeholder,
body.bico-nocturne .map-sidebar input::placeholder { color: var(--text-muted); }
body.bico-nocturne .spell-cov__search:focus,
body.bico-nocturne .map-sidebar input:focus { border-color: var(--gold-soft); outline: none; }

body.bico-nocturne .map-drawer__close {
  background: var(--surface-2);
  color: var(--gold);
  border-color: var(--border-strong);
}

/* ============================================================
   THE COMMAND POST MODAL

   .cmdpost__panel takes its surface from --map-parchment, which is the
   site's light TEXT colour being used as a background - so the panel is
   khaki. Its contents are all --map-ink, which this file flipped to
   light when the hex cards went dark. Light text on a light panel: the
   flip fixed the cards and broke this, because the two share a token.

   Giving the modal its own dark surface settles both: the ink stays
   light everywhere, and this panel stops being the one place it lands
   on something pale.

   The call to action was --map-teal (#2fd0bd, the guild category
   colour) which is neither a button colour nor anywhere else in the
   site's chrome. It is gold now, like every other primary action.

   Measured:
     body text on the panel   14.8:1
     dark text on the button   8.4:1
     eyebrow gold on panel     6.7:1
   ============================================================ */
body.bico-nocturne .cmdpost__panel {
  background: var(--surface-1);
  border-color: var(--gold-soft);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
body.bico-nocturne .cmdpost__head {
  background: linear-gradient(180deg, rgba(232, 198, 112, .10), rgba(232, 198, 112, 0));
  border-bottom-color: var(--border-strong);
}
body.bico-nocturne .cmdpost__eyebrow { color: var(--gold-soft); }
body.bico-nocturne .cmdpost__title   { color: var(--gold); }
body.bico-nocturne .cmdpost__close   { color: var(--text-muted); }
body.bico-nocturne .cmdpost__close:hover { color: var(--danger); }

body.bico-nocturne .cmdpost__loginwall p,
body.bico-nocturne .cmdpost__perks li,
body.bico-nocturne .cmdpost__section-head h3 { color: var(--text-primary); }
body.bico-nocturne .cmdpost__perks li { border-bottom-color: var(--border); }
body.bico-nocturne .cmdpost__fineprint,
body.bico-nocturne .cmdpost__empty,
body.bico-nocturne .cmdpost__section-head p { color: var(--text-muted); }

/* the primary action, in the site's gold rather than a category colour */
body.bico-nocturne .cmdpost__btn {
  background: linear-gradient(180deg, #f0d18a 0%, #d9ae56 100%);
  color: #14192e;
  border: 1px solid var(--gold);
  font-weight: 700;
}
body.bico-nocturne .cmdpost__btn:hover {
  filter: none;
  background: linear-gradient(180deg, #f7dfa4 0%, #e3bb66 100%);
  box-shadow: 0 4px 18px rgba(232, 198, 112, .28);
}

/* the perk rings were still on Tailwind; neutral was missed last time */
body.bico-nocturne .perk-ring--neutral {
  border-color: #c3cfe8;
  box-shadow: 0 0 6px rgba(195, 207, 232, .55);
}

/* --- the marker card's ⚙ options menu --------------------------------
   map.css paints this menu with --map-parchment, which this file turns
   into a TEXT colour (#f0e3c4) for the dark theme. The menu items use
   --map-ink, also light (#f2e7cb), so the menu rendered as a cream box
   with near-invisible writing: 1.04:1. The same trap the Nation Influence
   modal fell into - a surface reading a token that is no longer a surface.

   The menu takes the card's inner panel so it still reads as raised above
   the card, and hover moves to a gold wash, because the old hover colour
   is now the same as the menu itself. */
body.bico-nocturne .bico-card__options-menu {
  background: var(--map-card-inner-bg);
  border-color: var(--map-gold-deep);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
}
body.bico-nocturne .bico-card__option {
  color: var(--map-ink);
}
body.bico-nocturne .bico-card__option:hover,
body.bico-nocturne .bico-card__option:focus-visible {
  background: rgba(232, 198, 112, .14);
}
/* White on the bright gold hover was unreadable too. */
body.bico-nocturne .bico-card__options-toggle:hover {
  color: #14192e;
}

/* Count pips on gold: white text measured 2.81:1. Dark ink is 5.9:1. */
body.bico-nocturne .bico-card__buildings-count,
body.bico-nocturne .trad-filter__cat-count {
  color: #14192e;
}

/* ============================================================
   THE NIGHT SKY BEHIND THE MAP

   Three layers painted the margin around the map image: .map-area and
   .map-canvas in --map-parchment-dark (khaki #c3b696 once this file
   remaps it), and .leaflet-container again with !important. Under them,
   body.page-map still carried the old brown dungeon gradient from before
   the site went navy - so clearing only the map would have revealed brown.

   The body takes the site's ground, the map layers go transparent, and
   bico-sky.js (switched on in geopo/index.php) draws the same starfield
   the other pages have. Its canvas is fixed behind .bico-main, which is
   why the map has to be see-through rather than the stars being on top.
   ============================================================ */
body.bico-nocturne.page-map {
  background: var(--surface-1);
}
body.bico-nocturne .map-area,
body.bico-nocturne .map-canvas {
  background: transparent;
}
body.bico-nocturne .leaflet-container {
  background: transparent !important;
}

/* ============================================================
   THE LAST PARCHMENT SURFACES

   Same fault as the options menu above, everywhere else it survived:
   rules in map.css that paint a background with --map-parchment or
   --map-parchment-glow, both of which this file turns into LIGHT colours
   (#f0e3c4 and #f4ecda) for use as text. Found by parsing both
   stylesheets for parchment backgrounds with no dark-theme override, then
   measuring each one that renders on the live map.
   ============================================================ */

/* The spell / divine power detail panel. Shared by mages, occultists and
   high priests (map.js builds both with the same classes). Measured on the
   live map: title and values 1.04:1, labels and eyebrow 1.29:1. */
body.bico-nocturne .bico-spell-detail__backdrop {
  background: rgba(7, 11, 24, .72);
}
body.bico-nocturne .bico-spell-detail__panel {
  background: var(--map-card-bg);
  border-color: var(--map-gold-deep);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .6);
}
body.bico-nocturne .bico-spell-detail__close:hover {
  color: #14192e;
}
/* "Majeur": white on gold was 2.81:1. */
body.bico-nocturne .bico-detail__badge--major {
  color: #14192e;
}
/* "Requires": #b91c1c is a light-theme red and disappears on the dark panel. */
body.bico-nocturne .bico-detail__badge--req {
  color: #fca5a5;
  background: rgba(240, 85, 107, .14);
  border-color: rgba(240, 85, 107, .45);
}

/* Hover states. Each of these flashed cream behind light text on hover -
   not visible to a screenshot, only to a mouse. */
body.bico-nocturne .trad-filter__row:hover,
body.bico-nocturne .bico-card__buildings-summary:hover,
body.bico-nocturne .bico-card__spells-summary:hover,
body.bico-nocturne .bico-spellcheck__caster summary:hover,
body.bico-nocturne .bico-spell__row:hover,
body.bico-nocturne .bico-school-chip--off:hover {
  background: rgba(232, 198, 112, .12);
}
/* Its own rule: :has() inside a selector list would invalidate the whole
   list in a browser that cannot parse it. */
body.bico-nocturne .bico-spellcheck__toggle:hover:not(:has(input:disabled)) {
  background: rgba(232, 198, 112, .12);
}

/* Caster Coverage's range inputs in the sidebar: measured cream on the live map. */
body.bico-nocturne .trad-filter__coverage-range input {
  background: var(--map-card-inner-bg);
  color: var(--map-ink);
}

/* Cards for removed entities keep their diagonal stripes, in dark tones. */
body.bico-nocturne .bico-card[data-change-type="removed"] {
  background: repeating-linear-gradient(
    135deg,
    var(--map-card-bg) 0 8px,
    var(--map-chip-bg) 8px 12px
  );
}
body.bico-nocturne .bico-card[data-change-type="removed"]::after {
  background: var(--map-chip-bg);
}

/* The login gate, if it is shown. */
body.bico-nocturne .auth-gate__panel {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 198, 112, .12), transparent 70%),
    var(--map-card-bg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .15),
    0 24px 80px rgba(0, 0, 0, .6);
}
body.bico-nocturne .auth-gate__input {
  background: var(--map-card-inner-bg);
  color: var(--map-ink);
}

/* On phones, a marker with several entities opens this panel instead. */
@media (max-width: 768px) {
  body.bico-nocturne .bico-mpopup-panel {
    background: var(--map-card-bg);
  }
}
