:root {
    color-scheme: dark;
    --page-bg: #000;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--page-bg);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.space-stage,
.space-frame,
#starfield {
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
}

.space-frame {
    position: fixed;
    inset: 0;
    background: #000;
}

#starfield {
    display: block;
    touch-action: none;
}

#earth-stage {
    position: fixed;
    left: 50%;
    top: 50%;
    width: clamp(280px, 34vw, 560px);
    height: clamp(280px, 34vw, 560px);
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    transition:
        left 900ms cubic-bezier(.2, .8, .2, 1),
        top 900ms cubic-bezier(.2, .8, .2, 1),
        width 900ms cubic-bezier(.2, .8, .2, 1),
        height 900ms cubic-bezier(.2, .8, .2, 1),
        filter 900ms ease;
    z-index: 2;
}

#earth-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#content-stage {
    position: fixed;
    top: 50%;
    right: clamp(24px, 7vw, 132px);
    width: min(42vw, 620px);
    height: min(58vh, 560px);
    transform: translateY(-50%) translateX(28px);
    border-left: 1px solid rgba(180, 210, 255, 0);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    padding-left: clamp(24px, 4vw, 64px);
    transition:
        opacity 650ms ease 180ms,
        transform 900ms cubic-bezier(.2, .8, .2, 1),
        border-color 900ms ease;
    z-index: 1;
}

.space-frame.is-verifying #earth-stage {
    left: 50%;
    top: 50%;
    width: clamp(280px, 34vw, 560px);
    height: clamp(280px, 34vw, 560px);
    filter: saturate(1.04) brightness(1.04);
}

.space-frame.is-open #earth-stage {
    left: clamp(190px, 27vw, 520px);
    width: clamp(230px, 28vw, 460px);
    height: clamp(230px, 28vw, 460px);
    filter: saturate(0.92) brightness(0.92);
}

.space-frame.is-open #content-stage {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    border-color: rgba(180, 210, 255, 0.22);
    pointer-events: auto;
}

.space-frame.is-verifying #content-stage {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(28px);
    border-color: rgba(180, 210, 255, 0);
}

.site-footer {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(208, 236, 255, 0.36);
    font-family: "Courier New", Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0;
    line-height: 1.2;
    pointer-events: none;
    text-align: center;
    text-shadow: 0 0 8px rgba(92, 191, 255, 0.18);
    white-space: nowrap;
}

.terminal-form {
    width: min(100%, 520px);
    color: rgba(208, 236, 255, 0.92);
    font-family: "Courier New", Consolas, monospace;
    font-size: clamp(17px, 1.75vw, 28px);
    line-height: 1.35;
    text-shadow: 0 0 14px rgba(92, 191, 255, 0.28);
}

.terminal-panel {
    display: none;
}

.terminal-panel.is-active {
    display: block;
}

.terminal-line {
    display: block;
    min-height: 1.35em;
    letter-spacing: 0;
    margin: 0;
    white-space: pre-line;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0.55em;
    min-height: 1.6em;
    margin-top: 0.85em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 320ms ease;
}

.terminal-panel.is-ready .terminal-input-row {
    opacity: 1;
    transform: translateY(0);
}

.terminal-prompt {
    color: rgba(118, 216, 255, 0.82);
}

#visitor-email,
#visitor-password,
#visitor-full-name,
#visitor-date-of-birth,
#visitor-country,
#visitor-new-password,
#visitor-confirm-password {
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(235, 248, 255, 0.95);
    caret-color: rgba(208, 236, 255, 0.95);
    font: inherit;
    letter-spacing: 0;
}

#visitor-email::selection,
#visitor-password::selection,
#visitor-full-name::selection,
#visitor-date-of-birth::selection,
#visitor-new-password::selection,
#visitor-confirm-password::selection {
    background: rgba(118, 216, 255, 0.28);
}

#visitor-country {
    min-width: min(100%, 360px);
}

.country-suggestions {
    display: none;
    width: min(100%, 420px);
    max-height: 220px;
    margin-top: 0.7em;
    overflow-y: auto;
    border: 1px solid rgba(118, 216, 255, 0.34);
    border-radius: 4px;
    background: rgba(1, 8, 18, 0.94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.country-suggestions.is-open {
    display: block;
}

.country-suggestion {
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(235, 248, 255, 0.95);
    cursor: pointer;
    display: block;
    font: inherit;
    padding: 0.42em 0.62em;
    text-align: left;
}

.country-suggestion:hover,
.country-suggestion:focus-visible,
.country-suggestion.is-active {
    background: rgba(35, 129, 184, 0.32);
    outline: 0;
}

#visitor-date-of-birth::placeholder {
    color: rgba(208, 236, 255, 0.38);
}

.registration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 1.15em;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 320ms ease;
}

.terminal-panel.is-ready .registration-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.registration-actions button {
    min-width: 88px;
    border: 1px solid rgba(220, 246, 255, 0.32);
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18) 24%, rgba(118, 216, 255, 0.08) 54%, rgba(3, 18, 34, 0.38) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(82, 196, 255, 0.12) 45%, rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(18px) saturate(1.45);
    -webkit-backdrop-filter: blur(18px) saturate(1.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        inset 0 -12px 20px rgba(4, 27, 46, 0.22),
        0 8px 26px rgba(0, 0, 0, 0.34),
        0 0 18px rgba(92, 191, 255, 0.12);
    color: rgba(235, 248, 255, 0.95);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    padding: 0.58em 0.84em;
    text-align: center;
    text-shadow: 0 1px 10px rgba(7, 25, 42, 0.48);
    transition:
        background 240ms ease,
        border-color 240ms ease,
        box-shadow 240ms ease,
        transform 240ms ease;
}

.registration-actions button:hover,
.registration-actions button:focus-visible {
    background:
        radial-gradient(circle at 30% 12%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.24) 25%, rgba(118, 216, 255, 0.14) 56%, rgba(4, 22, 42, 0.44) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(82, 196, 255, 0.18) 45%, rgba(255, 255, 255, 0.1));
    border-color: rgba(220, 246, 255, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        inset 0 -12px 20px rgba(4, 27, 46, 0.18),
        0 10px 30px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(118, 216, 255, 0.26);
    outline: 0;
    transform: translateY(-1px);
}

.registration-actions button:active {
    transform: translateY(0) scale(0.98);
}

@media (max-width: 760px) {
    .space-frame.is-open #earth-stage {
        left: 50%;
        top: 31%;
        width: clamp(210px, 68vw, 360px);
        height: clamp(210px, 68vw, 360px);
    }

    #content-stage {
        top: auto;
        left: 50%;
        right: auto;
        bottom: 7vh;
        width: min(82vw, 520px);
        height: 34vh;
        transform: translateX(-50%) translateY(24px);
        border-left: 0;
        border-top: 1px solid rgba(180, 210, 255, 0);
        align-items: flex-start;
        padding: 26px 0 0;
    }

    .space-frame.is-open #content-stage {
        transform: translateX(-50%) translateY(0);
        border-top-color: rgba(180, 210, 255, 0.22);
    }
}
