
body, button, a {
    cursor: url("cursor.png"), auto;
}

body.playing, body.playing button {
    cursor: none;
}



@font-face {
    font-family: 'PressStart2P';
    src: url("./PressStart2P.ttf") format("truetype");
    font-display: swap;
}

#ui-root-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    pointer-events: none;
    bottom: 0;
    align-items: center;
}

body {
    transform-origin: center;
}

@keyframes scaleUpCanvas {
    from {
        scale: 0;
        top: 0;
        left: 0;
        opacity: 0;
    }
    to {
        top: 50%;
        left: 50%;
        scale: 1;
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        scale: 0;
        opacity: 0;
    }
    to {
        scale: 1;
        opacity: 1;
    }
}

canvas {
    animation: scaleUpCanvas 0.5s 0.3s ease both;
}

#ui-root {
    font-family: 'PressStart2P', monospace;
    color: #fff;
    aspect-ratio: 16 / 9;
    aspect-ratio: 16 / 9;
    /* width: 100%; */
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    container-type: size;
    animation: scaleUp 0.5s ease both;
    font-weight: bold;
}

.hud-text {
    letter-spacing: 0.02em;
}

#instructions {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: rgb(0 0 0 / 90%);
    pointer-events: auto;
}

#instructions .line {
    font-size: 1.7cqw;
    min-height: 0.5cqw;
    text-align: center;
}

#start-btn, #ok-btn, #restart-btn, #dialog-btn, a {
    text-decoration: none;
    pointer-events: auto;
    padding: 2.5cqw 2.5cqw 2.2cqw 2.5cqw;
    border-radius: 2px;
    font-size: 2cqw;
    font-family: 'PressStart2P', monospace;
    border: 0.35cqw solid #ffd800;
    border-radius: inherit;
    line-height: 0;
    background: #222;
    color: #ffd800;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
    margin-top: 1cqw;
    font-weight: bold;
}

button:has(i), a:has(i) {
    position: relative;
}

button > i, a > i {
    display: block;
    position: absolute;
    height: 0.6cqw;
    width: 0.6cqw;
    background: black;
}

button > i:nth-child(1), a > i:nth-child(1) {
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
}

button > i:nth-child(2), a > i:nth-child(2) {
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
}

button > i:nth-child(3), a > i:nth-child(3) {
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%);
}

button > i:nth-child(4), a > i:nth-child(4) {
    bottom: 0;
    right: 0;
    transform: translate(50%, 50%);
}

button > i::after, a > i::after {
    content: "";
    position: absolute;
    background: #ffd800;
    width: 50%;
    height: 50%;
}

button > i:nth-child(1)::after, a > i:nth-child(1)::after {
    right: 0;
    bottom: 0;
}

button > i:nth-child(2)::after, a > i:nth-child(2)::after {
    left: 0;
    bottom: 0;
}

button > i:nth-child(3)::after, a > i:nth-child(3)::after {
    top: 0;
    right: 0;
}

button > i:nth-child(4)::after, a > i:nth-child(4)::after {
    top: 0;
    left: 0;
}

#timer {
    position: fixed;
    top: 1.5cqw;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4cqw;
    pointer-events: none;
}

#game-over {
    position: fixed;
    z-index: 1;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    font-size: 6cqw;
    color: #ff0000;
    pointer-events: auto;
    background: #000000e8;
}

.subtitle-game-over {
    font-size: 0.25em;
    max-width: 63.5cqi;
    line-height: 1.3em;
    text-align: center;
}

#you-win-video-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000e0;
    flex-direction: column;
}

#you-win-video-container p {
    animation: fadeIn 0.5s 4s ease both;
    font-size: 1.3cqi;
    z-index: 1;
    line-height: 2cqw;
    text-align: center;
    margin-top: -7cqw;
}

#at-end-restart-button, #subscribe-link {
    pointer-events: auto;
    padding: 1cqw 2cqw;
    font-size: 1cqw;
    font-family: 'PressStart2P', monospace;
    border: 0.25cqw solid #ffffff;
    color: #ffffff;
    background: #000000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
    font-weight: bold;
    animation: fadeIn 0.5s 4s ease both;
    min-width: 13.7cqw;
}

button#at-end-restart-button {
    margin-bottom: 1cqi;
}

#at-end-restart-button > i::after {
    background: #ffffff;
}

button#subscribe-link {
    margin-top: 1.5cqi;
    color: tomato;
    border-color: tomato;
    background: tomato;
    color: white;
}

#subscribe-link > i::after {
    background: tomato;
}

#you-win-video {
    max-width: 100%;
    filter: brightness(1.3);
    max-width: 40cqi;
    box-shadow: 0 0 10px 40px black;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


#dialog {
    text-align: center;
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5cqi;
    pointer-events: none;
    font-size: 2cqi;
    background: #000000d8;
    line-height: 1.4em;
}

.ball-countdown {
    position: absolute;
    font-size: 1.3cqw;
    color: black;
    width: 2.5cqw;
    height: 1.5cqw;
    line-height: 1.5cqw;
    margin-left: -1.15cqw;
    margin-top: -0.6cqw;
    padding-top: 0;
    pointer-events: none;
    text-align: center;
    text-shadow: none;
}

#rotate-message {
    display: flex;
    z-index: 10000;
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    align-content: center;
    justify-content: center;
    align-items: center;
    background: #666;
}

#watch-video-btn {
    border-color: tomato;
    color: tomato;
}

#watch-video-btn > i::after {
    background: tomato;
}
