/* ── Base reset ───────────────────────────────────────────────── */
html {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: linear-gradient(0deg, #040a1f 0%, #04040a 100%);
    background-attachment: fixed;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    color: whitesmoke;
    align-items: center;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ── Title ────────────────────────────────────────────────────── */
#Welcome {
    font-size: 120px;
    margin-top: 0;
    padding-top: 60px;
    margin-bottom: 10px;
    color: whitesmoke;
}

#Welcome:hover {
    animation: glitch 0.4s ease;
}

@keyframes glitch {
    0%   { transform: translate(0   ,0); text-shadow: 0    0    red, 0    0    cyan; }
    28%  { transform: translate(-3px,0); text-shadow: 3px  1px  red, -3px 1px  cyan; }
    54%  { transform: translate(2px ,0); text-shadow: -2px -1px red, 2px  -1px cyan; }
    70%  { transform: translate(-2px,0); text-shadow: 2px  1px  red, -2px 1px  cyan; }
    100% { transform: translate(0   ,0); text-shadow: 0    0    red, 0    0    cyan; }
}

#nedwork {
    font-size: 40px;
    font-stretch: expanded;
    margin-top: 10px;
    color: whitesmoke;
}

#nedwork:hover {
    animation: glitch 0.4s ease;
}

#main-box {
    margin-bottom: 10vh;
}

/* ── Login box ────────────────────────────────────────────────── */
#login-box {
    background-color: #18181856;
    border-color: whitesmoke;
    border-radius: 50px;
    border-style: solid;
    margin-left: 30vw;
    margin-right: 30vw;
    padding-bottom: 4px;
}

.login_input {
    background-color: #18181856;
    border-color: whitesmoke;
    border-radius: 10px;
    padding: 5px;
    color: whitesmoke;
    margin-bottom: 20px;
    font-size: 20px;
    width: 80%;
}

#buttons {
    display: grid;
    grid-template-columns: 40% 20% 40%;
    width: 80%;
    margin: auto;
}

#reg-button {
    grid-column: 3;
}

#log-button, #reg-button {
    background-color: #515ada79;
    border-radius: 20px;
    border-style: none;
    margin-bottom: 10px;
    font-size: x-large;
    color: whitesmoke;
    cursor: pointer;
    padding: 8px 0;
    transition: background-color 0.2s;
}

#log-button:hover, #reg-button:hover {
    background-color: #515adaaa;
}

/* ── Custom cursor (desktop only) ────────────────────────────── */
@media (pointer: fine) {
    * { cursor: none !important; }

    #cursor {
        position: fixed;
        width: 12px; height: 12px;
        background: #515ada;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: transform 0.08s, width 0.2s, height 0.2s, background 0.2s, opacity 0.2s;
        mix-blend-mode: screen;
        display: block;
    }

    #cursor-ring {
        position: fixed;
        width: 36px; height: 36px;
        border: 1.5px solid rgba(81,90,218,0.5);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9998;
        transform: translate(-50%, -50%);
        transition: transform 0.18s ease-out, width 0.25s, height 0.25s, opacity 0.25s, border-color 0.2s;
        display: block;
    }

    #cursor.hovered  { width: 20px; height: 20px; background: #fff; }
    #cursor-ring.hovered { width: 54px; height: 54px; border-color: rgba(255,255,255,0.3); }
    #cursor.clicking { transform: translate(-50%, -50%) scale(0.7); }
}

/* Hide cursors on touch devices */
@media (pointer: coarse) {
    #cursor,
    #cursor-ring {
        display: none !important;
    }
}

/* ── Canvas background ────────────────────────────────────────── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -10;
    pointer-events: none;
}

/* ── Pulse bar ────────────────────────────────────────────────── */
#pulse-bar {
    margin: auto;
    width: 30vw;
    height: 2px;
    background: linear-gradient(90deg, transparent, #515ada, transparent);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    50%      { opacity: 20%; }
    0%, 100% { opacity: 80%; }
}

/* ── Tablet (≤ 1024px) ────────────────────────────────────────── */
@media (max-width: 1024px) {
    #Welcome {
        font-size: 80px;
        padding-top: 50px;
    }

    #nedwork {
        font-size: 32px;
    }

    #login-box {
        margin-left: 15vw;
        margin-right: 15vw;
    }
}

/* ── Mobile (≤ 600px) ─────────────────────────────────────────── */
@media (max-width: 600px) {
    #Welcome {
        font-size: 48px;
        padding-top: 36px;
        margin-bottom: 6px;
    }

    #nedwork {
        font-size: 22px;
        margin-top: 6px;
    }

    #main-box {
        margin-bottom: 6vh;
    }

    #pulse-bar {
        width: 60vw;
    }

    /* Full-width login box with safe side padding */
    #login-box {
        margin-left: 4vw;
        margin-right: 4vw;
        border-radius: 28px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .login-titel {
        font-size: 22px;
    }

    .login-text {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .login_input {
        font-size: 16px; /* prevents iOS auto-zoom on focus */
        width: 85%;
        padding: 8px 10px;
        margin-bottom: 14px;
        box-sizing: border-box;
    }

    #buttons {
        grid-template-columns: 45% 10% 45%;
        width: 85%;
        gap: 0;
        margin-bottom: 4px;
    }

    #log-button, #reg-button {
        font-size: 16px;
        padding: 10px 4px;
        border-radius: 16px;
    }
}

/* ── Very small screens (≤ 360px) ────────────────────────────── */
@media (max-width: 360px) {
    #Welcome {
        font-size: 38px;
    }

    #nedwork {
        font-size: 18px;
    }

    #login-box {
        margin-left: 2vw;
        margin-right: 2vw;
        border-radius: 20px;
    }

    #buttons {
        grid-template-columns: 48% 4% 48%;
    }

    #log-button, #reg-button {
        font-size: 14px;
    }
}
