body.home-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0a0f16;
    color: #e6eef7;
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    align-items: safe center;
}

html:has(body.home-gate),
body.home-gate {
    height: 100%;
}

body.home-gate .home-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
}

body.home-gate .orb-1 {
    width: 600px;
    height: 600px;
    top: -15%;
    left: -10%;
    background: radial-gradient(circle, rgba(0, 140, 255, 0.32), transparent 70%);
    animation: home-float-1 18s ease-in-out infinite;
}

body.home-gate .orb-2 {
    width: 700px;
    height: 700px;
    bottom: -20%;
    right: -15%;
    background: radial-gradient(circle, rgba(120, 60, 255, 0.26), transparent 70%);
    animation: home-float-2 22s ease-in-out infinite;
}

body.home-gate .orb-3 {
    width: 500px;
    height: 500px;
    top: 35%;
    left: 55%;
    background: radial-gradient(circle, rgba(0, 200, 255, 0.18), transparent 70%);
    animation: home-float-3 26s ease-in-out infinite;
}

@keyframes home-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    33% { transform: translate(60px, 40px) scale(1.12); opacity: 1; }
    66% { transform: translate(-30px, 70px) scale(0.95); opacity: 0.75; }
}

@keyframes home-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
    40% { transform: translate(-70px, -50px) scale(1.1); opacity: 1; }
    70% { transform: translate(40px, -30px) scale(0.92); opacity: 0.7; }
}

@keyframes home-float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(-80px, 60px) scale(1.15); opacity: 0.9; }
}

body.home-gate .home-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(20, 80, 160, 0.15), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: home-pulse 12s ease-in-out infinite;
}

@keyframes home-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

body.home-gate .lang-switcher {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

body.home-gate .lang-switch-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px 0 8px;
    border: 1px solid rgba(120, 170, 230, 0.22);
    border-radius: 10px;
    background: rgba(15, 22, 32, 0.65);
    color: #a9c6dd;
    font: 600 0.78rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.6px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px -6px rgba(0, 0, 0, 0.6);
}

body.home-gate .lang-switch-toggle:hover {
    border-color: rgba(120, 180, 240, 0.45);
    color: #e6f2ff;
}

body.home-gate .lang-switch-toggle:focus-visible {
    outline: none;
    border-color: rgba(80, 170, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(60, 150, 255, 0.15), 0 4px 18px -6px rgba(0, 140, 255, 0.4);
}

body.home-gate .lang-flag {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 2px;
}

body.home-gate .home-gate-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.home-gate .home-gate-panel h1 {
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 2rem;
    color: #f2f8ff;
    text-shadow: 0 4px 30px rgba(0, 160, 255, 0.25);
}

@keyframes home-rise {
    from {
        opacity: 0;
        transform: translateY(36px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.home-gate .home-gate-panel > h1,
body.home-gate .enter-code-form,
body.home-gate .home-hint {
    animation: home-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.home-gate .home-gate-panel > h1 {
    animation-delay: 0.08s;
}

body.home-gate .enter-code-form {
    animation-delay: 0.2s;
}

body.home-gate .home-hint {
    animation-delay: 0.36s;
}

@keyframes home-leave {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(42px);
    }
}

@keyframes home-orb-out {
    to { opacity: 0; }
}

body.home-gate.is-leaving {
    pointer-events: none;
}

body.home-gate.is-leaving .home-gate-panel,
body.home-gate.is-leaving .lang-switcher,
body.home-gate.is-leaving .boot-screen .boot-status-row {
    animation: home-leave 0.66s cubic-bezier(0.4, 0, 0.7, 0.2) forwards;
}

body.home-gate.is-leaving .home-orb,
body.home-gate.is-leaving .home-glow {
    animation: home-orb-out 0.66s ease forwards;
}

body.home-gate .gate-submit[aria-busy="true"] {
    opacity: 0.72;
    cursor: progress;
}

body.home-gate:not(.home-gate-link) .boot-screen {
    background: rgba(10, 15, 22, 0.34);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.home-gate:not(.home-gate-link) .boot-screen.is-idle,
body.home-gate:not(.home-gate-link) .boot-screen.is-done {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.home-gate:not(.home-gate-link) .boot-screen .boot-orb,
body.home-gate:not(.home-gate-link) .boot-screen .boot-glow {
    display: none;
}

body.home-gate .enter-code-form {
    width: 100%;
}

body.home-gate .input-wrapper {
    position: relative;
    width: 100%;
    background: rgba(15, 22, 32, 0.7);
    border: 1px solid rgba(120, 170, 230, 0.18);
    border-radius: 18px;
    padding: 0.85rem 1.6rem 0.6rem;
    transition: border-color 0.5s ease, background 0.5s ease, box-shadow 0.7s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    text-align: left;
    box-sizing: border-box;
}

body.home-gate .input-wrapper:hover {
    border-color: rgba(120, 180, 240, 0.32);
}

body.home-gate .input-wrapper:focus-within {
    border-color: rgba(80, 170, 255, 0.6);
    background: rgba(18, 28, 42, 0.82);
    box-shadow: 0 0 0 4px rgba(60, 150, 255, 0.09), 0 12px 44px -10px rgba(0, 140, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.home-gate .input-wrapper:has(.input-invalid) {
    border-color: rgba(255, 120, 120, 0.7);
}

body.home-gate .input-wrapper::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    width: 60%;
    height: 20px;
    background: rgba(60, 150, 255, 0.28);
    filter: blur(22px);
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.33, 1, 0.68, 1);
    pointer-events: none;
    z-index: -1;
}

body.home-gate .input-wrapper:focus-within::after {
    opacity: 1;
}

body.home-gate .field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #6f8fab;
    margin-bottom: 0.15rem;
    transition: color 0.6s ease;
}

body.home-gate .input-wrapper:focus-within .field-label {
    color: #6cb6ff;
}

body.home-gate #input-uniquecode {
    width: 100%;
    padding: 0.15rem 0;
    font-size: 1.05rem;
    font-family: "SF Mono", "Fira Code", "JetBrains Mono", ui-monospace, monospace;
    letter-spacing: 2px;
    text-align: left;
    color: #f0f7ff;
    background: transparent;
    border: none;
    outline: none;
    caret-color: #4cb0ff;
    box-sizing: border-box;
}

body.home-gate #input-uniquecode::placeholder {
    color: #4f6a84;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    font-family: Inter, system-ui, sans-serif;
}

body.home-gate .field-error {
    margin: 0.85rem 0 0;
    color: #ff9b9b;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: left;
}

body.home-gate .hidden,
body.home-gate #manual-psn[hidden] {
    display: none !important;
}

body.home-gate .gate-submit {
    width: 100%;
    margin-top: 1.15rem;
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #3b93ff 0%, #1d6fe0 100%);
    color: #fff;
    font: 600 0.95rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 28px -12px rgba(40, 130, 255, 0.9);
}

body.home-gate .gate-submit:hover {
    filter: brightness(1.06);
}

body.home-gate .gate-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(60, 150, 255, 0.35), 0 10px 28px -12px rgba(40, 130, 255, 0.9);
}

body.home-gate .client-notice {
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: rgba(15, 22, 32, 0.7);
    border: 1px solid rgba(120, 170, 230, 0.18);
    color: #d5e6f5;
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: left;
    box-sizing: border-box;
}

body.home-gate .home-hint {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.55rem;
    width: fit-content;
    max-width: 420px;
    margin: 1.5rem auto 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #7f9bb5;
    text-align: left;
    padding: 0 0.5rem;
}

body.home-gate #hintText {
    min-width: 0;
    text-align: left;
}

body.home-gate .home-hint-icon {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 0.15em;
    stroke: #5e8eb0;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.home-gate .home-hint strong {
    color: #a9c6dd;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    body.home-gate .orb-1,
    body.home-gate .orb-2,
    body.home-gate .orb-3,
    body.home-gate .home-glow,
    body.home-gate .home-gate-panel > h1,
    body.home-gate .enter-code-form,
    body.home-gate .home-hint,
    body.home-gate.is-leaving .home-gate-panel,
    body.home-gate.is-leaving .lang-switcher,
    body.home-gate.is-leaving .boot-screen .boot-status-row,
    body.home-gate.is-leaving .home-orb,
    body.home-gate.is-leaving .home-glow {
        animation: none;
    }
}

@media (max-width: 480px) {
    body.home-gate .home-gate-panel h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    body.home-gate .input-wrapper {
        padding: 0.75rem 1.2rem 0.5rem;
    }

    body.home-gate #input-uniquecode {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }

    body.home-gate .home-hint {
        font-size: 0.78rem;
    }

    body.home-gate .lang-switcher {
        top: 1rem;
        right: 1rem;
    }
}
