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

body {
    font-family: 'Orbitron', monospace;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    color: #ffffff;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="0.5" fill="white" opacity="0.8"/><circle cx="80" cy="10" r="0.3" fill="white" opacity="0.6"/><circle cx="45" cy="70" r="0.4" fill="white" opacity="0.7"/><circle cx="90" cy="50" r="0.2" fill="white" opacity="0.5"/><circle cx="10" cy="90" r="0.3" fill="white" opacity="0.6"/><circle cx="60" cy="30" r="0.5" fill="white" opacity="0.8"/><circle cx="30" cy="60" r="0.2" fill="white" opacity="0.4"/><circle cx="70" cy="80" r="0.4" fill="white" opacity="0.7"/></svg>') repeat;
    animation: twinkle 4s infinite alternate;
    z-index: -2;
}

.nebula {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 0, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 150, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 0, 150, 0.05) 0%, transparent 50%);
    animation: nebula-drift 20s infinite linear;
    z-index: -1;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes nebula-drift {
    0% { transform: rotate(0deg) translateX(10px); }
    100% { transform: rotate(360deg) translateX(10px); }
}

.header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(45deg, rgba(0, 100, 255, 0.1), rgba(150, 0, 255, 0.1));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 150, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.infinity {
    color: #00ff88;
    font-size: 4rem;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    animation: pulse 2s infinite;
}

.main-text {
    background: linear-gradient(45deg, #00ff88, #0096ff, #8000ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    font-weight: 400;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.connection-area {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.input-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: #00ff88;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.connection-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #0096ff;
}

.arrow-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #00ff88, #0096ff);
    margin-bottom: 5px;
    animation: pulse-line 2s infinite;
}

.arrow-head {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.5; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.2); }
}

.connect-btn {
    position: relative;
    background: linear-gradient(45deg, #00ff88, #0096ff);
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.connect-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.4);
}

.connect-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.connect-btn:hover .btn-glow {
    opacity: 1;
    animation: glow-rotate 1s linear infinite;
}

.connection-settings {
    margin-top: 1rem;
    text-align: center;
}

.connection-settings label {
    display: inline-block;
    color: #0096ff;
    font-size: 0.9rem;
    margin-right: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connection-settings select {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 150, 255, 0.3);
    border-radius: 10px;
    color: white;
    padding: 0.5rem 1rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.connection-settings select:focus {
    outline: none;
    border-color: #0096ff;
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.3);
}

.connection-settings select option {
    background: #1a1a2e;
    color: white;
}

@keyframes glow-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-area {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    min-height: 300px;
    position: relative;
}

.loading {
    display: none;
    text-align: center;
    color: #00ff88;
}

.loading.show {
    display: block;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 136, 0.3);
    border-top: 3px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.connection-path {
    display: none;
}

.connection-path.show {
    display: block;
}

.path-step {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #00ff88;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.path-step:nth-child(even) {
    border-left-color: #0096ff;
}

.path-step .emoji {
    font-size: 2rem;
    margin-right: 1rem;
}

.path-step .content {
    flex: 1;
}

.path-step .title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 0.5rem;
}

.path-step .description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-panel {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
}

.history-panel h3 {
    color: #0096ff;
    margin-bottom: 1rem;
    text-align: center;
}

.history-item {
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.history-item:hover {
    background: rgba(0, 255, 136, 0.1);
    transform: translateX(5px);
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #00ff88, transparent);
    border-radius: 50%;
    animation: float 6s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .infinity {
        font-size: 2.5rem;
    }
    
    .input-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .connection-arrow {
        transform: rotate(90deg);
    }
    
    .game-container {
        padding: 1rem;
    }
}