body {
    margin: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.hidden {
    display: none !important;
}

h1 { color: #4CAF50; font-size: 3rem; margin-bottom: 10px; text-align: center; }
h2 { color: #4CAF50; margin: 0; font-size: 1.8rem; }

/* Menu Buttons */
.menu-btn {
    background-color: #333;
    color: white;
    border: 2px solid #4CAF50;
    padding: 12px 24px;
    font-size: 1.1rem;
    margin: 8px;
    border-radius: 8px;
    cursor: pointer;
    width: 320px;
    transition: 0.2s;
}
.menu-btn:hover { background-color: #4CAF50; }

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 600px;
    margin-bottom: 10px;
}

.btn-back {
    background-color: #555;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-back:hover { background-color: #777; }

/* Global Controls */
.controls label { color: #ccc; margin-right: 5px; font-size: 0.9rem;}
.controls select {
    padding: 6px 10px;
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    cursor: pointer;
}

.start-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
}
.start-btn:hover { background-color: #45a049; }

.stats { font-size: 1.2rem; margin-bottom: 8px; color: #aaa; font-weight: bold; }
.game-instruction { color: #FFEB3B; margin-bottom: 12px; font-size: 0.9rem; }
.canvas-container { position: relative; }
canvas {
    background-color: #1e1e1e;
    border: 4px solid #333333;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.15);
}

.overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 30, 0.95);
    padding: 2.5rem;
    border-radius: 12px;
    border: 2px solid #555;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    width: 250px;
}
.overlay h2 { color: #E53935; font-size: 2rem; margin-bottom: 10px; }
.overlay h3 { color: #fff; font-size: 1.2rem; margin-bottom: 15px; }

/* Whack-a-Mole Grid */
#whack-grid {
    display: grid;
    grid-template-columns: repeat(3, 150px);
    grid-template-rows: repeat(3, 150px);
    gap: 15px;
    background-color: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    border: 4px solid #333;
}
.hole {
    background-color: #111;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 2px solid #222;
}
.mole {
    position: absolute;
    bottom: 0; left: 0; right: 0; top: 0;
    background-color: #FFC107;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    padding: 5px;
    cursor: crosshair;
    border-radius: 10px;
    transition: transform 0.1s;
    user-select: none;
}
.mole:active { transform: scale(0.9); }