/* =====================================================
   A GAME — Dark Mode
   Applied when <body class="darkmode">
   ===================================================== */

/* Base */
body.darkmode {
    background: #0f1216 !important;
    color: #e6e6e6 !important;
}

/* Links */
body.darkmode a {
    color: #8ad4ff !important;
}

/* Horizontal rules */
body.darkmode hr {
    border-color: #2a3545 !important;
}

/* =====================================================
   Main Containers
   ===================================================== */

body.darkmode #container,
body.darkmode #save,
body.darkmode #gamecontainer,
body.darkmode #quickdetails,
body.darkmode #employment,
body.darkmode #upgrades_container,
body.darkmode #mining_container,
body.darkmode #vault,
body.darkmode #vault_container,
body.darkmode #randomBossPortal,
body.darkmode #randomBossArea,
body.darkmode #orbs,
body.darkmode #enderbossFight,
body.darkmode #shrine,
body.darkmode div[name="globalBossContainer"] {
    background: #121820 !important;
    color: #e6e6e6 !important;
}

/* Sidebar specifically */
body.darkmode #save {
    border-right: 1px solid #2a3545 !important;
}

/* =====================================================
   Headings / Titles
   ===================================================== */

body.darkmode h1,
body.darkmode h2,
body.darkmode h3,
body.darkmode h4,
body.darkmode .title {
    color: #e6e6e6 !important;
}

/* =====================================================
   Tables
   ===================================================== */

body.darkmode table,
body.darkmode td,
body.darkmode th {
    color: #e6e6e6 !important;
    border-color: #2a3545 !important;
}

body.darkmode tr.dark,
body.darkmode tr.research {
    background: #0c1016 !important;
}

/* =====================================================
   Buttons
   ===================================================== */

body.darkmode button,
body.darkmode input[type="button"],
body.darkmode input[type="submit"] {
    background: #1b2430 !important;
    color: #e6e6e6 !important;
    border: 1px solid #2a3545 !important;
}

body.darkmode button:hover {
    filter: brightness(1.1);
}

/* =====================================================
   Inputs / Textareas
   ===================================================== */

body.darkmode input,
body.darkmode textarea,
body.darkmode select {
    background: #0c1016 !important;
    color: #e6e6e6 !important;
    border: 1px solid #2a3545 !important;
}

/* Battelog / enderBox */
body.darkmode textarea.enderBox {
    background: #0c1016 !important;
    color: #e6e6e6 !important;
}

/* =====================================================
   Popup
   ===================================================== */

body.darkmode #popup {
    background: #121820 !important;
    color: #e6e6e6 !important;
    border: 1px solid #2a3545 !important;
}

/* =====================================================
   Health Bars
   ===================================================== */

body.darkmode .healthbar,
body.darkmode .globalBossBar,
body.darkmode .bar {
    background: #0c1016 !important;
    border: 1px solid #2a3545 !important;
}

body.darkmode .healthbar span,
body.darkmode .globalBossBar span,
body.darkmode .bar span {
    background: #8ad4ff !important;
}

/* =====================================================
   Small UI text
   ===================================================== */

body.darkmode .displaytext {
    color: #e6e6e6 !important;
}

/* =====================================================
   Loading Screen
   ===================================================== */

body.darkmode #loading_screen {
    background: #0f1216 !important;
    color: #e6e6e6 !important;
}

/* =====================================================
   Optional: slightly dim images so whites aren’t blinding
   ===================================================== */

body.darkmode img {
    filter: brightness(0.95) contrast(1.05);
}

/* =====================================================
   Global Boss Event (quickdetails cell)
   ===================================================== */

body.darkmode td.globalbossevent,
body.darkmode .globalbossevent {
    background: #0c1016 !important;
    color: #e6e6e6 !important;
    border: 1px solid #2a3545 !important;
    border-radius: 6px;
}

/* Make the "Time until" label + timer readable */
body.darkmode .globalbossevent span,
body.darkmode .globalbossevent b,
body.darkmode .globalbossevent font,
body.darkmode .globalbossevent div {
    color: #e6e6e6 !important;
}

/* If JOIN becomes a link */
body.darkmode .globalbossevent a {
    color: #ff6b6b !important; /* still "danger" red but readable */
    font-weight: bold;
    text-decoration: none;
}

body.darkmode .globalbossevent a:hover {
    text-decoration: underline;
}

/* =====================================================
   Global Boss Lobby panels (dark mode)
   Mirrors globalbossevent treatment
   ===================================================== */

body.darkmode .globalbossGreen {
    background: #0c1016 !important;
    color: #e6e6e6 !important;
    border: 1px solid #2a3545 !important;
    border-radius: 6px;
}

/* Text inside lobby panels */
body.darkmode .globalbossGreen span,
body.darkmode .globalbossGreen b,
body.darkmode .globalbossGreen font,
body.darkmode .globalbossGreen div {
    color: #e6e6e6 !important;
}

/* Links inside lobby activity log (if any) */
body.darkmode .globalbossGreen a {
    color: #8ad4ff !important;
    font-weight: bold;
    text-decoration: none;
}

body.darkmode .globalbossGreen a:hover {
    text-decoration: underline;
}

/* Make hit markers visible in dark mode */
body.darkmode span[name="attackedSpan"] {
    color: #ff7a7a !important;          /* brighter red */
    font-weight: 800;
    text-shadow:
        0 0 6px rgba(255, 0, 0, 0.75),
        0 0 14px rgba(255, 0, 0, 0.45),
        1px 1px 0 rgba(0, 0, 0, 0.85),
        -1px -1px 0 rgba(0, 0, 0, 0.85);
    z-index: 9999;
    pointer-events: none;
}
