/* Crownlands UI readability and cohesion contract ------------------------ */

:root {
  --cl-readable-paper: #211a13;
  --cl-readable-paper-strong: #17110d;
  --cl-readable-paper-muted: #4f3f2d;
  --cl-readable-paper-soft: #66533a;
  --cl-readable-dark: #f3ead5;
  --cl-readable-dark-strong: #fff8e7;
  --cl-readable-dark-muted: #d2c3a3;
  --cl-readable-dark-soft: #baa987;
  --cl-readable-gold-paper: #5f431b;
  --cl-readable-gold-dark: #e5c67d;
  --cl-readable-success-paper: #304526;
  --cl-readable-warning-paper: #694516;
  --cl-readable-error-paper: #6b2928;
  --cl-disabled-dark: #c2b69e;
  --cl-focus-ring: #ead59a;
  --cl-paper-separator: rgba(73, 49, 26, .34);
}

body { color: var(--cl-readable-dark); }

:where(button):focus-visible,
:where(input):focus-visible,
:where(select):focus-visible,
:where(textarea):focus-visible,
:where(a):focus-visible,
:where([tabindex]):focus-visible {
  outline: 3px solid var(--cl-focus-ring);
  outline-offset: 2px;
}

:where(button):disabled {
  opacity: .78;
  cursor: not-allowed;
  filter: saturate(.58);
}

:where(input, select, textarea) {
  color: var(--cl-readable-paper-strong);
  caret-color: var(--cl-oxblood);
}

:where(input, textarea)::placeholder {
  color: #695d4c;
  opacity: 1;
}

/* Single-argument :where() entries keep zero specificity and let the browser
   index each surface, instead of testing a large union on every map element. */
/* Paper surfaces use ink, never inherited ivory. */
:where(.modal .modal-card),
:where(.profile-screen),
:where(.panel),
:where(.cl-panel),
:where(.online-login),
:where(.login-game-info),
:where(.profile-settings-section),
:where(.audio-channel-card),
:where(.kingdom-stat),
:where(.profile-achievement-summary),
:where(.profile-achievement-summary-grid > div),
:where(.profile-notification-row),
:where(.profile-skill-summary > div),
:where(.profile-skill-reset),
:where(.profile-skill-list .skill-row),
:where(.skill-preset-detail),
:where(.skill-preset-allocation-group),
:where(.shop-balance),
:where(.shop-rewarded-section),
:where(.shop-item),
:where(.inventory-summary),
:where(.inventory-slot),
:where(.inventory-selection),
:where(.city-list-summary),
:where(.city-list-row),
:where(.city-list-empty),
:where(.leaderboard-row),
:where(.leaderboard-empty),
:where(.battle-report-card),
:where(.battle-report-empty),
:where(.battle-report-detail-head),
:where(.battle-report-detail-grid > div),
:where(.incoming-attack-summary),
:where(.incoming-attack-card),
:where(.incoming-attack-empty),
:where(.outgoing-attack-card),
:where(.active-objective-card),
:where(.held-camp-operation-card),
:where(.held-stronghold-operation-card),
:where(.reinforcement-operation-card),
:where(.holding-reinforcement-panel),
:where(.holding-reinforcement-row),
:where(.scout-report-city),
:where(.scout-report-overview > div),
:where(.scout-breakdown-row),
:where(.scout-skill-list),
:where(.troop-route-city),
:where(.troop-slider-control),
:where(.troop-slider-preview > div),
:where(.send-confirm-card),
:where(.send-outcome),
:where(.camp-public-status > div),
:where(.gold-camp-info-grid > div),
:where(.camp-reward-overview > div),
:where(.camp-reward-row),
:where(.relic-drop-row),
:where(.deed-camp-condition),
:where(.deed-camp-history-row),
:where(.citadel-reign-row),
:where(.citadel-reign-note),
:where(.citadel-reign-empty),
:where(.clan-panel),
:where(.clan-card),
:where(.clan-hero),
:where(.clan-create-card),
:where(.clan-discovery),
:where(.clan-roster-panel),
:where(.clan-gift-panel),
:where(.clan-quest-panel),
:where(.clan-social-card),
:where(.clan-rename-card),
:where(.clan-list-row),
:where(.clan-member-row),
:where(.clan-applications article),
:where(.clan-rally-card),
:where(.clan-quest-card),
:where(.public-profile-section),
:where(.public-profile-location),
:where(.public-profile-clan),
:where(.public-clan-details dl div),
:where(.public-clan-member),
:where(.daily-reward-panel),
:where(.daily-reward-card),
:where(.daily-reward-loading),
:where(.daily-reward-error),
:where(.daily-mission-row),
:where(.daily-mission-detail-stat),
:where(.daily-mission-recommendation),
:where(.seasonal-achievement-panel),
:where(.seasonal-achievement-hero),
:where(.seasonal-achievement-row),
:where(.seasonal-achievement-details),
:where(.offline-reward-grid > div),
:where(.offline-lost-cities),
:where(.level-up-reward-card),
:where(.level-up-reward-item),
:where(.patch-notes-intro),
:where(.patch-notes-release-list article) {
  color: var(--cl-readable-paper);
}

:where(.modal .modal-card) :where(p, li, dd, dt, label, span, small),
:where(.profile-screen) :where(p, li, dd, dt, label, span, small),
:where(.profile-settings-section) :where(p, li, dd, dt, label, span, small),
:where(.shop-item) :where(p, li, dd, dt, label, span, small),
:where(.inventory-slot) :where(p, li, dd, dt, label, span, small),
:where(.inventory-selection) :where(p, li, dd, dt, label, span, small),
:where(.city-list-row) :where(p, li, dd, dt, label, span, small),
:where(.leaderboard-row) :where(p, li, dd, dt, label, span, small),
:where(.battle-report-card) :where(p, li, dd, dt, label, span, small),
:where(.incoming-attack-card) :where(p, li, dd, dt, label, span, small),
:where(.outgoing-attack-card) :where(p, li, dd, dt, label, span, small),
:where(.troop-route-city) :where(p, li, dd, dt, label, span, small),
:where(.troop-slider-control) :where(p, li, dd, dt, label, span, small),
:where(.troop-slider-preview > div) :where(p, li, dd, dt, label, span, small),
:where(.send-confirm-card) :where(p, li, dd, dt, label, span, small),
:where(.camp-info-tab-panel) :where(p, li, dd, dt, label, span, small),
:where(.clan-panel) :where(p, li, dd, dt, label, span, small),
:where(.clan-card) :where(p, li, dd, dt, label, span, small),
:where(.daily-reward-card) :where(p, li, dd, dt, label, span, small),
:where(.daily-mission-row) :where(p, li, dd, dt, label, span, small),
:where(.seasonal-achievement-row) :where(p, li, dd, dt, label, span, small) {
  color: var(--cl-readable-paper-muted);
  opacity: 1;
}

:where(.modal .modal-card) :where(h2, h3, h4, strong, b),
:where(.profile-screen) :where(h2, h3, h4, strong, b),
:where(.profile-settings-section) :where(h2, h3, h4, strong, b),
:where(.shop-item) :where(h2, h3, h4, strong, b),
:where(.inventory-slot) :where(h2, h3, h4, strong, b),
:where(.inventory-selection) :where(h2, h3, h4, strong, b),
:where(.city-list-row) :where(h2, h3, h4, strong, b),
:where(.leaderboard-row) :where(h2, h3, h4, strong, b),
:where(.battle-report-card) :where(h2, h3, h4, strong, b),
:where(.incoming-attack-card) :where(h2, h3, h4, strong, b),
:where(.outgoing-attack-card) :where(h2, h3, h4, strong, b),
:where(.troop-route-city) :where(h2, h3, h4, strong, b),
:where(.troop-slider-control) :where(h2, h3, h4, strong, b),
:where(.troop-slider-preview > div) :where(h2, h3, h4, strong, b),
:where(.send-confirm-card) :where(h2, h3, h4, strong, b),
:where(.camp-info-tab-panel) :where(h2, h3, h4, strong, b),
:where(.clan-panel) :where(h2, h3, h4, strong, b),
:where(.clan-card) :where(h2, h3, h4, strong, b),
:where(.daily-reward-card) :where(h2, h3, h4, strong, b),
:where(.daily-mission-row) :where(h2, h3, h4, strong, b),
:where(.seasonal-achievement-row) :where(h2, h3, h4, strong, b) {
  color: var(--cl-readable-paper-strong);
  opacity: 1;
}

.modal-card h2,
.profile-section-heading h3,
.daily-missions-heading h3,
.clan-panel-heading h3,
.clan-quest-heading h3,
.camp-info-tab-panel h3,
.relic-reward-heading,
.level-up-reward-header h2 {
  color: var(--cl-readable-paper-strong);
  text-shadow: 0 1px rgba(255, 248, 224, .55);
}

.profile-section-heading span,
.daily-missions-meta span,
.shop-balance span,
.inventory-summary span,
.city-list-summary span,
.camp-public-status span,
.gold-camp-info-grid span,
.camp-reward-overview span,
.seasonal-achievement-row-copy > span,
.seasonal-achievement-details > span,
.daily-mission-copy > div > span,
.level-up-eyebrow {
  color: var(--cl-readable-paper-muted);
  font-weight: 900;
  opacity: 1;
}

.kingdom-stat strong,
.profile-achievement-summary-grid strong,
.shop-balance strong,
.inventory-summary strong,
.city-list-summary strong,
.leaderboard-power strong,
.battle-report-troops strong,
.incoming-attack-force strong,
.troop-slider-readout strong,
.city-level-up-copy strong,
.gold-camp-info-grid strong,
.camp-total-defense strong,
.camp-reward-overview strong,
.citadel-reign-rank,
.level-up-reward-item strong {
  color: var(--cl-readable-gold-paper);
  text-shadow: none;
}

/* Timber, iron, and artwork-backed surfaces use ivory. */
:where(.setup-card),
:where(.online-login),
:where(.login-game-info),
:where(.commander-panel),
:where(.bottom-nav),
:where(.map-loading-panel),
:where(.profile-screen-header),
:where(.shop-modal .modal-card),
:where(.inventory-modal .modal-card),
:where(.common-gear-box-modal .modal-card),
:where(.common-gear-building-modal .modal-card),
:where(.inner-castle-modal .modal-card),
:where(.inner-castle-preview-tray),
:where(.common-gear-building-shell),
:where(.common-gear-character-panel),
:where(.common-gear-slot),
:where(.common-gear-reveal-shell),
:where(.battle-visual-target),
:where(.battle-visual-rule),
:where(.battle-visual-section),
:where(.battle-visual-wall),
:where(.battle-visual-rewards),
:where(.battle-visual-hero),
:where(.battle-visual-detail-card),
:where(.battle-visual-bonus-card),
:where(.battle-visual-outcome),
:where(.camp-stats-locked),
:where(.clan-shield-editor),
:where(.clan-shield-editor-preview),
:where(.clan-shield-preview-stage),
:where(.clan-shield-control),
:where(.clan-shield-color-group),
:where(.realm-activity-card.citadel),
:where(.effect-status-badge) {
  color: var(--cl-readable-dark);
}

:where(.setup-card) :where(p, li, span, small, label),
:where(.online-login) :where(p, li, span, small, label),
:where(.login-game-info) :where(p, li, span, small, label),
:where(.commander-panel) :where(p, li, span, small, label),
:where(.bottom-nav) :where(p, li, span, small, label),
:where(.map-loading-panel) :where(p, li, span, small, label),
:where(.profile-screen-header) :where(p, li, span, small, label),
:where(.shop-modal .modal-card) :where(p, li, span, small, label),
:where(.inventory-modal .modal-card) :where(p, li, span, small, label),
:where(.common-gear-box-modal .modal-card) :where(p, li, span, small, label),
:where(.common-gear-building-modal .modal-card) :where(p, li, span, small, label),
:where(.inner-castle-modal .modal-card) :where(p, li, span, small, label),
:where(.inner-castle-preview-tray) :where(p, li, span, small, label),
:where(.common-gear-building-shell) :where(p, li, span, small, label),
:where(.battle-visual-report) :where(p, li, span, small, label),
:where(.camp-stats-locked) :where(p, li, span, small, label),
:where(.clan-shield-editor) :where(p, li, span, small, label),
:where(.realm-activity-card.citadel) :where(p, li, span, small, label) {
  color: var(--cl-readable-dark-muted);
  opacity: 1;
}

:where(.setup-card) :where(h1, h2, h3, h4, strong, b),
:where(.online-login) :where(h1, h2, h3, h4, strong, b),
:where(.login-game-info) :where(h1, h2, h3, h4, strong, b),
:where(.commander-panel) :where(h1, h2, h3, h4, strong, b),
:where(.bottom-nav) :where(h1, h2, h3, h4, strong, b),
:where(.map-loading-panel) :where(h1, h2, h3, h4, strong, b),
:where(.profile-screen-header) :where(h1, h2, h3, h4, strong, b),
:where(.shop-modal .modal-card) :where(h1, h2, h3, h4, strong, b),
:where(.inventory-modal .modal-card) :where(h1, h2, h3, h4, strong, b),
:where(.common-gear-box-modal .modal-card) :where(h1, h2, h3, h4, strong, b),
:where(.common-gear-building-modal .modal-card) :where(h1, h2, h3, h4, strong, b),
:where(.inner-castle-modal .modal-card) :where(h1, h2, h3, h4, strong, b),
:where(.inner-castle-preview-tray) :where(h1, h2, h3, h4, strong, b),
:where(.common-gear-building-shell) :where(h1, h2, h3, h4, strong, b),
:where(.battle-visual-report) :where(h1, h2, h3, h4, strong, b),
:where(.camp-stats-locked) :where(h1, h2, h3, h4, strong, b),
:where(.clan-shield-editor) :where(h1, h2, h3, h4, strong, b),
:where(.realm-activity-card.citadel) :where(h1, h2, h3, h4, strong, b) {
  color: var(--cl-readable-dark-strong);
  opacity: 1;
}

.setup-card :where(h1, h2, strong),
.commander-panel .panel-header strong,
.profile-screen-header h2,
.shop-modal > .modal-card > h2,
.inventory-modal > .modal-card > h2,
.common-gear-box-modal > .modal-card > h2,
.common-gear-building-modal > .modal-card > h2,
.inner-castle-modal > .modal-card > h2,
.inner-castle-preview-copy strong,
.battle-visual-title strong,
.battle-visual-section-title,
.battle-visual-side-label,
.camp-stats-locked > strong {
  color: var(--cl-readable-dark-strong);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .76);
}

.online-login small,
.login-game-info p,
.login-game-info li,
.commander-panel .panel-header small,
.commander-panel .selected-info,
.bottom-nav .nav-btn small,
.inner-castle-intro,
.inner-castle-preview-copy span,
.inner-castle-preview-copy small,
.battle-visual-title small,
.battle-visual-rule,
.battle-visual-detail-row small,
.battle-visual-bonus-row small,
.battle-visual-wall-grid small,
.camp-stats-locked p {
  color: var(--cl-readable-dark-muted) !important;
}

.setup-card :where(.online-login, .login-game-info),
.setup-card :where(.online-login, .login-game-info) :where(p, li, span, small, label) {
  color: var(--cl-readable-paper-muted) !important;
  opacity: 1;
  text-shadow: none;
}

.setup-card :where(.online-login, .login-game-info) :where(h1, h2, h3, strong, b) {
  color: var(--cl-readable-paper-strong) !important;
  text-shadow: 0 1px rgba(255, 248, 224, .55);
}

.setup-card .server-realm-heading {
  color: #4b1f25 !important;
  font-weight: 950;
  text-shadow: none;
}

.setup-card #onlineStatusText {
  color: #2b1a0f !important;
  text-shadow: none;
}

.setup-card #onlineStatusDetail {
  color: #4f3f2d !important;
  text-shadow: none;
}

/* Shared controls keep their role legible in every surface context. */
:where(.primary-btn):not(:disabled),
:where(.profile-primary-btn):not(:disabled),
:where(.shop-buy-btn):not(:disabled),
:where(.inventory-use-btn):not(:disabled),
:where(.offline-collect-btn):not(:disabled),
:where(.troop-slider-confirm):not(:disabled),
:where(.main-city-change-btn):not(:disabled),
:where(.city-level-up-btn):not(:disabled),
:where(.skill-row button):not(:disabled),
:where(.profile-skill-reset button):not(:disabled),
:where(.leaderboard-toolbar button):not(:disabled),
:where(.action-buttons button):not(:disabled),
:where(.daily-mission-action button):not(:disabled),
:where(.seasonal-achievement-reward button):not(:disabled),
:where(.level-up-collect-btn):not(:disabled),
:where(.modal-actions button):not(:disabled) {
  color: var(--cl-readable-dark-strong);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .72);
}

:where(.ghost-btn):not(:disabled),
:where(.profile-secondary-btn):not(:disabled),
:where(.battle-report-back):not(:disabled),
:where(.battle-report-detail-btn):not(:disabled),
:where(.battle-report-locate-btn):not(:disabled),
:where(.city-list-toolbar button):not(:disabled),
:where(.city-list-locate):not(:disabled),
:where(.city-list-info):not(:disabled),
:where(.city-list-pager button):not(:disabled),
:where(.troop-slider-cancel):not(:disabled),
:where(.incoming-attack-locate):not(:disabled),
:where(.realm-activity-location-btn):not(:disabled),
:where(.recall-horn-btn):not(:disabled),
:where(.modal-actions .safe-action):not(:disabled),
:where(.modal-close):not(:disabled),
:where(.profile-screen-close):not(:disabled),
:where(.profile-icon-btn):not(:disabled),
:where(.audio-mute-button):not(:disabled) {
  color: var(--cl-readable-dark-strong);
  font-weight: 850;
}

:where(.primary-btn):disabled,
:where(.profile-primary-btn):disabled,
:where(.shop-buy-btn):disabled,
:where(.inventory-use-btn):disabled,
:where(.offline-collect-btn):disabled,
:where(.troop-slider-confirm):disabled,
:where(.main-city-change-btn):disabled,
:where(.city-level-up-btn):disabled,
:where(.skill-row button):disabled,
:where(.profile-skill-reset button):disabled,
:where(.leaderboard-toolbar button):disabled,
:where(.action-buttons button):disabled,
:where(.daily-mission-action button):disabled,
:where(.seasonal-achievement-reward button):disabled,
:where(.level-up-collect-btn):disabled,
:where(.modal-actions button):disabled {
  color: #514638;
  opacity: .84;
  font-weight: 850;
  text-shadow: 0 1px rgba(255, 249, 229, .42);
}

:where(.profile-tabs button),
:where(.push-alerts-option),
:where(.animation-mode-option),
:where(.skill-preset-tabs button),
:where(.battle-report-filters button),
:where(.seasonal-achievement-filters button),
:where(.active-operations-tab),
:where(.clan-section-nav button),
:where(.clan-browser-nav button) {
  color: #3b2b1d;
  font-weight: 900;
  opacity: 1;
}

:where(.profile-tabs button.active),
:where(.profile-tabs button[aria-selected="true"]),
:where(.push-alerts-option.active),
:where(.push-alerts-option[aria-pressed="true"]),
:where(.animation-mode-option.active),
:where(.animation-mode-option[aria-pressed="true"]),
:where(.skill-preset-tabs button.active),
:where(.skill-preset-tabs button[aria-selected="true"]),
:where(.battle-report-filters button.active),
:where(.seasonal-achievement-filters button.active),
:where(.active-operations-tab.active),
:where(.clan-section-nav button.active),
:where(.clan-browser-nav button.active) {
  color: var(--cl-readable-dark-strong);
  text-shadow: 0 1px rgba(0, 0, 0, .7);
}

/* Profile, skills, and settings. */
.profile-screen-header :where(span, small) {
  color: var(--cl-readable-dark-muted);
}

.profile-screen :where(
  .profile-name-row h3,
  .profile-level-row strong,
  .profile-section-heading h3,
  .profile-skill-summary strong,
  .profile-skill-reset strong,
  .profile-skill-list .skill-row strong,
  .profile-notification-row strong,
  .kingdom-stat strong
) {
  color: var(--cl-readable-paper-strong);
}

.profile-screen :where(
  .profile-flag-edit,
  .profile-level-row span,
  .profile-section-heading span,
  .profile-skill-summary span,
  .profile-skill-reset small,
  .profile-skill-list .skill-row small,
  .profile-notification-row small,
  .kingdom-stat span,
  .settings-card-description,
  .settings-section-header p
) {
  color: var(--cl-readable-paper-muted);
  opacity: 1;
}

.profile-skill-summary > div,
.profile-skill-reset,
.profile-skill-group > header,
.audio-channel-card {
  color: var(--cl-readable-dark);
}

.profile-skill-summary > div :where(strong, span, small),
.profile-skill-reset :where(strong, span, small),
.profile-skill-group > header :where(strong, span, small),
.audio-channel-card :where(strong, span, small, output) {
  color: var(--cl-readable-dark-strong) !important;
  opacity: 1;
}

.audio-channel-card .audio-channel-copy small {
  color: var(--cl-readable-dark-muted) !important;
  font-size: max(.7rem, 11px);
  font-weight: 750;
}

.audio-channel-card output {
  color: var(--cl-readable-gold-dark) !important;
}

.settings-card-description,
.settings-section-header p {
  font-size: max(.72rem, 11px);
  line-height: 1.45;
}

.push-alerts-status {
  color: var(--cl-readable-dark-muted);
  opacity: 1;
}

.animation-mode-status {
  color: var(--cl-readable-paper-muted) !important;
  opacity: 1;
  font-weight: 800;
}

.profile-achievement-summary,
.profile-achievement-summary :where(h3, strong) {
  color: var(--cl-readable-dark-strong) !important;
  text-shadow: 0 1px rgba(0, 0, 0, .72);
}

.profile-achievement-summary :where(span, small, p) {
  color: var(--cl-readable-dark-muted) !important;
  opacity: 1;
}

.profile-achievement-summary-grid > div {
  color: var(--cl-readable-dark);
}

/* Shop and inventory use dark frames around readable parchment entries. */
.shop-modal > .modal-card > :where(h2, .modal-title),
.inventory-modal > .modal-card > :where(h2, .modal-title),
.common-gear-box-modal > .modal-card > :where(h2, .modal-title),
.common-gear-building-modal > .modal-card > :where(h2, .modal-title) {
  color: var(--cl-readable-dark-strong) !important;
}

/* The officer workbench uses the mockup's burgundy title banner, not parchment. */
.common-gear-building-modal > .modal-card > h2 {
  color: #f2dfad !important;
  text-shadow: 0 2px 1px #1a0c09;
}

:where(.shop-item) :where(strong, b),
:where(.inventory-slot) :where(strong, b),
:where(.inventory-selection) :where(strong, b),
:where(.shop-balance) :where(strong, b),
:where(.inventory-summary) :where(strong, b) {
  color: var(--cl-readable-paper-strong);
}

:where(.shop-item) :where(span, small, p),
:where(.inventory-slot) :where(span, small, p),
:where(.inventory-selection) :where(span, small, p),
:where(.shop-balance) :where(span, small, p),
:where(.inventory-summary) :where(span, small, p) {
  color: var(--cl-readable-paper-muted);
  opacity: 1;
}

.shop-rewarded-items {
  grid-template-columns: minmax(0, 1fr);
}

.shop-item.rewarded-ad-shop-item {
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
}

.rewarded-ad-shop-copy {
  display: grid;
  align-content: center;
  gap: .16rem;
}

.rewarded-ad-shop-copy :where(strong, span, small) {
  margin-top: 0;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inventory-slot.empty,
.inventory-slot.empty :where(span, small, strong, p) {
  color: #584936;
  opacity: 1;
}

/* Troop, march, scout, and battle information remains ink on paper. */
:where(.troop-route-city) :where(strong, b, h3, h4),
:where(.troop-slider-control) :where(strong, b, h3, h4),
:where(.troop-slider-preview > div) :where(strong, b, h3, h4),
:where(.send-confirm-card) :where(strong, b, h3, h4),
:where(.send-outcome) :where(strong, b, h3, h4),
:where(.battle-report-card) :where(strong, b, h3, h4),
:where(.battle-report-detail-head) :where(strong, b, h3, h4),
:where(.battle-report-detail-grid > div) :where(strong, b, h3, h4),
:where(.incoming-attack-summary) :where(strong, b, h3, h4),
:where(.incoming-attack-card) :where(strong, b, h3, h4),
:where(.outgoing-attack-card) :where(strong, b, h3, h4),
:where(.scout-report-city) :where(strong, b, h3, h4),
:where(.scout-report-overview > div) :where(strong, b, h3, h4),
:where(.scout-breakdown-row) :where(strong, b, h3, h4),
:where(.scout-skill-list) :where(strong, b, h3, h4) {
  color: var(--cl-readable-paper-strong) !important;
  opacity: 1;
}

:where(.troop-route-city) :where(span, small, p, label),
:where(.troop-slider-control) :where(span, small, p, label),
:where(.troop-slider-preview > div) :where(span, small, p, label),
:where(.send-confirm-card) :where(span, small, p, label),
:where(.send-outcome) :where(span, small, p, label),
:where(.battle-report-card) :where(span, small, p, label),
:where(.battle-report-detail-head) :where(span, small, p, label),
:where(.battle-report-detail-grid > div) :where(span, small, p, label),
:where(.incoming-attack-summary) :where(span, small, p, label),
:where(.incoming-attack-card) :where(span, small, p, label),
:where(.outgoing-attack-card) :where(span, small, p, label),
:where(.scout-report-city) :where(span, small, p, label),
:where(.scout-report-overview > div) :where(span, small, p, label),
:where(.scout-breakdown-row) :where(span, small, p, label),
:where(.scout-skill-list) :where(span, small, p, label) {
  color: var(--cl-readable-paper-muted) !important;
  opacity: 1;
}

/* March cards keep ivory copy on their red/blue command surfaces. */
:is(.modal.incoming-attack-modal, .modal.outgoing-attack-modal)
  :is(.incoming-attack-card, .outgoing-attack-card)
  :is(strong, span, small, b, .player-name-link) {
  color: #fff8e8 !important;
  opacity: 1;
  text-shadow: 0 1px 1px rgba(3, 16, 28, .78) !important;
}

/* City information nests dark military/economic tiles inside a parchment modal. */
:where(.modal-city-stats .stat-wide) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .stat-chip) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .main-city-action-panel) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .city-level-up-panel) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .relinquish-city-action-panel) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .holding-reinforcement-panel) :where(strong, b, h3, h4, .player-name-link),
:where(.modal-city-stats .holding-reinforcement-row) :where(strong, b, h3, h4, .player-name-link) {
  color: var(--cl-readable-dark-strong) !important;
  opacity: 1;
}

:where(.modal-city-stats .stat-wide) :where(span, small, p, label),
:where(.modal-city-stats .stat-chip) :where(span, small, p, label),
:where(.modal-city-stats .main-city-action-panel) :where(span, small, p, label),
:where(.modal-city-stats .city-level-up-panel) :where(span, small, p, label),
:where(.modal-city-stats .relinquish-city-action-panel) :where(span, small, p, label),
:where(.modal-city-stats .holding-reinforcement-panel) :where(span, small, p, label),
:where(.modal-city-stats .holding-reinforcement-row) :where(span, small, p, label) {
  color: var(--cl-readable-dark-muted) !important;
  opacity: 1;
}

.modal-city-stats .city-level-up-panel :where(strong, span, small) {
  color: #f0d79b !important;
}

.modal-city-stats .relinquish-city-action-panel :where(strong, span, small, p) {
  color: #f2d7ce !important;
}

.modal-city-stats :where(.main-city-change-btn, .city-level-up-btn, .relinquish-city-btn) :where(span, small) {
  color: inherit !important;
}

.modal-city-stats :where(.main-city-change-btn, .city-level-up-btn, .relinquish-city-btn):disabled :where(span, small) {
  color: var(--cl-readable-dark-muted) !important;
}

.incoming-attack-badge :where(strong, small),
.battle-report-result :where(strong, small),
.troop-command-icon :where(span, small) {
  color: var(--cl-readable-dark-strong) !important;
}

.battle-visual-report :where(
  .battle-visual-target,
  .battle-visual-rule,
  .battle-visual-section,
  .battle-visual-wall,
  .battle-visual-rewards,
  .battle-visual-hero,
  .battle-visual-detail-card,
  .battle-visual-bonus-card,
  .battle-visual-outcome
) :where(strong, b, h3, h4) {
  color: var(--cl-readable-dark-strong);
}

.battle-visual-report :where(
  .battle-visual-target,
  .battle-visual-rule,
  .battle-visual-section,
  .battle-visual-wall,
  .battle-visual-rewards,
  .battle-visual-hero,
  .battle-visual-detail-card,
  .battle-visual-bonus-card,
  .battle-visual-outcome
) :where(span, small, p) {
  color: var(--cl-readable-dark-muted);
  opacity: 1;
}

/* Objective and clan panels use one parchment information language. */
:where(.camp-info-tab-panel),
:where(.camp-public-status > div),
:where(.gold-camp-info-grid > div),
:where(.gold-camp-description),
:where(.camp-reward-overview > div),
:where(.camp-reward-row),
:where(.relic-drop-row),
:where(.deed-camp-condition),
:where(.deed-camp-history-row),
:where(.citadel-reign-row),
:where(.citadel-reign-note),
:where(.citadel-reign-empty),
:where(.clan-panel),
:where(.clan-card),
:where(.clan-hero),
:where(.clan-create-card),
:where(.clan-discovery),
:where(.clan-roster-panel),
:where(.clan-gift-panel),
:where(.clan-quest-panel),
:where(.clan-social-card),
:where(.clan-rename-card),
:where(.clan-list-row),
:where(.clan-member-row),
:where(.clan-applications article),
:where(.clan-rally-card),
:where(.clan-quest-card),
:where(.clan-objective-card) {
  color: var(--cl-readable-paper);
}

:where(.camp-info-tab-panel) :where(strong, b, h3, h4),
:where(.camp-public-status > div) :where(strong, b, h3, h4),
:where(.gold-camp-info-grid > div) :where(strong, b, h3, h4),
:where(.gold-camp-description) :where(strong, b, h3, h4),
:where(.camp-reward-overview > div) :where(strong, b, h3, h4),
:where(.camp-reward-row) :where(strong, b, h3, h4),
:where(.relic-drop-row) :where(strong, b, h3, h4),
:where(.deed-camp-condition) :where(strong, b, h3, h4),
:where(.deed-camp-history-row) :where(strong, b, h3, h4),
:where(.citadel-reign-row) :where(strong, b, h3, h4),
:where(.citadel-reign-note) :where(strong, b, h3, h4),
:where(.clan-panel) :where(strong, b, h3, h4),
:where(.clan-card) :where(strong, b, h3, h4),
:where(.clan-hero) :where(strong, b, h3, h4),
:where(.clan-roster-panel) :where(strong, b, h3, h4),
:where(.clan-gift-panel) :where(strong, b, h3, h4),
:where(.clan-quest-panel) :where(strong, b, h3, h4),
:where(.clan-social-card) :where(strong, b, h3, h4),
:where(.clan-list-row) :where(strong, b, h3, h4),
:where(.clan-member-row) :where(strong, b, h3, h4),
:where(.clan-rally-card) :where(strong, b, h3, h4),
:where(.clan-quest-card) :where(strong, b, h3, h4),
:where(.clan-objective-card) :where(strong, b, h3, h4) {
  color: var(--cl-readable-paper-strong) !important;
  opacity: 1;
}

:where(.camp-info-tab-panel) :where(span, small, p, label, dt, dd),
:where(.camp-public-status > div) :where(span, small, p, label, dt, dd),
:where(.gold-camp-info-grid > div) :where(span, small, p, label, dt, dd),
:where(.gold-camp-description) :where(span, small, p, label, dt, dd),
:where(.camp-reward-overview > div) :where(span, small, p, label, dt, dd),
:where(.camp-reward-row) :where(span, small, p, label, dt, dd),
:where(.relic-drop-row) :where(span, small, p, label, dt, dd),
:where(.deed-camp-condition) :where(span, small, p, label, dt, dd),
:where(.deed-camp-history-row) :where(span, small, p, label, dt, dd),
:where(.citadel-reign-row) :where(span, small, p, label, dt, dd),
:where(.citadel-reign-note) :where(span, small, p, label, dt, dd),
:where(.clan-panel) :where(span, small, p, label, dt, dd),
:where(.clan-card) :where(span, small, p, label, dt, dd),
:where(.clan-hero) :where(span, small, p, label, dt, dd),
:where(.clan-roster-panel) :where(span, small, p, label, dt, dd),
:where(.clan-gift-panel) :where(span, small, p, label, dt, dd),
:where(.clan-quest-panel) :where(span, small, p, label, dt, dd),
:where(.clan-social-card) :where(span, small, p, label, dt, dd),
:where(.clan-list-row) :where(span, small, p, label, dt, dd),
:where(.clan-member-row) :where(span, small, p, label, dt, dd),
:where(.clan-rally-card) :where(span, small, p, label, dt, dd),
:where(.clan-quest-card) :where(span, small, p, label, dt, dd),
:where(.clan-objective-card) :where(span, small, p, label, dt, dd) {
  color: var(--cl-readable-paper-muted) !important;
  opacity: 1;
}

.camp-stats-locked,
.camp-stats-locked :where(strong, span, small, p) {
  color: var(--cl-readable-dark-strong) !important;
}

.camp-stats-locked p {
  color: var(--cl-readable-dark-muted) !important;
}

/* Daily rewards, missions, and achievements share high-contrast ink. */
:where(.daily-reward-panel) :where(strong, b, h3, h4),
:where(.daily-reward-card) :where(strong, b, h3, h4),
:where(.daily-reward-loading) :where(strong, b, h3, h4),
:where(.daily-reward-error) :where(strong, b, h3, h4),
:where(.daily-mission-row) :where(strong, b, h3, h4),
:where(.daily-mission-detail-stat) :where(strong, b, h3, h4),
:where(.daily-mission-recommendation) :where(strong, b, h3, h4),
:where(.seasonal-achievement-panel) :where(strong, b, h3, h4),
:where(.seasonal-achievement-hero) :where(strong, b, h3, h4),
:where(.seasonal-achievement-row) :where(strong, b, h3, h4),
:where(.seasonal-achievement-details) :where(strong, b, h3, h4) {
  color: var(--cl-readable-paper-strong) !important;
  opacity: 1;
}

:where(.daily-reward-panel) :where(span, small, p, label),
:where(.daily-reward-card) :where(span, small, p, label),
:where(.daily-reward-loading) :where(span, small, p, label),
:where(.daily-reward-error) :where(span, small, p, label),
:where(.daily-mission-row) :where(span, small, p, label),
:where(.daily-mission-detail-stat) :where(span, small, p, label),
:where(.daily-mission-recommendation) :where(span, small, p, label),
:where(.seasonal-achievement-panel) :where(span, small, p, label),
:where(.seasonal-achievement-hero) :where(span, small, p, label),
:where(.seasonal-achievement-row) :where(span, small, p, label),
:where(.seasonal-achievement-details) :where(span, small, p, label) {
  color: var(--cl-readable-paper-muted) !important;
  opacity: 1;
}

.daily-mission-copy > div > span,
.seasonal-achievement-row-copy > span,
.seasonal-achievement-hero > div:first-child > span,
.seasonal-achievement-reward > span {
  color: var(--cl-oxblood) !important;
}

.daily-missions-section .daily-missions-heading .profile-section-heading :where(span, h3, strong) {
  color: var(--cl-readable-dark-strong) !important;
  text-shadow: 0 1px rgba(0, 0, 0, .72);
}

.daily-missions-section .daily-missions-meta span {
  color: var(--cl-readable-dark-muted) !important;
}

.daily-missions-section .daily-missions-meta span:last-child {
  color: var(--cl-readable-gold-dark) !important;
}

.daily-mission-reward strong,
.seasonal-achievement-reward strong,
.seasonal-achievement-totals strong {
  color: var(--cl-readable-gold-paper) !important;
}

.daily-mission-copy small,
.daily-mission-reward small,
.seasonal-achievement-row-copy small,
.seasonal-achievement-reward small,
.seasonal-achievement-details small,
.camp-info-tab-panel small,
.citadel-reign-row small,
.clan-view small,
.shop-item small,
.inventory-selection small,
.battle-report-card small,
.incoming-attack-card small,
.outgoing-attack-card small,
.troop-slider-panel small {
  font-size: max(.625rem, 10px);
  line-height: 1.35;
}

.daily-mission-copy small,
.seasonal-achievement-row-copy small,
.seasonal-achievement-details small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.daily-mission-row.complete :where(strong, span, small),
.seasonal-achievement-row.complete :where(strong, span, small) {
  opacity: 1;
}

.daily-reward-card.locked {
  opacity: .84;
}

.daily-reward-card-amount {
  color: var(--cl-readable-dark-strong) !important;
  font-weight: 950;
  text-shadow: 0 2px 1px rgba(0, 0, 0, .92);
}

/* Status language reserves stronger color for meaning, not decoration. */
.toast {
  color: var(--cl-readable-dark-strong);
  border-color: rgba(203, 183, 143, .72);
  background:
    linear-gradient(180deg, rgba(66, 43, 27, .99), rgba(25, 18, 13, .99)),
    repeating-linear-gradient(90deg, rgba(231, 221, 196, .04) 0 1px, transparent 1px 7px);
}

.toast.success {
  border-left-color: #778d55;
}

.toast.warning {
  border-left-color: #bd8b3f;
}

.toast.error,
.toast.danger {
  border-left-color: #a85042;
}

.toast :where(strong, span, small),
.realm-activity-card :where(strong, span, small, p, b) {
  color: inherit;
  opacity: 1;
}

.realm-activity-card:not(.citadel) {
  color: var(--cl-readable-paper);
}

.realm-activity-card:not(.citadel) :where(strong, h3, h4, b) {
  color: var(--cl-readable-paper-strong);
}

.realm-activity-card:not(.citadel) :where(span, small, p) {
  color: var(--cl-readable-paper-muted);
}

:where([role="tooltip"], .tooltip, [data-tooltip]::after) {
  color: var(--cl-readable-dark-strong);
  background: #251a13;
  border-color: rgba(203, 183, 143, .7);
  font-family: var(--font-ui);
  font-size: max(.72rem, 11px);
  line-height: 1.35;
  text-shadow: none;
}

:where(.success, .status-success, .safe-status) {
  --status-readable-color: var(--cl-readable-success-paper);
}

:where(.warning, .status-warning, .limit-warning) {
  --status-readable-color: var(--cl-readable-warning-paper);
}

:where(.error, .danger, .status-error) {
  --status-readable-color: var(--cl-readable-error-paper);
}

/* Map labels sit over detailed art and need a restrained physical backing. */
.city-label,
.city-owner-name,
.city-clan-tag,
.map-city-clan-tag,
.army-token-label,
.camp-label,
.stronghold-label,
.teleport-label {
  text-shadow:
    0 1px 0 rgba(20, 14, 9, .96),
    1px 0 0 rgba(20, 14, 9, .8),
    -1px 0 0 rgba(20, 14, 9, .8);
}

.profile-gold strong,
.citadel-assault-countdown,
.effect-status-badge,
.bottom-nav .nav-btn,
.bottom-nav .nav-btn small {
  color: var(--cl-readable-dark-strong);
}

.profile-gold-production,
.effect-status-badge small,
.bottom-nav .nav-btn small {
  color: var(--cl-readable-dark-muted) !important;
  opacity: 1;
}

/* Compact landscape keeps supporting copy readable without enlarging panels. */
@media (max-height: 560px) and (orientation: landscape) {
  .modal-card #modalBody,
  .profile-screen :where(p, li, label, dd),
  .daily-mission-row,
  .seasonal-achievement-row,
  .battle-report-card,
  .incoming-attack-card,
  .outgoing-attack-card,
  .troop-slider-panel,
  .camp-info-tab-panel,
  .clan-view,
  .shop-panel,
  .inventory-panel {
    font-size: max(.75rem, 12px);
  }

  :where(
    .settings-card-description,
    .settings-section-header p,
    .audio-channel-copy small,
    .daily-mission-copy small,
    .daily-mission-reward small,
    .seasonal-achievement-row-copy small,
    .seasonal-achievement-details small,
    .battle-report-card small,
    .incoming-attack-card small,
    .outgoing-attack-card small,
    .troop-slider-panel small,
    .camp-info-tab-panel small,
    .clan-view small,
    .shop-item small,
    .inventory-selection small
  ) {
    font-size: max(.65rem, 10px);
    line-height: 1.35;
  }

  .daily-mission-copy strong,
  .seasonal-achievement-row-copy strong,
  .battle-report-card strong,
  .incoming-attack-card strong,
  .outgoing-attack-card strong {
    font-size: max(.7rem, 11px);
  }

  :where(
    .profile-tabs,
    .skill-preset-tabs,
    .battle-report-filters,
    .seasonal-achievement-filters,
    .active-operations-tabs,
    .clan-section-nav,
    .clan-browser-nav
  ) {
    min-width: 0;
  }

  :where(
    .profile-tabs button,
    .skill-preset-tabs button,
    .battle-report-filters button,
    .seasonal-achievement-filters button,
    .active-operations-tab,
    .clan-section-nav button,
    .clan-browser-nav button
  ) {
    min-width: 0;
    padding-inline: clamp(.32rem, 1.2vw, .62rem);
    font-size: max(.64rem, 10px);
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .modal-card h2,
  .profile-screen-header h2 {
    overflow-wrap: anywhere;
  }

  :where(.modal-actions, .troop-slider-actions, .action-buttons) button {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* Welcome Back uses one consistent dark surface with light, readable copy. */
.offline-reward-modal .modal-card {
  color: #f4ead4;
  border-color: #d9ad55;
  background: linear-gradient(180deg, #123b56, #0b2031 70%, #071722);
}

.offline-reward-modal .modal-card h2 {
  color: #ffd77a;
  border-color: rgba(255, 215, 122, .34);
  text-shadow: 0 2px 0 #04101a;
}

.offline-reward-modal .modal-card #modalBody {
  color: #f4ead4;
  overflow-y: auto;
}

.offline-reward-modal .offline-reward-panel > p,
.offline-reward-modal .offline-reward-grid :is(span, small),
.offline-reward-modal .offline-lost-cities :is(span, small) {
  color: #cad9df;
}

.offline-reward-modal .offline-reward-grid > div {
  color: #f4ead4;
  border-color: #426d83;
  background: linear-gradient(180deg, #153d55, #0b2639);
  box-shadow: inset 0 1px 0 rgba(232, 247, 255, .1);
}

.offline-reward-modal .offline-reward-grid strong,
.offline-reward-modal .offline-lost-cities strong {
  color: #ffd77a;
  text-shadow: 0 1px 0 #04101a;
}

.offline-reward-modal .offline-lost-cities {
  color: #fae7e2;
  border-color: #a95858;
  background: linear-gradient(180deg, #55282d, #3b2024);
}

.offline-reward-modal .offline-lost-cities.safe {
  color: #eaf6ea;
  border-color: #5f9774;
  background: linear-gradient(180deg, #23503a, #163628);
}

.offline-reward-modal .offline-lost-cities :is(p, li),
.offline-reward-modal .offline-lost-cities.safe :is(p, li) {
  color: inherit;
}

.offline-reward-modal .offline-collect-btn {
  min-height: 50px;
  color: #fff8e8 !important;
  border: 2px solid #c69a45 !important;
  background: linear-gradient(180deg, #72363a, #542728) !important;
  box-shadow: inset 0 1px 0 rgba(255, 248, 232, .2), 0 4px 10px rgba(47, 33, 19, .3) !important;
  letter-spacing: .06em;
  text-shadow: 0 1px 1px rgba(47, 33, 19, .82) !important;
}

.offline-reward-modal .offline-collect-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.offline-reward-modal .offline-collect-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(47, 33, 19, .34), 0 2px 5px rgba(47, 33, 19, .26) !important;
}
