/* Configuració General */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    /* Imatge de l'univers */
    background-image: url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?q=80&w=2000');
    background-size: cover;          /* S'adapta a tota la pantalla */
    background-attachment: fixed;    /* No es mou en fer scroll */
    background-position: center;     /* Centrada */
    background-repeat: no-repeat;
    background-color: #0b0d17;       /* Color fons fosc per si la imatge triga a carregar */
    min-height: 100vh;
}

header {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    letter-spacing: 2px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Estadístiques */
#stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 4px solid #3498db;
}

.stat-box span {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-box strong {
    font-size: 2.2rem;
    color: #2c3e50;
}

/* El Mapa */
#map {
    height: 650px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

/* Taula de Rànquing */
#league {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
}

#league h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#ranking {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

#ranking th, #ranking td {
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
}

#ranking th {
    background-color: #f8f9fa;
    color: #34495e;
}

#ranking tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

#ranking tbody tr:hover {
    background-color: #eaeaea;
}

/* Finestra Modal */
#contribution {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.modal label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #7f8c8d;
    margin-top: 5px;
}

.info-text {
    color: #e67e22;
    font-weight: bold;
    font-size: 0.8rem;
    margin-top: -3px;
    margin-bottom: 3px;
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

#close-modal:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.modal h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.modal input[readonly] {
    background-color: #e9ecef;
    color: #495057;
    cursor: not-allowed;
}

.modal button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 15px;
}

.modal button:hover {
    background-color: #27ae60;
}