:root {
    --background: #0c0517;
    --card: rgba(22, 10, 38, 0.94);
    --panel: #160a26;
    --border: rgba(216, 180, 254, 0.13);

    --text: #faf5ff;
    --muted: #c4b5d4;

    --blue: #c084fc;
    --blue-bright: #e879f9;
    --blue-light: #fbcfe8;

    --input: #160a26;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    color: var(--text);
    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(101, 24, 120, 0.24),
            transparent 55%
        ),
        radial-gradient(
            ellipse at 50% 100%,
            rgba(131, 0, 180, 0.10),
            transparent 50%
        ),
        var(--background);

    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
    outline: 2px solid var(--blue-bright);
    outline-offset: 5px;
}

/* ==========================================
   BACKGROUND GRID
========================================== */

.background-grid {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(197, 114, 225, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(197, 114, 225, 0.035) 1px,
            transparent 1px
        );

    background-size: 48px 48px;

    mask-image: linear-gradient(
        to bottom,
        black,
        transparent 95%
    );

    -webkit-mask-image: linear-gradient(
        to bottom,
        black,
        transparent 95%
    );
}

/* Ambient light */

.ambient {
    position: fixed;
    z-index: -2;

    width: 330px;
    height: 330px;

    border-radius: 50%;
    filter: blur(110px);

    opacity: 0.15;
    pointer-events: none;
}

.ambient-one {
    top: -130px;
    left: -130px;
    background: #d516ff;
}

.ambient-two {
    right: -130px;
    bottom: -130px;
    background: #9a00ff;
}

.ambient-three {
    top: 35%;
    left: 50%;

    width: 250px;
    height: 250px;

    background: #ad14bd;
    opacity: 0.07;

    transform: translateX(-50%);
}

/* ==========================================
   MAIN LAYOUT
========================================== */

.boot-screen {
    width: 100%;
    max-width: 1060px;
    margin: auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    animation: page-enter 0.7s var(--ease) both;
}

/* ==========================================
   TOP STATUS BAR
========================================== */

.top-status {
    width: 100%;
    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 0 5px;
    margin-bottom: 24px;

    color: #c4b5d4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.status-indicator {
    position: relative;

    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;
    background: #64e7a3;

    box-shadow: 0 0 12px #64e7a380;
}

.status-indicator::after {
    content: "";

    position: absolute;
    inset: -4px;

    border: 1px solid #64e7a360;
    border-radius: 50%;

    animation: status-pulse 2s ease-out infinite;
}

.status-title {
    color: #fae7ff;
}

.status-divider {
    color: #593560;
}

.status-label {
    color: #946f9b;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.status-version {
    flex-shrink: 0;
    color: #9871a0;
    font-size: 9px;
    letter-spacing: 1.5px;
}

/* ==========================================
   MAIN GLASS PANEL
========================================== */

.loading-panel {
    position: relative;
    isolation: isolate;

    width: 100%;
    max-width: 560px;

    padding: 43px 48px 35px;
    overflow: hidden;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            rgba(45, 15, 49, 0.97),
            rgba(27, 7, 29, 0.97)
        );

    border: 1px solid var(--border);
    border-radius: 24px;

    box-shadow:
        0 35px 100px rgba(0, 0, 0, 0.40),
        0 0 65px rgba(218, 30, 255, 0.045),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    animation: panel-enter 0.8s var(--ease) both;
}

.panel-top-line {
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;

    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(192, 132, 252, 0.85),
        transparent
    );

    box-shadow: 0 0 18px rgba(192, 132, 252, 0.35);
}

/* ==========================================
   LOGO
========================================== */

.logo-container {
    position: relative;

    width: 132px;
    height: 132px;

    display: grid;
    place-items: center;

    margin: 0 auto 28px;
}

.logo-halo {
    position: absolute;

    width: 100px;
    height: 100px;

    border-radius: 50%;

    background: rgba(215, 47, 255, 0.12);
    filter: blur(28px);

    animation: halo-breathe 3.5s ease-in-out infinite;
}

.logo-frame {
    position: relative;
    z-index: 2;

    width: 94px;
    height: 94px;
    padding: 10px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background: linear-gradient(
        145deg,
        #3c1543,
        #1e0921
    );

    border: 1px solid rgba(211, 111, 255, 0.43);
    border-radius: 23px;

    box-shadow:
        0 0 35px rgba(209, 46, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    transform: rotate(-3deg);

    animation: logo-float 4s ease-in-out infinite;
}

.server-logo {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
    object-position: center;

    border-radius: 11px;
}

.logo-fallback {
    display: none;

    width: 100%;
    height: 100%;

    place-items: center;

    color: var(--text);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -3px;
}

.logo-fallback span {
    color: var(--blue);
}

/* Orbit rings */

.logo-orbit {
    position: absolute;
    inset: 0;

    border: 1px solid rgba(192, 132, 252, 0.16);
    border-radius: 50%;

    pointer-events: none;
}

.orbit-one {
    transform: scale(1);
    animation: orbit-pulse 4s ease-in-out infinite;
}

.orbit-two {
    inset: 11px;
    border-color: rgba(192, 132, 252, 0.10);

    animation: orbit-pulse 4s ease-in-out infinite 1s;
}

/* Frame corner markers */

.logo-corner {
    position: absolute;
    z-index: 3;

    width: 12px;
    height: 12px;

    border-color: var(--blue);
    border-style: solid;

    opacity: 0.8;
}

.corner-tl {
    top: 9px;
    left: 9px;

    border-width: 1px 0 0 1px;
}

.corner-tr {
    top: 9px;
    right: 9px;

    border-width: 1px 1px 0 0;
}

.corner-bl {
    bottom: 9px;
    left: 9px;

    border-width: 0 0 1px 1px;
}

.corner-br {
    bottom: 9px;
    right: 9px;

    border-width: 0 1px 1px 0;
}

/* ==========================================
   CONNECTION LABEL
========================================== */

.system-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-bottom: 20px;

    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.label-line {
    width: 26px;
    height: 1px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(192, 132, 252, 0.65)
    );
}

.label-line:last-child {
    transform: rotate(180deg);
}

.connection-dot {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;

    border-radius: 50%;
    background: var(--blue-bright);

    box-shadow: 0 0 9px var(--blue);
}

/* ==========================================
   HEADING
========================================== */

.loading-panel h1 {
    display: flex;
    flex-direction: column;
    align-items: center;

    color: #dab9e0;

    font-size: clamp(22px, 4vw, 27px);
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 4px;
}

.brand-gradient {
    display: inline-block;

    margin-top: 1px;

    color: var(--blue-bright);
    font-size: clamp(38px, 7vw, 54px);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 4px;

    background: linear-gradient(
        110deg,
        #f7e7ff 0%,
        #e879f9 35%,
        #c940ff 70%,
        #edd0ff 100%
    );

    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    filter: drop-shadow(0 0 23px rgba(202, 54, 255, 0.12));
}

.subtitle {
    margin-top: 14px;

    color: #e0c4e5;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.description {
    margin-top: 11px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
}

/* ==========================================
   LOADING SECTION
========================================== */

.loading-section {
    margin-top: 35px;
    text-align: left;
}

.loading-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 12px;

    color: #c29dc9;
    font-size: 11px;
    font-weight: 600;
}

.loading-status-group {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

#loadingStatus {
    overflow-wrap: anywhere;
}

.mini-status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;

    border-radius: 50%;
    background: var(--blue);

    box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

#loadingPercent {
    flex-shrink: 0;

    color: var(--blue-bright);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Progress track */

.progress-track {
    position: relative;

    width: 100%;
    height: 7px;

    overflow: hidden;

    background: #110313;
    border: 1px solid rgba(216, 180, 254, 0.11);
    border-radius: 20px;

    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.progress-fill {
    position: relative;
    z-index: 1;

    width: 0%;
    height: 100%;

    border-radius: inherit;

    background: linear-gradient(
        90deg,
        #de26ff,
        #c084fc,
        #dca2ff
    );

    box-shadow: 0 0 15px rgba(192, 132, 252, 0.38);

    transition: width 0.25s ease;
}

.progress-glow {
    position: absolute;
    z-index: 2;

    top: 0;
    bottom: 0;
    left: -35%;

    width: 30%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );

    transform: skewX(-20deg);

    animation: progress-shine 2s linear infinite;

    pointer-events: none;
}

/* Loading details */

.loading-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: 12px;

    color: #8b5f93;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.loading-secure {
    color: #7fbdab;
    text-align: right;
}

.loading-secure span {
    color: #64e7a3;
    font-size: 7px;
}

/* ==========================================
   TERMINAL MESSAGE
========================================== */

.system-log {
    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;

    margin-top: 22px;
    padding: 12px 14px;

    overflow: hidden;

    color: #b48cbc;
    background: rgba(17, 3, 19, 0.65);

    border: 1px solid rgba(216, 180, 254, 0.09);
    border-radius: 9px;

    text-align: left;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.6;
}

.log-prefix {
    flex-shrink: 0;
    color: var(--blue);
    font-weight: 800;
}

#systemMessage {
    min-width: 0;
    overflow-wrap: anywhere;
}

.terminal-cursor {
    width: 6px;
    height: 12px;
    flex-shrink: 0;

    background: var(--blue);

    animation: cursor-blink 1s steps(2, start) infinite;
}

/* ==========================================
   ENTER WEBSITE BUTTON
========================================== */

.enter-button {
    position: relative;
    isolation: isolate;

    width: 100%;
    min-height: 65px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-top: 20px;
    padding: 13px 19px;

    overflow: hidden;

    color: #14051f;

    background: linear-gradient(
        110deg,
        #dba3ff,
        #c084fc 55%,
        #cd43ff
    );

    border: 1px solid rgba(228, 179, 255, 0.55);
    border-radius: 11px;

    box-shadow:
        0 7px 25px rgba(208, 54, 255, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);

    transition:
        transform 0.25s var(--ease),
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.enter-button::before {
    content: "";

    position: absolute;
    z-index: -1;

    top: -60%;
    left: -100%;

    width: 60%;
    height: 220%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.45),
        transparent
    );

    transform: rotate(24deg);

    transition: left 0.65s var(--ease);
}

.enter-button:hover::before {
    left: 150%;
}

.enter-button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 12px 35px rgba(208, 54, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);

    filter: brightness(1.04);
}

.enter-button:active {
    transform: translateY(0) scale(0.99);
}

.button-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.button-title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

.button-subtitle {
    color: rgba(20, 5, 31, 0.7);
    font-size: 10px;
    font-weight: 600;
}

.button-arrow {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    display: grid;
    place-items: center;

    color: #f8eaff;
    background: rgba(44, 4, 57, 0.9);
    border-radius: 9px;

    font-size: 19px;

    transition:
        transform 0.25s ease,
        background 0.25s ease;
}

.enter-button:hover .button-arrow {
    transform: translate(2px, -2px);
    background: #22062a;
}

/* ==========================================
   REDIRECT NOTE
========================================== */

.redirect-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 18px;

    color: #96719d;
    font-size: 10px;
    line-height: 1.6;
}

.redirect-dot {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;

    border-radius: 50%;
    background: #95739b;
}

/* ==========================================
   FOOTER
========================================== */

.boot-footer {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 24px;
    padding: 10px 0;

    color: #83608a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-align: center;
}

.footer-separator {
    color: #53305a;
}

.footer-right {
    margin-left: auto;
    color: #7b5084;
    font-size: 8px;
    letter-spacing: 1px;
}

/* ==========================================
   ANIMATIONS
========================================== */

@keyframes page-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logo-float {
    0%, 100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

@keyframes halo-breathe {
    0%, 100% {
        opacity: 0.6;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

@keyframes orbit-pulse {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.94);
    }

    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes status-pulse {
    0% {
        opacity: 0.8;
        transform: scale(0.8);
    }

    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

@keyframes progress-shine {
    from {
        left: -35%;
    }

    to {
        left: 110%;
    }
}

@keyframes cursor-blink {
    to {
        visibility: hidden;
    }
}

/* ==========================================
   TABLETS
========================================== */

@media (max-width: 768px) {
    body {
        padding: 22px;
    }

    .loading-panel {
        max-width: 520px;
        padding: 38px 35px 30px;
    }

    .footer-right {
        display: none;
    }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 520px) {
    body {
        padding: 16px;
    }

    .top-status {
        margin-bottom: 17px;
        min-height: 35px;
        font-size: 9px;
        letter-spacing: 1.2px;
    }

    .status-left {
        gap: 8px;
    }

    .status-label {
        font-size: 8px;
        letter-spacing: 0.7px;
    }

    .status-version {
        font-size: 8px;
    }

    .loading-panel {
        padding: 32px 23px 25px;
        border-radius: 19px;
    }

    .logo-container {
        width: 112px;
        height: 112px;
        margin-bottom: 23px;
    }

    .logo-frame {
        width: 82px;
        height: 82px;
        padding: 8px;
        border-radius: 20px;
    }

    .logo-corner {
        width: 10px;
        height: 10px;
    }

    .system-label {
        gap: 7px;
        margin-bottom: 17px;
        font-size: 8px;
        letter-spacing: 1.4px;
    }

    .label-line {
        width: 18px;
    }

    .loading-panel h1 {
        font-size: 22px;
        letter-spacing: 2.8px;
    }

    .brand-gradient {
        font-size: clamp(36px, 10vw, 47px);
        letter-spacing: 2.5px;
    }

    .subtitle {
        font-size: 13px;
    }

    .description {
        font-size: 11px;
    }

    .loading-section {
        margin-top: 29px;
    }

    .loading-info {
        font-size: 10px;
    }

    .loading-details {
        font-size: 7px;
        letter-spacing: 1px;
    }

    .system-log {
        margin-top: 19px;
        padding: 11px;
        font-size: 9px;
    }

    .enter-button {
        min-height: 60px;
        padding: 12px 14px;
    }

    .boot-footer {
        gap: 8px;
        margin-top: 18px;
        font-size: 8px;
        letter-spacing: 0.8px;
    }
}

/* ==========================================
   SMALL PHONES
========================================== */

@media (max-width: 360px) {
    body {
        padding: 12px;
    }

    .loading-panel {
        padding: 28px 17px 22px;
    }

    .status-label {
        display: none;
    }

    .status-divider {
        display: none;
    }

    .loading-panel h1 {
        font-size: 19px;
        letter-spacing: 2px;
    }

    .brand-gradient {
        font-size: 34px;
    }

    .system-label {
        font-size: 7px;
        letter-spacing: 1px;
    }

    .loading-details {
        font-size: 6px;
    }

    .footer-separator {
        display: none;
    }
}

/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}