@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;900&display=swap');

:root {
    --primary: #00ff88;
    --secondary: #ffcc00;
    --bg-dark: #0a0e0c;
    --card-bg: rgba(15, 25, 20, 0.8);
    --border: rgba(0, 255, 136, 0.2);
    --text: #e0f0e0;
    --accent-blue: #00ffff;
    --accent-red: #ff4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 255, 136, 0.1);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.loader-sub {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 136, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 204, 0, 0.05) 0%, transparent 40%);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 50px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.header-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.4));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05) rotate(2deg);
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to bottom, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary);
    opacity: 0.8;
}

/* Match Table Styling */
.quiniela-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 40px 150px 1.2fr 40px 1.2fr 100px 1fr;
    /* Flexible last column for results */
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pleno-card {
    grid-template-columns: 40px 150px 1.2fr 40px 1.2fr 100px 120px;
    /* Space for a single score */
}

.results-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: center;
}

.result-display {
    font-size: 1.2rem;
    font-weight: 900;
    text-align: center;
    color: var(--secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.score-display {
    font-size: 0.9rem;
    min-width: 50px;
}

.result-display.new-prediction {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% {
        background: var(--primary);
        color: black;
    }

    100% {
        background: rgba(0, 0, 0, 0.3);
        color: var(--secondary);
    }
}

.match-number {
    font-weight: 900;
    color: var(--primary);
    font-size: 1.2rem;
}

.match-card:hover {
    transform: translateX(10px);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.team-select {
    width: 100%;
}

.vs {
    text-align: center;
    font-weight: 300;
    opacity: 0.5;
}

.calculate-btn {
    background: linear-gradient(135deg, var(--primary), #00cc6a);
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.calculate-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.calculate-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.result-display {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    color: var(--secondary);
    min-width: 40px;
}

/* Modal Styling */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: linear-gradient(145deg, #1a2a22, #0a0e0c);
    border: 2px solid var(--primary);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.2);
}

.modal-result {
    font-size: 8rem;
    font-weight: 900;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px var(--primary);
}

.modal-title {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.modal-opinion {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.modal-variants {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.variant-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.variant-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.6;
    color: var(--primary);
}

.variant-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 900;
    color: var(--secondary);
    min-width: 50px;
}

.modal-close {
    background: white;
    color: black;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 850px) {
    .match-card {
        grid-template-columns: 40px 1fr 1fr;
        grid-template-areas:
            "num div calc"
            "local vs visitor"
            "res res res";
        gap: 10px;
    }

    .match-number {
        grid-area: num;
    }

    .division-select {
        grid-area: div;
    }

    .calculate-btn {
        grid-area: calc;
    }

    .local-select {
        grid-area: local;
    }

    .vs {
        grid-area: vs;
    }

    .visitor-select {
        grid-area: visitor;
    }

    .result-display {
        grid-area: res;
        margin-top: 5px;
    }
}

.pleno-15 {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.pleno-15 h3 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
    text-transform: uppercase;
}

.pleno-card {
    grid-template-columns: 40px 150px 1fr 40px 1fr 100px 120px;
    /* Increased last column for score */
}

.score-display {
    min-width: 100px;
    font-size: 1.2rem;
}

.pleno-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.footer-copy {
    text-align: center;
    margin-top: 4rem;
    font-size: 0.8rem;
    opacity: 0.4;
}

.footer-copy a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-copy a:hover {
    opacity: 0.8;
    text-decoration: underline;
}