/* ==========================================================================
   PQK WEB - CỬU LONG TRANH BÁ VÕ LÂM PORTAL
   Theme: Antique Gold & Black Lacquer Martial Arts (Kiếm Hiệp Cửu Long)
   ========================================================================== */

:root {
    --bg-dark: #110503;
    --bg-surface: #1d0905;
    --bg-card: #280e07;
    --bg-card-light: #36150b;
    --gold-bright: #ffdf78;
    --gold-primary: #e5b95d;
    --gold-dark: #8c5a1f;
    --gold-border: #6d3f15;
    --red-crimson: #a82315;
    --red-hover: #c93424;
    --text-primary: #f5e6cf;
    --text-muted: #b89c82;
    --text-gold: #ffdf78;
    --border-accent: rgba(229, 185, 93, 0.35);
    --shadow-wuxia: 0 8px 24px rgba(0, 0, 0, 0.65);
    --glow-gold: 0 0 15px rgba(229, 185, 93, 0.4);
}

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

html, body {
    background-color: #060202;
    background-image: url('/images/bg_wuxia_hero.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    min-width: 320px;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--gold-bright);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--gold-bright);
    text-shadow: 0 0 8px rgba(255, 223, 120, 0.5);
}

/* ==========================================================================
   UNIVERSAL DARK WUXIA FORM CONTROLS (NO WHITE BACKGROUNDS IN ANY TAB)
   ========================================================================== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="datetime-local"],
select,
textarea,
.wuxia-input,
.input-portal,
.form-control {
    background: #0d0402 !important;
    border: 1px solid #5a250d !important;
    color: #ffdf78 !important;
    border-radius: 4px;
    padding: 7px 11px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
}

input:focus, select:focus, textarea:focus, .wuxia-input:focus, .input-portal:focus, .form-control:focus {
    border-color: #f59e0b !important;
    background: #170704 !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45), inset 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    color: #fff !important;
}

select option {
    background: #150604 !important;
    color: #ffdf78 !important;
    padding: 6px;
}

::placeholder {
    color: #8c6f5a !important;
    font-size: 11px;
}

/* UNIVERSAL WUXIA TABLE */
.rank-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(12, 4, 2, 0.95);
    border: 1px solid #4a210b;
    border-radius: 4px;
    overflow: hidden;
}

.rank-table th {
    background: linear-gradient(180deg, #301308 0%, #170703 100%) !important;
    color: #ffdf78 !important;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 1px solid #6b3510;
    text-align: left;
}

.rank-table td {
    background: rgba(18, 6, 3, 0.75) !important;
    color: #e5d5c0 !important;
    padding: 7px 10px;
    border-bottom: 1px solid #2e1206;
    font-size: 11px;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.rank-table tr:hover td {
    background: rgba(60, 22, 10, 0.9) !important;
    color: #fff !important;
}

/* ==========================================================================
   TOP SECURITY STATUS BAR
   ========================================================================== */
.top-security-bar {
    background: linear-gradient(90deg, #090201, #1e0703, #090201);
    border-bottom: 1px solid rgba(229, 185, 93, 0.2);
    font-size: 12px;
    padding: 5px 0;
    color: var(--text-muted);
}

.top-security-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4ade80;
    font-weight: 600;
}

.security-pulse {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ==========================================================================
   HEADER & WUXIA NAVIGATION
   ========================================================================== */
.main-header {
    position: relative;
    background: linear-gradient(180deg, rgba(8, 3, 2, 0.98) 0%, rgba(18, 6, 4, 0.95) 100%);
    border-bottom: 2px solid var(--gold-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    z-index: 100;
}

.main-header::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    min-height: 80px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo img {
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(229, 185, 93, 0.4));
}

.brand-text h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 12px rgba(229,185,93,0.3);
}

.brand-text span {
    font-size: 11px;
    color: #e28a58;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(140, 90, 31, 0.35), rgba(70, 25, 8, 0.45));
    border-color: var(--gold-border);
    box-shadow: 0 0 12px rgba(229, 185, 93, 0.2);
}

.nav-link.highlight {
    background: linear-gradient(180deg, #992113, #631208);
    color: #fff;
    border: 1px solid #c93b28;
    box-shadow: 0 0 10px rgba(201, 59, 40, 0.4);
}

.nav-link.highlight:hover {
    background: linear-gradient(180deg, #b82817, #78170b);
    color: #fffae8;
}

/* ==========================================================================
   USER QUICK ACTIONS & SIDE PANEL
   ========================================================================== */
.user-widget-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-wuxia-primary {
    background: linear-gradient(180deg, #d49f3e 0%, #99621b 100%);
    color: #1a0803 !important;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid #ffd47d;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
}

.btn-wuxia-primary:hover {
    background: linear-gradient(180deg, #ebd068 0%, #b87a27 100%);
    box-shadow: 0 0 12px rgba(255, 223, 120, 0.6);
}

.btn-wuxia-red {
    background: linear-gradient(180deg, #ba2b1a 0%, #7d1509 100%);
    color: #fff !important;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 4px;
    border: 1px solid #e84c38;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
}

.btn-wuxia-red:hover {
    background: linear-gradient(180deg, #d93521 0%, #9c1b0c 100%);
    box-shadow: 0 0 12px rgba(232, 76, 56, 0.5);
}

.btn-wuxia-dark {
    background: rgba(30, 10, 5, 0.8);
    color: var(--gold-primary) !important;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--gold-border);
    cursor: pointer;
    font-size: 13px;
}

.btn-wuxia-dark:hover {
    background: rgba(60, 20, 10, 0.9);
    border-color: var(--gold-primary);
}

/* User summary drop */
.user-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(18, 5, 3, 0.85);
    border: 1px solid var(--gold-border);
    border-radius: 6px;
    padding: 4px 10px;
}

.badge-vip {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #110503;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.balance-xu {
    color: #fbbf24;
    font-weight: 700;
    font-size: 12px;
}

.balance-knb {
    color: #60a5fa;
    font-weight: 700;
    font-size: 12px;
}

/* ==========================================================================
   MAIN LAYOUT & CONTAINERS
   ========================================================================== */
.page-wrapper {
    max-width: 1200px;
    margin: 25px auto 40px;
    padding: 0 15px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 25px;
}

@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================================================
   DOWNLOAD WIDGET - RỰC LỬA
   ========================================================================== */
.widget-download-box {
    background: linear-gradient(145deg, #240b06, #3b130a);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow-wuxia), 0 0 15px rgba(229, 185, 93, 0.15);
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.btn-game-download {
    display: block;
    width: 100%;
    height: 100px;
    background: url('/images/bt-cai-dat.gif') no-repeat center center;
    background-size: contain;
    transition: transform 0.2s ease;
    border-radius: 6px;
}

.btn-game-download:hover {
    background: url('/images/bt-cai-dat-hover.gif') no-repeat center center;
    background-size: contain;
    transform: scale(1.02);
}

.download-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.download-quick-links a {
    display: block;
    background: rgba(15, 4, 2, 0.85);
    border: 1px solid rgba(229, 185, 93, 0.3);
    border-radius: 4px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.download-quick-links a:hover {
    background: rgba(50, 16, 8, 0.9);
    border-color: var(--gold-bright);
}

/* ==========================================================================
   CARDS, PANELS, AND TILES
   ========================================================================== */
.wuxia-card {
    background: linear-gradient(160deg, #210c07 0%, #170704 100%);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-wuxia);
    margin-bottom: 25px;
    position: relative;
}

.wuxia-card-header {
    background: linear-gradient(90deg, #421609 0%, #692410 50%, #421609 100%);
    border-bottom: 1px solid var(--gold-border);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wuxia-card-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-bright);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px #000;
}

.wuxia-card-body {
    padding: 18px;
}

/* ==========================================================================
   HERO BANNER & SLIDER
   ========================================================================== */
.hero-banner-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gold-border);
    margin-bottom: 25px;
    box-shadow: var(--shadow-wuxia);
    height: 340px;
    background-color: #0b0201;
}

.hero-banner-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.9);
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(14, 4, 2, 0.95) 0%, rgba(14, 4, 2, 0.3) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 30px;
}

.hero-badge {
    align-self: flex-start;
    background: var(--red-crimson);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.hero-title {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px #000;
    margin-bottom: 6px;
}

.hero-summary {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 650px;
    margin-bottom: 12px;
}

/* ==========================================================================
   NEWS LIST & TABS
   ========================================================================== */
.news-tabs {
    display: flex;
    border-bottom: 1px solid var(--gold-border);
    background: rgba(15, 5, 2, 0.7);
}

.news-tab-btn {
    padding: 10px 18px;
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.news-tab-btn:hover {
    color: var(--gold-primary);
}

.news-tab-btn.active {
    color: var(--gold-bright);
    background: rgba(66, 22, 9, 0.4);
    border-bottom: 2px solid var(--gold-primary);
}

.news-article-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px dashed rgba(229, 185, 93, 0.2);
    transition: background 0.2s ease;
}

.news-article-row:last-child {
    border-bottom: none;
}

.news-article-row:hover {
    background: rgba(229, 185, 93, 0.05);
}

.news-title-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.news-title-link:hover {
    color: var(--gold-bright);
}

.news-category-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-suki { background: #991b1b; color: #fee2e2; }
.badge-tintuc { background: #1e3a8a; color: #dbeafe; }
.badge-capnhat { background: #065f46; color: #d1fae5; }
.badge-huongdan { background: #78350f; color: #fef3c7; }

.news-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ==========================================================================
   LEADERBOARDS & RANK TABLE
   ========================================================================== */
.rank-table {
    width: 100%;
    border-collapse: collapse;
}

.rank-table th {
    background: rgba(18, 5, 3, 0.95);
    color: var(--gold-primary);
    font-family: Georgia, serif;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--gold-border);
}

.rank-table td {
    padding: 10px 8px;
    font-size: 13px;
    border-bottom: 1px solid rgba(229, 185, 93, 0.1);
    color: var(--text-primary);
}

.rank-table tr:hover td {
    background: rgba(229, 185, 93, 0.06);
}

.rank-top-1 {
    color: #fbbf24;
    font-weight: 900;
    font-size: 15px;
}
.rank-top-2 {
    color: #e5e7eb;
    font-weight: 800;
    font-size: 14px;
}
.rank-top-3 {
    color: #d97706;
    font-weight: 800;
    font-size: 14px;
}

.sect-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(45, 15, 8, 0.8);
    border: 1px solid rgba(229, 185, 93, 0.25);
    color: var(--gold-bright);
}

/* ==========================================================================
   KỲ TRÂN CÁC (KTC) SHOP CARDS
   ========================================================================== */
.ktc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.ktc-card {
    background: linear-gradient(160deg, #240c07 0%, #150603 100%);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ktc-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-bright);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), var(--glow-gold);
}

.ktc-item-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 10px;
    background: rgba(10, 3, 1, 0.6);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(229, 185, 93, 0.2);
}

.ktc-item-name {
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 6px;
    min-height: 40px;
}

.ktc-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 34px;
}

.ktc-price-box {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    border-radius: 4px;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--gold-primary);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(10, 3, 1, 0.85);
    border: 1px solid var(--gold-border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(229, 185, 93, 0.35);
    background: rgba(18, 5, 2, 0.95);
}

.text-danger {
    color: #f87171;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.alert-success {
    background: rgba(22, 101, 52, 0.85);
    border: 1px solid #4ade80;
    color: #dcfce7;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(153, 27, 27, 0.85);
    border: 1px solid #f87171;
    color: #fee2e2;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
/* ==========================================================================
   FOOTER (THIẾT KẾ ĐẸP - CHỈ GIỮ LẠI CỬU LONG TÁI KHỞI VÀ ICON)
   ========================================================================== */
.main-footer {
    background: linear-gradient(180deg, #120503 0%, #060201 100%);
    border-top: 2px solid #5a250d;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 223, 120, 0.15);
    padding: 22px 0;
    margin-top: 40px;
    position: relative;
    z-index: 10;
}

.footer-unified-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-dragon-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 28px;
    background: rgba(26, 9, 4, 0.7);
    border: 1px solid rgba(229, 185, 93, 0.35);
    border-radius: 30px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.footer-dragon-brand:hover {
    border-color: #ffdf78;
    box-shadow: 0 0 22px rgba(255, 223, 120, 0.35);
    transform: translateY(-1px);
}

.footer-dragon-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffdf78;
    box-shadow: 0 0 14px rgba(255, 223, 120, 0.5);
    transition: transform 0.3s ease;
}

.footer-dragon-brand:hover .footer-dragon-icon {
    transform: rotate(15deg) scale(1.08);
}

.footer-title-wuxia {
    font-family: 'Cinzel', 'Be Vietnam Pro', Georgia, serif;
    font-size: 19px;
    font-weight: 800;
    color: #ffdf78;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 223, 120, 0.6), 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   HOMEPAGE WUXIA PORTAL - EXACT MATCH TO USER REFERENCE SCREENSHOT
   ========================================================================== */

.exact-portal-container {
    max-width: 1080px;
    margin: 16px auto 40px;
    padding: 0 10px;
}

/* TOP HERO BANNER (admin_banner.jpg) WITH 5 INTEGRATED MENU BUTTONS */
.top-hero-frame {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(229, 185, 93, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    margin-bottom: 14px;
    background: #000;
}

.hero-main-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* PALACE SACRED PLAQUE (HOÀNH PHI HOÀNG CUNG CỬU LONG TÁI KHỞI) */
.palace-sacred-plaque {
    position: absolute;
    top: 20.25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.3%;
    height: 5.5%;
    min-width: 22px;
    min-height: 34px;
    border-radius: 2px;
    pointer-events: auto;
    cursor: pointer;
    z-index: 8;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plaque-flame-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 3px;
    background: radial-gradient(circle, rgba(255, 180, 50, 0.45) 0%, rgba(234, 88, 12, 0.2) 65%, transparent 100%);
    animation: sacredPlaquePulse 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes sacredPlaquePulse {
    0% {
        opacity: 0.35;
        transform: scale(0.92);
        filter: drop-shadow(0 0 4px rgba(255, 180, 50, 0.4));
    }
    50% {
        opacity: 0.9;
        transform: scale(1.12);
        filter: drop-shadow(0 0 12px rgba(255, 160, 40, 0.85));
    }
    100% {
        opacity: 0.4;
        transform: scale(0.98);
        filter: drop-shadow(0 0 5px rgba(255, 180, 50, 0.5));
    }
}

.palace-sacred-plaque:hover {
    transform: translate(-50%, -50%) scale(2.8);
    background: url('/images/palace_plaque_logo.png') no-repeat center center;
    background-size: contain;
    background-color: rgba(14, 5, 3, 0.96);
    border: 1.5px solid #ffdf78;
    box-shadow: 0 0 25px rgba(255, 130, 0, 0.95), 0 0 45px rgba(234, 179, 8, 0.7);
    z-index: 50;
    border-radius: 4px;
}

.hero-menu-overlay {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    background: rgba(14, 5, 3, 0.9);
    border: 1px solid #753b15;
    border-radius: 28px;
    padding: 5px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.hero-menu-item {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 18px;
    font-family: 'Cinzel', Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffdf78;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.hero-menu-item:hover, .hero-menu-item.active {
    background: linear-gradient(180deg, #992113 0%, #541107 100%) !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.6);
}

/* ========================================================
   KỲ TRÂN CÁC - TAB NHỎ CÓ NỀN RIÊNG TRÊN MENU CHÍNH
   ======================================================== */
.hero-menu-item.ktc-tab-btn {
    background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%) !important;
    border: 1.5px solid #fbbf24 !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #fffdf0 !important;
    text-shadow: 0 1px 2px #000, 0 0 8px rgba(251, 191, 36, 0.8) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.hero-menu-item.ktc-tab-btn:hover {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
    border-color: #fef08a !important;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.85) !important;
    transform: translateY(-2px) scale(1.05) !important;
    color: #fff !important;
}

.hero-menu-item.ktc-tab-btn.active {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%) !important;
    border-color: #ffdf78 !important;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.9) !important;
    color: #fff !important;
}





/* PORTAL 3-COLUMN GRID */
.portal-grid {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 12px;
    align-items: start;
}

/* BASE WUXIA BOX */
.wuxia-box {
    background: linear-gradient(180deg, #200b06 0%, #120402 100%);
    border: 1px solid #5a250d;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.box-title-center {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffdf78;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px #000;
}

/* ==================== LEFT COLUMN ==================== */
.login-box-portal {
    padding: 14px;
    margin-bottom: 12px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes loginBoxGlow {
    0% {
        box-shadow: 0 0 0 rgba(245, 158, 11, 0);
        border-color: #734a1c;
        transform: scale(1);
    }
    20% {
        box-shadow: 0 0 30px #f59e0b, 0 0 60px rgba(245, 158, 11, 0.8), inset 0 0 15px rgba(251, 191, 36, 0.5);
        border-color: #ffd05b;
        transform: scale(1.025);
    }
    40% {
        box-shadow: 0 0 15px #d97706, 0 0 30px rgba(217, 119, 6, 0.6);
        border-color: #f59e0b;
        transform: scale(1);
    }
    60% {
        box-shadow: 0 0 35px #fbbf24, 0 0 70px rgba(245, 158, 11, 0.9), inset 0 0 20px rgba(251, 191, 36, 0.6);
        border-color: #ffffff;
        transform: scale(1.025);
    }
    80% {
        box-shadow: 0 0 15px #d97706, 0 0 30px rgba(217, 119, 6, 0.5);
        border-color: #f59e0b;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 0 rgba(245, 158, 11, 0);
        border-color: #734a1c;
        transform: scale(1);
    }
}

.login-box-glowing {
    animation: loginBoxGlow 2.5s ease-in-out !important;
    position: relative;
    z-index: 100 !important;
}

.btn-ktc-login-prompt {
    width: 100%;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #ffdf78 !important;
    background: linear-gradient(180deg, #3d1b09 0%, #1f0b03 100%);
    border: 1px solid #b45309;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-ktc-login-prompt:hover {
    background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
    border-color: #ffd05b;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
    transform: translateY(-1px);
}

.login-box-portal .box-title-center {
    margin-bottom: 12px;
}

.field-wrap {
    margin-bottom: 8px;
}

.pass-wrap {
    position: relative;
}

.input-portal {
    width: 100%;
    background: #0a0302;
    border: 1px solid #451b0a;
    color: #ffdf78;
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-portal:focus {
    border-color: #ffdf78;
    background: #140503;
}

.input-portal::placeholder {
    color: #7d5b45;
    font-size: 11px;
}

.eye-toggle-btn {
    position: absolute;
    right: 8px;
    top: 6px;
    background: none;
    border: none;
    color: #7d5b45;
    cursor: pointer;
    font-size: 13px;
}

.login-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0 6px;
}

.btn-portal-crimson {
    background: linear-gradient(180deg, #9e2314 0%, #5c1006 100%);
    border: 1px solid #b83321;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 0;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-portal-crimson:hover {
    background: linear-gradient(180deg, #be2d1b 0%, #751508 100%);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.btn-portal-dark {
    background: linear-gradient(180deg, #38150c 0%, #1f0a05 100%);
    border: 1px solid #572110;
    color: #ffdf78 !important;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 0;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-portal-dark:hover {
    background: linear-gradient(180deg, #4d1d10 0%, #2a0e07 100%);
    border-color: #ffdf78;
}

.login-footer-links {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-top: 6px;
}

.foot-link {
    color: #9c785f;
    text-decoration: none;
}

.foot-link:hover {
    color: #ffdf78;
}

.user-logged-box {
    font-size: 12px;
}

.user-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(229, 185, 93, 0.2);
}

.vip-tag {
    background: #b45309;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.user-balance-list {
    margin-bottom: 10px;
}

.bal-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.user-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


/* LEADERBOARD SCROLL WIDGET (scroll_leaderboard.jpg) */
.leaderboard-scroll-container {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.scroll-bg-img {
    width: 100%;
    height: auto;
    display: block;
    filter: contrast(1.05);
}

.scroll-content-wrap {
    position: absolute;
    inset: 0;
    padding: 13.5% 8% 10% 8%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.scroll-title {
    text-align: center;
    font-family: 'Cinzel', 'Be Vietnam Pro', Georgia, serif;
    font-size: 16px;
    font-weight: 900;
    color: #4a1506;
    letter-spacing: 0.5px;
    margin-top: 2px;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

.scroll-table-header {
    display: grid;
    grid-template-columns: 26px 1fr 46px;
    font-size: 10px;
    font-weight: 800;
    color: #6a2a14;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(122, 62, 35, 0.35);
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.scroll-rows-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-grow: 1;
    justify-content: space-between;
}

.scroll-row-item {
    display: grid;
    grid-template-columns: 26px 1fr 46px;
    align-items: center;
    padding: 1px 0;
    border-bottom: 1px dashed rgba(122, 62, 35, 0.15);
}

.scroll-row-item:last-child {
    border-bottom: none;
}

.rank-circle {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
}

.rank-circle-1 { background: #d97706; color: #fff; box-shadow: 0 0 5px rgba(217, 119, 6, 0.7); }
.rank-circle-2 { background: #6b7280; color: #fff; }
.rank-circle-3 { background: #b45309; color: #fff; }
.rank-circle-4, .rank-circle-5, .rank-circle-6, 
.rank-circle-7, .rank-circle-8, .rank-circle-9, .rank-circle-10 { 
    background: #e2cca8; 
    color: #5c240d; 
}

.rank-char-name {
    color: #2b0e06;
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 3px;
}

.rank-char-lv {
    color: #5c1e0e;
    font-weight: 800;
    font-size: 11px;
    text-align: right;
}

.scroll-bottom-link {
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    margin-top: auto;
    padding-top: 4px;
}

.scroll-bottom-link a {
    color: #541d0c;
    text-decoration: none;
    background: rgba(255, 235, 175, 0.55);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(122, 62, 35, 0.35);
    display: inline-block;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.scroll-bottom-link a:hover {
    color: #a82315;
    background: rgba(255, 235, 175, 0.95);
    border-color: #a82315;
}

/* ==================== MIDDLE COLUMN ==================== */
.sub-nav-bar {
    background: linear-gradient(180deg, #1f0b06 0%, #100402 100%);
    border: 1px solid #54220c;
    border-radius: 4px;
    display: flex;
    justify-content: space-around;
    padding: 8px 10px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.sub-nav-item {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    color: #ffdf78;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 4px 10px;
    border-radius: 4px;
}

.sub-nav-item:hover, .sub-nav-item.active {
    color: #fff !important;
    background: rgba(185, 28, 28, 0.45);
    text-shadow: 0 0 8px rgba(255, 223, 120, 0.7);
}

.news-events-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.news-list-card {
    padding: 10px 12px;
    min-height: 165px;
    display: flex;
    flex-direction: column;
}

.badge-tag-row {
    margin-bottom: 8px;
}

.badge-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-tintuc { color: #60a5fa; }
.tag-sukien { color: #f59e0b; }
.tag-huongdan { color: #a3e635; }

.news-item-compact {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(229, 185, 93, 0.15);
}

.news-item-compact:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.news-title-txt {
    font-size: 12px;
    color: #ffdf78;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-title-txt:hover {
    color: #fff;
    text-decoration: underline;
}

.news-date-txt {
    font-size: 10px;
    color: #8c6f5a;
    margin-top: 2px;
}

.event-banner-card {
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-banner-link {
    display: block;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #57200d;
    text-decoration: none;
}

.event-banner-img {
    width: 100%;
    height: 112px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.event-banner-link:hover .event-banner-img {
    transform: scale(1.04);
}

.event-banner-label {
    background: #0f0402;
    color: #ffdf78;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 5px 0;
    font-family: Georgia, serif;
    letter-spacing: 1px;
}

/* 3 BOTTOM FEATURE TILES */
.bottom-three-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.feature-tile {
    padding: 8px 10px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    height: 130px;
    transition: all 0.25s ease;
}

.feature-tile:hover {
    border-color: #ffdf78;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 185, 93, 0.25);
}

.tile-visual-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.vs-glow-symbol {
    font-size: 28px;
    font-weight: 900;
    color: #ef4444;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.8), 0 0 20px rgba(239, 68, 68, 0.5);
    font-family: Impact, "Arial Black", sans-serif;
    letter-spacing: 1px;
}

.tile-thumb-img {
    width: 100%;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #4a1d0d;
}

.scroll-icon-symbol {
    font-size: 30px;
    filter: drop-shadow(0 0 8px rgba(229, 185, 93, 0.6));
}

.tile-bottom-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffdf78;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== RIGHT COLUMN ==================== */
.fire-download-banner-btn {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #8c2b18;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
    margin-bottom: 10px;
    transition: all 0.25s ease;
}

.fire-download-banner-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
}

.fire-download-img {
    width: 100%;
    height: auto;
    display: block;
}

.social-badge-card {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.social-badge-card:hover {
    border-color: #ffdf78;
    background: #250b05;
}

.social-badge-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #7d4416;
}

.social-badge-info {
    display: flex;
    flex-direction: column;
}

.social-title {
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    color: #ffdf78;
    letter-spacing: 1px;
}

.social-subtitle {
    font-size: 11px;
    color: #8c6f5a;
    letter-spacing: 1px;
}

.server-status-card {
    padding: 12px;
    font-size: 11px;
}

.status-live-line {
    color: #e5e7eb;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot-green {
    color: #22c55e;
    font-size: 12px;
    text-shadow: 0 0 6px #22c55e;
}

.status-ver-line {
    color: #9ca3af;
    margin-bottom: 10px;
}

.status-quick-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-status-btn {
    background: #0d0302;
    border: 1px solid #451b0a;
    border-radius: 3px;
    padding: 6px 8px;
    color: #ffdf78;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    display: block;
    transition: all 0.2s ease;
}

.quick-status-btn:hover {
    border-color: #ffdf78;
    background: #220803;
    color: #fff;
}

/* ==========================================================================
   DYNAMIC PORTAL TABS & INLINE PANELS (SPA ON HOMEPAGE)
   ========================================================================== */
.portal-tab-panel {
    display: none;
    animation: fadeInPanel 0.25s ease-in-out;
}

.portal-tab-panel.active {
    display: block;
}

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ADMIN CONTROLS INLINE ON HOMEPAGE */
.admin-inline-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: rgba(14, 5, 2, 0.95);
    border: 1px solid #734a1c;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 14px;
}

.admin-subtab-btn {
    background: #1c0a04;
    border: 1px solid #5a3516;
    color: #d1b89d;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.admin-subtab-btn:hover,
.admin-subtab-btn.active {
    background: linear-gradient(180deg, #991b1b, #7f1d1d);
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.admin-subtab-panel {
    display: none;
    animation: fadeInPanel 0.2s ease-in-out;
}

.admin-subtab-panel.active {
    display: block;
}

.btn-admin-special {
    display: block;
    background: linear-gradient(90deg, #991b1b, #d97706, #991b1b);
    background-size: 200% auto;
    color: #fff !important;
    text-align: center;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid #ffd05b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 6px;
}

.btn-admin-special:hover {
    background-position: right center;
    box-shadow: 0 0 18px rgba(255, 208, 91, 0.8);
    transform: scale(1.02);
}

.portal-msg-banner {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 12px;
}
.portal-msg-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    color: #86efac;
}
.portal-msg-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

/* ==========================================================================
   ADMIN ACTION CONTROLS & REORDER STYLES
   ========================================================================== */
.btn-order-move {
    background: #2a1107;
    border: 1px solid #734a1c;
    color: #ffdf78;
    padding: 2px 7px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 1px;
    transition: all 0.15s ease;
    line-height: 1.2;
}
.btn-order-move:hover {
    background: #54220c;
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.btn-order-del {
    background: #601007;
    border: 1px solid #991b1b;
    color: #fecaca;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 1px;
    transition: all 0.15s ease;
    font-weight: bold;
    line-height: 1.2;
}
.btn-order-del:hover {
    background: #991b1b;
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    position: relative;
}
.sortable-th:hover {
    background: #4a210b !important;
    color: #fff !important;
}

/* ADMIN SUBTABS REORDER BAR */
.admin-tab-item-wrap {
    display: inline-flex;
    align-items: center;
    background: rgba(20, 7, 3, 0.9);
    border: 1px solid #5a250d;
    border-radius: 4px;
    padding: 2px 4px;
    margin-right: 4px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    cursor: grab;
    user-select: none;
}
.admin-tab-item-wrap:active {
    cursor: grabbing;
}
.admin-tab-item-wrap.dragging {
    opacity: 0.45;
    transform: scale(0.96);
    border-style: dashed;
}
.admin-tab-item-wrap.drag-over {
    border: 2px dashed #ffd05b !important;
    background: rgba(245, 158, 11, 0.25) !important;
    transform: scale(1.03);
}
.admin-tab-item-wrap.active {
    border-color: #f59e0b;
    background: rgba(45, 16, 7, 0.95);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}
.admin-tab-item-wrap .admin-subtab-btn {
    border: none !important;
    background: transparent !important;
    padding: 4px 6px !important;
    cursor: pointer;
}
.admin-tab-controls {
    display: inline-flex;
    gap: 2px;
    margin-left: 2px;
    padding-left: 4px;
    border-left: 1px solid #4a210b;
}
.btn-tab-move {
    display: none !important;
}
.btn-order-edit {
    background: #1e3a5f;
    border: 1px solid #3b82f6;
    color: #93c5fd;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    margin: 0 2px;
    transition: all 0.2s;
}
.btn-order-edit:hover {
    background: #2563eb;
    color: #fff;
    border-color: #60a5fa;
}
.btn-tab-del {
    background: #450a0a;
    border: 1px solid #7f1d1d;
    color: #fca5a5;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 1;
}
.btn-tab-del:hover {
    background: #991b1b;
    color: #fff;
}

/* ==========================================================================
   FLOATING MESSENGER SUPPORT WIDGET (CHẠY THEO KHI CUỘN)
   ========================================================================== */
.floating-messenger-wrap {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.floating-messenger-btn {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0084ff 0%, #00c6ff 50%, #85180c 100%);
    box-shadow: 0 4px 20px rgba(0, 132, 255, 0.6), 0 0 15px rgba(245, 158, 11, 0.5);
    border: 2px solid #ffdf78;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-messenger-btn:hover {
    transform: scale(1.1) rotate(6deg);
    box-shadow: 0 6px 25px rgba(0, 132, 255, 0.85), 0 0 25px rgba(255, 223, 120, 0.8);
    color: #fff !important;
}

.pulse-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 223, 120, 0.7);
    animation: messengerPulse 2s infinite ease-out;
    pointer-events: none;
}

@keyframes messengerPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.floating-messenger-tooltip {
    background: rgba(18, 6, 3, 0.96);
    border: 1px solid #734a1c;
    border-radius: 20px;
    padding: 6px 14px;
    color: #ffdf78;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Be Vietnam Pro', sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    animation: tooltipFloat 3s infinite ease-in-out;
}

.tooltip-badge {
    background: #22c55e;
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

@keyframes tooltipFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ================= GM CHAT 24/7 MODAL ================= */
.gm-chat-box {
    position: fixed;
    bottom: 96px;
    right: 26px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    z-index: 999999;
    border-radius: 12px;
    border: 1.5px solid #d4af37;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.95), 0 0 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(rgba(14, 5, 3, 0.90), rgba(8, 2, 1, 0.95)), url('/images/bg_wuxia_hero.jpg') center top / cover no-repeat;
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: gmChatFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gmChatFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.gm-chat-header {
    background: linear-gradient(180deg, rgba(60, 20, 10, 0.96) 0%, rgba(25, 8, 4, 0.98) 100%);
    border-bottom: 1.5px solid #734a1c;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gm-avatar-crest {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid #f59e0b;
    overflow: visible;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.gm-avatar-crest img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.gm-online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #140502;
    border-radius: 50%;
    box-shadow: 0 0 6px #22c55e;
}

.gm-chat-title {
    font-family: 'Cinzel', serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffdf78;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px #000;
}

.gm-chat-sub {
    font-size: 11px;
    color: #c9ab8d;
    margin-top: 2px;
}

.gm-chat-btn-ctrl {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(229, 185, 93, 0.3);
    color: #ffd05b;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gm-chat-btn-ctrl:hover {
    background: #b91c1c;
    color: #fff;
    border-color: #ef4444;
}

.gm-chat-user-bar {
    background: rgba(20, 7, 3, 0.95);
    border-bottom: 1px dashed #543414;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}

.user-pill-tag {
    color: #ffdf78;
    font-weight: 600;
}

.vip-pill-tag {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #d97706;
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.xu-pill-tag {
    color: #4ade80;
    font-weight: 600;
    margin-left: auto;
}

.gm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gm-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.gm-chat-messages::-webkit-scrollbar-thumb {
    background: #734a1c;
    border-radius: 4px;
}

.chat-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 86%;
}

.chat-msg-row.gm-row {
    align-self: flex-start;
}

.chat-msg-row.user-row {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.chat-bubble.gm-bubble {
    background: rgba(28, 11, 6, 0.92);
    border: 1px solid #8c5a1f;
    color: #f5e6cf;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.chat-bubble.user-bubble {
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
    border: 1px solid #f59e0b;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(185, 28, 28, 0.4);
}

.bubble-header {
    font-size: 11px;
    font-weight: bold;
    color: #ffdf78;
    margin-bottom: 4px;
}

.bubble-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    text-align: right;
}

.gm-chat-footer {
    background: rgba(20, 7, 3, 0.98);
    border-top: 1px solid #734a1c;
    padding: 10px 12px;
}

.gm-input-field {
    flex: 1;
    background: rgba(10, 3, 2, 0.9);
    border: 1px solid #8c5a1f;
    border-radius: 20px;
    padding: 8px 14px;
    color: #fff;
    font-size: 12.5px;
    outline: none;
    transition: all 0.2s;
}

.gm-input-field:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.gm-btn-send {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: 1px solid #f59e0b;
    color: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.gm-btn-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.gm-auth-lock-card {
    text-align: center;
    background: rgba(22, 8, 4, 0.92);
    border: 1px dashed #a16207;
    border-radius: 8px;
    padding: 24px 18px;
    width: 100%;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE & IPHONE 15 PRO MAX RESPONSIVE SUITE
   Fully responsive across PC & Mobile, tailored specifically for iPhone 15 Pro Max
   (Viewport width 430px, Dynamic Island safe area, and iOS Home bar)
   ========================================================================== */

@media (max-width: 960px) {
    /* 1. Global Containers & Body */
    .exact-portal-container {
        padding: 0 8px !important;
        margin: 8px auto 25px !important;
    }

    .page-wrapper {
        margin: 10px auto !important;
        padding: 0 8px !important;
    }

    /* 2. Seamless Column Reordering:
       Login / Account Profile & Admin button (order 1)
       Content Area with News, KTC Shop, Admin 9 Tabs (order 2)
       Download & Social Links (order 3)
       Leaderboard Scroll (order 4)
    */
    .portal-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }

    .col-left {
        display: contents !important;
    }

    .login-box-portal {
        order: 1 !important;
        width: 100% !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
    }

    .col-middle {
        order: 2 !important;
        width: 100% !important;
    }

    .col-right {
        order: 3 !important;
        width: 100% !important;
    }

    .leaderboard-scroll-container {
        order: 4 !important;
        width: 100% !important;
        max-width: 430px !important;
        margin: 8px auto 0 !important;
    }

    /* 3. Top Hero Banner & 5 Menu Buttons */
    .top-hero-frame {
        border-radius: 6px !important;
        margin-bottom: 10px !important;
    }

    .hero-menu-overlay {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin: 8px 0 0 0 !important;
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 6px !important;
        padding: 6px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }

    .hero-menu-item {
        grid-column: span 2 !important;
        padding: 10px 4px !important;
        font-size: 11px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: normal !important;
        border-radius: 4px !important;
        touch-action: manipulation;
    }

    .hero-menu-item:nth-child(4),
    .hero-menu-item:nth-child(5) {
        grid-column: span 3 !important;
    }

    /* 4. Sub-Navigation Bar */
    .sub-nav-bar {
        display: flex !important;
        gap: 4px !important;
        padding: 6px !important;
    }

    .sub-nav-item {
        flex: 1 !important;
        text-align: center !important;
        padding: 8px 4px !important;
        font-size: 11px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation;
    }

    /* 5. Mobile Inputs & Forms (Prevent iOS Safari auto-zoom by using 16px font) */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="url"],
    input[type="datetime-local"],
    select,
    textarea,
    .wuxia-input,
    .input-portal,
    .form-control {
        font-size: 16px !important;
        min-height: 42px;
        box-sizing: border-box;
    }

    ::placeholder {
        font-size: 13px !important;
    }

    .login-buttons-row button,
    .user-action-btns button {
        min-height: 44px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation;
    }

    .btn-admin-special {
        min-height: 48px !important;
        font-size: 12px !important;
        padding: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-top: 10px !important;
        touch-action: manipulation;
    }

    /* 6. Admin 9 Subtabs - Horizontal Swipe Carousel on Mobile */
    .admin-inline-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        gap: 8px !important;
        padding: 6px 6px 12px 6px !important;
        border-radius: 8px !important;
        touch-action: pan-x !important;
        scrollbar-width: thin;
        scrollbar-color: #b45309 #180b06;
    }

    .admin-inline-nav::-webkit-scrollbar {
        height: 6px;
    }

    .admin-inline-nav::-webkit-scrollbar-track {
        background: #180b06;
        border-radius: 3px;
    }

    .admin-inline-nav::-webkit-scrollbar-thumb {
        background: #b45309;
        border-radius: 3px;
    }

    .admin-tab-item-wrap {
        flex: 0 0 auto !important;
        scroll-snap-align: start !important;
        white-space: nowrap !important;
        margin: 0 !important;
        min-height: 42px !important;
        padding: 4px 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        touch-action: manipulation;
    }

    .admin-subtab-btn {
        font-size: 12px !important;
        white-space: nowrap !important;
        padding: 6px 8px !important;
    }

    /* 7. Admin Forms - Single Column Vertical Touch Stack on Mobile */
    .admin-form-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .admin-form-grid button[type="submit"] {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        touch-action: manipulation;
    }

    /* 8. Admin Tables - Smooth Touch Scroll & Large Touch Action Buttons */
    .admin-table-wrap {
        max-height: 280px !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid #381a0b !important;
        border-radius: 4px !important;
        margin-bottom: 8px !important;
    }

    .admin-table-wrap table {
        min-width: 580px !important;
    }

    #table-admin-revokexu {
        min-width: 680px !important;
    }

    .btn-order-move,
    .btn-order-edit,
    .btn-order-del,
    .btn-wuxia-red {
        padding: 6px 10px !important;
        font-size: 12px !important;
        min-height: 32px !important;
        touch-action: manipulation;
    }

    /* 9. Admin Modals - Centered Full-Mobile Card */
    .admin-modal-card {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 16px !important;
        margin: 10px !important;
        box-sizing: border-box !important;
    }

    .admin-modal-row-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* 10. KTC Icon Picker Dropdown as Centered Mobile Modal */
    #ktcIconPickerDropdown,
    #editKtcIconPickerDropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 92vw !important;
        max-width: 390px !important;
        max-height: 85vh !important;
        z-index: 999999 !important;
        box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.8), 0 12px 35px rgba(0, 0, 0, 0.95) !important;
        border: 2px solid #b45309 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }

    #ktcIconsListContainer,
    #editKtcIconsContainer {
        grid-template-columns: repeat(4, 1fr) !important;
        max-height: 240px !important;
    }

    /* 11. Floating Messenger Support Widget with iOS Safe Area */
    .floating-messenger-tooltip {
        display: none !important;
    }

    .floating-messenger-wrap {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        right: 14px !important;
        z-index: 99999 !important;
    }

    .floating-messenger-btn {
        width: 50px !important;
        height: 50px !important;
    }

    /* 12. Main Header for Inner Pages */
    .header-container {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 12px 10px !important;
        min-height: auto !important;
    }

    .nav-menu {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    .nav-link {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 38px;
    }

    .user-widget-bar {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   SPECIFIC REFINEMENTS FOR IPHONE 15 PRO MAX & SMALL VIEWPORTS (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
    /* KTC Shop: 2 Clean Columns on 430px screen width */
    #portal-tab-ktc [style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Feature Tiles: 3 Columns with balanced font sizes */
    .bottom-three-tiles {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .feature-tile {
        height: 110px !important;
        padding: 6px 4px !important;
    }

    .vs-glow-symbol {
        font-size: 20px !important;
    }

    .scroll-icon-symbol {
        font-size: 22px !important;
    }

    .tile-bottom-title {
        font-size: 10px !important;
    }

    /* News card titles */
    .latest-news-content-box h3 {
        font-size: 14px !important;
    }

    .latest-news-text {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
}