@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

:root { 
    --primary: #6366f1; 
    --bg: #f1f5f9; 
    --radius: 18px; 
}

body { 
    font-family: 'Poppins', sans-serif; 
    background: var(--bg); 
    margin: 0; 
    padding-bottom: 40px; 
    color: #1e293b; 
}

.container { padding: 15px; max-width: 500px; margin: auto; }

.navbar { 
    background: white; 
    padding: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}

.logo { font-weight: 800; color: var(--primary); text-decoration: none; font-size: 1.1rem; }

.card { 
    background: white; 
    border-radius: var(--radius); 
    padding: 20px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
    margin-bottom: 15px; 
}

input, select { 
    width: 100%; padding: 12px; margin-bottom: 10px; 
    border: 2px solid #e2e8f0; border-radius: 12px; 
    font-size: 1rem; box-sizing: border-box; font-family: inherit; 
}

/* GRIGLIA GIOCATORI */
.player-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.player-card { 
    border-radius: 22px; 
    padding: 12px 6px; 
    color: white; 
    text-align: center; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.1); 
    position: relative;
}

.p-name { 
    font-weight: 800; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.score-display { 
    font-size: 2.8rem; 
    font-weight: 800; 
    margin: 2px 0; 
    line-height: 1; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.controls-row { display: flex; gap: 3px; justify-content: center; margin: 4px 0; }

.btn-s { 
    flex: 1; border: none; background: rgba(0,0,0,0.18); 
    color: white; padding: 10px 0; border-radius: 8px; 
    font-weight: 800; cursor: pointer; font-size: 0.75rem; 
}

.btn-s:active { transform: scale(0.9); background: rgba(255,255,255,0.2); }

.history-log { display: flex; justify-content: center; gap: 3px; margin-top: 6px; min-height: 18px; }
.hist-tag { background: rgba(255,255,255,0.25); padding: 1px 5px; border-radius: 4px; font-size: 0.6rem; font-weight: 700; }

/* TABELLA CLASSIFICA (Stile Chiaro) */
.modern-leaderboard {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.table-row-modern {
    border-bottom: 1px solid #f1f5f9;
}

.self-row {
    background: #f8fafc;
    font-weight: bold;
}

/* BOTTONI AZIONE */
.btn-p { 
    background: var(--primary); color: white; border: none; 
    padding: 15px; width: 100%; border-radius: 15px; 
    font-weight: 700; cursor: pointer; margin-top: 10px; font-size: 1rem; 
}
.btn-wa { background: #25d366; }
.btn-bgstats { background: #3b82f6; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.dot.online { background: #10b981; box-shadow: 0 0 8px #10b981; }

.modal { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.9); z-index: 3000; align-items: center; justify-content: center; }
.modal-box { background: white; padding: 25px; border-radius: 25px; width: 85%; max-width: 350px; text-align: center; color: #1e293b; }

.btn-invite { width: 90%; margin-top: 10px; border: none; background: rgba(0,0,0,0.2); color: white; padding: 7px; border-radius: 10px; font-size: 0.7rem; font-weight: 800; cursor: pointer; }