﻿/* --- 1. IMPORT FONT VT323 (Bản sao hoàn hảo của Coder's Crux trên Web) --- */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* --- 2. BẢNG MÀU & BIẾN --- */
:root {
    --bg-color: #202028; /* Nền tối Retro */
    --card-bg: #e6e6e6; /* Nền thẻ sáng */
    --accent-red: #ff0055; /* Đỏ Arcade */
    --accent-yellow: #ffcc00; /* Vàng Coin */
    --accent-green: #00cc66; /* Xanh lá Console */
    --accent-blue: #2d9bf0; /* Xanh dương Player 1 */
    --border-color: #000000; /* Viền đen tuyệt đối */
    --shadow-hard: 6px 6px 0px #000000;
    /* CẤU HÌNH FONT: Dùng duy nhất 1 font cho đồng bộ */
    --font-main: 'VT323', monospace;
}

/* --- 3. CẤU HÌNH CHUNG --- */
body {
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: var(--font-main);
    /* Font VT323 dáng khá nhỏ và gầy, nên cần để size to hơn bình thường */
    font-size: 1.6rem;
    color: #000;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-bottom: 0 !important;
}

    body > .container {
        flex: 1;
    }

/* --- 4. CÁC CLASS TIỆN ÍCH --- */
/* Tiêu đề cần to hẳn lên và viết hoa */
.pixel-font, h1, h2, h3, h4, h5, .navbar-brand-box, .btn {
    font-family: var(--font-main);
    text-transform: uppercase;
    font-weight: 400; /* Font pixel không cần bold, bản thân nó đã đậm */
    letter-spacing: 1px;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

/* Khử bo tròn toàn bộ */
.card, .btn, input, select, img, .navbar, .alert {
    border-radius: 0 !important;
}

/* --- 5. COMPONENT: NES CONTAINER --- */
.nes-container {
    border: 4px solid var(--border-color);
    background-color: #fff;
    box-shadow: var(--shadow-hard);
    position: relative;
    padding: 20px;
}

    .nes-container.dark {
        background-color: #000;
        color: #fff;
        border-color: #fff;
        box-shadow: 6px 6px 0px #555;
    }

    .nes-container.with-title > .title {
        display: block;
        position: absolute;
        top: -1.8rem;
        left: 1rem;
        background-color: #fff;
        padding: 0 10px;
        font-family: var(--font-main);
        font-size: 1.4rem;
        border: 4px solid #000;
    }

/* --- 6. BUTTONS --- */
.btn {
    border: 4px solid #000;
    font-size: 1.3rem; /* Tăng size chữ trong nút */
    padding: 8px 20px;
    margin: 5px;
    box-shadow: 4px 4px 0px #000;
    transition: all 0.1s;
    line-height: 1;
}

    .btn:hover {
        transform: translate(-2px, -2px);
        box-shadow: 6px 6px 0px #000;
    }

    .btn:active {
        transform: translate(4px, 4px);
        box-shadow: 0px 0px 0px #000;
    }

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
}

.btn-success {
    background-color: var(--accent-green);
    color: #000;
}

.btn-danger {
    background-color: var(--accent-red);
    color: #fff;
}

.btn-warning {
    background-color: var(--accent-yellow);
    color: #000;
}

.btn-light {
    background-color: #fff;
    color: #000;
}

/* --- 7. INPUTS --- */
.form-control, .form-select, textarea {
    border: 4px solid #000;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
    font-family: var(--font-main);
    font-size: 1.8rem; /* Input cần to rõ */
    background-color: #f0f0f0;
}

    .form-control:focus, .form-select:focus {
        background-color: #fff;
        box-shadow: 4px 4px 0px var(--accent-blue);
        border-color: #000;
    }

/* --- 8. GAME CARD --- */
.game-card {
    border: 4px solid #000;
    background: #fff;
    transition: 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .game-card:hover {
        transform: translateY(-5px);
        box-shadow: 8px 8px 0px var(--accent-yellow);
        border-color: #000;
    }

.badge-pixel {
    background: #000;
    color: #fff;
    padding: 5px 10px;
    font-size: 1.2rem;
    border: 2px solid #fff;
    outline: 2px solid #000;
    font-family: var(--font-main);
}

/* --- 9. NAVBAR --- */
.custom-navbar {
    background: linear-gradient(90deg, #2c3e50, #4ca1af);
    border-bottom: 4px solid #000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    padding: 0;
    height: 60px;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
}

    .custom-navbar .container {
        height: 100%;
        display: flex;
        align-items: center;
    }

.navbar-brand-box {
    background-color: rgba(0,0,0,0.3);
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-family: var(--font-main);
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem; /* Logo to hơn chút */
    margin-right: 20px;
    letter-spacing: 2px;
}

.custom-nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 0 20px !important;
    height: 100%;
    font-size: 1.6rem; /* Menu to rõ */
    font-family: var(--font-main);
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-right: 1px solid rgba(255,255,255,0.1);
}

    .custom-nav-link:hover, .custom-nav-link.active {
        background-color: rgba(255,255,255,0.15);
        color: #fff !important;
        border-bottom: 4px solid #00cc66;
    }

/* --- 10. DROPDOWN MENU --- */
.dropdown-container {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

    /* Show menu on container hover */
    .dropdown-container:hover .custom-dropdown {
        display: block;
    }

.custom-dropdown {
    display: none;
    position: absolute;
    top: 100%; /* Stick to bottom of navbar */
    left: 0;
    min-width: 250px;
    background-color: #fff;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
    border: 2px solid #000;
    z-index: 1000;
    padding: 0;
    animation: slideUp 0.2s ease-out;
}

    /* Invisible bridge to prevent menu flicker */
    .custom-dropdown::before {
        content: "";
        position: absolute;
        top: -20px; /* Extend hover area upwards */
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #000;
    text-decoration: none;
    font-family: var(--font-main);
    font-size: 1.2rem;
    border-bottom: 1px dotted #ccc;
    transition: all 0.1s;
}

    .dropdown-item:hover {
        background-color: #00cc66;
        color: #fff;
        padding-left: 25px;
    }

/* --- 11. FOOTER --- */
.footer {
    position: relative !important;
    width: 100%;
    background-color: #000;
    border-top: 4px solid var(--accent-green);
    color: #fff !important;
    padding: 20px 0;
    margin-top: 50px;
    font-family: var(--font-main);
    font-size: 1.4rem;
    text-align: center;
}

    .footer a {
        color: var(--accent-yellow) !important;
        text-decoration: none;
    }

        .footer a:hover {
            color: var(--accent-red) !important;
            text-decoration: underline wavy #fff;
        }

/* --- 12. ANIMATIONS --- */
@keyframes blink {
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s step-start infinite;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* --- MUSIC PLAYER WIDGET --- */
.music-player-box {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Treo ở góc phải dưới cùng */
    z-index: 9999; /* Luôn nổi lên trên cùng */
    background-color: #000;
    border: 4px solid #fff;
    padding: 10px;
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 250px;
}

/* Style cho nút bấm nhạc */
#musicBtn {
    border: 2px solid #fff;
    font-size: 0.8rem;
    padding: 2px 10px;
    min-width: 60px;
}

/* Style cho thanh trượt volume (nhìn cho giống Pixel) */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}

    input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        height: 15px;
        width: 15px;
        background: #00cc66;
        border: 2px solid #fff;
        cursor: pointer;
        margin-top: -5px;
        box-shadow: 2px 2px 0px #000;
    }

    input[type=range]::-webkit-slider-runnable-track {
        width: 100%;
        height: 5px;
        cursor: pointer;
        background: #fff;
        border: 1px solid #000;
    }