/* Global hard override: remove white surfaces across the web app */

html,
body {
  background: #05070d !important;
  background-color: #05070d !important;
}

body {
  --bs-body-bg: #05070d;
  --bs-body-color: #e8f0ff;
  --bs-secondary-bg: rgba(10, 18, 36, 0.92);
  --bs-tertiary-bg: rgba(10, 18, 36, 0.82);
  --bs-border-color: rgba(92, 145, 236, 0.28);
}

main {
  background-color: transparent !important;
}

.bg-white,
.bg-light,
.table-light,
.table-light > :not(caption) > * > *,
.alert-light,
.btn-light,
.list-group-item-light,
.breadcrumb.bg-light,
.navbar.bg-light,
.card.bg-white,
.dropdown-menu.bg-white,
.modal-content.bg-white {
  background-color: rgba(10, 18, 36, 0.92) !important;
  color: #e8f0ff !important;
  border-color: rgba(92, 145, 236, 0.28) !important;
}

[class*="bg-white"],
[class*="bg-light"] {
  background-color: rgba(10, 18, 36, 0.92) !important;
  color: #e8f0ff !important;
}

body.battle-zone,
body.custom-dark {
  background: #05070d !important;
  background-color: #05070d !important;
}

/* Defensive dark surfaces for bootstrap/base components */
body.custom-dark .card,
body.custom-dark .modal-content,
body.custom-dark .dropdown-menu,
body.custom-dark .offcanvas,
body.custom-dark .accordion-item,
body.custom-dark .accordion-button,
body.custom-dark .popover,
body.custom-dark .list-group-item,
body.custom-dark .table,
body.custom-dark .table > :not(caption) > * > *,
body.custom-dark .bg-body,
body.custom-dark .bg-body-secondary,
body.custom-dark .bg-body-tertiary,
body.custom-dark .bg-white,
body.custom-dark .bg-light,
body.vibe-ui-enabled .card,
body.vibe-ui-enabled .modal-content,
body.vibe-ui-enabled .dropdown-menu,
body.vibe-ui-enabled .offcanvas,
body.vibe-ui-enabled .accordion-item,
body.vibe-ui-enabled .accordion-button,
body.vibe-ui-enabled .popover,
body.vibe-ui-enabled .list-group-item,
body.vibe-ui-enabled .table,
body.vibe-ui-enabled .table > :not(caption) > * > *,
body.vibe-ui-enabled .bg-body,
body.vibe-ui-enabled .bg-body-secondary,
body.vibe-ui-enabled .bg-body-tertiary,
body.vibe-ui-enabled .bg-white,
body.vibe-ui-enabled .bg-light,
body.battle-zone .card,
body.battle-zone .modal-content,
body.battle-zone .dropdown-menu,
body.battle-zone .offcanvas,
body.battle-zone .accordion-item,
body.battle-zone .accordion-button,
body.battle-zone .popover,
body.battle-zone .list-group-item,
body.battle-zone .table,
body.battle-zone .table > :not(caption) > * > *,
body.battle-zone .bg-body,
body.battle-zone .bg-body-secondary,
body.battle-zone .bg-body-tertiary,
body.battle-zone .bg-white,
body.battle-zone .bg-light {
  background-color: rgba(10, 18, 36, 0.92) !important;
  color: #e8f0ff !important;
  border-color: rgba(92, 145, 236, 0.28) !important;
}

body.custom-dark .form-control,
body.custom-dark .form-select,
body.custom-dark .input-group-text,
body.custom-dark textarea,
body.custom-dark input:not([type="checkbox"]):not([type="radio"]),
body.vibe-ui-enabled .form-control,
body.vibe-ui-enabled .form-select,
body.vibe-ui-enabled .input-group-text,
body.vibe-ui-enabled textarea,
body.vibe-ui-enabled input:not([type="checkbox"]):not([type="radio"]),
body.battle-zone .form-control,
body.battle-zone .form-select,
body.battle-zone .input-group-text,
body.battle-zone textarea,
body.battle-zone input:not([type="checkbox"]):not([type="radio"]) {
  background-color: rgba(7, 14, 30, 0.88) !important;
  color: #e8f0ff !important;
  border-color: rgba(92, 145, 236, 0.32) !important;
}

body.custom-dark .form-control::placeholder,
body.custom-dark .form-select::placeholder,
body.custom-dark textarea::placeholder,
body.custom-dark input::placeholder,
body.vibe-ui-enabled .form-control::placeholder,
body.vibe-ui-enabled .form-select::placeholder,
body.vibe-ui-enabled textarea::placeholder,
body.vibe-ui-enabled input::placeholder,
body.battle-zone .form-control::placeholder,
body.battle-zone .form-select::placeholder,
body.battle-zone textarea::placeholder,
body.battle-zone input::placeholder {
  color: #9db3d8 !important;
}

body.custom-dark .form-control:focus,
body.custom-dark .form-select:focus,
body.custom-dark textarea:focus,
body.custom-dark input:focus,
body.vibe-ui-enabled .form-control:focus,
body.vibe-ui-enabled .form-select:focus,
body.vibe-ui-enabled textarea:focus,
body.vibe-ui-enabled input:focus,
body.battle-zone .form-control:focus,
body.battle-zone .form-select:focus,
body.battle-zone textarea:focus,
body.battle-zone input:focus {
  background-color: rgba(7, 14, 30, 0.95) !important;
  color: #e8f0ff !important;
  border-color: rgba(96, 180, 255, 0.58) !important;
  box-shadow: 0 0 0 0.2rem rgba(55, 140, 255, 0.22) !important;
}

body.custom-dark .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

body.custom-dark .table-light,
body.custom-dark .table-light > :not(caption) > * > *,
body.vibe-ui-enabled .table-light,
body.vibe-ui-enabled .table-light > :not(caption) > * > *,
body.battle-zone .table-light,
body.battle-zone .table-light > :not(caption) > * > * {
  --bs-table-bg: rgba(10, 18, 36, 0.92) !important;
  --bs-table-color: #e8f0ff !important;
}

body.custom-dark .pagination .page-link,
body.vibe-ui-enabled .pagination .page-link,
body.battle-zone .pagination .page-link {
  background-color: rgba(10, 18, 36, 0.92) !important;
  color: #dbe9ff !important;
  border-color: rgba(92, 145, 236, 0.3) !important;
}

body.custom-dark .pagination .page-link:hover,
body.custom-dark .pagination .page-link:focus,
body.vibe-ui-enabled .pagination .page-link:hover,
body.vibe-ui-enabled .pagination .page-link:focus,
body.battle-zone .pagination .page-link:hover,
body.battle-zone .pagination .page-link:focus {
  background-color: rgba(22, 34, 62, 0.95) !important;
  color: #ffffff !important;
}

/* Auth/tournament helper cards that came with explicit white backgrounds */
.auth-card,
.captcha-box,
.section-content,
.content-wrapper,
.panel-white,
.white-panel {
  background: rgba(10, 18, 36, 0.92) !important;
  color: #e8f0ff !important;
  border-color: rgba(92, 145, 236, 0.3) !important;
}

/* Catch inline styles using white backgrounds */
[style*="background: #fff"],
[style*="background:#fff"],
[style*="background: #ffffff"],
[style*="background:#ffffff"],
[style*="background-color: #fff"],
[style*="background-color:#fff"],
[style*="background-color: #ffffff"],
[style*="background-color:#ffffff"],
[style*="background: white"],
[style*="background:white"],
[style*="background-color: white"],
[style*="background-color:white"],
[style*="background: #fff" i],
[style*="background:#fff" i],
[style*="background: #ffffff" i],
[style*="background:#ffffff" i],
[style*="background-color: #fff" i],
[style*="background-color:#fff" i],
[style*="background-color: #ffffff" i],
[style*="background-color:#ffffff" i],
[style*="background: white" i],
[style*="background:white" i],
[style*="background-color: white" i],
[style*="background-color:white" i] {
  background: rgba(10, 18, 36, 0.92) !important;
  color: #e8f0ff !important;
  border-color: rgba(92, 145, 236, 0.28) !important;
}

/* Keep text readable when previous styles assumed white background */
.text-dark,
.text-black,
.text-body,
.text-muted.text-dark {
  color: #dbe9ff !important;
}
