:root {
    --bg-color: #050a14;
    --glass-bg: rgba(20, 30, 50, 0.6);
    --glass-border: rgba(0, 255, 255, 0.1);
    --neon-green: #00ff9d;
    --neon-blue: #00ccff;
    --text-color: #e0e6ed;
    --accent-color: #ff0055;
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center initially, but allow scroll */
    padding: 40px 20px;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 255, 157, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 204, 255, 0.05) 0%, transparent 40%);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-container {
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
}

.highlight {
    color: var(--neon-green);
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

/* Grid for Formations */
.formation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.formation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.formation-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.formation-card.active {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
    background: rgba(0, 255, 157, 0.05);
}

.formation-card img {
    width: 100%;
    max-width: 80px;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.formation-card span {
    font-weight: bold;
    font-size: 0.9rem;
}

.formation-card input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.input-group span {
    color: var(--neon-blue);
    font-weight: bold;
}

input[type=range] {
    width: 100%;
    height: 6px;
    background: #2a3b55;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--neon-green);
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-green);
    transition: transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

select {
    width: 100%;
    padding: 12px;
    background: #0f1926;
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

.cta-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, var(--neon-green), #00e68a);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.2);
}

.cta-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.4);
}

.cta-button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Panel */
.result-panel {
    border-color: var(--neon-blue);
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    opacity: 1;
    max-height: 1000px;
    /* arbitrary large value */
}

.result-panel.collapsed {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
}

.result-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.result-text {
    flex: 1;
    min-width: 250px;
}

.result-text h3 {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.neon-text {
    font-size: 3rem;
    color: var(--neon-blue);
    text-shadow: 0 0 20px rgba(0, 204, 255, 0.5);
    margin-bottom: 20px;
}

.result-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.result-visual img {
    max-width: 100%;
    width: 280px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.1);
    border: 1px solid var(--neon-blue);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .result-content {
        flex-direction: column-reverse;
        text-align: center;
    }
}

/* Tactics Grid Display */
.tactics-grid-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
    text-align: left;
}

.tactic-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--neon-green);
}

.tactic-box.full-width {
    grid-column: span 2;
    border-left-color: var(--neon-blue);
}

.tactic-box .label {
    display: block;
    font-size: 0.75rem;
    color: #8899aa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.tactic-box .value {
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.highlight-text {
    color: var(--neon-blue) !important;
}

/* ... Tactics Grid ... */

/* Radar Scan Effect for Tactical Board */
.result-visual {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.result-visual::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 255, 157, 0) 0%, rgba(0, 255, 157, 0.1) 50%, rgba(0, 255, 157, 0) 100%);
    transform: translateY(-100%);
    animation: scan 3s infinite linear;
    pointer-events: none;
}

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

    100% {
        transform: translateY(100%);
    }
}

/* Player Image Hover Effect */
#player-image {
    transition: transform 0.5s ease;
}

#player-image:hover {
    transform: scale(1.05) rotate(1deg);
    filter: drop-shadow(0 0 15px var(--accent-color));
}

/* Loading Animation Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 157, 0.3);
    border-top: 4px solid var(--neon-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-green);
    letter-spacing: 2px;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.player-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
}

.neon-text-pink {
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(255, 0, 85, 0.5);
    margin-bottom: 20px;
}