:root {
    --retro-font: 'Press Start 2P', cursive;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
    font-family: var(--retro-font);
    color: #fff;
    overflow: hidden;
}

/* Wrapper for screen and button */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#screen {
    width: 90vw;
    height: 70vw;
    max-width: 960px;
    max-height: 720px;
    background-color: #000;
    border-radius: 2.5em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.8);
    padding: 1.5em;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#screen::after {
    content: '';
    position: absolute;
    top: 1.5em;
    left: 1.5em;
    right: 1.5em;
    bottom: 1.5em;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 100;
}

#game-area {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    user-select: none;
    image-rendering: pixelated;
}

#world {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300%; 
    background-color: #87CEEB;
}

/* Message & Help Screens */
#message-screen, #level-message-screen, #help-screen {
    position: absolute;
    top: 1.5em;
    left: 1.5em;
    right: 1.5em;
    bottom: 1.5em;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 50;
    transition: opacity 0.5s;
}

#level-message-screen { font-size: 2.5em; color: #FFD700; text-shadow: 3px 3px 0 #000; }
#message-screen.hidden, #level-message-screen.hidden, #help-screen.hidden { opacity: 0; pointer-events: none; }
#message-screen h1 { font-size: 2em; color: #FFD700; margin-bottom: 20px; }
#message-screen .instructions { font-size: 0.8em; line-height: 1.8; }

#help-screen { background-color: rgba(0, 0, 0, 0.9); text-align: left; padding: 2em; box-sizing: border-box; }
#help-screen h2 { color: #FFD700; font-size: 1.5em; }
#help-screen p { font-size: 0.7em; line-height: 2.2; max-width: 80%; } /* MODIFIED line-height */

/* Styles for the GitHub link */
#help-screen a {
    color: #FFD700;
    text-decoration: underline;
    transition: color 0.2s;
}
#help-screen a:hover {
    color: #fff;
}

#close-help-button { margin-top: 20px; }


/* Buttons */
.button-container { display: flex; gap: 20px; }
#start-button, #help-button, #close-help-button, #external-help-button { 
    margin-top: 30px; padding: 15px 30px; font-family: var(--retro-font); font-size: 1em; background-color: #4CAF50; color: white; border: 3px solid white; cursor: pointer; box-shadow: 0 5px #999; 
}
#help-button, #external-help-button { background-color: #008CBA; }
#start-button:hover, #help-button:hover, #close-help-button:hover, #external-help-button:hover { transform: translateY(-2px); }
#start-button:active, #help-button:active, #close-help-button:active, #external-help-button:active { box-shadow: 0 2px #666; transform: translateY(4px); }

#controls-bar {
    width: 90vw;
    max-width: 960px;
    display: flex;
    justify-content: flex-start;
    padding-top: 15px;
}

#external-help-button {
    font-size: 0.8em;
    padding: 10px 15px;
    margin: 0;
}

/* HUD */
#hud {
    position: absolute;
    top: 1.5em;
    left: 1.5em;
    right: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 20px;
    box-sizing: border-box;
    font-size: 1.2em;
    text-shadow: 2px 2px 2px #000;
    z-index: 10;
    color: #FFD700;
}

/* NEW: Player Info Wrapper */
#player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === MODIFIED RULE === */
#player-scores {
    display: flex;
    flex-direction: column; /* Stack scores vertically */
    gap: 0.6em;             /* Reduce the gap between them */
}

#p2-score {
    color: mediumorchid;
}

/* NEW: Gamepad Status Styles */
#gamepad-status {
    font-size: 0.7em;
    display: flex;
    gap: 1.2em;
    padding-left: 2px;
}

#p1-gp-status {
    color: gold;
}

#p2-gp-status {
    color: mediumorchid;
}


#dev-mode-indicator { color: #ff4757; position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-size: 0.8em; }

/* Game Objects */
.hidden { display: none !important; }
.game-object { position: absolute; will-change: transform; font-size: 2em; }
.player { z-index: 5; font-size: 2.5em; transition: filter 0.1s ease-in-out; }
.player-1-glow { filter: drop-shadow(0 0 10px gold) drop-shadow(0 0 4px gold); }
.player-2-glow { filter: drop-shadow(0 0 12px mediumorchid) drop-shadow(0 0 5px mediumorchid); }

.platform { font-size: 2.5em; color: #228B22; }
.flower { z-index: 1; font-size: 2.2em; }
.thorn { font-size: 2.2em; color: #696969; }

/* Dev Mode Hitbox Style */
.hitbox {
    position: absolute;
    border: 1px solid rgba(255, 0, 0, 0.9);
    background-color: rgba(255, 0, 0, 0.1);
    box-sizing: border-box;
    pointer-events: none;
    z-index: 99;
}


/* Clouds */
.cloud-container { position: absolute; pointer-events: none; filter: blur(1px); }
.cloud-puff { position: absolute; border-radius: 50%; }
.cloud-puff.regular { background-color: rgba(255, 255, 255, 0.7); }
.cloud-puff.thunder { background-color: rgba(128, 128, 128, 0.7); }
