* {
    box-sizing: border-box;
}

    *:focus {
        outline: none;
    }

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: Arial;
    background-color: #360046;
    background-image: radial-gradient(circle at 50% 25%, rgba(87, 25, 108, 0.34) 0%, rgba(87, 25, 108, 0.16) 16%, rgba(54, 0, 70, 0) 42%), radial-gradient(circle at 50% 86%, rgba(122, 56, 145, 0.26) 0%, rgba(122, 56, 145, 0.1) 20%, rgba(54, 0, 70, 0) 46%), linear-gradient(180deg, #18001f 0%, #260031 28%, #360046 62%, #22002c 100%);
    padding: 0;
    min-height: 100%;
    min-height: -webkit-fill-available;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    color: white;
    overflow-x: hidden;
}

#qx-login-slide {
    position: relative;
    overflow: hidden;
}

    #qx-login-slide > .fp-tableCell {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    #qx-login-slide::before {
        content: "";
        position: absolute;
        inset: 10% 5% auto;
        height: min(52vw, 340px);
        border-radius: 50%;
        background: radial-gradient(circle, rgba(96, 32, 118, 0.3) 0%, rgba(96, 32, 118, 0.1) 34%, rgba(96, 32, 118, 0) 72%);
        filter: blur(18px);
        pointer-events: none;
        z-index: 0;
    }

    #qx-login-slide::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 4vh;
        width: min(70vw, 430px);
        height: 54px;
        transform: translateX(-50%);
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 187, 13, 0.32) 0%, rgba(54, 0, 70, 0.18) 42%, rgba(54, 0, 70, 0) 75%);
        filter: blur(16px);
        pointer-events: none;
        z-index: 0;
    }

.login-screen {
    position: relative;
    z-index: 1;
    width: min(460px, 92vw);
    margin: 0 auto;
    padding: clamp(12px, 3vh, 40px) clamp(24px, 5vw, 38px) clamp(10px, 2.5vh, 34px);
    background: linear-gradient(180deg, rgba(64, 10, 82, 0.92) 0%, rgba(44, 3, 58, 0.95) 55%, rgba(28, 0, 37, 0.97) 100%);
    border-radius: 30px;
    color: white;
    border: 1px solid rgba(176, 124, 194, 0.6);
    box-shadow: 0 0 0 2px rgba(164, 112, 184, 0.14), 0 0 16px rgba(90, 28, 112, 0.48), 0 0 34px rgba(54, 0, 70, 0.38), 0 26px 44px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 24px rgba(112, 52, 132, 0.14);
    overflow: visible;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
}

    .login-screen::before {
        content: "";
        position: absolute;
        inset: 12px;
        border-radius: 22px;
        /*border: 1px solid rgba(255, 255, 255, 0.09);*/
        pointer-events: none;
    }

    .login-screen::after {
        content: "";
        position: absolute;
        left: 8%;
        right: 8%;
        bottom: -18px;
        height: 42px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 187, 13, 0.22) 0%, rgba(97, 31, 118, 0.16) 45%, rgba(97, 31, 118, 0) 78%);
        filter: blur(12px);
        pointer-events: none;
    }

    .login-screen h2 {
        margin-top: 0;
        color: white;
    }

#login-go {
    font-family: 'Fjalla One', Arial, sans-serif;
    font-size: clamp(18px, min(5vw, 3.5vh), 25px);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-title {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 1vh, 12px);
    margin-bottom: clamp(6px, 1.5vh, 22px);
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
}

.loading-img {
    height: clamp(30px, 12vh, 120px);
    display: none;
    margin: auto;
    width: 80%;
    object-fit: contain;
    flex-shrink: 1;
    min-height: 0;
}

.logo-img {
    height: auto;
    display: block;
    margin: auto;
    width: min(80%, 290px);
    max-height: clamp(40px, 14vh, 150px);
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(23, 8, 42, 0.55));
    flex-shrink: 1;
    min-height: 0;
}

.login-form input[type="text"] {
    text-align: center;
    background: linear-gradient(180deg, rgba(63, 11, 81, 0.96) 0%, rgba(47, 4, 62, 0.98) 100%);
    border: 1px solid rgba(144, 101, 160, 0.58);
    border-radius: 100px;
    font-size: clamp(16px, 4vw, 23px);
    font-weight: 700;
    color: white;
    padding: clamp(8px, 1.5vh, 16px) 22px;
    width: 100%;
    max-width: 360px;
    transition: border-color .25s, box-shadow .25s, transform .25s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.03), 0 8px 20px rgba(18, 0, 24, 0.4);
}

    .login-form input[type="text"]::placeholder {
        color: rgba(255, 255, 255, 0.45);
    }

    .login-form input[type="text"]:focus {
        border-color: rgba(255, 187, 13, 0.9);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 187, 13, 0.2), 0 0 18px rgba(255, 187, 13, 0.22);
        transform: translateY(-1px);
    }

.btn {
    border: 1px solid rgba(255, 233, 167, 0.9);
    background: linear-gradient(180deg, #ffd15c 0%, #ffbb0d 55%, #d89200 100%);
    color: #4a2500;
    font-size: 20px;
    padding: clamp(8px, 1.5vh, 14px) 0;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255, 246, 214, 0.45);
    border-radius: 100px;
    box-shadow: 0 0 0 2px rgba(255, 187, 13, 0.22), inset 0 1px 0 rgba(255, 250, 229, 0.55), 0 10px 28px rgba(255, 187, 13, 0.24), 0 0 22px rgba(54, 0, 70, 0.24);
    transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

    .btn:hover {
        box-shadow: 0 0 0 2px rgba(255, 205, 79, 0.32), inset 0 1px 0 rgba(255, 251, 233, 0.65), 0 14px 34px rgba(255, 187, 13, 0.3), 0 0 28px rgba(255, 187, 13, 0.22);
        filter: brightness(1.03);
        transform: translateY(-1px);
    }

    .btn:active {
        transform: translateY(1px);
    }

.qx-avatar-btn {
    width: clamp(32px, min(12vh, 18vw), 84px);
    height: clamp(32px, min(12vh, 18vw), 84px);
    top: calc(clamp(32px, min(12vh, 18vw), 84px) * -0.4);
}

@media screen and (max-height: 420px) {
    .logo-img {
        display: none;
    }

    .loading-img {
        display: none !important;
    }

    .qx-avatar-btn {
        width: clamp(32px, min(12vh, 18vw), 52px);
        height: clamp(32px, min(12vh, 18vw), 52px);
        top: calc(clamp(32px, min(12vh, 18vw), 52px) * -0.4);
        right: 10px;
        border-width: 2px;
    }
}

@media screen and (max-height: 200px) {
    .login-screen {
        border-style: none;
        background-color: transparent;
        box-shadow: none;
        padding: 6px;
        border-radius: 0;
    }
}

@media screen and (max-width: 195px ) {
    .logo-img {
        height: auto;
    }

    input {
        border-radius: 5px;
    }

    .btn {
        border-radius: 5px;
    }
}

.login-form {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.5vh, 14px);
    flex-shrink: 0;
}

.control-group {
    margin-bottom: 0;
    width: 100%;
    max-width: 360px;
}

.pin-code-field {
    font-weight: bold !important;
}

.nickname-field {
    font-weight: bold !important;
}

.app-title h6 {
    margin-top: -10px;
    font-weight: normal;
    user-select: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    color: rgba(244, 228, 250, 0.72);
    line-height: 1.45;
    max-width: 320px;
    margin-bottom: 0;
}

@media screen and (max-height: 550px) {
    #qx-login-incognito {
        display: none;
    }
}

@media screen and (max-width: 150px) {
    #qx-login-incognito {
        display: none;
    }
}

#qx-login-subtitle {
    font-size: clamp(22px, min(7vw, 5vh), 44px);
    letter-spacing: 0.06em;
    margin-bottom: 0;
    text-shadow: 0 4px 18px rgba(54, 0, 70, 0.45);
}

@media screen and (max-height: 480px) {
    #qx-login-subtitle {
        display: none;
    }
}

.login-link {
    font-size: 14px;
    color: rgba(247, 238, 255, 0.76);
    display: block;
    margin-top: 2px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

    .login-link:hover {
        color: white;
    }

@media screen and (max-height: 450px) {
    .login-link {
        display: none;
    }
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

#pulse-container {
    height: 396px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: min(360px, 88vw);
    margin: -147px auto 0;
    z-index: -1;
    filter: blur(2px);
    scale: 0.75;
}

@media screen and (max-width: 150px ) {
    #pulse-container {
        display: none;
    }
}

@media screen and (max-height: 500px) {
    #pulse-container {
        display: none;
    }
}

.pulse-circle {
    border-radius: 50%;
    background: purple;
    width: calc(min(40vw, 250px));
    height: calc(min(40vw, 250px));
    position: absolute;
    opacity: 0;
    animation: scaleIn 4s infinite cubic-bezier(.36, .11, .89, .32);
    z-index: -1;
}

@keyframes scaleIn {
    from {
        transform: scale(.5, .5);
        opacity: .5;
    }

    to {
        transform: scale(2.5, 2.5);
        opacity: 0;
    }
}


/* Loading animation */
.loader {
    width: clamp(30px, 12vh, 120px);
    height: clamp(30px, 12vh, 120px);
    border: 5px solid #FFF;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    position: relative;
    animation: pulse 1s linear infinite;
    display: none;
    margin: auto;
    overflow: visible;
    scale: 0.8;
}

    .loader:after {
        content: '';
        position: absolute;
        width: clamp(30px, 12vh, 120px);
        height: clamp(30px, 12vh, 120px);
        border: 5px solid #FFF;
        border-radius: 50%;
        display: inline-block;
        box-sizing: border-box;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        animation: scaleUp 1s linear infinite;
    }

@keyframes scaleUp {
    0% {
        transform: translate(-50%, -50%) scale(0)
    }

    60%, 100% {
        transform: translate(-50%, -50%) scale(1)
    }
}

@keyframes pulse {
    0%, 60%, 100% {
        transform: scale(1)
    }

    80% {
        transform: scale(1.2)
    }
}
