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

@keyframes scan-lines {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

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

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

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

body {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff0030, transparent);
    animation: scan-lines 3s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.main-container {
    width: 100vw;
    height: 100dvh;
    position: relative;
    border: 3px solid #ff4444;
    box-shadow: 0 0 30px #ff4444;
}

/* Chain-specific themes */
.main-container.theme-eth {
    border-color: rgb(229, 9, 20);
    box-shadow: 0 0 30px rgb(229, 9, 20);
}

.main-container.theme-base {
    border-color: rgb(0, 82, 255);
    box-shadow: 0 0 30px rgb(0, 82, 255);
}

.main-container.theme-sol {
    border-color: rgb(153, 69, 255);
    box-shadow: 0 0 30px rgb(153, 69, 255);
}

.main-container.theme-btc {
    border-color: rgb(242, 169, 0);
    box-shadow: 0 0 30px rgb(242, 169, 0);
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(90deg, 
        rgba(26, 26, 26, 0.95) 0%, 
        rgba(42, 42, 42, 0.95) 50%, 
        rgba(26, 26, 26, 0.95) 100%);
    border-bottom: 2px solid #ff4444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.theme-eth .header {
    border-bottom-color: rgb(229, 9, 20);
}

.theme-base .header {
    border-bottom-color: rgb(0, 82, 255);
}

.theme-sol .header {
    border-bottom-color: rgb(153, 69, 255);
}

.theme-btc .header {
    border-bottom-color: rgb(242, 169, 0);
}

.system-title {
    font-size: 18px;
    color: #ff4444;
    text-shadow: 0 0 10px #ff4444;
    letter-spacing: 3px;
    font-weight: bold;
    animation: pulse 2s ease-in-out infinite;
}

.theme-eth .system-title {
    color: rgb(229, 9, 20);
    text-shadow: 0 0 10px rgb(229, 9, 20);
}

.theme-base .system-title {
    color: rgb(0, 82, 255);
    text-shadow: 0 0 10px rgb(0, 82, 255);
}

.theme-sol .system-title {
    color: rgb(153, 69, 255);
    text-shadow: 0 0 10px rgb(153, 69, 255);
}

.theme-btc .system-title {
    color: rgb(242, 169, 0);
    text-shadow: 0 0 10px rgb(242, 169, 0);
}

.chain-selector {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.chain-btn {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #666;
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.chain-btn:hover {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.chain-btn.active {
    animation: glitch 0.3s ease-in-out;
}

.theme-eth .chain-btn.active {
    border-color: rgb(229, 9, 20);
    color: rgb(229, 9, 20);
    box-shadow: 0 0 15px rgb(229, 9, 20);
}

.theme-base .chain-btn.active {
    border-color: rgb(0, 82, 255);
    color: rgb(0, 82, 255);
    box-shadow: 0 0 15px rgb(0, 82, 255);
}

.theme-sol .chain-btn.active {
    border-color: rgb(153, 69, 255);
    color: rgb(153, 69, 255);
    box-shadow: 0 0 15px rgb(153, 69, 255);
}

.theme-btc .chain-btn.active {
    border-color: rgb(242, 169, 0);
    color: rgb(242, 169, 0);
    box-shadow: 0 0 15px rgb(242, 169, 0);
}

#visualizationCanvas {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.8), #000);
    touch-action: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-top: 2px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #00ff00;
}

/* Responsive */
@media (max-width: 1024px) {
    .header {
        height: 70px;
    }

    #visualizationCanvas {
        top: 70px;
        height: calc(100% - 70px);
        touch-action: none;
    }
}
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        height: 80px;
        padding: 10px;
    }
    
    .system-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .chain-btn {
        padding: 8px 12px;
        font-size: 10px;
    }
    
    #visualizationCanvas {
        top: 80px;
        height: calc(100% - 80px);
        touch-action: none;
    }
}

@media (max-width: 480px) {
    .header {
        height: 70px;
        padding: 8px;
    }

    .system-title {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .chain-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .chain-btn {
        padding: 6px 10px;
        font-size: 9px;
        margin: 2px;
    }

    #visualizationCanvas {
        top: 70px;
        height: calc(100% - 70px);
        touch-action: none;
    }
}

