body {
    margin: 0;
    overflow: hidden;
    background-color: #333;
    user-select: none;
}

canvas {
    display: block;
}

#rotate-device {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-size: 2em;
    text-align: center;
    padding-top: 50%;
    z-index: 1000;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    z-index: 100;
}

.overlay-content {
    text-align: center;
}

.overlay h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.overlay button {
    padding: 12px 30px;
    font-size: 0.5em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

#playerNameInput {
    padding: 10px;
    font-size: 0.5em;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 80%;
    max-width: 200px;
    box-sizing: border-box;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#gameUI {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2em; /* Decreased font size */
    display: flex;
    gap: 20px;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
}

#playerNameDisplay, #timerDisplay, #scoreDisplay {
    margin: 0;
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 50;
}

#left-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#right-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

#controls button {
    width: 70px;
    height: 70px;
    font-size: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    margin: 5px;
    user-select: none;
    touch-action: manipulation;
    transition: background-color 0.1s ease;
}

#fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    border-radius: 10px;
    z-index: 50;
}

@media screen and (max-width: 800px) and (orientation: portrait) {
    #rotate-device {
        display: block;
    }
    #game-container {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    #gameUI {
        left: 10px;
        transform: translateX(0);
        font-size: 1em;
        padding: 5px 10px;
        gap: 10px;
    }
}

@media (pointer: coarse) {
    #controls {
        display: flex;
    }
    #fullscreen-btn {
        display: block;
    }
}