:root {
    --ball-width: 50px;
    --joystick-width: 130px;
    --control-ball-width: 40px;
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-color: #f0f0f0;
}

#gameArea {
    display: flex;
    flex-direction: column;
    width: 80vw;
    height: 80vh;
    background-color: #000;
    border-radius: 30px;
    overflow: hidden;
}

#moveArea {
    position: relative;
    flex: 7;
    /* 70% of the game area */
    background-color: #282828;
}

#circle {
    position: absolute;
    width: var(--ball-width);
    height: var(--ball-width);
    background-color: red;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: top 0.3s linear, left 0.3s linear;
    -webkit-transition: top 0.3s linear, left 0.3s linear;
    -moz-transition: top 0.3s linear, left 0.3s linear;
    -ms-transition: top 0.3s linear, left 0.3s linear;
    -o-transition: top 0.3s linear, left 0.3s linear;
}

#controlArea {
    flex: 3;
    /* 30% of the game area */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    position: relative;
}

#joystick, #keyboardJoystick {
    width: var(--joystick-width);
    height: var(--joystick-width);
    background-color: rgba(0, 0, 0, 0.2);
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#joystick.hidden, #keyboardJoystick.hidden {
    display: none;
}

#controlBall {
    width: var(--control-ball-width);
    height: var(--control-ball-width);
    background-color: gray;
    border-radius: 50%;
    position: absolute;
    /* Make it position absolute to move freely within joystick */
}

/* Arrow icon styles */
.arrow {
    width: 20px;
    height: 20px;
    background-color: transparent;
    position: absolute;
    font-size: 50px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow.up {
    top: 15%;
    left: 50%;
    transform: translate(-50%, -100%);
}

.arrow.down {
    bottom: 15%;
    left: 50%;
    transform: translate(-50%, 100%);
}

.arrow.left {
    left: 15%;
    top: 50%;
    transform: translate(-100%, -50%);
}

.arrow.right {
    right: 15%;
    top: 50%;
    transform: translate(100%, -50%);
}

.pressed {
    text-shadow: 0 -1px 4px #FFF, 0 -2px 10px #ff0, 0 -10px 20px #ff8000, 0 -18px 40px #F00;
}