/* ===================================
   CỔ TIÊN KỶ - UI Component Styles
   HD Xianxia Watercolor Remaster
   =================================== */

/* ===================================
   PANELS & MODALS
   =================================== */
.game-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg);
    z-index: 30;
    max-width: 90vw;
    max-height: min(85vh, calc(100dvh - 24px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: panelFadeIn 0.25s ease-out;
    isolation: isolate;
}

/* Corner ornaments on panels */
.game-panel::before,
.game-panel::after {
    content: '◆';
    position: absolute;
    font-size: 0.45rem;
    color: var(--accent-gold);
    opacity: 0.35;
    pointer-events: none;
}
.game-panel::before { top: 8px; left: 10px; }
.game-panel::after { bottom: 8px; right: 10px; }

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(246, 201, 78, 0.08);
    background: rgba(0, 0, 0, 0.25);
    position: relative;
}

/* Header bottom gold line */
.panel-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(246, 201, 78, 0.25), transparent);
}

.panel-title {
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-gold);
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(246, 201, 78, 0.15);
}

.panel-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    transform: scale(1.1);
}

.panel-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Custom scrollbar */
.panel-body::-webkit-scrollbar,
.window-body::-webkit-scrollbar {
    width: 4px;
}
.panel-body::-webkit-scrollbar-track,
.window-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}
.panel-body::-webkit-scrollbar-thumb,
.window-body::-webkit-scrollbar-thumb {
    background: rgba(246, 201, 78, 0.2);
    border-radius: 2px;
}
.panel-body::-webkit-scrollbar-thumb:hover,
.window-body::-webkit-scrollbar-thumb:hover {
    background: rgba(246, 201, 78, 0.4);
}

.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 25;
    animation: overlayFadeIn 0.2s ease-out;
}

/* ===================================
   INVENTORY UI
   =================================== */
.inventory-panel {
    width: 480px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

@media (min-width: 1920px) {
    .inventory-panel {
        width: 1280px;
        max-height: 85vh;
    }
}

/* Standard desktop (1200-1919px) */
@media (min-width: 1200px) and (max-width: 1919px) {
    .inventory-panel {
        width: 1100px;
        max-height: 80vh;
    }
}

/* Laptop/Desktop compact (900-1199px) */
@media (min-width: 900px) and (max-width: 1199px) {
    .inventory-panel {
        width: 960px;
        max-height: 75vh;
    }
}

/* Large tablet (768-899px) */
@media (min-width: 768px) and (max-width: 899px) {
    .inventory-panel {
        width: 880px;
        max-height: 72vh;
    }
}

/* Mobile & small tablets (<768px) - full width */
@media (max-width: 767px) {
    .inventory-panel {
        width: calc(100vw - 12px) !important;
        max-height: 75vh;
    }
}

/* ===================================
   REMASTERED XIANXIA ITEM & EQUIP SLOTS
   =================================== */
.inv-slot {
    aspect-ratio: 1;
    background: radial-gradient(circle at 50% 30%, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
    border: 1.5px solid rgba(251, 191, 36, 0.25) !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    font-size: 1.5rem !important;
    overflow: visible !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.inv-slot::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 6px;
    background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.inv-slot:hover {
    border-color: #fbbf24 !important;
    background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.4), rgba(15, 23, 42, 0.95)) !important;
    transform: translateY(-3px) scale(1.08) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(251, 191, 36, 0.4) !important;
    z-index: 10;
}

.inv-slot.equipped {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.2) !important;
}

.inv-slot .item-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #0f172a !important;
    border: 1px solid #fbbf24 !important;
    color: #fef08a !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
    padding: 0px 4px !important;
    border-radius: 4px !important;
    line-height: 1.2 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    pointer-events: none;
}

/* Rarity borders with rich glows */
.inv-slot.rarity-common { border-color: rgba(148, 163, 184, 0.5) !important; }
.inv-slot.rarity-uncommon { border-color: #22c55e !important; box-shadow: 0 0 10px rgba(34, 197, 94, 0.35) !important; }
.inv-slot.rarity-rare { border-color: #38bdf8 !important; box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important; }
.inv-slot.rarity-epic { border-color: #c084fc !important; box-shadow: 0 0 14px rgba(192, 132, 252, 0.5) !important; }
.inv-slot.rarity-legendary {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.75) !important;
    animation: auraPulse 2.5s ease-in-out infinite alternate !important;
}

/* Equipment Mannequin Slot Box Remaster */
.equip-slot-box {
    position: absolute;
    width: 60px !important;
    height: 60px !important;
    border: 1.5px solid rgba(251, 191, 36, 0.35) !important;
    border-radius: 10px !important;
    background: radial-gradient(circle at 50% 30%, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4) !important;
    z-index: 2;
}

.equip-slot-box:hover {
    border-color: #fbbf24 !important;
    background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.45), rgba(15, 23, 42, 0.95)) !important;
    transform: scale(1.1) translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 16px rgba(251, 191, 36, 0.5) !important;
    z-index: 10;
}

.equip-slot-box.rarity-uncommon { border-color: #22c55e !important; box-shadow: 0 0 10px rgba(34, 197, 94, 0.4) !important; }
.equip-slot-box.rarity-rare     { border-color: #38bdf8 !important; box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important; }
.equip-slot-box.rarity-epic     { border-color: #c084fc !important; box-shadow: 0 0 14px rgba(192, 132, 252, 0.55) !important; }
.equip-slot-box.rarity-legendary{ border-color: #fbbf24 !important; box-shadow: 0 0 18px rgba(251, 191, 36, 0.8) !important; animation: auraPulse 2.5s infinite alternate !important; }

.equip-slot-icon {
    font-size: 1.6rem !important;
    line-height: 1 !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.equip-slot-label {
    font-size: 0.58rem !important;
    color: #e2e8f0 !important;
    margin-top: 3px !important;
    text-align: center;
    max-width: 54px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* ===================================
   TOOLTIP
   =================================== */
.tooltip {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    max-width: 280px;
    z-index: 100;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease-out;
}

.tooltip-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    text-shadow: 0 0 6px rgba(246, 201, 78, 0.15);
}

.tooltip-type {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.tooltip-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 8px;
}

.tooltip-stats {
    border-top: 1px solid rgba(246, 201, 78, 0.08);
    padding-top: 8px;
}

.tooltip-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 3px 0;
}

.tooltip-stat .stat-value {
    color: var(--moc-color);
    font-weight: 700;
}

.tooltip-stat .stat-value.negative {
    color: var(--luc-color);
}

/* ===================================
   BEAST PANEL
   =================================== */
.beast-panel {
    width: 600px;
}

.beast-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(246, 201, 78, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.beast-tab {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-main);
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
}

.beast-tab:hover { color: var(--text-primary); }
.beast-tab.active {
    color: var(--text-gold);
    border-bottom-color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(246, 201, 78, 0.2);
}

.beast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.beast-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.beast-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.beast-card .beast-sprite {
    font-size: 2.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.beast-card .beast-name {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.beast-card .beast-level {
    font-size: 0.7rem;
    color: var(--text-gold);
    text-shadow: 0 0 6px rgba(246, 201, 78, 0.15);
}

/* ===================================
   QUEST LOG
   =================================== */
.quest-panel {
    top: 82px;
    right: 14px;
    bottom: 92px;
    left: auto;
    width: min(340px, calc(100vw - 28px));
    max-width: none;
    max-height: none;
    transform: none;
    border-radius: 12px 4px 12px 4px;
    background: rgba(10, 14, 24, 0.93);
    box-shadow: -12px 16px 42px rgba(0, 0, 0, 0.42);
    animation: questPanelFadeIn 0.25s ease-out;
}

@keyframes questPanelFadeIn {
    from { opacity: 0; transform: translateX(18px) scale(0.97); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: none; }
}

.panel-overlay-quests {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
}

.quest-panel .panel-body {
    padding: 10px 12px;
}

.quest-completed-list summary {
    padding: 8px 10px;
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: 6px;
    color: #86efac;
    font-size: 0.76rem;
    cursor: pointer;
    background: rgba(34, 197, 94, 0.05);
}

@media (max-width: 700px) {
    .game-panel:not(.quest-panel) {
        width: calc(100vw - 12px) !important;
        max-width: calc(100vw - 12px);
        max-height: calc(100dvh - 16px);
        border-radius: 10px;
    }

    .inventory-panel .panel-body {
        grid-template-columns: 1fr !important;
        overflow-y: auto;
    }

    .quest-panel {
        top: auto;
        right: 6px;
        bottom: 82px;
        left: 6px;
        width: auto;
        height: min(40dvh, 360px);
    }
}

.quest-item {
    padding: 9px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.quest-item:hover {
    border-color: var(--border-gold);
    background: rgba(246, 201, 78, 0.02);
}

.quest-item.active {
    border-color: var(--accent-gold);
    background: rgba(246, 201, 78, 0.04);
}

/* Active quest golden line */
.quest-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-gold), transparent);
}

.quest-item.completed {
    opacity: 0.5;
    border-color: rgba(34, 197, 94, 0.2);
}

.quest-title {
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quest-type {
    font-size: 0.58rem;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.quest-type.main {
    background: rgba(246, 201, 78, 0.15);
    color: var(--text-gold);
    border: 1px solid rgba(246, 201, 78, 0.2);
}

.quest-type.side {
    background: rgba(167, 139, 250, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(167, 139, 250, 0.15);
}

.quest-desc {
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.quest-progress {
    margin-top: 5px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), #f59e0b);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 4px rgba(246, 201, 78, 0.3);
}

/* ===================================
   CULTIVATION PANEL
   =================================== */
.cultivation-display {
    text-align: center;
    padding: 24px;
}

.cult-realm {
    font-family: var(--font-title);
    font-size: 1.7rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fde68a, #f6c94e, #d97706);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: shimmerGold 4s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(246, 201, 78, 0.2));
}

.cult-sublevel {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.cult-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(246, 201, 78, 0.08);
}

.cult-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-gold));
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.3);
}

.cult-chance {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cult-chance strong {
    color: var(--text-gold);
    text-shadow: 0 0 8px rgba(246, 201, 78, 0.2);
}

.cult-btn {
    margin-top: 22px;
    padding: 14px 44px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(167, 139, 250, 0.3));
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-main);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.cult-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(246, 201, 78, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.cult-btn:hover::before { opacity: 1; }

.cult-btn:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.cult-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   COMBAT FLOATING TEXT
   =================================== */
.damage-text {
    position: fixed;
    font-weight: 800;
    font-size: 1.2rem;
    color: #ef4444;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 20;
    animation: damageFloat 1s ease-out forwards;
}

.damage-text.heal {
    color: #4ade80;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3), 0 2px 4px rgba(0,0,0,0.8);
}

.damage-text.crit {
    font-size: 1.7rem;
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(246, 201, 78, 0.4), 0 2px 4px rgba(0,0,0,0.9);
    animation: critFloat 1.2s ease-out forwards;
}

.damage-text.miss {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1rem;
}

/* ===================================
   SETTINGS PANEL
   =================================== */
.settings-panel {
    width: 400px;
}

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

.setting-label {
    font-size: 0.88rem;
}

.setting-toggle {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.setting-toggle.active {
    background: rgba(167, 139, 250, 0.4);
    border-color: var(--primary-light);
}

.setting-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.setting-toggle.active::after {
    transform: translateX(20px);
}

.setting-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    border: 2px solid rgba(246, 201, 78, 0.6);
    box-shadow: 0 0 6px rgba(246, 201, 78, 0.2);
}

/* ===================================
   IN-GAME MENU
   =================================== */
.ig-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    padding: 28px;
    z-index: 30;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    min-width: 280px;
    box-shadow: var(--shadow-lg);
}

.ig-menu h3 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-gold);
    letter-spacing: 1px;
}

.ig-menu .menu-btn {
    width: 100%;
    margin-bottom: 8px;
    justify-content: center;
}

/* ===================================
   INTERACTION PROMPT & PREMIUM EFFECTS
   =================================== */
.interaction-prompt {
    position: fixed;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-glass);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 15;
    pointer-events: none;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: promptPulse 1.8s infinite alternate;
}

.prompt-key {
    background: linear-gradient(135deg, var(--accent-gold), #d97706);
    color: #111;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.78rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.prompt-text {
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.skill-slot.on-cooldown {
    filter: brightness(0.65) saturate(0.8);
}

.skill-cooldown.active {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #ef4444;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Tooltip premium adjustments */
#game-tooltip {
    transition: opacity 0.15s ease-out;
}

#game-tooltip.hidden {
    display: none !important;
}

.mobile-action-buttons {
    position: relative;
}

.action-btn.interact-btn {
    position: absolute;
    top: -65px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, rgba(16, 185, 129, 0.25) 100%);
    border: 2px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
    animation: interactBtnPulse 1.8s infinite alternate;
}

/* ===================================
   ADMIN GM PANEL STYLES
   =================================== */
.admin-tab {
    padding: 8px 13px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font-main);
}

.admin-tab.active {
    color: var(--text-gold);
    border-bottom-color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(246, 201, 78, 0.2);
}

.admin-btn {
    padding: 10px 14px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: var(--font-main);
}

.admin-btn:hover {
    background: rgba(167, 139, 250, 0.35);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
}

.admin-btn.primary {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(219, 39, 119, 0.4));
    border-color: var(--accent-rose);
    font-weight: 700;
}

.admin-tab-content.hidden {
    display: none !important;
}

/* ===================================
   HUD HOTKEYS & KEYCAP GUIDES
   =================================== */
.hud-btn {
    position: relative !important;
}

.hud-keycap {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #0f172a;
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0px 3px;
    border-radius: 3px;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none;
}

.hud-hotkeys-bar {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 95vw;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 20px;
    padding: 4px 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    transition: all 0.3s ease;
}

.hk-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-family: var(--font-main);
    white-space: nowrap;
}

.hk-key {
    background: #1e293b;
    border: 1px solid #fbbf24;
    color: #fbbf24;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hk-label {
    color: #e2e8f0;
    font-weight: 500;
}

/* Online room panel */
.online-hud-btn {
    min-width: 62px;
    color: #67e8f9;
    border-color: rgba(34, 211, 238, 0.65) !important;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.94), rgba(13, 148, 136, 0.72)) !important;
    font: 700 0.68rem Georgia, serif;
}
.online-hud-btn span { color: #fef08a; font-size: 0.58rem; }
.chat-hud-btn {
    min-width: 62px;
    color: #d9f99d;
    border-color: rgba(132, 204, 22, 0.6) !important;
    background: linear-gradient(135deg, rgba(54, 83, 20, 0.92), rgba(21, 94, 117, 0.72)) !important;
    font: 700 0.68rem Georgia, serif;
}
.chat-hud-btn span {
    display: none;
    min-width: 16px;
    height: 16px;
    margin-left: 3px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff7ed;
    font: 800 0.58rem/16px Arial, sans-serif;
}
.chat-hud-btn.has-unread span { display: inline-block; }
.trade-hud-btn {
    min-width: 62px;
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.65) !important;
    background: linear-gradient(135deg, rgba(92, 47, 6, 0.94), rgba(24, 24, 27, 0.78)) !important;
    font: 700 0.68rem Georgia, serif;
}
.family-hud-btn {
    min-width: 62px;
    color: #bae6fd;
    border-color: rgba(14, 165, 233, 0.65) !important;
    background: linear-gradient(135deg, rgba(12, 74, 110, 0.94), rgba(20, 83, 45, 0.72)) !important;
    font: 700 0.68rem Georgia, serif;
}
.online-panel {
    position: fixed;
    z-index: 8000;
    top: 78px;
    right: 18px;
    width: min(360px, calc(100vw - 24px));
    padding: 18px;
    color: #ecfeff;
    border: 1px solid rgba(103, 232, 249, 0.55);
    border-radius: 14px;
    background: radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.24), transparent 42%), linear-gradient(145deg, rgba(8, 20, 35, 0.98), rgba(10, 37, 46, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), inset 0 0 35px rgba(34, 211, 238, 0.05);
}
.online-panel.hidden { display: none !important; }
.online-panel-head { display: flex; align-items: flex-start; justify-content: space-between; }
.online-panel-head small { color: #67e8f9; letter-spacing: 0.16em; font: 700 0.6rem Georgia, serif; }
.online-panel-head h2 { margin: 4px 0 14px; color: #fef3c7; font: 700 1.45rem Georgia, serif; }
.online-panel-head > button { width: 30px; height: 30px; border-radius: 50%; color: #a5f3fc; border: 1px solid #155e75; background: #082f49; cursor: pointer; }
.online-room-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 13px 15px; border: 1px solid rgba(251, 191, 36, 0.35); border-radius: 10px; background: rgba(15, 23, 42, 0.72); }
.online-room-card span { color: #94a3b8; font-size: 0.62rem; letter-spacing: 0.14em; }
.online-room-card strong { grid-row: span 2; color: #facc15; font: 800 1.3rem Consolas, monospace; letter-spacing: 0.12em; }
.online-room-card em { color: #a5f3fc; font-size: 0.72rem; font-style: normal; }
.online-actions { display: grid; gap: 9px; margin-top: 12px; }
.online-actions button, .online-actions input { min-height: 38px; border-radius: 8px; font: 700 0.78rem Georgia, serif; }
.online-actions button { color: #ecfeff; border: 1px solid #0e7490; background: linear-gradient(135deg, #155e75, #0f766e); cursor: pointer; }
.online-actions button:disabled { opacity: 0.4; cursor: default; }
.online-actions button.danger { border-color: #9f1239; background: rgba(136, 19, 55, 0.55); }
.online-join-row { display: grid; grid-template-columns: 1fr 106px; gap: 8px; }
.online-join-row input { min-width: 0; padding: 0 12px; color: #fef3c7; border: 1px solid #155e75; outline: none; background: rgba(2, 6, 23, 0.72); text-transform: uppercase; letter-spacing: 0.12em; }
.online-note { margin: 13px 0 9px; color: #94a3b8; font-size: 0.69rem; line-height: 1.5; }
.online-connection { display: flex; align-items: center; gap: 7px; color: #a5f3fc; font-size: 0.68rem; }
.online-connection i { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 9px #22d3ee; }
.chat-panel {
    position: fixed;
    z-index: 8001;
    right: 18px;
    bottom: 132px;
    width: min(360px, calc(100vw - 24px));
    padding: 14px;
    color: #ecfeff;
    border: 1px solid rgba(163, 230, 53, 0.48);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(9, 22, 20, 0.98), rgba(20, 31, 44, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62), inset 0 0 32px rgba(132, 204, 22, 0.04);
}
.chat-panel.hidden { display: none !important; }
.chat-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.chat-panel-head small { color: #bef264; letter-spacing: 0.16em; font: 700 0.6rem Georgia, serif; }
.chat-panel-head h2 { margin: 3px 0 0; color: #fef3c7; font: 700 1.2rem Georgia, serif; }
.chat-panel-head > button { width: 28px; height: 28px; border-radius: 50%; color: #d9f99d; border: 1px solid #3f6212; background: #1a2e05; cursor: pointer; }
.chat-messages {
    height: 220px;
    overflow-y: auto;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.52);
    scrollbar-width: thin;
}
.chat-empty {
    color: #94a3b8;
    font-size: 0.72rem;
    text-align: center;
    padding-top: 74px;
}
.chat-message {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-message:last-child { border-bottom: 0; }
.chat-name {
    min-width: 0;
    overflow: hidden;
    color: #bef264;
    font: 800 0.72rem Arial, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-time { color: #64748b; font-size: 0.62rem; }
.chat-text {
    grid-column: 1 / -1;
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    user-select: text;
}
.chat-form {
    display: grid;
    grid-template-columns: 1fr 68px;
    gap: 8px;
    margin-top: 10px;
}
.chat-form input,
.chat-form button {
    min-height: 36px;
    border-radius: 8px;
    font: 700 0.78rem Georgia, serif;
}
.chat-form input {
    min-width: 0;
    padding: 0 10px;
    color: #f8fafc;
    border: 1px solid #365314;
    outline: none;
    background: rgba(2, 6, 23, 0.74);
}
.chat-form input:focus { border-color: #a3e635; box-shadow: 0 0 0 2px rgba(163, 230, 53, 0.12); }
.chat-form button {
    color: #f7fee7;
    border: 1px solid #4d7c0f;
    background: linear-gradient(135deg, #3f6212, #0f766e);
    cursor: pointer;
}
.chat-form button:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 700px) {
    .online-panel { top: 62px; right: 6px; width: calc(100vw - 12px); max-height: calc(100dvh - 70px); overflow-y: auto; }
    .online-hud-btn { min-width: 48px; padding-inline: 4px !important; }
    .chat-hud-btn { min-width: 48px; padding-inline: 4px !important; }
    .trade-hud-btn { min-width: 48px; padding-inline: 4px !important; }
    .family-hud-btn { min-width: 48px; padding-inline: 4px !important; }
    .chat-panel { right: 6px; bottom: 92px; width: calc(100vw - 12px); }
    .chat-messages { height: min(220px, 42dvh); }
}

/* ===================================
   DISCORD
   =================================== */
.discord-ic {
    display: inline-flex;
    vertical-align: middle;
    filter: drop-shadow(0 0 4px rgba(88, 101, 242, 0.45));
}

/* Small floating logo, flush to screen edge (main menu only) */
.discord-fab {
    --glow: 88, 101, 242;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5865f2;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    animation: fabPulse 3s ease-in-out infinite;
}
.discord-fab .discord-ic {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
}
.discord-fab:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 10px 26px rgba(88, 101, 242, 0.75);
}
.discord-fab:active { transform: scale(0.95); }

/* Các nút mạng xã hội xếp cạnh nút Discord chính. Mặc định (điện thoại): cột dọc.
   Màn hình ≥768px (máy tính): hàng ngang. Tất cả có hiệu ứng phát sáng. */
.social-fab {
    --glow: 88, 101, 242;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    animation: fabPulse 3s ease-in-out infinite;
}
.social-fab svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
    display: block;
}
.social-fab:hover {
    transform: translateY(-2px) scale(1.08);
}
.social-fab:active { transform: scale(0.95); }
.social-fab.discord-alt {
    --glow: 34, 197, 94;
    bottom: 66px;
    background: linear-gradient(135deg, #22c55e, #15803d);
}
.social-fab.facebook {
    --glow: 24, 119, 242;
    bottom: 118px;
    background: linear-gradient(135deg, #1877f2, #0a58ca);
}
.social-fab.tiktok {
    --glow: 254, 44, 85;
    bottom: 170px;
    background: linear-gradient(135deg, #010101, #161823);
    border-color: rgba(254, 44, 85, 0.35);
}

/* Hiệu ứng phát sáng nhấp nháy theo màu từng nút */
@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35),
            0 0 6px 2px rgba(var(--glow), 0.55),
            0 0 18px 8px rgba(var(--glow), 0.18);
    }
    50% {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35),
            0 0 14px 6px rgba(var(--glow), 0.9),
            0 0 30px 14px rgba(var(--glow), 0.32);
    }
}

/* Máy tính: dàn 3 nút thành hàng ngang góc phải-dưới */
@media (min-width: 768px) {
    .discord-fab { right: 14px; bottom: 14px; }
    .social-fab.discord-alt { right: 66px; bottom: 14px; }
    .social-fab.facebook { right: 118px; bottom: 14px; }
    .social-fab.tiktok { right: 170px; bottom: 14px; }
}

a.discord-quick {
    color: #94a3b8;
}
a.discord-quick:hover {
    background: rgba(88, 101, 242, 0.18);
    border-color: rgba(88, 101, 242, 0.55);
    color: #c7d2fe;
}
