:root {
    --vn-red: #da251d;       /* Đỏ cờ Việt Nam */
    --vn-yellow: #ffff00;    /* Vàng sao */
    --bg-light: #fffdf5;     /* Màu kem sáng */
    --text-color: #333;      /* Màu chữ đen */
    --border-gold: #d4ac0d;  /* Viền vàng đồng */
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
}

/* --- MENU --- */
#main-menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 253, 231, 0.95); /* Nền sáng mờ */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.menu-box {
    background: #fff;
    padding: 30px 40px;
    border: 3px solid var(--vn-red);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(218, 37, 29, 0.2);
    max-width: 500px;
    width: 90%;
}

.logo-container {
    margin-bottom: 10px;
}
.unit-logo {
    height: 80px;
    display: block;
    margin: 0 auto;
}

.menu-title {
    color: var(--vn-red);
    font-weight: 900;
    font-size: 28px;
    margin: 10px 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.author-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Lựa chọn chế độ */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.mode-option {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    background: #f9f9f9;
}

.mode-option:hover {
    background: #ffebee; /* Hồng nhạt */
    border-color: var(--vn-red);
}

.mode-option input:checked + .mode-label {
    color: var(--vn-red);
    font-weight: bold;
}

.instructions {
    background: #fff8e1; /* Vàng rất nhạt */
    border: 1px dashed var(--border-gold);
    padding: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: left;
}

.instr-title {
    margin-top: 0;
    color: #d35400;
    font-size: 16px;
    text-decoration: underline;
}

#btn-start-game {
    background: var(--vn-red);
    color: var(--vn-yellow);
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 0 #b71c1c; /* Hiệu ứng nút nổi */
    transition: transform 0.1s;
}

#btn-start-game:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* --- GAME STAGE --- */
#main-stage {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    background-color: var(--bg-light);
    /* Pattern lưới mờ */
    background-image: 
        linear-gradient(rgba(218, 37, 29, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(218, 37, 29, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

#game-container {
    width: 800px;
    height: 100%;
    position: relative;
    border-left: 2px solid rgba(0,0,0,0.1);
    border-right: 2px solid rgba(0,0,0,0.1);
    background: white;
}

/* --- HUD --- */
#hud {
    position: absolute;
    top: 0;
    width: 100%;
    height: 60px;
    background: var(--vn-red);
    color: var(--vn-yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

.hud-item {
    font-size: 18px;
}
.highlight {
    font-size: 22px;
    color: #fff;
}

/* Máu */
.hp-point {
    display: inline-block;
    width: 15px;
    height: 15px;
    background-color: var(--vn-yellow);
    margin-right: 2px;
    border-radius: 50%;
    border: 1px solid #b71c1c;
}

/* --- INPUT ZONE --- */
#bottom-zone {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: #eee;
    border-top: 4px solid var(--vn-red);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

#soldier-img {
    height: 120px;
    position: absolute;
    left: 20px;
    bottom: 0;
    z-index: 21;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

#typing-input {
    width: 60%;
    padding: 12px 20px;
    font-size: 20px;
    border: 2px solid var(--vn-red);
    border-radius: 30px;
    outline: none;
    text-align: center;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
#typing-input:focus {
    background-color: #fffde7;
}

/* --- GAME ELEMENTS (DYNAMIC) --- */
/* Giả định game.js tạo ra các div có class .word hoặc tương tự */
/* Bạn cần đảm bảo game.js thêm class phù hợp, ở đây tôi style cho các thẻ div con trực tiếp */

#mode1-area, #mode2-area {
    position: absolute;
    top: 60px;
    bottom: 80px;
    width: 100%;
    overflow: hidden;
}

/* Style cho từ rơi (Mode 1) */
.falling-word { 
    position: absolute;
    color: #b71c1c; /* Đỏ đậm */
    font-weight: 900;
    font-size: 20px;
    text-shadow: 2px 2px 0px #fff, -1px -1px 0 #fff; /* Viền trắng để dễ đọc */
    padding: 5px 10px;
    border: 1px solid rgba(218, 37, 29, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
}

/* Style cho địch (Mode 2) */
#enemy-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 50px;
}
.enemy {
    width: 100px;
    height: 100px;
    margin: 10px;
    background: #ddd;
    border: 2px solid #999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border-radius: 50%; /* Hình tròn */
}
.enemy.active {
    background: #ffcdd2; /* Đỏ nhạt */
    border-color: var(--vn-red);
    color: var(--vn-red);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* --- GAME OVER --- */
#game-over {
    display: none; /* JS sẽ bật cái này lên */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--vn-red);
    padding: 40px;
    border: 4px solid var(--vn-yellow);
    text-align: center;
    color: white;
    z-index: 100;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    width: 400px;
}

.game-over-buttons button {
    margin: 10px;
    padding: 10px 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

.btn-retry {
    background: var(--vn-yellow);
    color: var(--vn-red);
}

.btn-menu {
    background: white;
    color: #333;
}