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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

.main-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    /* Space between instructions and game */
    padding: 1rem;
}

/* RESPONSIVE: Stack them on small screens */
@media (max-width: 1000px) {
    .main-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .instructions-panel {
        display: none;
        /* Hide instructions on very small screens to save space */
    }
}

/* INSTRUCTION PANEL STYLES */
.instructions-panel {
    border: 2px solid #39FF14;
    padding: 1.5rem;
    background-color: #0a0a0a;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    min-width: 200px;
}

.instructions-panel h3 {
    color: #39FF14;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 5px #39FF14;
}

.instructions-panel ul {
    list-style: none;
    padding: 0;
}

.instructions-panel li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.instructions-panel .key {
    background: #333;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #666;
    margin-right: 10px;
    color: #fff;
    min-width: 30px;
    text-align: center;
    box-shadow: 0 2px 0 #000;
}

.instructions-panel .action {
    color: #aaa;
}

.instructions-panel .mission {
    margin-top: 2rem;
    border-top: 1px dashed #333;
    padding-top: 1rem;
    font-size: 0.6rem;
    color: #888;
    line-height: 1.6;
    text-align: center;
}

/* GAME CANVAS */
canvas {
    background-color: #0a0a0a;
    border: 2px solid #39FF14;
    box-shadow: 0 0 20px #39FF14;
    max-width: 100%;
    /* Ensures it shrinks on small screens */
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    padding: 0 1rem;
    font-size: 1.2rem;
}

/* COMMON OVERLAY STYLES (Used for Start Screen & Game Over) */
#start-screen,
#message-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    text-align: center;
    z-index: 10;
    width: 90%;
    max-width: 500px;
}

/* START SCREEN SPECIFIC STYLES */
#start-screen {
    border: 4px solid #D900FF;
    /* Neon Purple Border */
    box-shadow: 0 0 25px #D900FF, inset 0 0 15px #D900FF;
    /* Outer and Inner Glow */
    border-radius: 20px;
}

#start-screen h1 {
    font-size: 2.5rem;
    color: #FFD700;
    /* Gold */
    text-shadow: 4px 4px 0px #333;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

#start-screen p {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: #fff;
    line-height: 1.6;
}

#start-button {
    background-color: #00FFFF;
    /* Cyan */
    color: #000;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    box-shadow: 0 0 15px #00FFFF;
    transition: all 0.2s;
}

#start-button:hover {
    background-color: #fff;
    transform: scale(1.05);
}

/* GAME OVER BOX STYLES */
#message-box {
    border: 2px solid #39FF14;
    box-shadow: 0 0 20px #39FF14;
}

#message-box h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#message-box button {
    background-color: #39FF14;
    color: #000;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    box-shadow: 0 0 10px #39FF14;
    transition: all 0.2s ease;
    display: block;
    width: 100%;
    margin-top: 1rem;
}

#message-box button:hover {
    background-color: #fff;
    color: #000;
}

#message-box button:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

#survival-tip {
    margin-top: 1.5rem;
    min-height: 3em;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

/* FOOTER STYLES */
.footer {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

.heart {
    color: red;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    10% {
        transform: scale(1.3);
    }

    20% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    40% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

/* UTILITY */
.hidden {
    display: none !important;
}