/* FantaJB — stile Juventibus: nero/antracite, bianco, accent giallo/arancio */

:root {
    --bg: #0d0e10;
    --bg-alt: #17181b;
    --surface: #1c1d21;
    --surface-hover: #232429;
    --border: #2c2d33;
    --text: #f2f2f2;
    --text-muted: #9a9aa2;
    --accent: #f5a623;
    --accent-dim: #b97c1a;
    --accent-contrast: #14140f;
    --danger: #e5484d;
    --success: #3ecf8e;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-glow: 0 0 0 1px rgba(245, 166, 35, 0.15), 0 8px 24px rgba(0, 0, 0, 0.4);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-padding-top: 72px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
}

.site-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    background: rgba(13, 14, 16, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.site-header__logo {
    width: 32px;
    height: 32px;
}

.site-header__title {
    font-weight: 800;
    letter-spacing: 0.5px;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.site-header__account {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-header__account:hover {
    color: var(--accent);
}

.site-header__account strong {
    color: var(--text);
}

.site-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.site-nav.is-open {
    display: flex;
}

.site-nav__link {
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    color: var(--accent);
    background: var(--surface-hover);
}

.site-header__menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.site-header__menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

.site-header__menu-toggle:hover {
    border-color: var(--accent-dim);
}

@media (min-width: 640px) {
    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        gap: 18px;
        margin: 0 0 0 24px;
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
    }

    .site-nav__link {
        padding: 4px 2px;
    }

    .site-header__menu-toggle {
        display: none;
    }
}

/* ---------- Hero ---------- */

.hero {
    padding: 48px 20px 32px;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.hero__brand {
    display: block;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.hero__logo {
    margin: 0 auto 20px;
}

.hero__title {
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.hero__subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 0 28px;
}

.hero__counter {
    margin: 24px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

.hero__counter-value {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.hero__counter-label {
    color: var(--text-muted);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
    text-decoration: none;
    cursor: pointer;
    padding: 12px 20px;
    transition: transform 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-contrast);
}

.btn--primary:hover {
    background: #ffb64a;
    box-shadow: var(--shadow-glow);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.btn--dark {
    background: #000000;
    color: var(--accent);
    border: 1px solid var(--border);
}

.btn--dark:hover {
    border-color: var(--accent-dim);
}

.btn--white {
    background: #ffffff;
    color: #111111;
}

.btn--white:hover {
    background: #f0f0f0;
}

.btn--disabled {
    background: var(--surface);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn--lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn--block {
    display: flex;
    width: 100%;
    margin-top: 8px;
}

.btn--sm {
    padding: 9px 14px;
    font-size: 13px;
}

/* ---------- Early supporter banner ---------- */

.early-banner {
    max-width: 640px;
    margin: 0 auto 32px;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.12), rgba(245, 166, 35, 0.04));
    border: 1px solid rgba(245, 166, 35, 0.35);
    border-radius: var(--radius);
    text-align: center;
}

.early-banner__eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1.5px;
}

.early-banner__text {
    margin: 0;
    font-size: 14px;
}

/* ---------- Bacheca generale (widget anteprima in home) ---------- */

.general-board-preview {
    padding: 12px 16px 8px;
    max-width: 680px;
    margin: 0 auto;
}

.general-board-preview__head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.general-board-preview__title {
    font-size: 18px;
    margin: 0;
}

.general-board-preview__sub {
    font-size: 13px;
    color: var(--text-muted);
}

.general-board-preview__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.general-preview-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.general-preview-item--poll {
    border-left: 3px solid var(--accent);
    background: rgba(245, 166, 35, 0.08);
}

.general-preview-item:hover {
    background: var(--bg-alt);
}

.general-preview-item__head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 3px;
}

.general-preview-item__time {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

.general-preview-item__text {
    margin: 0;
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.general-preview-item--poll .general-preview-item__text {
    font-weight: 700;
}

/* .chat-composer (board.css) fornisce già layout/bottoni/input: qui aggiungiamo
   solo gli arrotondamenti e lo spazio verso gli elementi sotto, dato che nella
   modale è la barra in fondo a uno "shell" mentre qui è un box autonomo. */
.general-board-preview__composer {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.general-board-preview__composer.chat-composer {
    border-top: 1px solid var(--border);
}

.general-board-preview__login-prompt {
    display: block;
    text-align: center;
    padding: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.general-board-preview__login-prompt:hover {
    border-color: var(--accent-dim);
    background: var(--bg-alt);
}

/* ---------- Team grid ---------- */

.teams {
    padding: 12px 16px 40px;
    max-width: 1080px;
    margin: 0 auto;
}

.teams__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 620px) {
    .teams__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .teams__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.team-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    animation: card-in 0.5s var(--ease) forwards;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.team-card:hover {
    border-color: var(--accent-dim);
}

.team-card--mine {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.team-card__mine-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--accent-contrast);
    background: var(--accent);
    border-radius: 999px;
    padding: 3px 9px;
}

@keyframes card-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.team-card__rank {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    background: var(--bg-alt);
    border-radius: 999px;
    padding: 3px 9px;
}

.team-card__logo {
    margin: 8px auto 12px;
    border-radius: 50%;
    background: var(--bg-alt);
}

.team-card__name {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 800;
}

.team-card__contestant {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 13px;
}

.team-card__curve {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    margin: 0 0 14px;
    padding: 10px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}

.team-card__curve span {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.4s var(--ease), transform 0.4s var(--ease);
}

.team-card__curve span.is-lit {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(245, 166, 35, 0.5);
}

.team-card__figures-btn {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 10px 14px;
    background: #000000;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.team-card__figures-btn:hover {
    box-shadow: var(--shadow-glow);
}

.team-card__figures-btn:active {
    transform: scale(0.97);
}

.team-card__count {
    font-weight: 800;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.team-card__pct {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.team-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.team-card__action {
    position: relative;
    flex: 1;
}

.team-card__unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg);
}

.team-card__nicknames {
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--text-muted);
    min-height: 16px;
}

.team-card__nicknames--empty {
    font-style: italic;
}

/* +1 pulse feedback */
.team-card.is-pulsing {
    animation: pulse-card 0.6s var(--ease);
}

@keyframes pulse-card {
    0% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.5); }
    100% { box-shadow: 0 0 0 14px rgba(245, 166, 35, 0); }
}

.team-card__delta {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--success);
    font-weight: 800;
    font-size: 13px;
    opacity: 0;
    transform: translateY(0);
}

.team-card__delta.is-visible {
    animation: float-up 1.1s var(--ease) forwards;
}

@keyframes float-up {
    0% { opacity: 0; transform: translateY(4px); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-14px); }
}

/* ---------- Live support race ---------- */

.race {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.race__title {
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 800;
    margin: 0 0 16px;
}

.race__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.race__row {
    display: grid;
    grid-template-columns: 32px 28px 1fr auto auto;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.race__row.is-moving {
    box-shadow: var(--shadow-glow);
}

.race__position {
    font-weight: 800;
    color: var(--text-muted);
}

.race__logo {
    border-radius: 50%;
    background: var(--bg-alt);
}

.race__name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race__supporters,
.race__pct {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Rose (blocco pubblico) ---------- */

.rosters {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.rosters__title {
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 800;
    margin: 0 0 16px;
}

.roster-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.roster-accordion__item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.roster-accordion__header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    text-align: left;
}

.roster-accordion__logo {
    border-radius: 50%;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.roster-accordion__name {
    flex: 1;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-accordion__chevron {
    color: var(--text-muted);
    transition: transform 0.2s var(--ease);
}

.roster-accordion__header[aria-expanded="true"] .roster-accordion__chevron {
    transform: rotate(180deg);
}

.roster-accordion__body {
    padding: 0 14px 16px;
    border-top: 1px solid var(--border);
}

.roster-accordion__body .roster-total {
    margin: 12px 0 14px;
}

.roster-accordion__body .roster-groups {
    max-height: none;
    overflow: visible;
}

/* ---------- Footer ---------- */

.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal__panel {
    position: relative;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: sheet-in 0.3s var(--ease);
}

@keyframes sheet-in {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 640px) {
    .modal {
        align-items: center;
        justify-content: center;
    }
    .modal__panel {
        width: 480px;
        border-radius: var(--radius);
    }
}

.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.modal__title {
    font-size: 19px;
    margin: 0 0 20px;
    padding-right: 30px;
}

.modal__warning {
    font-size: 13px;
    color: var(--accent);
    font-weight: 700;
    margin: 4px 0 18px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
}

.field input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

/* Chrome's autofill/strong-password icon can otherwise shrink or
   re-style the field to its native appearance. */
.field input[type="password"]::-webkit-credentials-auto-fill-button,
.field input[type="password"]::-webkit-strong-password-auto-fill-button,
.field input[type="password"]::-webkit-contacts-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.field input[type="password"]::-ms-reveal,
.field input[type="password"]::-ms-clear {
    display: none;
}

.platform-toggle {
    display: flex;
    gap: 10px;
}

.platform-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.platform-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}

.platform-option__icon {
    width: 18px;
    height: 18px;
}

.platform-toggle input[type="radio"]:checked + .platform-option {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(245, 166, 35, 0.08);
}

.platform-toggle input[type="radio"]:focus-visible + .platform-option {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.platform-option--twitch.is-active,
.platform-toggle input#platform-twitch:checked + .platform-option--twitch {
    color: #9146ff;
    border-color: #9146ff;
}

.platform-toggle input#platform-youtube:checked + .platform-option--youtube {
    color: #ff0000;
    border-color: #ff0000;
}

.field--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.field--checkbox input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.field--checkbox label {
    color: var(--text);
    font-size: 13px;
}

.field--honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.field--error {
    background: rgba(229, 72, 77, 0.12);
    border: 1px solid rgba(229, 72, 77, 0.4);
    color: #ff9a9d;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
}

.modal__success {
    text-align: center;
    padding: 20px 0;
}

.modal__success-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 8px;
}

.toast {
    position: absolute;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 14, 16, 0.78);
    backdrop-filter: blur(3px);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
}

.toast[hidden] {
    display: none;
}

.toast.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.toast__card {
    width: 100%;
    max-width: 320px;
    background: var(--surface);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-visible .toast__card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast p {
    margin: 0 0 14px;
    font-size: 13px;
    text-align: center;
}

.toast__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.badge--early {
    background: rgba(245, 166, 35, 0.15);
    color: var(--accent);
    border: 1px solid rgba(245, 166, 35, 0.4);
}

.curve-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.curve-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

/* ---------- Bacheca generale (modale interattiva completa) ---------- */

.modal__panel--board {
    padding: 20px 0 0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal__panel--board .modal__title {
    margin-left: 20px;
    margin-right: 20px;
    flex-shrink: 0;
}

/* Specificità più alta di .board-shell (board.css, caricato dopo questo file)
   per vincere il conflitto sulla proprietà height: qui la bacheca vive dentro
   una modale (altezza vincolata), non a tutta pagina come in bacheca.php. */
.modal__panel--board .board-shell {
    height: 65vh;
    max-width: none;
    margin: 0;
    flex: 1;
    min-height: 0;
}

@media (max-width: 480px) {
    .modal__panel--board .board-shell {
        height: 75vh;
    }
}

/* ---------- Roster modal (rosa squadra) ---------- */

.modal__panel--roster {
    max-width: 560px;
}

.roster-total {
    font-size: 14px;
    color: var(--text-muted);
    margin: -8px 0 18px;
}

.roster-total strong {
    color: var(--accent);
}

.roster-groups {
    max-height: 60vh;
    overflow-y: auto;
}

.roster-loading {
    color: var(--text-muted);
    font-size: 14px;
}

.roster-group {
    margin-bottom: 18px;
}

.roster-group:last-child {
    margin-bottom: 0;
}

.roster-group__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin: 0 0 8px;
}

.roster-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.roster-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    padding: 8px 12px;
    font-size: 14px;
}

.roster-player__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-player__club {
    color: var(--text-muted);
    font-size: 12px;
}

.roster-player__cost {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text);
}

/* ---------- Confirm / legal pages ---------- */

.confirm-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.confirm-card {
    max-width: 480px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
}

.confirm-eyebrow {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0 0 16px;
}

.confirm-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
}

.confirm-title {
    font-size: 22px;
    margin: 0 0 12px;
}

.confirm-title--error {
    color: var(--danger);
}

.confirm-text {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 20px;
}

.confirm-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 20px 0 28px;
}

.confirm-stat__value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.confirm-stat__label {
    font-size: 11px;
    color: var(--text-muted);
}

.legal-page {
    padding: 32px 20px 60px;
}

.legal-content {
    max-width: 680px;
    margin: 0 auto;
}

.legal-content h1 {
    font-size: 26px;
}

.legal-content h2 {
    font-size: 16px;
    color: var(--accent);
    margin-top: 28px;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 12px;
}

/* ---------- Sotto-pagine (calendario.php, rose.php) ---------- */

.page-header {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 8px;
    text-align: center;
}

.page-header__back {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.page-header__back:hover {
    color: var(--accent);
}

.page-header__title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
}

.page-header__subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.page-empty {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- Classifica campionato (fascia home + eventuale riuso) ---------- */

.standings {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.standings__title {
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 800;
    margin: 0 0 16px;
}

.standings__scroll {
    overflow-x: auto;
}

.standings__table {
    width: 100%;
    min-width: 480px;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 13px;
}

.standings__table th {
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    padding: 0 8px 4px;
}

.standings__table th:first-child,
.standings__table td:first-child {
    text-align: left;
    padding-left: 14px;
}

.standings__table td {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: none;
    border-right: none;
    padding: 10px 8px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.standings__table tr td:first-child {
    border-left: 1px solid var(--border);
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.standings__table tr td:last-child {
    border-right: 1px solid var(--border);
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.standings__team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.standings__logo {
    border-radius: 50%;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.standings__points {
    color: var(--accent);
    font-weight: 800;
}

/* ---------- Calendario (fascia home + pagina completa) ---------- */

.fixtures-preview {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.fixtures-preview__title {
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 800;
    margin: 0 0 16px;
}

.fixtures-preview__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 560px) {
    .fixtures-preview__grid {
        grid-template-columns: 1fr;
    }
}

.fixtures-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.fixtures-card__label {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fixtures-card__matches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fixtures-match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    margin: 0;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.fixtures-match:hover {
    background: var(--surface-hover);
    border-color: var(--border);
}

.fixtures-match__team {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.fixtures-match__team--away {
    /* row-reverse flips the flow direction, so "flex-start" is what packs
       content to the visual right edge here — "flex-end" would hug the left. */
    justify-content: flex-start;
    text-align: right;
    flex-direction: row-reverse;
}

.fixtures-match__logo {
    border-radius: 50%;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.fixtures-match__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixtures-match__score {
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.predict-widget {
    margin-top: 6px;
    padding: 0 8px;
}

.predict-btn {
    margin-top: 10px;
}

.predict-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-alt);
}

.predict-bar__seg {
    display: block;
    height: 100%;
    transition: width 0.3s var(--ease);
}

.predict-bar__seg--home {
    background: var(--accent);
}

.predict-bar__seg--draw {
    background: #000000;
}

.predict-bar__seg--away {
    background: #ffffff;
}

.predict-bar__labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.predict-bar__label {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.predict-bar__label--away {
    text-align: right;
}

.predict-bar__label--mine {
    color: var(--accent);
    font-weight: 700;
}

.predict-modal__rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.predict-modal-row {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.predict-modal-row__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.predict-modal-row__choices {
    display: flex;
    gap: 8px;
}

.predict-modal-row__choices button {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    text-align: center;
}

.predict-modal-row__choice.is-selected {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.predict-modal-row__closed {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.predict-modal-row__bar {
    margin-top: 10px;
}

.predict-choice--mine {
    background: var(--accent) !important;
    color: var(--accent-contrast) !important;
    border-color: var(--accent) !important;
}

.predict-modal-row__choices button:disabled:not(.predict-choice--mine) {
    opacity: 0.45;
}

#predict-confirm {
    margin-top: 18px;
}

.fixtures-preview__cta,
.rosters__cta {
    text-align: center;
}

.fixtures-full {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 16px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 700px) {
    .fixtures-full {
        grid-template-columns: 1fr;
    }
}

.fixtures-round {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.fixtures-round--pending {
    opacity: 0.75;
}

.fixtures-round__title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fixtures-round__matches {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- Formazioni (modale aperta cliccando una partita) ---------- */

.modal__panel--match {
    max-width: 680px;
    background: #000;
}

.lineup-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.match-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-card__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 8px;
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.match-card__team--away {
    order: 3;
}

.match-card__logo {
    border-radius: 50%;
    background: var(--bg-alt);
}

.match-card__team-name {
    font-size: 13px;
    font-weight: 700;
}

.match-card__formation {
    font-size: 11px;
    color: var(--text-muted);
}

.match-card__center {
    order: 2;
    align-self: center;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 14px;
}

.match-card__center strong {
    display: block;
    color: var(--accent);
    font-size: 16px;
}

/* Punteggio fantacalcio (somma voti) sotto al risultato "1-1": informazione
   secondaria, il risultato resta il numero grande in accent. */
.match-card__points {
    display: block;
    font-size: 10px;
}

.match-card__bench-label {
    text-align: center;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 0 4px;
}

.match-row {
    display: grid;
    grid-template-columns: 1fr 38px 38px 1fr;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.match-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.match-player--away {
    flex-direction: row-reverse;
    text-align: right;
}

.match-player__photo {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-alt);
    overflow: visible;
}

.match-player__photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-alt);
}

.match-player__photo--empty {
    visibility: hidden;
}

.match-player__badge {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #14140f;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

.match-player--away .match-player__badge {
    left: auto;
    right: -2px;
}

.match-player__name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-player__name--empty {
    color: var(--text-muted);
}

.match-row__vote {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Un fantavoto reale (non il segnaposto "-") risalta in accent. */
.match-row__vote--set {
    flex-direction: column;
    height: 28px;
    padding: 0;
    overflow: hidden;
    border-color: transparent;
}

.match-row__voto,
.match-row__fantavoto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    line-height: 1;
}

.match-row__voto {
    height: 13px;
    font-size: 10px;
    background: #000;
    color: #fff;
}

.match-row__fantavoto {
    height: 15px;
    font-size: 12px;
    font-weight: 800;
    background: #f5c518;
    color: #14140f;
}

/* Voto provvisorio da live_N.json: il fantavoto ufficiale (bonus/malus) non è
   ancora arrivato da teamLineup, quindi la casella sotto resta neutra invece
   del giallo "ufficiale", per non far sembrare definitivo un numero che può
   ancora cambiare. */
.match-row__vote--provisional .match-row__fantavoto {
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
}

/* Convocato ma mai entrato in campo (partita reale già finita): icona invece
   di "-", per distinguerlo da "non ancora giocata/in corso". */
.match-row__vote--not-played {
    color: var(--text-muted);
    font-size: 16px;
    opacity: 0.6;
}

.match-row__vote--hidden {
    /* Restano nel markup solo per occupare le colonne 2/3 della griglia (altrimenti
       il giocatore in trasferta finirebbe nella colonna stretta pensata per il voto):
       visibility:hidden le nasconde senza toglierle dal flusso della griglia. */
    visibility: hidden;
}

/* ---------- Rose — pagina completa ---------- */

.rose-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 16px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 700px) {
    .rose-page {
        grid-template-columns: 1fr;
    }
}

.rose-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.rose-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.rose-card__logo {
    border-radius: 50%;
    background: var(--bg-alt);
    flex-shrink: 0;
}

.rose-card__name {
    font-weight: 800;
    font-size: 16px;
}

.rose-card__groups {
    margin-top: 12px;
}

.legal-back {
    margin-bottom: 20px;
}

/* ---------- Accessibility ---------- */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
