:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ffe5ec;
    --accent-color: #c9184a;
    --text-color: #590d22;
    --background-color: #fff0f3;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    /* Prevent scrolling during game */
    touch-action: none;
    /* Prevent standard touch actions */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

h1,
h2 {
    font-family: 'Fredoka One', cursive;
    color: var(--accent-color);
    text-align: center;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    box-sizing: border-box;
}

.screen.active {
    display: flex;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
    font-family: 'Fredoka One', cursive;
    margin-top: 20px;
}

.btn:active {
    transform: scale(0.95);
}

#game-area {
    width: 100%;
    max-width: 500px;
    min-height: 400px;
    /* Allow height to grow */
    background-color: white;
    border: 4px solid var(--primary-color);
    border-radius: 15px;
    position: relative;
    /* overflow: hidden; Removed to allow scrolling if needed, or keeping it but ensuring content fits */
    overflow: hidden;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    /* Center canvas content */
    align-items: center;
    flex-direction: column;
    /* Stack content vertically */
    padding: 10px;
    /* Prevent content touching edges */
}

canvas {
    touch-action: none;
}

/* Trivia Buttons */
.trivia-btn {
    display: block;
    width: 80%;
    margin: 10px auto;
    background-color: var(--secondary-color);
    color: var(--accent-color);
    border: 2px solid var(--primary-color);
    padding: 10px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
}

.trivia-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #game-area {
        height: 60vh;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Level Controls */
.ctrl-btn {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    margin: 5px;
    cursor: pointer;
}

.ctrl-btn:active {
    background: var(--secondary-color);
}

/* Custom Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    border: 4px solid var(--primary-color);
    text-align: center;
    max-width: 80%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.small-btn {
    padding: 10px 20px;
    margin: 10px;
    font-size: 1rem;
}