* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    width: 100%;
    height: 100%;
    background: url('/images/bg_768.jpg') no-repeat center top fixed, #0a0c10;
    background-size: cover;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 12, 0.85);
    z-index: 1;
}

/* =========================================================================
   LOGIN CARD STYLES
   ========================================================================= */
.login-card-modal {
    position: relative;
    z-index: 10;
    background: #151924;
    border: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 165, 0, 0.25);
    border-radius: 12px;
    padding: 30px;
    color: #e0e0e0;
    width: 420px;
    max-width: 90vw;
    margin: auto;
}

.login-card-title {
    color: #ffd700;
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.25);
    padding-bottom: 10px;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
}

.login-error-msg {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid #ff5252;
    color: #ff5252;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.input-group {
    margin-bottom: 16px;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
    font-weight: bold;
}

.custom-input {
    width: 100%;
    padding: 12px 15px;
    background: #080a0f;
    border: 1px solid #2a3142;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.custom-input:focus {
    border-color: #ffd700;
}

.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(180deg, #e5c158 0%, #b8860b 100%);
    color: #0a0c10;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

.btn-submit:hover {
    background: linear-gradient(180deg, #f5d168 0%, #c8961b 100%);
}

.login-footer-info {
    font-size: 12px;
    color: #777;
    margin-top: 15px;
    text-align: center;
}

/* =========================================================================
   SERVER SELECTION & TAB HUB CONTAINER
   ========================================================================= */
body.server-select-page {
    min-height: 100vh;
    background: url('/images/bg_768.jpg') no-repeat center top fixed, #0d0f17;
    background-size: cover;
    flex-direction: column;
    color: #fff;
    overflow-y: auto;
    padding: 20px 0;
}

.server-select-container {
    position: relative;
    z-index: 10;
    width: 950px;
    max-width: 96vw;
    background: linear-gradient(145deg, rgba(20, 26, 38, 0.96), rgba(12, 16, 24, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 25px 30px;
    margin: 10px auto;
}

.user-welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.user-welcome-bar .uname {
    color: #ffd700;
    font-weight: bold;
}

.btn-logout-sm {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 4px;
    background: rgba(255, 107, 107, 0.1);
}

.btn-logout-sm:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #fff;
}

.server-title {
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 18px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 215, 0, 0.3);
    font-family: Georgia, 'Times New Roman', serif;
}

/* =========================================================================
   GATEWAY TAB NAVIGATION (100% Zero JS)
   ========================================================================= */
.gateway-tab-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.25);
    margin-bottom: 20px;
    padding-bottom: 2px;
    overflow-x: auto;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: bold;
    transition: all 0.15s ease-in-out;
}

.tab-item:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.4);
}

.tab-item.active {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.3) 0%, rgba(20, 26, 38, 0.9) 100%);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.6);
    border-bottom: 2px solid #141a26;
    margin-bottom: -2px;
    box-shadow: 0 -3px 10px rgba(255, 215, 0, 0.15);
}

.tab-icon {
    font-size: 15px;
}

/* =========================================================================
   SERVER LIST GRID STYLES
   ========================================================================= */
.server-list-wrapper {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

.server-list-wrapper::-webkit-scrollbar {
    width: 7px;
}

.server-list-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

.server-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}

.server-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: #ffd700;
}

.server-grid-3col {
    width: 100%;
    display: block;
}

.server-grid-3col::after {
    content: "";
    display: table;
    clear: both;
}

.server-card-form {
    float: left;
    width: 31.8%;
    margin-right: 2.3%;
    margin-bottom: 10px;
}

.server-card-form:nth-child(3n) {
    margin-right: 0 !important;
}

.server-btn-card {
    position: relative;
    width: 100%;
    height: 48px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 0 8px;
}

.server-btn-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 5px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
}

.btn-type-new {
    background: linear-gradient(180deg, #c83232 0%, #961e1e 50%, #640c0c 100%);
    border-color: #e64a4a;
}

.btn-type-hot {
    background: linear-gradient(180deg, #249cb8 0%, #156d82 50%, #0d4e5e 100%);
    border-color: #3bbad9;
}

.ribbon-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.ribbon {
    position: absolute;
    top: 6px;
    left: -18px;
    width: 60px;
    padding: 1.5px 0;
    text-align: center;
    font-size: 8.5px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.ribbon-new { background: linear-gradient(135deg, #ff2a55 0%, #b80024 100%); }
.ribbon-hot { background: linear-gradient(135deg, #ff7b00 0%, #d44d00 100%); }

.server-btn-text {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    z-index: 2;
    text-align: center;
    padding-left: 12px;
}

/* =========================================================================
   MOD: QUÀ TÍCH NẠP STYLES
   ========================================================================= */
.mod-accumulate-wrapper {
    animation: fadeIn 0.2s ease-in-out;
}

.mod-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.server-select-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-label {
    font-size: 13px;
    font-weight: bold;
    color: #cbd5e1;
}

.mod-select {
    padding: 6px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    outline: none;
}

.btn-mod-filter {
    padding: 6px 14px;
    background: linear-gradient(180deg, #d4af37 0%, #aa820a 100%);
    border: none;
    border-radius: 6px;
    color: #000;
    font-size: 12.5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-mod-filter:hover {
    background: linear-gradient(180deg, #f0c952 0%, #c49912 100%);
}

.character-info-badge {
    font-size: 13px;
}

.text-gold { color: #ffd700; }
.text-warning { color: #f59e0b; }

.mod-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: bold;
    margin-bottom: 18px;
    text-align: center;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #34d399;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid #f43f5e;
    color: #fb7185;
}

.event-banner-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 20px;
}

.event-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.event-title-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-status-tag {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid #d97706;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.event-name {
    font-size: 17px;
    color: #ffd700;
}

.event-time-range {
    font-size: 12.5px;
    color: #94a3b8;
}

.charge-stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-label {
    font-size: 13.5px;
    color: #cbd5e1;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
}

.stat-desc {
    font-size: 12px;
    color: #94a3b8;
    max-width: 450px;
    text-align: right;
}

.reward-tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 15px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 6px;
}

.reward-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-ready {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.card-claimed {
    opacity: 0.65;
    background: rgba(15, 23, 42, 0.5);
}

.reward-card-header {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.milestone-badge {
    font-size: 15px;
    color: #ffd700;
    font-weight: bold;
}

.tier-title {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.reward-items-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.reward-item-pill {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #e2e8f0;
    display: flex;
    justify-content: space-between;
}

.item-qty {
    color: #38bdf8;
    font-weight: bold;
}

.reward-card-footer {
    text-align: center;
}

.btn-claim-reward {
    width: 100%;
    padding: 8px;
    background: linear-gradient(180deg, #10b981 0%, #047857 100%);
    border: 1px solid #34d399;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.btn-claim-reward:hover {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
}

.badge-status {
    padding: 7px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.badge-claimed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-locked {
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mod-empty-msg {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}