.screen {
    height: 100dvh !important;
    padding: 4dvh 1dvw;
    background-color: #0D77C5;
    background-image: url("assets/wave.png");
    background-size: 100% 40%;
    background-position-x: center;
    background-position-y: bottom;
    background-repeat: no-repeat;
}

#welcome-screen {
    overflow: hidden;
    background-image: url("assets/bg.png");
    background-size: cover;
    background-position: top left;
}

#username-error {
    display: none;
    color: #de3920;
    font-family: "Alfa Slab One";
    font-size: 18px;
}

.screen>div {
    margin: 1dvh 0;
}

.welcome-logo {
    max-height: max(200px, 20dvh);
}

.game-title {
    width: min(92dvw, 1200px);
    display: flex;
    padding: 10px 36px 12px;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    border-radius: 28px;
    color: #ffc11b;
    text-align: center;
    text-shadow: 0 6px 0 #e73929;
    font-family: "Alfa Slab One";
    font-size: 63px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    background-color: #055490;
    box-shadow: 0 6px 0 0 #f1ece2;
}

.base-button {
    margin-bottom: 5dvh;
    width: unset;
    font-size: clamp(24px, 4dvh, 36px);
    width: 92dvw;
    box-sizing: border-box;
    display: flex;
    padding: 10px 36px 12px;
    flex-direction: column;
    align-items: center;
    border-radius: 28px;
    border: 6px solid #ffc11b;
    background: #de3920;
    color: #f1ece2;
    text-align: center;
    font-family: "Funnel Display";
    font-size: 36px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    box-shadow:
        0 6px 0 0 #04548f,
        0 -4px 0 0 rgba(0, 0, 0, 0.2) inset,
        0 4px 0 0 rgba(255, 255, 255, 0.2) inset;
}

/* Landscape Orientation Styles */
.rotate-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: "Funnel Display", "Arial", sans-serif;
    text-align: center;
    pointer-events: all;
}

.page-title {
    color:  #ffc11b;
    text-align: center;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
    font-family: "Funnel Display";
    font-size: clamp(16px, 10vh, 45px);
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    margin-bottom: 2dvh;
}

.input-field {
    font-size: clamp(20px, 4vw, 32px);
    padding: clamp(12px, 2.5vh, 20px) clamp(16px, 3vw, 24px);
    border-radius: 24px;
    background: #f1ece2 !important;
    box-shadow: 0 -4px 0 0 #04548f inset !important;
    color: #022f51 !important;
    border: none !important;
    font-family: "Funnel Display";
    font-size: clamp(24px, 5vw, 36px);
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    margin: 2dvh 0;
}

.character-display {
    border-radius: 24px;
    background: #f1ece2 !important;
    box-shadow: 0 -4px 0 0 #04548f inset !important;  
    padding: clamp(12px, 2.5vh, 20px) clamp(16px, 3vw, 24px);
}

#controller {
    background: #F1ECE2;
    touch-action: none;
    overflow: hidden;
}

#controller-bg {
    border-radius: 16px;
    background: #FFC11B;
}

#controller-bg #virtual-joystick {
    width: clamp(140px, 25vw, 180px);
    height: clamp(140px, 25vw, 180px);
    border: 4px solid #E64438;
    border-radius: 50%;
    position: absolute;
    background-color: #FF4C3E;
    touch-action: none;
    z-index: 10;
    left: 10%;
    pointer-events: none;
    box-shadow:  -1px -1px 4px 11px #FCD59E;
    -webkit-box-shadow:  -1px -1px 4px 11px #FCD59E;
    -moz-box-shadow:  -1px -1px 4px 11px #FCD59E;
}

#controller-bg #virtual-joystick #joystick-knob {
    width: 60px;
    height: 60px;
    background: linear-gradient(318.61deg, #FF7B70 14.53%, #FF4C3E 49.83%, #FF210F 85.71%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    touch-action: none;
}

#controller-bg #help-text {
    width: 60%;
    color: #666;
    font-size: 1.2em;
    opacity: 0;
    pointer-events: none;
}

#fire {
    width: clamp(140px, 25vw, 180px);
    height: clamp(140px, 25vw, 180px);
    border-radius: 50%;
    background: #0D77C5;
    border: 3px solid #0D77C5;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    touch-action: manipulation;
    box-shadow:  -1px -1px 4px 11px #FCD59E;
    -webkit-box-shadow:  -1px -1px 4px 11px #FCD59E;
    -moz-box-shadow:  -1px -1px 4px 11px #FCD59E;
}

#countdowncontainer {
    padding-bottom: 15dvh;
}

#connection-countdown {
    color: var(--ffc-11-b, #ffc11b);
    text-align: center;
    text-shadow: 0 8px 0 #e73929;
    font-family: "Alfa Slab One";
    font-size: clamp(80px, 20vw, 150px);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

@media (orientation: landscape) {
    .welcome-logo {
        max-height: 20dvh !important;
    }
    .sponsor-logos {
        max-height: 10dvh !important;
    }
    
    .base-button {
        margin-bottom: unset;
        width: unset;
        max-width: 92dvw;
        font-size: 30px;
    }

    .game-title {
        width: unset;
        font-size: 40px;
    }

    #character-image {
        max-height: 44dvh;
    }
}

/* Landscape Orientation Styles */
.rotate-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: "Funnel Display", "Arial", sans-serif;
    text-align: center;
    pointer-events: all;
}

.rotate-icon {
    font-size: 4em;
    margin-bottom: 30px;
    animation: rotate 4s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(1, 1, 1, 0.3));
    fill: #ffffff;
    color: #ffffff;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotate-text {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    padding: 0 30px;
    line-height: 1.4;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rotate-subtext {
    font-size: 1.1em;
    text-align: center;
    padding: 10px 30px;
    opacity: 0.9;
    margin-top: 10px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hide controller elements in portrait mode on mobile */
@media screen and (max-width: 768px) and (orientation: portrait) {
    #controller.force-landscape {
        display: none !important;
    }

    .rotate-prompt.show {
        display: flex !important;
    }
}

@media screen and (min-width: 769px),
screen and (orientation: landscape) {
    .rotate-prompt {
        display: none !important;
    }
}