:root {
    --green: #0a7a3f;
    --green-dark: #04512c;
    --red: #e3141c;
    --red-dark: #b30d14;
    --ink: #10231a;
    --muted: #5d6f65;
    --bg: #eef4f0;
    --card: #ffffff;
    --shadow: 0 8px 24px -12px rgba(4, 60, 32, 0.35);
    --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.4;
}

/* ---------- Intestazione ---------- */
.hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    color: #fff;
    padding: 32px 16px 110px;
    background:
        repeating-linear-gradient(115deg, transparent 0 38px, rgba(255, 255, 255, 0.035) 38px 76px),
        radial-gradient(circle at 50% 0%, #11975180, transparent 65%),
        var(--green-dark);
}

/* Fascia rossa in diagonale */
.hero::after {
    content: '';
    position: absolute;
    left: -5%;
    right: -5%;
    bottom: -42px;
    height: 74px;
    background: var(--red);
    border-top: 6px solid #fff;
    transform: rotate(-2.5deg);
}

.hero-logo {
    width: 170px;
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.hero-kicker {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.85;
}

h1 {
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: clamp(2.2rem, 9vw, 3.8rem);
    line-height: 1;
    text-transform: uppercase;
    margin-top: 6px;
}

h1 span {
    display: inline-block;
    background: var(--red);
    padding: 0 14px 2px 10px;
    border-radius: 8px;
}

.logo-btn {
    display: block;
    margin: 0 auto;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s;
}

.logo-btn:hover {
    transform: scale(1.05);
}

.logo-btn:active {
    transform: scale(0.95);
}

.container {
    position: relative;
    max-width: 680px;
    margin: -52px auto 0;
    padding: 0 16px;
    z-index: 1;
}

/* ---------- Loghi squadre ---------- */
.logo-disc {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #dde7e1;
    overflow: hidden;
}

.logo-disc img {
    width: 82%;
    height: 82%;
    object-fit: contain;
}

/* ---------- Prossima partita ---------- */
.next-card {
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 18px 40px -16px rgba(4, 60, 32, 0.5);
    overflow: hidden;
    text-align: center;
}

.next-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #fff;
    background: linear-gradient(100deg, var(--red), var(--red-dark));
}

.next-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown {
    background: #fff;
    color: var(--red-dark);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 50px;
    padding: 4px 12px;
    white-space: nowrap;
}

.next-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 24px 14px 18px;
}

.next-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    gap: 10px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.1;
}

.next-team .logo-disc {
    width: 88px;
    height: 88px;
    border: 3px solid #e2ebe5;
}

.next-team.mine {
    color: var(--green);
}

.next-team.mine .logo-disc {
    border-color: var(--green);
}

.next-vs {
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 2rem;
    color: var(--red);
}

.next-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    background: #f4f9f6;
    border-top: 1px dashed #cbdcd2;
}

.next-info span {
    color: var(--muted);
    font-size: 0.9rem;
}

.next-card .update-result-btn {
    margin: 14px 0 16px;
}

/* ---------- Riepilogo stagione ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.stat {
    background: var(--card);
    border-radius: 14px;
    border-bottom: 4px solid var(--muted);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 10px 4px;
}

.stat strong {
    display: block;
    font-family: var(--display);
    font-size: 2rem;
    line-height: 1;
}

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

.stat.won { border-color: var(--green); }
.stat.draw { border-color: #d49a00; }
.stat.lost { border-color: var(--red); }

/* ---------- Calendario ---------- */
.month-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 32px 0 14px;
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.7rem;
    text-transform: uppercase;
    color: var(--green-dark);
}

.month-title::after {
    content: '';
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--red), var(--green), transparent);
}

.match-card {
    display: flex;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 14px;
    transition: transform 0.2s;
}

.match-card:hover {
    transform: translateY(-2px);
}

.date-block {
    flex: 0 0 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(170deg, var(--green), var(--green-dark));
    border-right: 5px solid var(--red);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.day {
    font-family: var(--display);
    font-weight: 700;
    font-size: 2.6rem;
    line-height: 1;
}

.match-body {
    flex: 1;
    min-width: 0;
    padding: 14px 14px 12px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 8px;
}

.round {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.time {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.35rem;
}

.badge {
    display: inline-block;
    border-radius: 50px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta .badge {
    margin-left: auto;
}

.badge.home, .badge.won { background: #dcf3e5; color: var(--green-dark); }
.badge.away, .badge.lost { background: #fde3e4; color: var(--red-dark); }
.badge.draw { background: #fdf0c8; color: #7a5600; }

.row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-weight: 500;
}

.row.mine {
    font-weight: 700;
    color: var(--green);
}

.team-name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
}

.score {
    min-width: 48px;
    text-align: center;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--ink);
    background: var(--bg);
    border-radius: 8px;
}

.match-card.won .row.mine .score { background: var(--green); color: #fff; }
.match-card.lost .row.mine .score { background: var(--red); color: #fff; }
.match-card.draw .score { background: #fdf0c8; }

.location {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e8efeb;
    font-size: 0.82rem;
    color: var(--muted);
}

.match-footer {
    margin-top: 8px;
}

.status {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--red-dark);
}

.update-result-btn {
    font: 700 0.85rem 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: var(--green);
    border: 2px solid var(--red);
    border-radius: 50px;
    padding: 8px 18px;
    cursor: pointer;
}

.update-result-btn:hover {
    background: var(--green-dark);
}

.site-footer {
    margin-top: 32px;
    padding: 22px 16px;
    text-align: center;
    color: #fff;
    background: var(--green-dark);
    border-top: 5px solid var(--red);
    font-size: 0.85rem;
}

@media (max-width: 420px) {
    .date-block { flex-basis: 60px; }
    .day { font-size: 2.2rem; }
    .next-team { font-size: 1.05rem; }
    .next-team .logo-disc { width: 70px; height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

.back-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50px;
    padding: 8px 14px;
}

.back-btn:hover {
    background: var(--red);
}

/* ---------- Schede Calendario / Classifica ---------- */
.tabs {
    display: flex;
    gap: 6px;
    margin-top: 24px;
    padding: 6px;
    background: var(--card);
    border-radius: 50px;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--green-dark);
    background: none;
    border: 0;
    border-radius: 50px;
    padding: 8px;
    cursor: pointer;
}

.tab.active {
    background: var(--green);
    color: #fff;
}

.standings-card {
    margin-top: 20px;
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.standings {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: center;
}

.standings th {
    background: var(--green-dark);
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    padding: 10px 6px;
    border-bottom: 4px solid var(--red);
}

.standings td {
    padding: 11px 6px;
    border-bottom: 1px solid #e8efeb;
}

.standings .name {
    text-align: left;
}

.standings .col-pt {
    font-weight: 700;
}

.standings tbody tr.mine {
    background: #dcf3e5;
    color: var(--green-dark);
    font-weight: 700;
}

/* Sul telefono restano le colonne principali */
@media (max-width: 560px) {
    .standings .col-gf, .standings .col-gs { display: none; }
    .standings { font-size: 0.78rem; }
    .standings th, .standings td { padding-left: 4px; padding-right: 4px; }
}

.standings-note, .standings-message {
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 14px;
}

.standings-message a {
    color: var(--green);
    font-weight: 600;
}
