/* Dark-mode overrides for custom elements that use hard-coded light colors */

[data-bs-theme="dark"] .page-card {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
}

[data-bs-theme="dark"] .mascot-modal {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
}

[data-bs-theme="dark"] .speech-bubble {
  /* Bubble background is intentionally light; keep text readable */
  color: #000 !important;
}

[data-bs-theme="dark"] .myword-footer {
  background: var(--bs-tertiary-bg) !important;
  border-top: 1px solid var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .myword-footer a {
  color: var(--bs-link-color) !important;
}

[data-bs-theme="dark"] #keyboard btn-dark,
[data-bs-theme="dark"] #keyboard .btn-dark {
    background: #3a3f46 !important;
    color: #f1f5f9 !important;
    border: 1px solid #555b63 !important;
    box-shadow: 0 2px 0 rgba(0,0,0,.35) !important;
}

/* Use this anywhere you previously did color:black */
.mw-force-darktext {
    color: #000 !important; /* light mode */
}

/* In dark mode, swap to your brand secondary */
[data-bs-theme="dark"] .mw-force-darktext,h3,h2 {
    color: #9FABFE !important;
}
[data-bs-theme="dark"] h3, h2 {
    color: #769EFF !important;
}
[data-bs-theme="dark"] .auto-choice-title {
    color: #769EFF !important;
}
[data-bs-theme="dark"] .auto-choice-sub {
    color: #9FABFE !important;
}
.rulesgrey {
    color: #555 !important; /* light mode */
}

[data-bs-theme="dark"] .rulesgrey {
    color: white !important;
}
.blackwhite {
    color: black !important; /* light mode */
}

[data-bs-theme="dark"] .blackwhite {
    color: white !important;
}

/* =========================================================
   Popup Modal (#popupModal) – DARK MODE ONLY
   Soft dark-grey instead of black
   ========================================================= */

/* Modal container */
[data-bs-theme="dark"] #popupModal .exciting-modal-content {
    background: #555b63; /* soft dark grey */
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 20px 50px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Header image area stays neutral */
[data-bs-theme="dark"] #popupModal .modal-header-image {
    background: #769EFF;
}

/* Body text */
[data-bs-theme="dark"] #popupModal .modal-body {
    color: rgba(255,255,255,0.92) !important;
}

/* Footer */
[data-bs-theme="dark"] #popupModal .modal-footer {
    background: transparent;
}

/* Button – keep your existing style, just ensure contrast */
[data-bs-theme="dark"] #popupModal .exciting-modal-btn {
    color: #fff;
}

/* Override any forced black text utility */
[data-bs-theme="dark"] #popupModal .mw-force-darktext {
    color: rgba(255,255,255,0.92) !important;
}
