:root {
    --primary-color: #8b6cff;
    --primary-dark: #6a4de0;
    --secondary-color: #c7a776;
    --accent-color: #c2b6ff;
    --success-color: #2fd07b;
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.72);
    --background: #0b0c10;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
    --gradient-primary: linear-gradient(135deg, #8b6cff 0%, #bca7ff 100%);
    --gradient-secondary: linear-gradient(135deg, #c7a776 0%, #f0d7b1 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 20% 10%, rgba(139, 108, 255, 0.25), transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(199, 167, 118, 0.18), transparent 50%),
        radial-gradient(circle at 50% 90%, rgba(194, 182, 255, 0.15), transparent 55%),
        var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient::before,
.ambient::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: ambientDrift 26s ease-in-out infinite;
}

.ambient::before {
    background: rgba(139, 108, 255, 0.35);
    top: -10%;
    left: -5%;
}

.ambient::after {
    background: rgba(199, 167, 118, 0.28);
    bottom: -15%;
    right: -10%;
    animation-delay: -8s;
}

.orb {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.65;
    animation: orbFloat 18s ease-in-out infinite;
}

.orb-1 {
    background: rgba(139, 108, 255, 0.35);
    top: -160px;
    left: -120px;
    animation-delay: -4s;
}

.orb-2 {
    background: rgba(199, 167, 118, 0.28);
    top: 20%;
    right: -160px;
    animation-duration: 22s;
}

.orb-3 {
    background: rgba(194, 182, 255, 0.25);
    bottom: -200px;
    left: 35%;
    animation-duration: 26s;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.header {
    padding: 2rem 0;
    text-align: center;
}

.logo {
    display: inline-block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 2rem 4rem;
}

.hero {
    text-align: center;
    max-width: 720px;
    margin-bottom: 3.5rem;
}

.hero-title {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-caption {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: rgba(245, 245, 247, 0.6);
    letter-spacing: 0.02em;
}

.test-button-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.launch-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

.launch-ring {
    --progress: 0deg;
    position: relative;
    width: min(220px, 70vw);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 10px;
    background: conic-gradient(#c7a776 var(--progress), rgba(255, 255, 255, 0.12) 0deg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.launch-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: rgba(10, 12, 18, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
}

    width: min(380px, 80vw);
    background: rgba(10, 12, 18, 0.6);
    border-radius: 28px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.console-screen {
    background: linear-gradient(160deg, rgba(18, 20, 28, 0.95), rgba(10, 12, 18, 0.7));
    border-radius: 22px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

.console-display {
    position: relative;
    width: 100%;
    height: 220px;
}

.console-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 76px;
    height: 54px;
    transform: translate(-50%, -50%);
    transition: transform 0.45s ease;
    z-index: 3;
}

.console-body {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(139, 108, 255, 0.9), rgba(199, 167, 118, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.console-base {
    position: absolute;
    bottom: -12px;
    left: 50%;
    width: 58px;
    height: 8px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(245, 245, 247, 0.7);
    opacity: 0.85;
}

.console-light {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9bf6ff;
    box-shadow: 0 0 14px rgba(155, 246, 255, 0.9);
    animation: lightBlink 2.2s ease-in-out infinite;
}

.console-network {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.network-node {
    position: absolute;
    width: 18px;
    height: 14px;
    border-radius: 5px;
    background: rgba(245, 245, 247, 0.15);
    border: 1px solid rgba(194, 182, 255, 0.45);
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s ease;
    animation: nodeFloat 3.4s ease-in-out infinite;
    z-index: 2;
}

.network-node::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    height: 1px;
    width: var(--line-length, 0%);
    transform-origin: 0% 50%;
    transform: rotate(var(--line-rotate, 0deg));
    background: linear-gradient(90deg, rgba(194, 182, 255, 0.8), rgba(139, 108, 255, 0));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.launch-panel.is-running .console-icon {
    transform: translate(-50%, -50%) scale(0.72);
}

.launch-panel.is-running .network-node {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.launch-panel.is-running .network-node::before {
    opacity: 0.8;
    animation: linkPulse 2.2s ease-in-out infinite;
}

.launch-button {
    position: relative;
    z-index: 1;
    width: min(160px, 50vw);
    aspect-ratio: 1;
    background: var(--gradient-secondary);
    color: #0b0c10;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 18px 50px rgba(199, 167, 118, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-button:hover {
    transform: scale(1.03);
    box-shadow: 0 26px 70px rgba(199, 167, 118, 0.45);
}

.launch-button:active {
    transform: scale(0.99);
}

.launch-button.loading {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.launch-panel.is-running .launch-ring {
    transform: scale(0.98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.results {
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.result-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.35);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.result-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.result-value {
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.result-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.restart-button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(245, 245, 247, 0.2);
    padding: 0.85rem 2.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    margin: 0 auto;
}

.restart-button:hover {
    background: var(--surface-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.results-note {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(245, 245, 247, 0.6);
}

.other-tests {
    width: 100%;
    max-width: 860px;
    margin-top: 3.5rem;
}

.other-tests-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.other-tests-title {
    font-family: 'Nunito', 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.other-tests-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.other-tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.other-test-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem 1.4rem;
    border-radius: 18px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.other-test-button:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.other-test-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.footer {
    padding: 2rem 0;
    text-align: center;
    color: rgba(245, 245, 247, 0.5);
    font-size: 0.875rem;
}

.is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.6rem;
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
    }
    
    .console-frame {
        width: min(320px, 90vw);
    }

    .console-screen {
        min-height: 200px;
    }

    .launch-button {
        width: min(140px, 58vw);
        font-size: 0.95rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .result-value {
        font-size: 2rem;
    }

    .other-tests-title {
        font-size: 1.6rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes nodeFloat {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -54%) scale(1.05);
    }
}

@keyframes linkPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

@keyframes lightBlink {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(20px, -30px, 0) scale(1.08);
    }
}

@keyframes ambientDrift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(-30px, 20px, 0) scale(1.12);
    }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(245, 245, 247, 0.4);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.status-error {
    color: #ffb2ad;
}

.error-message {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 59, 48, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 59, 48, 0.3);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
