body {
    box-sizing: border-box;
}

/* --- ADMIN PANEL STYLING (NEW) --- */

/* Modal Container */
.admin-panel-container {
    background: linear-gradient(145deg, rgba(20, 10, 30, 0.95), rgba(40, 20, 50, 0.95));
    border: 1px solid rgba(255, 107, 53, 0.2);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* Header & Search */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-box {
    position: relative;
    width: 300px;
}
.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px 10px 40px;
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.search-box input:focus {
    border-color: #ff6b35;
    background: rgba(0, 0, 0, 0.6);
    outline: none;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Styled Table */
.table-wrapper {
    overflow-y: auto;
    max-height: 60vh;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.styled-table thead th {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 15px;
    text-align: left;
    position: sticky;
    top: 0;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.styled-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.styled-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.styled-table td {
    padding: 12px 15px;
    color: #d1d5db;
    vertical-align: middle;
}

/* User Info Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-cell img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: #000;
}
.user-info h4 { margin: 0; color: white; font-weight: 600; font-size: 0.95rem; }
.user-info span { font-size: 0.75rem; color: #9ca3af; }

/* Custom Select Dropdown */
.role-select-wrapper {
    position: relative;
    width: 120px;
}
.role-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(75, 85, 99, 0.5);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    appearance: none; /* Xóa mũi tên mặc định */
    transition: border 0.2s;
}
.role-select:focus { border-color: #ff6b35; }
.role-select:hover { border-color: #9ca3af; }

/* Custom Scrollbar for Table */
.table-wrapper::-webkit-scrollbar { width: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.table-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 107, 53, 0.3); border-radius: 10px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255, 107, 53, 0.6); }

@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Các item trong menu */
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9rem;
    transition: background 0.2s;
    background: transparent;
    width: 100%;
    text-align: left;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.menu-item.logout { color: #ef4444; }
.menu-item.logout:hover { background: rgba(239, 68, 68, 0.1); }

/* Table Quản lý User */
.user-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.user-table th { text-align: left; color: #ff6b35; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; }
.user-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; color: #d1d5db; }
.role-select { 
    background: rgba(0,0,0,0.5); color: white; border: 1px solid #4b5563; 
    padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; cursor: pointer;
}
.role-select:focus { border-color: #ff6b35; outline: none; }

.halloween-bg, .christmas-bg {
    /* Xanh Đen (Bầu trời đêm) -> Xanh Than (Núi đá) -> Xanh Ngọc Đậm (Băng giá) */
    background: linear-gradient(135deg, #020024 0%, #09203f 50%, #004e92 100%);
    background-attachment: fixed;
}

/* KẾT HỢP: Giữ nguyên nút màu Cam/Vàng của bạn, nó sẽ cực kỳ nổi trên nền xanh này */
.corn-gradient {
    background: linear-gradient(135deg, #ea580c 0%, #facc15 50%, #ffe066 100%);
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.2); 
    color: #3f1d0b; /* Chữ màu nâu đậm */
}

/* Chữ Corn-text cũng đổi sang màu cực quang cho đồng bộ */
.corn-text {
    background: linear-gradient(135deg, #00f260, #0575e6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(0, 242, 96, 0.5));
}

/* Sửa lại card Halloween thành card Christmas (Kính mờ + viền đỏ/xanh) */
.halloween-card {
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.2), rgba(185, 28, 28, 0.1));
    border: 1px solid rgba(22, 163, 74, 0.3);
    position: relative;
    overflow: hidden;
}

/* Hiệu ứng tuyết phủ lên card (Tuỳ chọn) */
.halloween-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.7);
    box-shadow: 0 0 10px white;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(255, 107, 53, 0.3);
}

.nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ffcc02);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.section-hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-glow {
    animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 25px rgba(255, 107, 53, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.7);
    }
}

.minecraft-font {
    font-family: 'Courier New', monospace;
    /* text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.8); */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.leaderboard-item {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 204, 2, 0.1));
    border-left: 5px solid;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 204, 2, 0.2));
    transform: translateX(8px);
}

.rank-1 {
    border-left-color: #ffd700;
}

.rank-2 {
    border-left-color: #c0c0c0;
}

.rank-3 {
    border-left-color: #cd7f32;
}

.rank-other {
    border-left-color: #ff6b35;
}

.news-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 107, 53, 0.2);
    transition: all 0.3s ease;
}

.news-card:hover {
    border-color: rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 204, 2, 0.05));
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.9));
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
}

.status-online {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    border: 2px solid rgba(255, 107, 53, 0.4);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6b35;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.map-container {
    position: relative;
    width: 100%;
    height: 650px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(45deg, #1a0b2e, #2d1b3d);
    border: 2px solid rgba(255, 107, 53, 0.3);
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #d1d5db;
    text-align: center;
}

.floating-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* .corn-text {
    background: linear-gradient(135deg, #ff6b35, #ffcc02);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.halloween-card {
    background: linear-gradient(135deg, rgba(139, 79, 155, 0.1), rgba(45, 27, 61, 0.2));
    border: 1px solid rgba(139, 79, 155, 0.3);
} */

.achievement-badge {
    background: linear-gradient(135deg, #ff6b35, #ffcc02);
    color: #1a0b2e;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* --- CSS MỚI (CHO AUTH & FORUM) --- */
.hidden-force {
    display: none !important;
}

/* Modal Styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 9999;
}

.glass-panel {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Role Badges */
.role-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #dc2626;
    color: white;
    border: 1px solid #ef4444;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

.role-dev {
    background: #2563eb;
    color: white;
    border: 1px solid #3b82f6;
}

.role-helper {
    background: #16a34a;
    color: white;
    border: 1px solid #22c55e;
}

.role-vip {
    background: #eab308;
    color: black;
    border: 1px solid #facc15;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.role-member {
    background: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
}

/* Google Button */
.google-btn {
    background: white;
    color: #1f2937;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: bold;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.2s;
}

.google-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

/* Loading Spinner */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid #ff6b35;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- MENU DROPDOWN PC: ĐẸP & MƯỢT --- */

/* Khung chứa menu (để canh chỉnh vị trí) */
.user-menu-container {
    position: relative;
}

/* Bản thân cái menu sổ xuống */
.user-dropdown {
    position: absolute;
    top: 100%; /* Nằm ngay dưới nút Avatar */
    right: 0;
    width: 260px; /* Rộng hơn chút cho thoáng */
    margin-top: 12px; /* Cách nút một chút */
    
    /* Hiệu ứng kính mờ (Glassmorphism) */
    background: rgba(15, 23, 42, 0.95); /* Màu nền tối thẫm */
    backdrop-filter: blur(20px); /* Làm mờ nền phía sau */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Viền mỏng tinh tế */
    border-radius: 16px; /* Bo tròn góc */
    
    /* Bóng đổ mềm mại */
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    
    /* Animation hiện ra */
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease-out;
    
    overflow: hidden; /* Để bo tròn góc con bên trong */
    z-index: 100;
}

/* Hiệu ứng hiện ra */
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mũi tên nhỏ chỉ lên trên (Optional - cho đẹp) */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    z-index: -1;
}

/* Các mục trong menu */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1; /* Màu chữ xám sáng */
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* Đường kẻ mờ giữa các mục */
}

/* Hover vào mục menu */
.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding-left: 20px; /* Hiệu ứng đẩy nhẹ sang phải */
}

/* Mục cuối cùng không cần gạch chân */
.menu-item:last-child {
    border-bottom: none;
}

/* Nút Đăng xuất (Màu đỏ nhẹ) */
.menu-item.logout {
    color: #f87171;
}
.menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Icon trong menu (nếu bạn thêm icon vào thẻ span) */
.menu-item span:first-child {
    font-size: 1.1rem; /* Icon to hơn chữ chút */
}

/* Nút xóa */
.delete-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.05);
}

.snowflake {
        position: fixed;
        top: -10px;
        z-index: 9999;
        user-select: none;
        cursor: default;
        animation-name: snowfall;
        animation-duration: 10s;
        animation-timing-function: linear;
        animation-iteration-count: infinite;
        opacity: 0.8;
        color: #FFF;
        font-size: 1em;
    }
    @keyframes snowfall {
        0% { transform: translateY(0) rotate(0deg); opacity: 1; }
        100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
    }