/* LoTTERY/lab · selector de tema y capa de contraste oscuro consolidada */

/* --------------------------------------------------------------------------
   Control claro / oscuro
   -------------------------------------------------------------------------- */
.theme-toggle-item{display:flex;align-items:center;}
.theme-toggle{
  position:relative;display:inline-flex;align-items:center;gap:.22rem;
  margin-left:.45rem;padding:.2rem;border:1px solid rgba(23,58,105,.18);
  border-radius:999px;background:#eef3f9;color:#173a69;
  box-shadow:0 3px 12px rgba(27,57,96,.08);cursor:pointer;
}
.theme-toggle:hover{border-color:rgba(13,110,253,.38);box-shadow:0 4px 14px rgba(27,57,96,.13);}
.theme-toggle:focus-visible{outline:0;box-shadow:0 0 0 .2rem rgba(13,110,253,.20);}
.theme-toggle-icon{
  display:grid;place-items:center;width:28px;height:28px;border-radius:50%;
  opacity:.48;transition:opacity .16s ease,background-color .16s ease,color .16s ease;
}
.theme-toggle-icon svg{width:15px;height:15px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
html[data-theme="light"] .theme-toggle-sun,
html:not([data-theme]) .theme-toggle-sun{opacity:1;background:#fff;color:#8a5900;box-shadow:0 1px 5px rgba(27,57,96,.12);}
html[data-theme="dark"] .theme-toggle{background:#111827;border-color:#526173;color:#f8fafc;box-shadow:0 3px 12px rgba(0,0,0,.28);}
html[data-theme="dark"] .theme-toggle-moon{opacity:1;background:#263244;color:#e5efff;box-shadow:0 1px 5px rgba(0,0,0,.35);}
@media (max-width:991.98px){.theme-toggle-item{padding:.35rem 0 .15rem}.theme-toggle{margin-left:0}}
@media (prefers-reduced-motion:reduce){.theme-toggle,.theme-toggle-icon{transition:none}}

/* --------------------------------------------------------------------------
   Tema oscuro: paleta única de alto contraste
   -------------------------------------------------------------------------- */
html[data-theme="dark"]{
  color-scheme:dark;
  --bs-body-bg:#0b1118;
  --bs-body-color:#f1f5f9;
  --bs-secondary-color:#d1dae5;
  --bs-emphasis-color:#ffffff;
  --bs-border-color:#465566;
  --bs-link-color:#9dceff;
  --bs-link-hover-color:#d7ebff;
}
html[data-theme="dark"] body{background:#0b1118!important;color:#f1f5f9!important;}

/* Texto general: se evita cualquier gris de bajo contraste heredado */
html[data-theme="dark"] body :is(p,li,dd,dt){color:#e2e8f0;}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,
.display-title,.section-title,.card-title,.support-title,.cost-heading,.footer-title){color:#ffffff!important;text-shadow:none!important;}
html[data-theme="dark"] :is(strong,b){color:#ffffff;}
html[data-theme="dark"] :is(.text-secondary,.text-muted,.small.text-secondary,.card-text,.section-subtitle,.hero-lead,.hero-support-hint,
.cost-note,.support-note,.footer-source,.reduction-limit-note,.reduction-status){color:#cbd5e1!important;}
html[data-theme="dark"] .eyebrow{color:#cfe8ff!important;background:transparent!important;text-shadow:none!important;}
html[data-theme="dark"] :is(.info-label,.form-label,legend,label){color:#eaf3ff!important;}
html[data-theme="dark"] :is(.info-value,.selection-preview,.reference-numbers){color:#f1f5f9!important;}
html[data-theme="dark"] .text-primary,
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.display-title,.section-title,.card-title) .text-primary{color:#b9dcff!important;}

/* Enlaces generales */
html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand){color:#9dceff;}
html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):visited{color:#b8d8ff;}
html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):hover,
html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):focus{color:#ffffff;}

/* Navegación */
html[data-theme="dark"] :is(.site-nav,.navbar){background:#0e141b!important;border-color:#3d4b5a!important;box-shadow:0 6px 22px rgba(0,0,0,.22)!important;}
html[data-theme="dark"] :is(.navbar-brand,.navbar-brand span,.navbar-light .navbar-nav .nav-link,.nav-link){color:#eef4fa!important;}
html[data-theme="dark"] :is(.navbar-light .navbar-nav .nav-link:hover,.navbar-light .navbar-nav .nav-link:focus,.nav-link:hover,.nav-link:focus){color:#ffffff!important;}
html[data-theme="dark"] .navbar-toggler{border-color:#526173!important;}
html[data-theme="dark"] .navbar-toggler-icon{filter:invert(1) grayscale(1) brightness(2);}
html[data-theme="dark"] .dropdown-menu{background:#141c26!important;border-color:#465566!important;box-shadow:0 12px 28px rgba(0,0,0,.34)!important;}
html[data-theme="dark"] .dropdown-item{color:#eef4fa!important;}
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus{background:#263344!important;color:#ffffff!important;}
html[data-theme="dark"] .dropdown-divider{border-color:#465566!important;}

/* Superficies principales: ninguna tarjeta conserva fondos claros */
html[data-theme="dark"] :is(.hero-panel,.content-card,.game-card,.generator-card,.future-card,.reduction-tool-card,
.reduction-results-panel,.cost-panel,.paypal-box,.reference-pattern,.selection-strip,.notice,.info-band,
.reduction-definition,.reduction-config,.reduction-limit-note,.reduction-status,.reduction-progress,
.reference-row,.gordo-summary-item,.euro-summary-item,.card){
  background:#141c26!important;color:#f1f5f9!important;border-color:#465566!important;
}
html[data-theme="dark"] :is(.hero-panel,.content-card,.game-card,.generator-card,.future-card,.reduction-tool-card,
.reduction-results-panel,.cost-panel,.reference-pattern,.selection-strip,.notice,.info-band,.card) :is(p,li,dd,dt){color:#e2e8f0!important;}
html[data-theme="dark"] :is(.rule-list,.rule-list li,.reduction-definition,.results-list,.results-list li){color:#e2e8f0!important;}

/* Formularios */
html[data-theme="dark"] :is(.form-control,.form-select){background:#0f1720!important;color:#f8fafc!important;border-color:#526173!important;}
html[data-theme="dark"] .form-control::placeholder{color:#b2becb!important;opacity:1;}
html[data-theme="dark"] :is(.form-control,.form-select):focus{background:#111b26!important;color:#ffffff!important;border-color:#8dbef2!important;box-shadow:0 0 0 .2rem rgba(141,190,242,.20)!important;}
html[data-theme="dark"] .form-select{color-scheme:dark;}
html[data-theme="dark"] :is(.form-control,.form-select):disabled{background:#1a2531!important;color:#d7e0e9!important;border-color:#526173!important;opacity:1;}

/* Botones */
html[data-theme="dark"] .btn-ml{background:#1f6feb!important;border-color:#4c9aff!important;color:#ffffff!important;}
html[data-theme="dark"] .btn-ml:hover,
html[data-theme="dark"] .btn-ml:focus{background:#1557a0!important;border-color:#9cc8f5!important;color:#ffffff!important;}
html[data-theme="dark"] .btn-soft{background:#263548!important;color:#f4f8fc!important;border-color:#607287!important;}
html[data-theme="dark"] .btn-soft:hover,
html[data-theme="dark"] .btn-soft:focus{background:#33465d!important;color:#ffffff!important;border-color:#86a5c7!important;}
html[data-theme="dark"] :is(.btn:disabled,.btn.disabled){opacity:.82;}

/* Cuadrículas y selectores */
html[data-theme="dark"] :is(.reduction-number-grid>button,.gordo-key-grid>button,.stars button,.number-pick,.euro-pick,.gordo-key){
  background:#111923!important;color:#f4f7fa!important;border-color:#607080!important;
}
html[data-theme="dark"] :is(.reduction-number-grid>button,.gordo-key-grid>button,.stars button):hover{background:#1a2633!important;border-color:#9cc8f5!important;color:#ffffff!important;}
html[data-theme="dark"] :is(.reduction-number-grid>button.is-selected,.reduction-number-grid>button[aria-pressed="true"],
.gordo-key-grid>button.is-selected,.gordo-key-grid>button[aria-pressed="true"],.stars button.is-selected,.stars button[aria-pressed="true"]){
  background:#23598e!important;color:#ffffff!important;border-color:#b1d5fa!important;
}
html[data-theme="dark"] .selection-count{background:#214c78!important;color:#ffffff!important;border-color:#91bce7!important;}
html[data-theme="dark"] .reference-letter{background:#214c78!important;color:#ffffff!important;border-color:#91bce7!important;}

/* Resultados y fichas específicas */
html[data-theme="dark"] :is(.result-row,.gordo-ball,.euro-ball){background:#111923!important;color:#f5f8fb!important;border-color:#526173!important;}
html[data-theme="dark"] .gordo-key-badge{background:#23598e!important;color:#ffffff!important;border-color:#b1d5fa!important;}
html[data-theme="dark"] .euro-star{background:#594b13!important;color:#fff6c7!important;border-color:#bca44e!important;}
html[data-theme="dark"] :is(.gordo-bet,.euro-bet,.euromillones-bet){color:#f1f5f9!important;border-bottom-color:#465566!important;}
html[data-theme="dark"] .game-icon{background:#1a304a!important;color:#cfe8ff!important;border-color:#537ca6!important;}
html[data-theme="dark"] :is(.meta-pill,.game-meta){background:#243140!important;color:#e0e9f2!important;border-color:#526173!important;}

/* Costes */
html[data-theme="dark"] .cost-panel{background:#121a24!important;}
html[data-theme="dark"] :is(.cost-line,.cost-line>span){color:#f1f5f9!important;}
html[data-theme="dark"] .cost-total{border-top-color:#526173!important;color:#ffffff!important;}
html[data-theme="dark"] :is([data-unit-price],[data-cost-count],.bet-cost){background:#214c78!important;color:#ffffff!important;border-color:#91bce7!important;}
html[data-theme="dark"] [data-total-cost]{background:#2d6399!important;color:#ffffff!important;border-color:#b1d5fa!important;}

/* --------------------------------------------------------------------------
   Apoyo y donaciones: bloque especialmente protegido contra bajo contraste
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .support-section{background:#0b1118!important;color:#f4f7fa!important;}
html[data-theme="dark"] .support-card{background:#151e29!important;color:#f4f7fa!important;border-color:#526173!important;}
html[data-theme="dark"] .support-icon{background:#512033!important;color:#ffd0dc!important;border-color:#9b5068!important;box-shadow:none!important;}
html[data-theme="dark"] .support-title{color:#ffffff!important;}
html[data-theme="dark"] .support-lead{color:#edf2f7!important;}
html[data-theme="dark"] .support-highlight{background:#1d3552!important;color:#edf6ff!important;border-color:#668db5!important;box-shadow:none!important;}
html[data-theme="dark"] .support-highlight strong{color:#ffffff!important;}
html[data-theme="dark"] .support-note{color:#d7e0e9!important;}
html[data-theme="dark"] .paypal-box{background:#101a25!important;color:#f8fafc!important;border:1px solid #607287!important;}
html[data-theme="dark"] .paypal-link{display:inline-block;}
html[data-theme="dark"] .paypal-text-link,
html[data-theme="dark"] .paypal-text-link:visited{
  display:inline-flex;align-items:center;gap:.35rem;
  margin-top:.45rem;padding:.48rem .72rem;border-radius:.55rem;
  background:#1f6feb!important;color:#ffffff!important;border:1px solid #79b8ff!important;
  font-weight:800!important;text-decoration:none!important;
}
html[data-theme="dark"] .paypal-text-link:hover,
html[data-theme="dark"] .paypal-text-link:focus{background:#1557a0!important;color:#ffffff!important;border-color:#b1d5fa!important;text-decoration:none!important;}
html[data-theme="dark"] .paypal-text-link:focus-visible{outline:3px solid #cfe8ff!important;outline-offset:3px!important;}
html[data-theme="dark"] .support-thanks,
html[data-theme="dark"] .support-thanks strong{color:#f1f5f9!important;}

/* Tema claro: el enlace de PayPal conserva apariencia de enlace legible */
html[data-theme="light"] .paypal-text-link,
html:not([data-theme]) .paypal-text-link{color:#0b3d7a;font-weight:700;text-decoration:underline;text-underline-offset:.18em;}
html[data-theme="light"] .paypal-text-link:visited,
html:not([data-theme]) .paypal-text-link:visited{color:#0b3d7a;}
html[data-theme="light"] .paypal-text-link:hover,
html[data-theme="light"] .paypal-text-link:focus,
html:not([data-theme]) .paypal-text-link:hover,
html:not([data-theme]) .paypal-text-link:focus{color:#062f68;}

/* Tablas, progreso y utilidades Bootstrap */
html[data-theme="dark"] .progress{background:#283544!important;}
html[data-theme="dark"] hr{border-color:#526173!important;opacity:1;}
html[data-theme="dark"] table{color:#f1f5f9!important;}
html[data-theme="dark"] .table{--bs-table-color:#f1f5f9;--bs-table-bg:transparent;--bs-table-border-color:#526173;}
html[data-theme="dark"] :is(.bg-light,.bg-white){background-color:#141c26!important;}
html[data-theme="dark"] :is(.text-dark,.text-black){color:#f1f5f9!important;}
html[data-theme="dark"] :is(.border,.border-top,.border-bottom){border-color:#526173!important;}
html[data-theme="dark"] code{color:#ffc0d8!important;background:#252d38!important;border-radius:.3rem;padding:.08em .28em;}

/* Pie */
html[data-theme="dark"] .site-footer{background:#080d12!important;color:#dbe3eb!important;border-color:#3b4754!important;}
html[data-theme="dark"] .footer-title{color:#ffffff!important;}
html[data-theme="dark"] .footer-source{color:#dbe3eb!important;}
html[data-theme="dark"] .footer-sep{border-color:#465566!important;}
html[data-theme="dark"] .site-footer a:not(.btn),
html[data-theme="dark"] .footer-source a{color:#a9d3ff!important;}
html[data-theme="dark"] .site-footer a:not(.btn):hover,
html[data-theme="dark"] .footer-source a:hover{color:#ffffff!important;}

/* --------------------------------------------------------------------------
   v8 · Auditoría final de legibilidad del tema oscuro
   Corrige bloques auxiliares que en el CSS base pueden conservar fondos claros.
   -------------------------------------------------------------------------- */
html[data-theme="dark"] :is(.hero-support-hint,.cost-note,.reduction-limit-note,.reduction-status,.support-note){
  color:#f1f5f9!important;
  background:#101923!important;
  border-color:#526173!important;
  opacity:1!important;
  text-shadow:none!important;
}
html[data-theme="dark"] .hero-support-hint{
  background:#0f1b27!important;
  color:#f8fafc!important;
  border:1px solid #607287!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(.hero-support-hint,.cost-note,.reduction-limit-note,.reduction-status,.support-note) :is(strong,b,span){
  color:inherit!important;
}

/* Párrafos y textos auxiliares: alto contraste estable en cualquier superficie oscura */
html[data-theme="dark"] body :is(p,li,dd,dt){color:#e9eff5!important;}
html[data-theme="dark"] body :is(.text-secondary,.text-muted,.card-text,.section-subtitle,.hero-lead,.footer-source){
  color:#dde6ef!important;
  opacity:1!important;
}
html[data-theme="dark"] body :is(small,.small):not(a){color:#dde6ef!important;opacity:1!important;}
html[data-theme="dark"] :is(.hero-lead,.section-subtitle){color:#eef4fa!important;}

/* Superficies informativas: fondo y texto se fijan juntos para evitar texto claro sobre fondos heredados claros */
html[data-theme="dark"] :is(.notice,.info-band,.selection-strip,.reference-pattern,.reduction-definition,
.reduction-config,.reduction-progress,.reduction-results-panel,.cost-panel,.paypal-box){
  background:#121b25!important;
  color:#f1f5f9!important;
  border-color:#526173!important;
}
html[data-theme="dark"] :is(.notice,.info-band,.selection-strip,.reference-pattern,.reduction-definition,
.reduction-config,.reduction-progress,.reduction-results-panel,.cost-panel,.paypal-box) *:not(.btn):not(a){
  color:inherit!important;
}

/* Tarjetas: los textos secundarios no pueden heredar grises oscuros del tema claro */
html[data-theme="dark"] :is(.hero-panel,.content-card,.game-card,.generator-card,.future-card,.reduction-tool-card,.card)
:is(p,.text-secondary,.text-muted,.card-text,.small,small){
  color:#e5edf5!important;
  opacity:1!important;
}

/* Bloque de apoyo: se protege toda la jerarquía tipográfica */
html[data-theme="dark"] .support-card :is(p,.support-lead,.support-note,.support-thanks){color:#edf3f8!important;opacity:1!important;}
html[data-theme="dark"] .support-card .support-highlight{background:#19334f!important;color:#f5f9ff!important;border-color:#7399bf!important;}
html[data-theme="dark"] .support-card .support-highlight :is(strong,b,span){color:#ffffff!important;}
html[data-theme="dark"] .support-card .paypal-box{background:#0e1823!important;color:#f8fafc!important;border-color:#607287!important;}

/* Formularios, etiquetas y mensajes de estado */
html[data-theme="dark"] :is(.form-label,label,legend,.info-label){color:#f0f6fc!important;opacity:1!important;}
html[data-theme="dark"] :is(.info-value,.selection-preview,.reference-numbers,[role="status"]){color:#f1f5f9!important;opacity:1!important;}

/* Asegura títulos y microtítulos legibles incluso cuando el CSS base define color propio */
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.display-title,.section-title,.card-title,.support-title,.cost-heading){
  color:#ffffff!important;
}
html[data-theme="dark"] .eyebrow{color:#d9edff!important;opacity:1!important;}


/* === Botones de reducciones: verde suave y accesible === */
.btn-reductions{
  background:#e8f7ed!important;
  border-color:#b8dec4!important;
  color:#205b35!important;
  box-shadow:none;
}
.btn-reductions:hover,
.btn-reductions:focus{
  background:#d9f0e1!important;
  border-color:#8fcaa2!important;
  color:#164628!important;
}
.btn-reductions:focus-visible{
  outline:3px solid rgba(44,122,72,.28)!important;
  outline-offset:2px;
}
html[data-theme="dark"] .btn-reductions{
  background:#183a27!important;
  border-color:#568c68!important;
  color:#e8f8ed!important;
}
html[data-theme="dark"] .btn-reductions:hover,
html[data-theme="dark"] .btn-reductions:focus{
  background:#215033!important;
  border-color:#79ad89!important;
  color:#ffffff!important;
}
html[data-theme="dark"] .btn-reductions:focus-visible{
  outline:3px solid #9bd3aa!important;
  outline-offset:2px;
}
