/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #1a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #300606, #0c0101);
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    text-align: center;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Main Menu Styles */
.title-container {
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.game-title {
    font-size: 4rem;
    color: #ff6600;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.game-subtitle {
    font-size: 2rem;
    color: #ffcc00;
    text-shadow: 0 0 5px #ff6600;
}

@keyframes pulse {
    0% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
    50% { text-shadow: 0 0 15px #ff0000, 0 0 30px #ff0000, 0 0 40px #ff0000; }
    100% { text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.menu-button {
    padding: 15px 40px;
    font-size: 1.5rem;
    background: linear-gradient(to bottom, #990000, #660000);
    color: #fff;
    border: 2px solid #ff6600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #000;
    box-shadow: 0 0 10px #ff0000;
}

.menu-button:hover {
    background: linear-gradient(to bottom, #cc0000, #990000);
    transform: scale(1.05);
    box-shadow: 0 0 15px #ff0000;
}

/* Flame Effects */
.flames-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1;
    overflow: hidden;
}

.flame {
    position: absolute;
    bottom: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(255,255,0,0.5) 0%, rgba(255,102,0,0.5) 40%, rgba(255,0,0,0.5) 100%);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    transform-origin: center bottom;
    animation: flicker 3s infinite alternate;
}

.flame1 {
    left: 10%;
    animation-delay: 0.2s;
}

.flame2 {
    left: 50%;
    transform: translateX(-50%);
    height: 250px;
    width: 250px;
    animation-delay: 0.5s;
}

.flame3 {
    right: 10%;
    animation-delay: 0.8s;
}

@keyframes flicker {
    0%, 100% {
        transform: scaleY(1) scaleX(1);
        opacity: 0.8;
    }
    25% {
        transform: scaleY(1.1) scaleX(0.9);
        opacity: 1;
    }
    50% {
        transform: scaleY(0.95) scaleX(1.05);
        opacity: 0.9;
    }
    75% {
        transform: scaleY(1.05) scaleX(0.95);
        opacity: 1;
    }
}

/* Game Screen Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border-bottom: 2px solid #ff6600;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.score-container, .time-container, .combo-container {
    font-size: 1.5rem;
    color: #ffcc00;
    text-shadow: 0 0 5px #ff6600;
}

#game-area {
    width: 100%;
    height: calc(100% - 60px);
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

/* Game objects */
.game-object {
    position: absolute;
    cursor: pointer;
    transition: transform 0.1s;
}

.game-object:hover {
    transform: scale(1.05);
}

.game-object.building {
    filter: drop-shadow(0 0 5px #ff6600);
}

.game-object.demon {
    filter: drop-shadow(0 0 8px #ff0000);
    animation: rotate 3s infinite linear;
}

.game-object.angel {
    filter: drop-shadow(0 0 8px #ffffff);
    animation: float 2s infinite alternate;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

/* Instructions Screen */
.instructions-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ff6600;
    margin: 20px 0;
    max-width: 800px;
    text-align: left;
}

.instructions-content p {
    margin-bottom: 10px;
    font-size: 1.2rem;
    line-height: 1.5;
}

/* Leaderboard Screen */
#leaderboard-content {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ff6600;
    margin: 20px 0;
    max-width: 800px;
    width: 100%;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
}

#leaderboard-table th, #leaderboard-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ff6600;
}

#leaderboard-table th {
    background-color: rgba(153, 0, 0, 0.7);
    color: #ffcc00;
}

#leaderboard-table tr:nth-child(even) {
    background-color: rgba(51, 0, 0, 0.5);
}

#leaderboard-table tr:hover {
    background-color: rgba(255, 102, 0, 0.3);
}

/* Game Over Screen */
.final-score-container {
    margin: 20px 0;
    font-size: 2rem;
}

#final-score {
    font-size: 3rem;
    color: #ffcc00;
    text-shadow: 0 0 10px #ff6600;
    margin-top: 10px;
}

.nickname-container {
    margin: 20px 0;
}

#nickname-input {
    padding: 10px;
    font-size: 1.2rem;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff6600;
    border-radius: 5px;
    color: #fff;
    margin: 10px 0;
    width: 300px;
    max-width: 100%;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }
    
    .game-subtitle {
        font-size: 1.5rem;
    }
    
    .menu-button {
        padding: 12px 30px;
        font-size: 1.2rem;
    }
    
    .game-header {
        padding: 5px 10px;
    }
    
    .score-container, .time-container, .combo-container {
        font-size: 1.2rem;
    }
    
    .instructions-content p {
        font-size: 1rem;
    }
    
    #final-score {
        font-size: 2.5rem;
    }
    
    #nickname-input {
        width: 250px;
    }
}

/* Frenzy Mode Animation */
@keyframes frenzy {
    0% { background-color: rgba(255, 0, 0, 0.2); }
    50% { background-color: rgba(255, 0, 0, 0.4); }
    100% { background-color: rgba(255, 0, 0, 0.2); }
}

.frenzy-mode {
    animation: frenzy 1s infinite;
}

/* Point Animation */
.point-popup {
    position: absolute;
    color: #ffcc00;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0000;
    pointer-events: none;
    animation: point-float 1s forwards;
}

@keyframes point-float {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}
