body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: sans-serif;
}

h1 {
    margin-top: 10px;
    margin-bottom: 15px;
}

canvas {
    border: 1px solid black;
    background-color: #fff;
    display: block;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

#gameContainer {
    position: relative;
    margin-top: 10px;
    width: 95%;
    max-width: 400px;
}

#gameInfo {
    margin-bottom: 10px;
    font-size: 1.2em;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    top: 1px;
    left: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gameOver {
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    background-color: rgba(236, 240, 241, 0.85);
    box-sizing: border-box;
}

#gameOver h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #c0392b;
}

#gameOver p {
    font-size: 0.8em;
    color: #34495e;
    margin-bottom: 20px;
}

#restartButton {
    padding: 12px 25px;
    font-size: 0.8em;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

#restartButton:hover {
    background-color: #2980b9;
}

#instructions {
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
}

#instructions p {
    margin: 5px 0;
}

/* Style for Start Game Screen (similar to Game Over) */
#startGameScreen {
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #34495e;
    font-weight: bold;
    text-align: center;
    background-color: rgba(236, 240, 241, 0.9);
    box-sizing: border-box;
}

#startGameScreen h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

#startGameScreen p {
    font-size: 0.8em;
    color: #34495e;
    margin-bottom: 20px;
}

#startButton {
    padding: 12px 25px;
    font-size: 0.8em;
    cursor: pointer;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

#startButton:hover {
    background-color: #27ae60;
}

.score-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

#difficultySelector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 400px;
    padding: 0 10px;
    box-sizing: border-box;
}
