/*
 * Final cascade lock for dark UI readability.
 * Symptom fixed: Firefox briefly shows correct light text, then Bootstrap CDN
 * (or UA ButtonText / CanvasText) flips copy to black on dark backgrounds.
 */

:root,
html,
html[data-bs-theme],
html[data-bs-theme="light"],
html[data-bs-theme="dark"],
body {
    color-scheme: dark !important;
    --bs-body-color: #F3F4F6 !important;
    --bs-body-bg: #0B0F14 !important;
    --bs-body-color-rgb: 243, 244, 246 !important;
    --bs-body-bg-rgb: 11, 15, 20 !important;
    --bs-emphasis-color: #F3F4F6 !important;
    --bs-secondary-color: #A3AEBB !important;
    --bs-tertiary-color: #6B7A8D !important;
    --bs-heading-color: #F3F4F6 !important;
    --bs-border-color: #2A3442 !important;
}

html,
body,
#app,
#ui-modal-root {
    color: #F3F4F6 !important;
    background-color: #0B0F14 !important;
}

/* Firefox form controls default to system ButtonText/CanvasText unless forced. */
button,
input,
select,
textarea {
    color-scheme: dark !important;
}

.ui-modal-panel,
.ui-modal-content,
.ui-modal-header,
.ui-modal-footer,
.ui-modal-title,
.no-order,
.no-order-label,
.no-order-summary-crumbs,
.no-order-summary-desc,
.no-order-treasury,
.battle-no-info,
.battle-no-info-objective,
.battle-no-info-note,
.battle-no-info-row span,
.battle-no-info-row strong {
    color: #F3F4F6 !important;
}

.no-order-label,
.no-order-field > span,
.no-order-treasury,
.battle-no-info-row span,
.no-order-summary-desc {
    color: #94a3b8 !important;
}

.no-order-summary-title,
.no-order-treasury strong {
    color: #fbbf24 !important;
}

.no-order-seg-btn {
    color: #cbd5e1 !important;
    -moz-text-fill-color: #cbd5e1;
}

.no-order-seg-btn.is-active,
.no-order-seg-btn:hover:not(:disabled) {
    color: #fbbf24 !important;
    -moz-text-fill-color: #fbbf24;
}

.no-order-btn--ghost {
    color: #e2e8f0 !important;
    -moz-text-fill-color: #e2e8f0;
}

/* Keep dark label on gold CTA. */
.no-order-btn--primary,
.no-order-btn-star,
.ui-btn-primary {
    color: #1a1205 !important;
    -moz-text-fill-color: #1a1205;
}

.no-order-input,
.no-order-input option {
    color: #f8fafc !important;
    -moz-text-fill-color: #f8fafc;
    background-color: rgba(15, 23, 42, 0.95) !important;
    color-scheme: dark !important;
}
