body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    background-color: #f4f4f4;
    color: #333;
}

h1 {
    margin-bottom: 20px;
}

.game-area {
    border: 2px solid #555;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative; /* Crucial for positioning elements within games */
    display: flex; /* Helps center content if game's root doesn't fill it */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevents content spill from affecting layout */
}

/* --- Platformer Game Styles (from previous step, unchanged) --- */
.platformer-game-root {
    position: relative;
    width: 700px;
    height: 350px;
    background-color: #e0f7fa;
    overflow: hidden;
    border: 1px dashed #00796b;
}
.platformer-game-root .player { position: absolute; width: 25px; height: 40px; background-color: #ff5722; border-radius: 3px; }
.platformer-game-root .platform { position: absolute; background-color: #795548; height: 20px; border-top: 2px solid #5d4037; }
.platformer-game-root .start-platform { bottom: 0; left: 0; width: 120px; }
.platformer-game-root .middle-platform { bottom: 100px; left: 300px; width: 80px; }
.platformer-game-root .end-platform { bottom: 0; right: 0; width: 120px; }
.platformer-game-root .goal { position: absolute; width: 30px; height: 30px; background-color: #ffeb3b; border: 2px solid #fbc02d; border-radius: 50%; bottom: 25px; right: 20px; display: flex; align-items: center; justify-content: center; font-size: 1.2em; }
.platformer-game-root .goal::before { content: '★'; color: #f57f17; }

/* --- Clicker Game Styles (from previous step, unchanged) --- */
.clicker-game-root { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 500px; height: 300px; padding: 20px; background-color: #fffde7; border: 1px dashed #fbc02d; box-sizing: border-box; }
.clicker-game-root .clicker-instructions { margin-bottom: 25px; font-size: 1.3em; color: #8d6e63; text-align: center; }
.clicker-game-root .clicker-target { width: 120px; height: 120px; background-color: #03a9f4; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; user-select: none; font-weight: bold; font-size: 0.9em; text-align: center; border: 3px solid #0288d1; box-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: transform 0.1s ease, background-color 0.2s; position: relative; }
.clicker-game-root .clicker-target:hover { background-color: #039be5; }
.clicker-game-root .clicker-target:active { transform: scale(0.93); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.clicker-game-root .clicker-feedback { margin-top: 25px; font-size: 1.1em; color: #555; }


/* --- Memory Game Styles --- */
.memory-game-root {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 400px; /* Adjusted for a 2x2 grid typically */
    height: 450px; /* Ample height for title and grid */
    padding: 20px;
    background-color: #f3e5f5; /* Light purple */
    border: 1px dashed #ab47bc; /* Purple border */
    box-sizing: border-box;
}

.memory-game-root .memory-title {
    font-size: 1.5em;
    color: #6a1b9a; /* Darker purple */
    margin-bottom: 20px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* For a 2x2 grid */
    gap: 10px;
    width: 220px; /* (100px card + 10px gap + 100px card) */
    height: 220px;
}

.memory-card {
    width: 100px;
    height: 100px;
    background-color: #ce93d8; /* Medium purple */
    border: 2px solid #ab47bc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    color: #4a148c; /* Darkest purple for symbol */
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.memory-card.flipped, .memory-card.matched {
    background-color: #e1bee7; /* Lighter purple when flipped/matched */
    transform: rotateY(180deg); /* Simple flip effect */
}

.memory-card .card-content { /* Content will be hidden by default if card is not flipped */
    display: none;
}

.memory-card.flipped .card-content, .memory-card.matched .card-content {
    display: block;
    transform: rotateY(180deg); /* Counter-rotate content to be readable */
}

.memory-card.hidden { /* Default state showing back of card */
    background-color: #ba68c8; /* Darker purple for card back */
    font-size: 1em; /* Could show a generic symbol or nothing */
}
.memory-card.hidden .card-content {
    display: none;
}


/* --- Reaction Game Styles --- */
.reaction-game-root {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 600px;
    height: 400px;
    padding: 20px;
    background-color: #424242; /* Dark grey initial state */
    color: white;
    border: 1px dashed #757575;
    box-sizing: border-box;
    cursor: pointer; /* Click anywhere in the box */
    text-align: center;
    transition: background-color 0.2s ease;
}

.reaction-game-root .reaction-message {
    font-size: 2em;
    font-weight: bold;
}

.reaction-game-root.wait {
    background-color: #d32f2f; /* Red for "Wait" */
}

.reaction-game-root.go {
    background-color: #388e3c; /* Green for "Go" */
}

.reaction-game-root.early {
    background-color: #fbc02d; /* Yellow for "Too Early" */
    color: #333;
}

.reaction-game-root.result .reaction-message {
    font-size: 1.5em; /* Smaller for results */
}
.reaction-game-root.result .reaction-time {
    font-size: 2.5em;
    color: #81c784; /* Light green for time */
    margin-top: 10px;
}
.reaction-game-root.result .reaction-subtext {
    font-size: 1em;
    margin-top: 15px;
}

/* css/style.css */
/* ... (previous styles for body, game-area, platformer, clicker, memory, reaction) ... */

/* --- Falling Hazards Game Styles --- */
.falling-hazards-root {
    position: relative;
    width: 600px;
    height: 450px;
    background-color: #263238; /* Dark blue-grey */
    overflow: hidden; /* Important! */
    border: 1px dashed #546e7a;
    color: white;
    display: flex; /* For centering instructions initially */
    flex-direction: column;
    align-items: center;
    padding-top: 10px; /* Space for timer/instructions */
}

.falling-hazards-root .fh-player {
    position: absolute; /* Positioned relative to root */
    width: 30px;
    height: 30px;
    background-color: #4CAF50; /* Green */
    border-radius: 50%; /* Circle player */
    bottom: 20px; /* Initial y position from bottom */
}

.falling-hazards-root .fh-hazard {
    position: absolute; /* Positioned relative to root */
    background-color: #F44336; /* Red */
    border-radius: 3px; /* Slightly rounded square */
}

.falling-hazards-root .fh-timer {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2em;
    color: #CFD8DC; /* Light blue-grey text */
}
.falling-hazards-root .fh-instructions {
    font-size: 0.9em;
    color: #90A4AE;
    margin-top: 20px; /* Push below timer if timer is also centered initially */
    text-align: center;
    position: absolute;
    top: 35px; /* Below timer */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
}

/* css/style.css */
/* ... (previous styles) ... */

/* --- Platformer Game Styles (Additions/Modifications) --- */
.platformer-game-root .coin {
    position: absolute;
    width: 20px; /* Increased size for coins */
    height: 20px;
    background-color: #FFD700; /* Gold color */
    border: 2px solid #FFA500; /* Orange border */
    border-radius: 50%; /* Circular */
    box-shadow: 0 0 5px #FFD700;
}

#platformerCoinDisplay { /* Style for the coin counter */
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2em;
    color: #4A148C; /* Dark purple, or choose another contrasting color */
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 3px;
}

/* Adjust platformer root size if needed for new level */
.platformer-game-root {
    position: relative;
    width: 800px; /* Increased width */
    height: 400px; /* Increased height */
    background-color: #e0f7fa;
    overflow: hidden;
    border: 1px dashed #00796b;
}

/* css/style.css */
.character-select {
    text-align: center;
    padding: 20px;
}

.classes-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.class-card {
    cursor: pointer;
    padding: 15px;
    border: 2px solid #444;
    border-radius: 8px;
    width: 200px;
    transition: all 0.3s ease;
}

.class-card:hover {
    background-color: #f0f0f0;
    transform: translateY(-5px);
}

.class-icon {
    font-size: 3em;
    margin: 10px 0;
}

.select-prompt {
    color: #666;
    font-style: italic;
}

/* Main game styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.game-area {
    width: 800px;
    height: 600px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* Player Input Game styles */
.player-input-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
}

.player-input-screen h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.player-input-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 400px;
    gap: 15px;
}

#player-name {
    padding: 12px 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    outline: none;
    text-align: center;
}

#start-button {
    padding: 12px 20px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#start-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

#start-button:active {
    transform: translateY(1px);
}

.error-message {
    color: #ffcccc;
    font-weight: bold;
    margin-top: 15px;
    min-height: 20px;
}

/* Character Stats Game styles */
.character-stats-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #43cea2, #185a9d);
    color: white;
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.character-name {
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.character-coins {
    font-size: 1.5em;
    background-color: rgba(255, 215, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.coin-icon {
    color: gold;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    width: 120px;
    font-size: 1.2em;
}

.stat-value {
    width: 40px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px;
    border-radius: 5px;
}

.stat-bar {
    flex-grow: 1;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 10%;
    transition: width 0.5s;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: auto;
}

.continue-button {
    padding: 12px 25px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.continue-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.continue-button:active {
    transform: translateY(1px);
}



        /* === ARCADE SPECIFIC STYLES === */
        .arcade-menu {
            justify-content: flex-start; /* Aligns children (header, cabinets, exit) to the top */
        }

        .arcade-header {
            width: 100%;
            margin-bottom: 20px !important; /* Reduced from 25px */
            text-align: center; /* Ensure text elements within are centered */
        }
        .arcade-header h2 {
            font-family: 'Press Start 2P', cursive;
            color: #FFFF00;
            font-size: 2em;
            text-shadow: 2px 2px #FF0000, -2px -2px #00FFFF;
            margin-top: 0; /* Remove default margin */
            margin-bottom: 10px; /* Reduced from 15px */
            letter-spacing: 1px;
        }
        .arcade-header p {
            font-family: 'Press Start 2P', cursive;
            color: #00FF00;
            font-size: 1em;
            margin: 3px 0; /* Reduced from 5px */
            letter-spacing: 0.5px;
        }

        .arcade-cabinets-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px; /* Reduced from 20px */
            padding: 10px 0;
            width: 100%;
        }

        .arcade-cabinet {
            background: linear-gradient(to bottom, #3a3a3a 0%, #1a1a1a 100%);
            border: 3px solid #555;
            border-radius: 8px 8px 5px 5px;
            width: 150px;
            padding: 8px;
            text-align: center;
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            box-shadow: 3px 3px 5px rgba(0,0,0,0.6);
        }
        .arcade-cabinet:hover, .arcade-cabinet:focus  {
            transform: scale(1.03);
            box-shadow: 0 0 12px #FFFF00, 0 0 18px #FF00FF;
            outline: 2px solid #FFFF00;
        }

        .arcade-cabinet img {
            width: 100%;
            height: 100px;
            object-fit: cover;
            border: 2px solid #222;
            border-radius: 4px;
            margin-bottom: 8px;
            background-color: #000;
        }

        .arcade-cabinet .arcade-cabinet-title {
            font-family: 'Press Start 2P';
            color: #FFFFFF;
            background-color: #D20000;
            padding: 5px 3px;
            font-size: 0.65em;
            margin: 0;
            border-radius: 1px;
            line-height: 1.1;
            word-wrap: break-word; /* or overflow-wrap: break-word; */
            text-shadow: 1px 1px #000;
            min-height: calc(0.65em * 1.2 * 2 + 10px); /* Attempt to reserve space for two lines of text + padding */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #arcade-exit-button {
            background-color: #B22222;
            border-color: #FF6347;
            padding: 12px 25px;
            font-size: 1em;
            /* margin-top will be handled by its container */
        }
        #arcade-exit-button:hover {
            background-color: #CD5C5C;
            border-color: #FFA07A;
        }

        /* Container for exit button to control its spacing */
        .arcade-exit-button-container { /* Assuming you wrap the exit button for margin control if needed */
            width: 100%;
            text-align: center;
            margin-top: 20px; /* Reduced from 25px */
        }

        .arcade-loading-screen {
            font-family: 'Press Start 2P', cursive;
            color: #00FF00;
            font-size: 1.3em;
            text-align: center;
            padding-top: 100px; /* Keep padding for vertical centering feel */
            line-height: 1.8;
        }
