@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(135deg, #001100 0%, #2F4F2F 30%, #00FF00 70%, #32CD32 100%);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: inherit;
}

.screen.active {
    display: flex;
}

.screen-content {
    text-align: center;
    background: rgba(210, 180, 140, 0.98);
    padding: 40px;
    border-radius: 20px;
    border: 4px solid #2F4F2F;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 700px;
}

/* Typography */
.title {
    font-size: 24px;
    color: #2F4F2F;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #00FF00;
    line-height: 1.2;
}

.subtitle {
    font-size: 12px;
    color: #8B4513;
    margin-bottom: 20px;
    line-height: 1.4;
    font-weight: bold;
}

/* Buttons */
.game-button {
    background: linear-gradient(45deg, #2F4F2F, #00FF00);
    color: #D2B48C;
    border: 3px solid #2F4F2F;
    padding: 15px 25px;
    font-size: 14px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.game-button:hover {
    background: linear-gradient(45deg, #556B2F, #32FF32);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.game-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Instructions */
.instructions {
    margin: 20px 0;
    text-align: left;
    background: rgba(47, 79, 79, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #2F4F2F;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    font-size: 10px;
    color: #8B4513;
    padding-left: 10px;
}

.controls-info {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 8px;
    border: 2px solid #00FF00;
}

.controls-info p {
    font-size: 10px;
    color: #2F4F2F;
    margin: 0;
}

.win-message {
    font-size: 12px;
    color: #8B4513;
    margin-bottom: 20px;
    font-weight: bold;
}

.achievement {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 10px;
    border: 2px solid #00FF00;
}

.achievement .trophy {
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
}

.achievement p {
    font-size: 10px;
    color: #2F4F2F;
    margin: 0;
}

/* Game Screen */
#gameScreen {
    background: linear-gradient(135deg, #001100 0%, #2F4F2F 30%, #00FF00 70%, #32CD32 100%);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

.game-ui {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(210, 180, 140, 0.95);
    border-bottom: 3px solid #2F4F2F;
    font-size: 10px;
    color: #2F4F2F;
}

.ui-stats {
    display: flex;
    gap: 20px;
}

.ui-controls {
    font-size: 8px;
    opacity: 0.7;
}

/* Canvas */
#gameCanvas {
    display: block;
    border: 4px solid #2F4F2F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: #D2B48C;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* End Screen Stats */
.stats {
    margin: 30px 0;
    font-size: 12px;
    color: #2F4F2F;
}

.stats p {
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 8px;
    border: 2px solid #00FF00;
}

/* Responsive Design */
@media (max-width: 900px) {
    .title {
        font-size: 18px;
    }
    
    .screen-content {
        padding: 30px;
        margin: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 800px;
        max-height: 600px;
    }
    
    .game-ui {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .ui-stats {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.screen.active .screen-content {
    animation: fadeIn 0.5s ease-out;
}

/* Hidden class for JavaScript control */
.hidden {
    display: none !important;
}