
:root {
    color-scheme: dark;

    --bg: #07111f;
    --panel: #0d1b2e;
    --line: rgba(80, 190, 255, 0.23);
    --text: #eef7ff;
    --muted: #9db4ca;
    --cyan: #39d5ff;
    --green: #69f0ae;
    --red: #ff7185;
    --gold: #ffd76a;
}

* {
    box-sizing: border-box;
}

/* Sfondo e struttura generale */
body {
    margin: 0;
    min-height: 100vh;
    padding: 30px 14px 44px;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    background:
        radial-gradient(
            ellipse at 15% 0%,
            rgba(20, 113, 190, 0.24),
            transparent 45%
        ),
        radial-gradient(
            ellipse at 90% 20%,
            rgba(0, 225, 255, 0.1),
            transparent 38%
        ),
        var(--bg);
}

.container {
    width: min(1120px, 100%);
    margin: auto;
}

/* Intestazione e logo */
.topline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
}

.brand img {
    display: block;
    width: min(260px, 70vw);
    max-height: 80px;
    object-fit: contain;
    object-position: center;
}

.muted,
.refresh {
    color: var(--muted);
    font-size: 0.6rem !important;
}

.refresh {
    margin-top: 2px;
}

/* Sezione principale */
.hero {
    padding: clamp(16px, 3vw, 26px);
    border: 1px solid var(--line);
    border-radius: 23px;
    background: linear-gradient(
        135deg,
        rgba(16, 43, 70, 0.96),
        rgba(8, 19, 34, 0.96)
    );
    box-shadow: 0 18px 60px #0003;
    margin-bottom: 16px;
}

.eyebrow {
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1.05;
    margin: 6px 0;
}

.subtitle {
    max-width: 650px;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

/* Statistiche */
.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.stat {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #040d1966;
}

.stat strong {
    display: block;
    color: var(--cyan);
    font-size: 1.6rem;
}

.stat span {
    color: var(--muted);
    font-size: 0.8rem;
}

/* Tabella della classifica */
.card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgba(13, 27, 46, 0.94);
}

.tablehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 19px 21px;
    border-bottom: 1px solid var(--line);
}

h2 {
    font-size: 1.08rem;
    margin: 0;
}

.tablewrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid #78a5cd1c;
    white-space: nowrap;
}

th {
    background: #050e1a77;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #39d5ff0b;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* Posizioni e punteggi */
.rank {
    font-weight: 800;
    color: var(--muted);
}

.toprank {
    color: var(--gold);
}

.nick {
    font-weight: 750;
}

.points {
    color: var(--cyan);
    font-weight: 900;
}

.positive {
    color: var(--green);
    font-weight: 750;
}

.negative {
    color: var(--red);
    font-weight: 750;
}

/* Messaggi */
.error,
.empty {
    padding: 25px;
    line-height: 1.6;
}

.error {
    color: #ffd5da;
    background: #96142d26;
}

/* Regole del punteggio */
.rules {
    display: flex;
    gap: 10px 18px;
    flex-wrap: wrap;
    padding: 17px 21px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--muted);
}

.rules b {
    color: var(--text);
}

/* Piè di pagina */
footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 22px;
}

/* Adattamento per smartphone */
@media (max-width: 580px) {
    body {
        padding: 17px 9px 28px;
    }

    .hero {
        padding: 16px;
        border-radius: 17px;
    }

    .stats {
        gap: 7px;
    }

    .stat {
        padding: 11px 8px;
    }

    .stat strong {
        font-size: 1.3rem;
    }

    .stat span {
        font-size: 0.7rem;
    }

    .tablehead {
        padding: 15px;
    }
	.topline {
		gap: 4px;
		margin-bottom: 10px;
	}

	.brand img {
		width: min(230px, 65vw);
		max-height: 70px;
	}

	.refresh {
		margin-top: 0;
	}
}