/* Light mode corrections for colours written in the module stylesheets.
   Every rule is scoped to the light theme: the default night palette is
   untouched. The map viewer keeps its night look, like its canvas drawing. */

:root[data-theme="light"] body {
  background-image: radial-gradient(ellipse at 85% 0%, #d9ece2aa, transparent 55%);
}

:root[data-theme="light"] .topbar {
  background: #f3f0e9eb;
}

:root[data-theme="light"] .chat-launcher {
  box-shadow: 0 4px 20px rgb(16 40 33 / 0.18);
}

:root[data-theme="light"] #chat-panel {
  box-shadow: 0 15px 55px rgb(16 40 33 / 0.2);
}

:root[data-theme="light"] .village-combobox [role="listbox"] {
  box-shadow: 0 12px 30px rgb(16 40 33 / 0.16);
}

:root[data-theme="light"] .village-travel-errors {
  color: var(--danger);
}

/* Offensive mission quotas. */
:root[data-theme="light"] .offense-mission-target-waves .offense-quota.is-pending {
  color: #8a4a10;
  border-color: #dfb07a;
  background: #fcefdd;
}

:root[data-theme="light"] .offense-mission-target-waves .offense-quota.is-covered {
  color: #1f6a49;
  border-color: #8dc8aa;
  background: #e2f3ea;
}

/* Combat simulator: attack and defence colours readable as text. */
:root[data-theme="light"] .combat-space {
  --combat-attack: #a85a22;
  --combat-defense: #2c6aa8;
}

:root[data-theme="light"] .combat-runbar {
  box-shadow: 0 8px 30px rgb(16 40 33 / 0.14);
}

:root[data-theme="light"] .combat-paste-dialog::backdrop {
  background: rgb(16 40 33 / 0.45);
}

/* Troop comparator gauges: a darker track on the light panels. */
:root[data-theme="light"] .forge-control input[type="range"],
:root[data-theme="light"] .bonus-control input[type="range"] {
  --gauge-track: color-mix(in srgb, var(--muted) 75%, var(--surface-strong));
}

/* RC Analytics: panels lighter than the page, a paper-like capture backdrop. */
:root[data-theme="light"] .rc-module-page {
  --rc-panel: var(--surface-raised);
}

:root[data-theme="light"] .rc-module-page .dropzone {
  background: linear-gradient(140deg, var(--accent-soft), var(--surface));
}

:root[data-theme="light"] .rc-module-page .image-thumb {
  background: var(--surface-strong);
}

:root[data-theme="light"] .rc-module-page dialog::backdrop {
  background: rgb(16 40 33 / 0.45);
}

/* RC Analytics: small coloured labels kept above 4.5:1 on their light backgrounds. */
:root[data-theme="light"] .rc-module-page .rc-outcome-kept {
  color: var(--accent-hover);
}

:root[data-theme="light"] .rc-module-page .rc-hypothesis-choice small {
  color: var(--ink-2);
}

/* The theme switch in the account menu and the footer. */
.theme-switch {
  margin: 0;
}

.site-footer .theme-switch .link-button {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Attaques reçues: the paste field on light paper, the sticky assessment bar lifted. */
:root[data-theme="light"] .incoming-page textarea {
  background: var(--surface);
}

:root[data-theme="light"] .incoming-page .incoming-assess-bar {
  box-shadow: 0 6px 20px rgb(16 40 33 / 0.1);
}

/* Disponibilités horaires: the hatching of the hour that does not exist stays visible on light paper. */
:root[data-theme="light"] .presence-page .presence-cell.is-missing {
  background: repeating-linear-gradient(
    135deg,
    var(--surface) 0 6px,
    var(--line-strong) 6px 7px
  );
}

/* Disponibilités horaires: the two strongest steps of the heat map keep white figures above 4.5:1. */
:root[data-theme="light"] .presence-page .presence-level-4 {
  background: var(--accent);
}

:root[data-theme="light"] .presence-page .presence-level-5 {
  background: var(--accent-hover);
}

:root[data-theme="light"] .presence-page .presence-heat td.is-missing,
:root[data-theme="light"] .presence-page .presence-swatch.is-missing,
:root[data-theme="light"] .presence-page .presence-state-missing {
  background: repeating-linear-gradient(
    135deg,
    var(--surface) 0 6px,
    var(--line-strong) 6px 7px
  );
}

/* Défense: the send bar lifted from the page, the progress track and the late state readable on light paper. */
:root[data-theme="light"] .defense-page .defense-sendbar {
  box-shadow: 0 -6px 20px rgb(16 40 33 / 0.1);
}

:root[data-theme="light"] .defense-page progress,
:root[data-theme="light"] .defense-page progress::-webkit-progress-bar {
  background: var(--line);
}

:root[data-theme="light"] .defense-page .defense-call {
  box-shadow: 0 4px 14px rgb(16 40 33 / 0.06);
}

/* Send statuses (lot D): the comment field on light paper. */
:root[data-theme="light"] .send-status .send-status-more textarea {
  background: var(--surface);
}

/* Mes départs (lot D): the cards lifted from light paper. */
:root[data-theme="light"] .departures-page .departure {
  box-shadow: 0 4px 14px rgb(16 40 33 / 0.06);
}

:root[data-theme="light"] .departures-page .departure.is-cancelled,
:root[data-theme="light"] .departures-page .departure-notice {
  background: var(--surface-raised);
}

/* Departure alarms (lot D): the banner and the badge lifted from light paper. */
:root[data-theme="light"] #departure-alarm .departure-alarm-banner {
  box-shadow: 0 10px 30px rgb(16 40 33 / 0.18);
}

:root[data-theme="light"] .departure-chip {
  box-shadow: 0 2px 8px rgb(16 40 33 / 0.1);
}

/* Discord de l’équipe (lot E): the code and the cards lifted from light paper. */
:root[data-theme="light"] .team-discord .team-discord-raw {
  background: var(--surface);
}

:root[data-theme="light"] .team-discord .team-discord-summary div,
:root[data-theme="light"] .team-discord .team-discord-failures li {
  box-shadow: 0 4px 14px rgb(16 40 33 / 0.06);
}

/* Messages Discord (lot E) in the profile. */
:root[data-theme="light"] .profile-discord-messages {
  background: var(--surface-raised);
}

/* Classements, fiches joueur et royaume (lot F): cards, tables and curves lifted from light paper. */
:root[data-theme="light"] .atlas-page .atlas-figures article,
:root[data-theme="light"] .atlas-page .atlas-table-wrap,
:root[data-theme="light"] .atlas-page .atlas-chart svg {
  box-shadow: 0 4px 14px rgb(16 40 33 / 0.06);
}

:root[data-theme="light"] .atlas-page .atlas-table tr.is-mine {
  background: var(--accent-soft);
}

/* Recherche globale (lot F): the window and its button on light paper. */
:root[data-theme="light"] #global-search {
  box-shadow: 0 18px 50px rgb(16 40 33 / 0.22);
}

:root[data-theme="light"] #global-search::backdrop {
  background: rgb(16 40 33 / 0.35);
}

:root[data-theme="light"] .global-search-trigger:not([hidden]) {
  background: var(--surface);
}

/* Chercheurs version 2 (lot F): the saved filters and notes on light paper. */
:root[data-theme="light"] .finder-page .finder-tools {
  box-shadow: 0 4px 14px rgb(16 40 33 / 0.06);
}

:root[data-theme="light"] .finder-page .finder-save input,
:root[data-theme="light"] .finder-page .finder-note textarea,
:root[data-theme="light"] .atlas-page .finder-note textarea {
  background: var(--surface);
}
