:root {
    --navy: #10375d;
    --green: #2c9a4a;
    --ink: #16263d;
    --muted: #637386;
    --paper: #fffdf9;
    --line: rgba(22, 38, 61, 0.12);
    --danger: #aa3e3e;
    --accent: #0f8b6d;
    --success: #1a6c55;
    --bg: linear-gradient(180deg, #f8efe1 0%, #f1e4d0 100%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, rgba(44, 154, 74, 0.12), transparent 26%), 
                radial-gradient(circle at bottom right, rgba(16, 55, 93, 0.1), transparent 30%), 
                var(--bg);
    padding: 20px;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ink);
}

.panel {
    width: min(540px, 100%);
    background: rgba(255, 253, 249, 0.96);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(22, 38, 61, 0.11);
}

.panel-top { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(22, 38, 61, 0.08);
    border: 1px solid rgba(22, 38, 61, 0.1);
}

.language-toggle a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--ink);
}

.language-toggle a.is-active {
    background: var(--ink);
    color: #fffaf0;
    box-shadow: 0 10px 18px rgba(22, 38, 61, 0.16);
}

.brand { margin-bottom: 18px; }
.brand img { height: 74px; width: auto; display: block; margin: 0 auto; }

.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--accent); margin-bottom: 12px; text-align: center; }
h1 { margin: 0 0 10px; font-size: 2.4rem; line-height: .95; text-align: center; }
p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; text-align: center; }

label { display: block; margin-bottom: 8px; font-weight: 700; text-align: left; }
input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    margin-bottom: 16px;
    background: #fff;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid > div { min-width: 0; }

button, a.button {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

button { background: var(--accent); color: #fff; }
a.button { margin-top: 12px; background: rgba(22, 38, 61, 0.05); color: var(--ink); border: 1px solid var(--line); }

.alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(170, 62, 62, 0.1);
    color: var(--danger);
    border: 1px solid rgba(170, 62, 62, 0.18);
    text-align: left;
}
.alert.success { background: rgba(26, 108, 85, 0.1); color: var(--success); border-color: rgba(26, 108, 85, 0.18); }
.alert.error { background: rgba(170, 62, 62, 0.1); color: var(--danger); border-color: rgba(170, 62, 62, 0.18); }

.debug { margin-top: -8px; margin-bottom: 18px; font-size: .9rem; color: var(--muted); line-height: 1.5; text-align: left; }
.small { font-size: .92rem; color: var(--muted); text-align: left; }

@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
}


/* Stili specifici della Home (index.php) */
        .shell { width: min(1140px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 56px; }
        .nav {
            display: grid;
            grid-template-columns: 1.15fr 0.85fr;
            align-items: center;
            gap: 28px;
            margin-bottom: 42px;
            padding: 12px 0 10px;
        }
        .brandmark {
            display: flex;
            align-items: center;
            width: 100%;
            min-width: 0;
            text-decoration: none;
        }
        .brandmark img {
            width: 100%;
            max-width: none;
            max-height: none;
            height: auto;
            display: block;
            filter: drop-shadow(0 12px 22px rgba(16, 55, 93, 0.08));
        }
        .nav .stack {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            border: 1px solid rgba(16, 55, 93, 0.1);
            border-radius: 26px;
            background: rgba(255, 252, 247, 0.72);
            box-shadow: 0 16px 34px rgba(16, 55, 93, 0.06);
            backdrop-filter: blur(8px);
        }
        .nav .button {
            min-height: 46px;
            min-width: 142px;
            padding: 11px 14px;
            white-space: nowrap;
        }
        .language-toggle {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px;
            border-radius: 999px;
            background: rgba(16, 55, 93, 0.08);
            border: 1px solid rgba(16, 55, 93, 0.1);
        }
        .language-toggle a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 58px;
            min-height: 38px;
            padding: 8px 12px;
            border-radius: 999px;
            text-decoration: none;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: var(--ink);
        }
        .language-toggle a.is-active {
            background: var(--navy);
            color: #fffaf0;
            box-shadow: 0 10px 18px rgba(16, 55, 93, 0.16);
        }
        .stack, .event-actions, .notice-actions { display: flex; flex-wrap: wrap; gap: 12px; }
        .button {
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            border-radius: 999px; padding: 12px 18px; text-decoration: none; font-weight: 700;
            border: 1px solid var(--line); background: rgba(255,255,255,0.84); color: var(--ink);
        }
         .button-exit{background:rgba(159,58,58,.10);color:#8c3434;border-color:rgba(159,58,58,.22);} .button-exit:hover{background:rgba(159,58,58,.16);}
        .button-secondary { background: rgba(255,255,255,0.78); color: var(--ink); }
        .button-warning { background: rgba(44, 154, 74, 0.14); color: var(--green-dark); border-color: rgba(44, 154, 74, 0.2); }
        .hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: stretch; margin-bottom: 28px; }
        .hero-copy, .hero-panel, .events, .event-section, .notice, .notice-item {
            background: rgba(255, 252, 247, 0.88);
            border: 1px solid var(--line);
            border-radius: 30px;
            padding: 32px;
            box-shadow: 0 24px 64px rgba(16, 55, 93, 0.08);
            backdrop-filter: blur(10px);
        }
        .hero-copy {
            position: relative;
            overflow: hidden;
            isolation: isolate;
            min-height: 430px;
        }
        .hero-copy > * {
            position: relative;
            z-index: 1;
        }
        .hero-panel {
            position: relative;
            overflow: hidden;
            background: linear-gradient(180deg, rgba(16, 55, 93, 0.96) 0%, rgba(20, 73, 110, 0.93) 100%);
            border-color: rgba(16, 55, 93, 0.22);
            color: #f7f3ea;
            box-shadow: 0 26px 60px rgba(16, 55, 93, 0.18);
        }
        .hero-panel::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 34%), radial-gradient(circle at bottom left, rgba(44, 154, 74, 0.22), transparent 30%);
            pointer-events: none;
        }
        .hero-panel > * {
            position: relative;
            z-index: 1;
        }
        .hero-panel .eyebrow {
            color: rgba(255, 255, 255, 0.72);
            margin-bottom: 10px;
        }
        .hero-panel-title {
            margin: 0 0 12px;
            font-size: clamp(1.55rem, 2.6vw, 2.2rem);
            line-height: 1.02;
            color: #fffaf0;
        }
        .hero-panel-copy {
            margin: 0 0 20px;
            color: rgba(247, 243, 234, 0.82);
            line-height: 1.65;
        }
        .hero-panel .list {
            gap: 12px;
        }
        .hero-panel .list li {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.14);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(6px);
        }
        .hero-panel .list strong {
            color: #fff6e6;
            font-size: 1.02rem;
        }
        .hero-panel .muted {
            color: rgba(247, 243, 234, 0.78);
        }
        .notice-item { padding: 22px; border-radius: 22px; background: #fff; box-shadow: none; }
        .eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem; color: var(--green-dark); margin-bottom: 16px; }
        h1 { margin: 0 0 18px; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 0.92; }
        h2 { margin: 0 0 10px; font-size: clamp(1.55rem, 3vw, 2.35rem); }
        h3 { margin: 0 0 10px; font-size: 1.18rem; }
        .lead { font-size: 1.08rem; line-height: 1.7; color: var(--muted); margin-bottom: 26px; max-width: 58ch; }
        .hero-logo {
            position: absolute;
            inset: 0;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 28px;
            pointer-events: none;
            z-index: 0;
        }
        .hero-logo img {
            width: 100%;
            max-width: none;
            height: auto;
            opacity: 0.14;
            filter: drop-shadow(0 22px 28px rgba(16, 55, 93, 0.1));
            transform: scale(1.08);
        }
        .hero-copy .eyebrow,
        .hero-copy h1,
        .hero-copy .lead,
        .hero-copy .stack,
        .hero-copy .callout {
            max-width: 32rem;
        }
        .hero-copy .callout {
            background: rgba(255, 252, 247, 0.78);
            backdrop-filter: blur(4px);
        }
        .list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
        .list li { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid rgba(16, 55, 93, 0.08); }
        .list strong { display: block; margin-bottom: 6px; font-size: 1rem; }
        .muted { color: var(--muted); line-height: 1.55; }
        .callout { margin-top: 24px; padding: 16px 18px; border-left: 4px solid var(--green); border-radius: 16px; background: rgba(44, 154, 74, 0.1); }
        .sections { display: grid; gap: 18px; }
        .event-grid, .notice-grid { display: grid; gap: 14px; margin-top: 18px; }
        .event-item { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:18px; border-radius:22px; background:#fff; border:1px solid rgba(16,55,93,.08); }
        .pill { display:inline-flex; padding:6px 10px; border-radius:999px; background:rgba(44,154,74,.12); color:var(--green-dark); font-size:.82rem; font-weight:700; margin-bottom:8px; }
        .pill-unread { background: rgba(16,55,93,.1); color: var(--navy); }
        .pill-read { background: rgba(16,55,93,.06); color: var(--muted); }
        .notice { margin-bottom: 24px; }
        .notice-copy { white-space: pre-wrap; }
        .small { font-size: .92rem; color: var(--muted); }
        @media (max-width: 840px) {
            .hero, .event-item { grid-template-columns: 1fr; display:block; }
            .shell { width: min(100% - 20px, 1140px); }
            .nav {
                grid-template-columns: 1fr;
                gap: 18px;
                margin-bottom: 28px;
                padding: 0;
            }
            .nav .stack {
                justify-content: flex-start;
                padding: 12px 14px;
                border-radius: 22px;
            }
            .hero-copy, .hero-panel, .events, .event-section, .notice, .notice-item { padding: 24px; }
            .hero-copy { min-height: 360px; }
            .hero-panel-title { font-size: 1.7rem; }
            .hero-panel-copy { margin-bottom: 18px; }
            .event-actions { margin-top:12px; }
            .brandmark img { width: 100%; max-height: none; height: auto; }
            .hero-logo { padding: 18px; }
            .hero-logo img { width: 118%; opacity: 0.12; transform: scale(1.02); }
        }

/* --- Stili aggiunti per le pagine interne (Predictions, Pool, etc) --- */
.match { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 20px; border-radius: 20px; background: #fff; border: 1px solid rgba(16, 55, 93, 0.08); margin-bottom: 14px; }
.match-locked { opacity: 0.7; background: rgba(255, 255, 255, 0.6); }
.score-form { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.score-form input { width: 70px; text-align: center; font-size: 1.2rem; font-weight: 700; margin-bottom: 0; padding: 10px; }
.score-actions { display: flex; justify-content: flex-end; }
.score-actions .button { padding: 10px 16px; font-size: 0.9rem; }

.pill-status-pending { background: rgba(230, 162, 60, 0.12); color: #b88230; }
.pill-status-predicted { background: rgba(44, 154, 74, 0.12); color: var(--green-dark); }
.pill-status-locked { background: rgba(16, 55, 93, 0.08); color: var(--muted); }
.deadline { font-weight: 600; font-size: 0.85rem; margin-top: 8px; }
.deadline-open { color: #b88230; }
.deadline-locked { color: var(--danger); }
.summary { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-pill { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }
.summary-done { background: rgba(44, 154, 74, 0.12); color: var(--green-dark); }
.summary-open { background: rgba(230, 162, 60, 0.12); color: #b88230; }
.summary-locked { background: rgba(16, 55, 93, 0.08); color: var(--muted); }
.filters { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 24px; background: rgba(255, 255, 255, 0.6); padding: 16px; border-radius: 16px; border: 1px solid rgba(16, 55, 93, 0.08); }
.filters div { flex: 1; }
.filters label { margin-bottom: 6px; font-size: 0.9rem; }
.filters select { margin-bottom: 0; padding: 10px; }
.filters button { width: auto; padding: 10px 20px; }
.section-block { margin-bottom: 40px; }
.section-copy { margin-bottom: 20px; text-align: left; }

@media (max-width: 840px) {
    .match { grid-template-columns: 1fr; gap: 16px; }
    .score-form { justify-content: flex-start; margin-bottom: 8px; }
    .score-actions { justify-content: flex-start; }
}
