/*!
 =========================================================
 * WebEngine CMS - Atlans Theme Override (Perfected)
 * Gothic / Medieval Dark Fantasy Style
 * Blood crimson, aged gold, glass panels, forged metal
 * Licensed under the MIT license
 =========================================================
*/

/* === ROOT VARIABLES === */
:root {
    --gothic-black:      #0a0a0a;
    --deep-crimson:      #5c0000;
    --blood-red:         #8b0000;
    --aged-gold:         #c9a96e;
    --dark-stone:        #1f1f1f;
    --border-crimson:    #a11212;
    --text-parchment:    #e8d9b8;
    --online-green:      #00ff44;
}

/* === BASE FIXES & UTILITIES === */
.table > * > tr > * { border-top: none !important; }

a:focus, a:hover { color: inherit !important; text-decoration: none !important; }

.nopadding { padding: 0 !important; margin: 0 !important; }
.vcenter { display: inline-block; vertical-align: middle; float: none; }

/* === GLOBAL STYLES === */
body {
    background: #772424 url('../img/background.jpg') no-repeat top center fixed !important;
    background-size: cover !important;
}

a { color: #f1c232 !important; }
a:hover { color: #ff9999 !important; text-shadow: 0 0 6px rgba(255,80,80,0.7) !important; }

.btn-primary {
    background: linear-gradient(#5c0000, #3c0000) !important;
    border: 2px solid var(--border-crimson) !important;
    color: var(--aged-gold) !important;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.9) !important;
    text-shadow: 1px 1px 2px #000 !important;
    transition: all .1s ease-in !important;
    border-radius: 0 !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(#8b0000, #5c0000) !important;
    border-color: var(--aged-gold) !important;
    color: #ffffffba !important;
    box-shadow: 0 0 15px rgba(201,169,110,0.5) !important;
}

.table-bordered, .table-bordered > * > tr > * {
    border: 1px solid #3a1a1a !important;
}
.table > thead > tr > th {
    background: #2c0000 !important;
    color: var(--aged-gold) !important;
    border-bottom: 3px double var(--aged-gold) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) { background-color: #142526 !important; }
.table-hover > tbody > tr:hover { background-color: #1d3536 !important; }

.alert-danger { color: #ffe2e2; background: #502c2c; border-color: #724a4a; }
.alert-success { color: #d5ffd6; background: #406830; border-color: #82af70; }

/* === PANELS & GLASS EFFECTS === */
#container, .footer, .panel-news, .panel-general, .panel-sidebar,
.panel-addstats, .panel-downloads, .myaccount-table, .general-table-ui,
.panel-usercp, .rankings-table-wrapper, .panel-login, .login-panel,
.account-login-panel {
    background: rgba(55, 20, 40, 0.80) !important;
    backdrop-filter: blur(12px) saturate(110%) brightness(0.95) !important;
    -webkit-backdrop-filter: blur(12px) saturate(111%) brightness(0.95) !important;
    border: 2px solid rgba(161,18,18,0.45) !important;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.85), 0 0 22px rgba(201,169,110,0.18) !important;
}

.panel-login .panel-body, #login-panel .panel-body, .login-module { background: transparent !important; }

.panel-heading, .module-title, .panel-title, .sidebar .panel-heading {
    background: linear-gradient(to bottom, #3c0000, #1a0000) !important;
    border-bottom: 4px solid var(--aged-gold) !important;
    border-top: 2px solid var(--border-crimson) !important;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8) !important;
}
.panel-heading h3, .panel-title, .module-title {
    color: var(--aged-gold) !important;
    text-shadow: 1px 1px 3px #000, 0 0 8px rgba(201,169,110,0.5) !important;
    letter-spacing: 1px !important;
}

/* === RANKINGS TABS === */
.rankings_menu a {
    background: linear-gradient(#4a0000, #2c0000) !important;
    border: 2px outset #6b0000 !important;
    color: #d9b38c !important;
    font-weight: bold !important;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.9) !important;
}
.rankings_menu a:hover {
    background: linear-gradient(#8b0000, #5c0000) !important;
    border-color: var(--aged-gold) !important;
    color: #fff !important;
}
.rankings_menu a.active {
    background: #a11212 !important;
    border: 2px solid var(--aged-gold) !important;
    box-shadow: 0 0 15px rgba(201,169,110,0.6) !important;
}

/* === NEWS & NOTICE TAGS === */
.panel-news {
    background: rgba(25, 10, 35, 0.82) !important;
    border: 3px double var(--aged-gold) !important;
    box-shadow: 0 0 25px rgba(201,169,110,0.25) !important;
}

.home-news-block-article-type {
    background: linear-gradient(145deg, #97001d, #ffc40e) !important;
    color: #ffffff !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    padding: 6px 14px !important;
    min-width: 80px !important;
    border: 2px solid #ff5252 !important;
    border-radius: 6px !important;
    box-shadow: 0 0 12px rgba(255,23,68,0.6), inset 0 1px 3px rgba(255,255,255,0.3) !important;
    transition: all 0.25s ease !important;
}
.home-news-block-article-type:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 20px rgba(255,23,68,0.9) !important;
    background: #ff901f !important;
}

/* === TYPOGRAPHY === */
.panel-title, h1, h2, h3, h4, .module-title, .page-title,
.webengine-mu-logo, .logo-text, #navbar ul li a {
    font-family: 'MedievalSharp', cursive !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}

body, p, td, th, li, .panel-body, input, label {
    font-family: 'Cinzel', serif !important;
    font-weight: 400 !important;
}

/* === ONLINE USERS & HEADER INFO (consolidated & fixed scaling/position) === */
.header-info {
    width: 340px !important;
    max-width: 90% !important;
    margin: -6px auto !important;
    padding: 20px 28px !important;
    background: linear-gradient(to bottom, rgba(20,10,30,0.2), rgba(10,5,20,0.92)) !important;
    backdrop-filter: blur(10px) !important;
    border: 3px solid var(--aged-gold) !important;
    border-image: linear-gradient(to right, transparent, var(--aged-gold), transparent) 1 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 25px rgba(201,169,110,0.35), inset 0 0 18px rgba(0,0,0,0.9) !important;
    color: var(--text-parchment) !important;
    text-align: center !important;
    font-family: 'Cinzel', serif !important;
}

.online-count, .webengine-online-bar .online-count, .online-number {
    font-family: 'Pirata One', cursive !important;
    font-size: 25px !important;
    font-weight: normal !important;
    color: var(--online-green) !important;
    text-shadow: 0 0 8px rgba(0,255,68,0.7) !important;
    margin: -8px 8px 0 -10px !important; /* safe positioning, no extreme negative */
    display: inline-block !important;
    vertical-align: middle !important;
}

.webengine-online-bar {
    width: 85% !important;
    height: 10px !important;
    margin: 6px auto !important;
    background: #1a0000 !important;
    border: 2px solid #6b0000 !important;
    border-radius: 6px !important;
}
.webengine-online-bar .webengine-online-bar-progress {
    background: linear-gradient(to right, var(--online-green), #00cc44) !important;
    box-shadow: 0 0 12px rgba(0,255,85,0.6) !important;
}

.header-info strong, .online-users-label, .server-time-label, .local-time-label {
    font-family: 'Pirata One', cursive !important;
    font-size: 18px !important;
    color: var(--aged-gold) !important;
    text-shadow: 1px 1px 3px #000 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    margin-bottom: 6px !important;
    display: block !important;
}

.server-time-value, .local-time-value, #tServerTime, #tLocalTime {
    text-align: left !important;
    margin-left: 0 !important;
    width: 100% !important;
    font-size: 14px !important;
    color: #ffdd99 !important;
    text-shadow: 1px 1px 4px #000 !important;
}

@media (max-width: 768px) {
    .header-info { width: 90% !important; padding: 16px 20px !important; }
    .online-count { font-size: 22px !important; margin-left: -5px !important; }
}

/* === LOGIN INPUTS === */
.form-control, input#webengineLogin_user, input#webengineLogin_pass,
input[type="text"].form-control, input[type="password"].form-control {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 16px !important;
    color: var(--text-parchment) !important;
    background: #111f20 !important;
    border: 1px solid #20393a !important;
}
.form-control:focus {
    color: #ffffff !important;
    border-color: #1c919d !important;
    box-shadow: 0 0 8px rgba(28,145,157,0.5) !important;
}
.form-control::placeholder {
    color: #6c8989 !important;
    opacity: 0.7 !important;
}

/* === LOGO & OTHER FIXES === */
.webengine-mu-logo, img.webengine-mu-logo {
    display: block !important;
    margin: -40px auto 0 auto !important;
}
@media (max-width: 991px) { .webengine-mu-logo { margin-top: -25px !important; max-width: 80% !important; } }

/* Forgot password link */
.panel-heading:has(.panel-title) {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    padding: 12px 18px !important;
}
.panel-title { margin: 0 !important; flex: 1 !important; font-size: 22px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.panel-title a.pull-right, .panel-heading a[href*="forgotpassword"] {
    font-size: 12px !important;
    padding: 4px 10px !important;
    margin-left: 15px !important;
    color: var(--aged-gold) !important;
    background: transparent !important;
    border: none !important;
}
.panel-title a.pull-right:hover { color: #ff9999 !important; text-decoration: underline !important; }
@media (max-width: 480px) {
    .panel-heading:has(.panel-title) { flex-direction: column !important; }
    .panel-title a.pull-right { margin: 8px 0 0 0 !important; align-self: flex-end !important; }
}

/* UserCP Title */
.panel-sidebar.panel-usercp .panel-title, .panel-usercp .panel-heading h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    padding: 8px 12px !important;
    text-align: center !important;
}

/* === INVENTORY TOOLTIPS (safe & readable) === */
.equip-wrap *, .equip-grid *, .equip-item *, .item-tooltip, .item-tooltip * {
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: normal !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}
.item-tooltip {
    background: #1a1a1a !important;
    color: #ddd !important;
    border: 2px solid #c7b358 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.6) !important;
}
@media (max-width: 768px) {
    .item-tooltip { min-width: 220px !important; width: 90vw !important; font-size: 13px !important; }
}

/* Make character name stand out more */
body table td:nth-child(4) a {
    color: #ffdd99 !important;
    font-weight: normal !important;
    text-shadow: 0 0 6px rgba(255,221,153,0.6) !important;
}

.sidebar-banner img {
    width: 100%;
    border: 2px solid var(--aged-gold);
    box-shadow: 0 0 15px rgba(201,169,110,0.6);
    transition: all 0.3s ease;
}
.sidebar-banner img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255,215,0,0.8);
}




/* === RANKINGS TABS – Glass Float Premium === */
.rankings_menu {
    max-width: 980px;
    margin: 14px auto 8px;
    padding: 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.rankings_menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(140,25,25,.18), rgba(90,10,10,.12));
    border: 1px solid rgba(201,169,110,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 16px rgba(0,0,0,.4);
    backdrop-filter: blur(8px);
    color: var(--aged-gold);
    font-weight: 800;
    letter-spacing: .3px;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(0,0,0,.5);
    transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
    overflow: hidden;
    isolation: isolate;
}

.rankings_menu a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,215,0,.25), transparent 50%);
    mix-blend-mode: screen;
    opacity: .6;
    pointer-events: none;
}

.rankings_menu a::after {
    content: "";
    position: absolute;
    top: -120%; left: -60%;
    width: 120%; height: 300%;
    transform: rotate(25deg);
    background: linear-gradient(to right, transparent, var(--glass-sheencolor) 45%, transparent 70%);
    transition: transform .5s ease;
    pointer-events: none;
    opacity: .5;
}

.rankings_menu a:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 22px rgba(0,0,0,.45);
    border-color: var(--aged-gold);
}

.rankings_menu a:hover::after { transform: rotate(25deg) translateX(160%); }

.rankings_menu a.active {
    background: linear-gradient(180deg, #ffe38a 0%, #f2c24a 45%, #c6922a 45%, #a87417 100%);
    border-color: rgba(201,169,110,.8);
    color: #1a1202;
    text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 -1px 0 rgba(0,0,0,.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.18);
}

.rankings_menu a.active::before { opacity: .9; }
.rankings_menu a.active::after { opacity: .25; }






#header {
    position: relative;
    min-height: 180px;           /* ← Back to reasonable size – just enough for logo + some breathing room */
    height: auto;
    overflow: visible;
    z-index: 5;
    margin-bottom: 10px;         /* Small space before news – no big gap */
}

/* Sparks container – push it down so flames appear to start near news even with shorter header */
.sparks {
    position: absolute;
    width: 1200px;
    left: 50%;
    margin-left: -800px;         /* Keeps perfect centering */
    bottom: -80px;              /* ← Negative = starts BELOW the header bottom (near news top) */
    pointer-events: none;
}

.sparks > div { position: absolute; }

/* Individual sparks – same as before, but ensure linear timing is explicit */
.sparks .spark_1 {
    background: url(../img/spark_1.png) no-repeat;
    width: 764px;
    height: 313px;
    right: 0;
    bottom: -220px;
    transform: scale(0.6);
    animation: spark-1 6s linear infinite;  /* explicit linear = constant speed */
    animation-delay: 0.4s;
}

.sparks .spark_2 {
    background: url(../img/spark_2.png) no-repeat;
    width: 179px;
    height: 335px;
    right: 300px;
    bottom: -220px;
    transform: scale(0.6);
    animation: spark-1 6s linear infinite;
    animation-delay: 1.7s;
}

.sparks .spark_3 {
    background: url(../img/spark_3.png) no-repeat;
    width: 128px;
    height: 165px;
    right: 450px;
    bottom: -200px;
    transform: scale(0.6);
    animation: spark-3 6s linear infinite;
    animation-delay: 3.2s;
}

.sparks .spark_4 {
    background: url(../img/spark_4.png) no-repeat;
    width: 794px;
    height: 176px;
    right: 0;
    bottom: -200px;
    transform: scale(0.6);
    animation: spark-5 6s linear infinite;
    animation-delay: 0.9s;
}

.sparks .spark_5 {
    background: url(../img/spark_4.png) no-repeat;
    width: 794px;
    height: 176px;
    right: 200px;
    bottom: -190px;
    transform: scale(0.6);
    animation: spark-5 6s linear infinite;
    animation-delay: 4.6s;
}

/* Constant speed rise – ends at bottom: +100px at 100% */
@keyframes spark-1 {
    0%   { bottom: -220px; transform: scale(0.6);  opacity: 1;   }
    25%  { bottom: -140px; transform: scale(0.7);  opacity: 1;   }
    50%  { bottom:  -60px; transform: scale(0.8);  opacity: 0.95; }
    75%  { bottom:   20px; transform: scale(0.9);  opacity: 0.8;  }
    100% { bottom:  100px; transform: scale(1.0);  opacity: 0;   }
}

/* spark-3 – same total travel distance, ends at +100px */
@keyframes spark-3 {
    0%   { bottom: -200px; transform: scale(0.6);  opacity: 1;   }
    25%  { bottom: -125px; transform: scale(0.7);  opacity: 1;   }
    50%  { bottom:  -50px; transform: scale(0.8);  opacity: 0.95; }
    75%  { bottom:   25px; transform: scale(0.9);  opacity: 0.8;  }
    100% { bottom:  100px; transform: scale(1.0);  opacity: 0;   }
}

/* spark-5 – same logic, ends at +100px */
@keyframes spark-5 {
    0%   { bottom: -190px; transform: scale(0.6);  opacity: 1;   }
    25%  { bottom: -117px; transform: scale(0.7);  opacity: 1;   }
    50%  { bottom:  -45px; transform: scale(0.8);  opacity: 0.95; }
    75%  { bottom:   27px; transform: scale(0.9);  opacity: 0.8;  }
    100% { bottom:  100px; transform: scale(1.0);  opacity: 0;   }
}



/* Force ALL main visible content blocks ABOVE sparks layer */
#container,
#content,
.header-info-container,       /* ← Add this: online count box parent */
.header-info,                 /* ← Add this: direct container for count/bar/times */
.panel-news,                  /* Latest News */
.panel-general,
.panel-login,
.login-panel,
.account-login-panel,
.panel-usercp,
.myaccount-table,
.general-table-ui {
    position: relative;       /* Ensures own stacking context */
    z-index: 10;              /* Solidly above #header (z2) and sparks (z1) */
}

/* Keep header low so its sparks stay behind everything below */
#header {
    z-index: 2;
}

/* Explicitly lowest for sparks (already good, but reinforce) */
.sparks,
.sparks * {
    z-index: 1 !important;    /* !important if any bleed-through persists */
    pointer-events: none;
}

/* Layering: make online count box + main content ABOVE sparks (minimal addition) */
.header-info-container,
.header-info {
    position: relative;       /* Required for stacking context */
    z-index: 10;              /* Same as your news/login panels → on top of sparks */
}

