/* GLOBAL RESET & FONTS */
:root {
    --bg-dark: #050a14;
    --panel-bg: rgba(10, 20, 40, 0.6);
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --alert-red: #ff2a2a;
    --matrix-green: #0f0;
    --text-main: #e0f0ff;
    --glass-border: 1px solid rgba(0, 243, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: url('https://turbo-cdn.dev/banner/blue-neural-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Scanline effect bg - optional overlay if needed, or we can keep it simple on top of image via .scan-line div */
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* OVERLAYS */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #000 120%);
    pointer-events: none;
    z-index: 2;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(0, 243, 255, 0.3);
    opacity: 0.4;
    animation: scan 6s linear infinite;
    pointer-events: none;
    z-index: 10;
}

/* CONTAINER */
.app-container {
    position: relative;
    z-index: 5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.cyber-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.icon-pulse {
    width: 20px;
    height: 20px;
    background: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--neon-blue);
    animation: pulse 2s infinite;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    line-height: 1;
}

.header-subtitle {
    color: var(--neon-purple);
    font-size: 10px;
    letter-spacing: 3px;
    font-family: 'Share Tech Mono', monospace;
    margin-top: 2px;
}

.version {
    font-size: 12px;
    color: var(--neon-purple);
    vertical-align: super;
}

.server-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #888;
}

.status-value {
    color: var(--matrix-green);
    margin-left: 10px;
}

/* MAIN LAYOUT */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    flex: 1;
    height: 0;
    /* Important for scroll/overflow */
}

/* PANELS */
.panel {
    background: var(--panel-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 2px;
    /* slight padding for inner border look */
    transition: all 0.5s ease;
}

.result-panel.dimmed {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

.panel-header {
    background: rgba(0, 243, 255, 0.1);
    padding: 10px 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.deco {
    color: var(--neon-purple);
}

.panel-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* INPUTS */
.input-group {
    position: relative;
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--neon-blue);
    font-family: 'Share Tech Mono', monospace;
}

input,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #336;
    padding: 12px 15px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    outline: none;
    transition: 0.3s;
}

input:focus,
select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.game-preview {
    margin-top: 15px;
    border: 1px solid var(--neon-blue);
    background: rgba(0, 0, 0, 0.4);
    padding: 5px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

#game-thumb {
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 150px;
    /* Slight increase, but let aspect ratio rule */
    object-fit: contain;
    /* Ensure full image is visible */
    display: block;
    margin: 0 auto;
    /* Center the image */
    opacity: 0.9;
    transition: all 0.3s;
    border-radius: 4px;
}

#game-thumb:hover {
    opacity: 1;
}

/* BUTTON */
.cyber-btn {
    position: relative;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 15px;
    width: 100%;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
    margin-top: 20px;
    text-shadow: 0 0 5px var(--neon-blue);
}

.cyber-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    letter-spacing: 2px;
}

.cyber-btn:disabled {
    border-color: #555;
    color: #555;
    background: transparent;
    cursor: not-allowed;
    text-shadow: none;
    box-shadow: none;
}

/* SECURITY READOUT */
.security-readout {
    margin-top: auto;
    border-top: 1px dashed #336;
    padding-top: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: #667;
}

.green {
    color: var(--matrix-green);
}

.blue {
    color: var(--neon-blue);
}

/* VISUALIZATION CENTER */
.vis-panel {
    position: relative;
    overflow: hidden;
}

.vis-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.neural-core {
    width: 250px;
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: 0.5s;
    perspective: 1000px;
    /* Enable 3D effect */
}

.core-center {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #000 30%, #111 100%);
    border: 2px solid var(--neon-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    font-weight: 900;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    font-size: 14px;
    position: relative;
}

/* Pseudo-element for inner glow */
.core-center::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 20px var(--neon-blue);
    animation: pulse 2s infinite;
}

.core-ring {
    position: absolute;
    border-radius: 50%;
    transform-style: preserve-3d;
}

.core-success {
    border-color: var(--matrix-green) !important;
    box-shadow: 0 0 50px var(--matrix-green) !important;
    background: rgba(0, 255, 0, 0.1);
    color: var(--matrix-green) !important;
    text-shadow: 0 0 15px var(--matrix-green);
    animation: none;
}

/* Ring 1: Fast Inner Spin */
.r1 {
    width: 130px;
    height: 130px;
    border: 2px dashed var(--neon-purple);
    border-top: 2px solid transparent;
    border-bottom: 2px solid transparent;
    animation: spin 3s linear infinite;
    opacity: 0.8;
}

/* Ring 2: Reverse Blue Arc */
.r2 {
    width: 170px;
    height: 170px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-left: 4px solid var(--neon-blue);
    border-right: 4px solid var(--neon-blue);
    animation: spin-rev 5s linear infinite;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* Ring 3: Slow Outer Pulse */
.r3 {
    width: 210px;
    height: 210px;
    border: 1px dotted #fff;
    opacity: 0.3;
    animation: spin 15s linear infinite;
}

/* Ring 4: 3D Tilted Ring */
.r4 {
    width: 240px;
    height: 240px;
    border: 1px solid var(--neon-blue);
    border-color: var(--neon-blue) transparent;
    opacity: 0.5;
    animation: spin-tilt 8s linear infinite;
}

/* Ring 5: Expansion Ring */
.r5 {
    width: 100px;
    height: 100px;
    border: 1px solid var(--neon-purple);
    opacity: 0;
    animation: ripple 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes spin-tilt {
    0% {
        transform: rotateX(60deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(60deg) rotateZ(360deg);
    }
}

@keyframes ripple {
    0% {
        width: 90px;
        height: 90px;
        opacity: 0.8;
        border-width: 2px;
    }

    100% {
        width: 250px;
        height: 250px;
        opacity: 0;
        border-width: 0px;
    }
}

/* DATA STREAM */
.data-stream {
    width: 90%;
    height: 300px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    font-family: 'Share Tech Mono', monospace;
    color: var(--matrix-green);
    font-size: 12px;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1);
}

.log-line {
    margin-bottom: 2px;
}

/* RESULTS */
.target-info-box {
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border: 1px solid var(--neon-blue);
    border-left: 5px solid var(--neon-blue);
    font-family: 'Share Tech Mono', monospace;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    border-bottom: 1px dashed #333;
    padding-bottom: 2px;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.label {
    color: #888;
    font-size: 11px;
}

.value {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    /* Slightly larger for readability */
}

.cyan {
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
}

.purple {
    color: var(--neon-purple);
    text-shadow: 0 0 5px var(--neon-purple);
}

.metric-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.bar-container {
    width: 100%;
    height: 6px;
    background: #222;
    margin-bottom: 5px;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 10px var(--neon-blue);
    transition: width 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.metric-value {
    float: right;
    font-weight: bold;
    font-size: 18px;
}

.metric-big {
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border: 1px solid var(--neon-purple);
}

.time-window {
    font-size: 32px;
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-purple);
    text-shadow: 0 0 15px var(--neon-purple);
    margin-top: 10px;
}

.volatility-display {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

.spin-prediction {
    font-size: 28px;
    font-family: 'Orbitron', sans-serif;
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
    font-weight: bold;
    letter-spacing: 2px;
}

/* FOOTER */
.cyber-footer {
    text-align: center;
    font-size: 10px;
    color: #555;
    margin-top: 10px;
    font-family: 'Share Tech Mono', monospace;
}

.hidden {
    display: none;
}

/* ANIMATIONS */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-rev {
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 5px var(--neon-blue);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 20px var(--neon-blue);
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 5px var(--neon-blue);
    }
}

@keyframes scan {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    body {
        overflow-y: auto;
        /* Enable vertical scroll */
        height: auto;
        min-height: 100vh;
    }

    .main-grid {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .app-container {
        height: auto;
        min-height: 100%;
        overflow: visible;
        padding-bottom: 50px;
        /* Add space at bottom */
    }

    .cyber-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .neural-core {
        width: 180px;
        /* Slightly larger base */
        height: 180px;
        margin: 20px 0;
        perspective: 500px;
    }

    .r4 {
        width: 170px;
        height: 170px;
    }

    /* Scaled down from 240 */
    .r3 {
        width: 150px;
        height: 150px;
    }

    .r2 {
        width: 120px;
        height: 120px;
    }

    .r1 {
        width: 90px;
        height: 90px;
    }

    .r5 {
        width: 80px;
        height: 80px;
    }

    /* Base size for ripple */

    .core-center {
        width: 60px;
        height: 60px;
        font-size: 10px;
    }

    .vis-panel {
        min-height: 250px;
        /* Ensure visibility for core */
    }
}