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

body {
    font-family: 'Roboto', sans-serif;
    background: #000;
    color: #e0e0e0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Secció general */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem;
    position: relative;
    transition: background 0.8s ease;
}

/* Secció 0: Setup */
#section-0 {
    background: radial-gradient(circle at left top, #FF6B35 0%, #1A73E8 55%, #000 100%);
}

/*#section-0 {*/
/*    background: radial-gradient(ellipse at top, #1A73E8 0%, #0d47a1 40%, #000 100%);*/
/*}*/

.setup-container {
    text-align: center;
    max-width: 700px;
    animation: fadeInUp 1s ease-out;
}

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

.setup-container h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #FF6B35 0%, #FFB84D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

.setup-container p {
    font-size: 1.1rem;
    margin-bottom: 4rem;
    opacity: 0.85;
    font-weight: 300;
    line-height: 1.8;
}

.selector-group {
    margin-bottom: 2.5rem;
}

.selector-group label {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.8rem;
    opacity: 0.8;
    color: #FF6B35;
}

select {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1.05rem;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.4s ease;
    outline: none;
}

select:hover {
    background: rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

select:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.2);
}

select option {
    background: #0d47a1;
    color: white;
    padding: 1rem;
}

.scroll-hint {
    margin-top: 4rem;
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    opacity: 0.5;
    letter-spacing: 1px;
    animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-15px); opacity: 0.8; }
}

/* Seccions 1-5: Visualitzacions */
#section-1, #section-2, #section-3, #section-4, #section-5 {
    background: radial-gradient(ellipse at center, #0a1929 0%, #000 70%);
}

.viz-container {
    width: 100%;
    max-width: 1500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.viz-container svg {
    overflow: visible;
}

.narrative {
    text-align: center;
    max-width: 800px;
    margin-bottom: 2.2rem;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.narrative h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #1A73E8 0%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.narrative p {
    font-size: 1.05rem;
    line-height: 1.8;
    opacity: 0.75;
    font-weight: 300;
}

#main-viz {
    width: 100%;
    padding: 2.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;

    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.015) 40%,
        rgba(0, 0, 0, 0) 70%
    );
}

#main-viz svg {
    display: block;
}


/* Tooltip */
.tooltip {
    position: absolute;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.95) 0%, rgba(13, 71, 161, 0.95) 100%);
    color: white;
    padding: 1rem 1.3rem;
    border-radius: 15px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.9rem;
    z-index: 1000;
    border: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.tooltip.visible {
    opacity: 1;
}

.tooltip strong {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: #FF6B35;
    letter-spacing: 1px;
}

/* Labels dels equips */
.team-label {
    fill: #FFC7B3;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Estils per eixos i etiquetes */
.axis path,
.axis line {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.axis text {
    fill: rgba(255, 255, 255, 0.5);
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 300;
}

.axis-label {
    fill: rgba(255, 255, 255, 0.7);
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
}

.grid line {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-dasharray: 2,2;
}

.grid path {
    stroke-width: 0;
}

/* Estats dels punts */
.team-point {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1.5px;
}

.team-point.dimmed {
    opacity: 0.3;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.team-point.highlighted {
    filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.8));
    stroke: #FF6B35;
    stroke-width: 3px;
    opacity: 1 !important;
}

/* Llegenda */
.legend {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
}

.legend-title {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

.legend-label {
    fill: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}


/* Botó Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #FF6B35 0%, #1A73E8 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

.scroll-to-top::before {
    content: '↑';
    font-size: 1.8rem;
    color: white;
    font-weight: bold;
}

/* ---------- SECCIÓ 4: ESTIL DE JOC ---------- */

#section-4 {
    min-height: auto;
    padding-bottom: 1px;
}

/* Títol principal */
#section-4 h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 56px;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 1.2rem;

    background: linear-gradient(90deg, #1A73E8, #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Subtítols Ofensiva / Defensiva / Progressió */
#section-4 h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 24px;

    background: linear-gradient(90deg, #1A73E8, #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.radar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 160px;
    margin-top: 40px;
    justify-items: center;
}

#section-4 svg {
    width: 420px;
    overflow: visible;
}

/* ---------- SECCIÓ 5: KPI CARDS (CONCLUSIONS) ---------- */

#kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-title {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 12px;
}

.kpi-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    margin-bottom: 6px;
}

.kpi-sub {
    font-size: 13px;
    opacity: 0.6;
}

/* Colors segons valor */
.kpi-positive {
    color: #FF6B35;
}

.kpi-negative {
    color: #64B5F6;
}

.kpi-neutral {
    color: rgba(255,255,255,0.6);
}
