/* ===================================
   FANTABit - Stili CSS Principali
   Separato dal file HTML per una migliore manutenibilitÃ 
   =================================== */

/* ===================================
   OTTIMIZZAZIONE SAFE AREA SMARTPHONE
   Gestione notch, Dynamic Island e barra di stato
   per iPhone e altri smartphone moderni
   =================================== */

/* Safe area support per smartphone con notch/barra di stato */
:root {
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --header-height: 64px;
    --mobile-top-app-bar-height: 56px;
    /* Tema chiaro â€” base bianca con sfumature blu e verde */
    --theme-bg-0: #f0f9ff;
    --theme-bg-1: #e0f2fe;
    --theme-bg-2: #f8fafc;
    --theme-surface-1: rgba(255, 255, 255, 0.97);
    --theme-surface-2: rgba(241, 245, 249, 0.97);
    --theme-surface-3: rgba(219, 234, 254, 0.96);
    --theme-text: #0f172a;
    --theme-text-soft: #1e293b;
    --theme-muted: #64748b;
    --theme-border: rgba(37, 99, 235, 0.18);
    --theme-accent: #1d4ed8;
    --theme-accent-strong: #2563eb;
    --theme-accent-deep: #1e40af;
    --theme-accent-cyan: #0284c7;
    --btn-primary-start: #1d4ed8;
    --btn-primary-mid: #2563eb;
    --btn-primary-end: #1e40af;
    --btn-primary-glow: rgba(37, 99, 235, 0.35);
    --theme-highlight: #d97706;
    --theme-success: #059669;
    --theme-danger: #dc2626;
    --theme-data: #1e3a5f;
}

/* ===================================
   DARK THEME — CSS VARIABLE OVERRIDES
   =================================== */
html.dark {
    --theme-bg-0: #0f172a;
    --theme-bg-1: #1e293b;
    --theme-bg-2: #111827;
    --theme-surface-1: rgba(30, 41, 59, 0.97);
    --theme-surface-2: rgba(15, 23, 42, 0.97);
    --theme-surface-3: rgba(30, 58, 138, 0.5);
    --theme-text: #f1f5f9;
    --theme-text-soft: #e2e8f0;
    --theme-muted: #94a3b8;
    --theme-border: rgba(148, 163, 184, 0.2);
    --theme-accent: #3b82f6;
    --theme-accent-strong: #60a5fa;
    --theme-accent-deep: #2563eb;
    --theme-accent-cyan: #22d3ee;
    --btn-primary-start: #2563eb;
    --btn-primary-mid: #3b82f6;
    --btn-primary-end: #1d4ed8;
    --btn-primary-glow: rgba(59, 130, 246, 0.45);
    --theme-highlight: #f59e0b;
    --theme-success: #10b981;
    --theme-danger: #ef4444;
    --theme-data: #e2e8f0;
}

/* Valore numerico tabelle (classifiche/stats) */
.data-val { color: var(--theme-data); }

/* Transizione fluida durante switch tema */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* Theme toggle styling */
html.dark #theme-toggle {
    background-color: #334155;
}

/* ========================================
   DARK THEME OVERRIDES
   ======================================== */
html.dark body {
    background: #0f172a;
    color: #f1f5f9;
}

html.dark .bg-white {
    background-color: var(--theme-bg-1) !important;
}

html.dark .bg-slate-50,
html.dark .bg-gray-50 {
    background-color: var(--theme-bg-0) !important;
}

html.dark .bg-slate-100,
html.dark .bg-gray-100 {
    background-color: var(--theme-bg-2) !important;
}

html.dark .bg-blue-50\/30,
html.dark .hover\:bg-blue-50\/30:hover {
    background-color: rgba(30, 58, 95, 0.3) !important;
}

html.dark .text-slate-900,
html.dark .text-gray-900 {
    color: var(--theme-text) !important;
}

html.dark .text-slate-800,
html.dark .text-gray-800 {
    color: var(--theme-text) !important;
}

html.dark .text-slate-700,
html.dark .text-gray-700 {
    color: var(--theme-text-soft) !important;
}

html.dark .text-slate-600,
html.dark .text-gray-600 {
    color: var(--theme-text-soft) !important;
}

html.dark .text-slate-500,
html.dark .text-gray-500 {
    color: var(--theme-muted) !important;
}

html.dark .text-slate-400,
html.dark .text-gray-400 {
    color: #64748b !important;
}

html.dark .border-slate-100,
html.dark .border-gray-100 {
    border-color: var(--theme-border) !important;
}

html.dark .border-slate-200,
html.dark .border-gray-200 {
    border-color: var(--theme-border) !important;
}

html.dark .border-slate-300,
html.dark .border-gray-300 {
    border-color: var(--theme-border) !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--theme-border) !important;
}

html.dark .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

html.dark .text-blue-700 {
    color: #60a5fa !important;
}

html.dark .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.15) !important;
}

html.dark .text-amber-700 {
    color: #fbbf24 !important;
}

html.dark .bg-red-100 {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

html.dark .text-red-700 {
    color: #f87171 !important;
}

html.dark .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

html.dark .text-green-700 {
    color: #4ade80 !important;
}

html.dark .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.15) !important;
}

html.dark .text-purple-700 {
    color: #c084fc !important;
}

html.dark .bg-slate-100 {
    background-color: rgba(100, 116, 139, 0.2) !important;
}

html.dark .text-slate-700 {
    color: #94a3b8 !important;
}

html.dark .ring-blue-500\/20 {
    --tw-ring-color: rgba(59, 130, 246, 0.15) !important;
}

/* Badge & accent color overrides for new light→dark classes */
html.dark .bg-yellow-100 {
    background-color: rgba(234, 179, 8, 0.15) !important;
}

html.dark .text-yellow-700 {
    color: #fbbf24 !important;
}

html.dark .text-yellow-600 {
    color: #facc15 !important;
}

html.dark .text-blue-600 {
    color: #60a5fa !important;
}

html.dark .text-green-600 {
    color: #4ade80 !important;
}

html.dark .text-teal-600 {
    color: #2dd4bf !important;
}

html.dark .text-orange-600 {
    color: #fb923c !important;
}

html.dark .bg-yellow-50 {
    background-color: rgba(234, 179, 8, 0.1) !important;
}

html.dark .bg-green-50 {
    background-color: rgba(34, 197, 94, 0.1) !important;
}

html.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

html.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

html.dark .bg-slate-200 {
    background-color: rgba(100, 116, 139, 0.25) !important;
}

html.dark .border-yellow-300 {
    border-color: rgba(234, 179, 8, 0.3) !important;
}

html.dark .border-orange-300 {
    border-color: rgba(251, 146, 60, 0.3) !important;
}

html.dark .border-teal-300 {
    border-color: rgba(45, 212, 191, 0.3) !important;
}

html.dark .border-purple-300 {
    border-color: rgba(168, 85, 247, 0.3) !important;
}

html.dark .border-green-300 {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

html.dark .border-blue-300 {
    border-color: rgba(59, 130, 246, 0.3) !important;
}

html.dark .border-red-300 {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

html.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Match-details modal dark */
html.dark #match-details-modal .bg-white {
    background-color: #1e293b !important;
}

html.dark .shadow-md,
html.dark .shadow-lg,
html.dark .shadow-xl {
    --tw-shadow-color: rgba(0, 0, 0, 0.4) !important;
}

/* Body dark overrides */
html.dark body {
    background-image: linear-gradient(rgba(10, 15, 30, 0.82), rgba(10, 15, 30, 0.82)), url('../assets/BackGround_1.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

html.dark body::before {
    opacity: 0.15;
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}

html.dark body::after {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.6), transparent);
}

/* Drawers dark */
html.dark .mobile-drawer {
    background: #1e293b;
    color: #f1f5f9;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
}

html.dark .mobile-drawer-header {
    background: #0f172a;
    border-bottom-color: rgba(148, 163, 184, 0.15);
}

html.dark .mobile-drawer-title {
    color: #f1f5f9;
}

html.dark .mobile-drawer-close {
    background: #334155;
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

html.dark .mobile-menu-block {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.15);
}

html.dark .mobile-menu-block-title {
    color: #94a3b8;
}

html.dark .mobile-menu-current-league {
    color: #f1f5f9;
}

html.dark .mobile-menu-select {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

html.dark .mobile-menu-select option {
    background: #1e293b;
    color: #f1f5f9;
}

html.dark .mobile-menu-link {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(148, 163, 184, 0.15);
    color: #60a5fa;
}

html.dark .mobile-menu-link:active {
    background: rgba(59, 130, 246, 0.15);
}

html.dark .mobile-profile-drawer-top {
    background: #1e40af;
}

/* Alternate table rows dark */
html.dark .bg-gray-750 {
    background-color: rgba(30, 58, 95, 0.25);
}

/* Landing / Hero dark */
html.dark .public-home-hero {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html.dark .public-home-kicker {
    color: #60a5fa;
}

/* Login form dark */
html.dark #login-form-container,
html.dark #signup-form-container {
    background-color: rgba(30, 41, 59, 0.98);
}

html.dark input::placeholder {
    color: #64748b !important;
}

/* Footer dark — gradient already works on dark bg, just deepen slightly */
html.dark .site-footer {
    background: linear-gradient(180deg, #0c3878 0%, #1d4ed8 36%, #0891b2 100%);
}

/* Legal disclaimer dark */
html.dark .legal-disclaimer-footer {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.15);
}

/* Desktop top nav dark */
html.dark #desktop-top-nav {
    background: linear-gradient(135deg, #071a4a 0%, #1a3fa0 45%, #0c6ea6 100%);
}

/* Progress bar dark */
html.dark .bg-gray-700 {
    background-color: #334155 !important;
}

/* Sticky column (player stats table) dark */
html.dark .sticky.left-0.bg-white {
    background-color: var(--theme-bg-1) !important;
}

/* Colore personalizzato per righe alternate tabella */
.bg-gray-750 {
    background-color: #f0f7ff;
}

/* Elementi visibili solo per admin */
.admin-only.admin-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Elementi visibili solo per super-admin */
.super-admin-only.super-admin-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Nascondi i tab nav admin su mobile (solo desktop) */
#admin-tabs-nav {
    display: none !important;
}

@media (min-width: 1024px) {
    #admin-tabs-nav {
        display: flex !important;
    }
}

/* Sottosezioni Admin visibili solo su desktop */
.admin-desktop-only {
    display: none !important;
}

@media (min-width: 1024px) {
    .admin-desktop-only.active {
        display: block !important;
    }
}

/* Previene lo zoom su iOS quando si tappa su input */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none;
}

/* Migliora lo scrolling su iOS */
body,
html {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

body {
    font-family: 'Chakra Petch', 'Rajdhani', 'Segoe UI', sans-serif;
    background-color: #f8fafc;
    background-image: url('../assets/BackGround_1.jpg');
    background-size: cover;
    background-position: center top;
    color: #1e293b;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    /* Sticky footer: body occupa sempre l'intera altezza del viewport */
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    /* Padding per safe area — no horizontal padding: nav/footer handle full bleed themselves */
    padding-top: 0;
    padding-right: 0;
    padding-bottom: max(0.5rem, var(--safe-area-inset-bottom));
    padding-left: 0;
}

/* Il contenuto principale si espande per spingere il footer in fondo */
body > #app-content-area {
    flex: 1;
}

/* Leggero pattern puntinato per profonditÃ  */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
    background-image:
        radial-gradient(circle, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Safe area spacer per il top notch */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: max(0px, var(--safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(29, 78, 216, 0.1), transparent);
    z-index: 35;
    pointer-events: none;
}

/* ===================================
   COMPONENTI COMUNI
   =================================== */

.card {
    background-color: var(--theme-surface-1);
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    padding: 16px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(4px);
}

/* Responsive padding for cards */
@media (min-width: 768px) {
    .card {
        padding: 24px;
    }
}

/* ===================================
   UI FOUNDATION
   Layer minima di componenti riusabili
   per ridurre la frammentazione di modali,
   pannelli interni e superfici.
   =================================== */

.ui-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
}
html.dark .ui-overlay {
    background: rgba(15, 23, 42, 0.92);
}

.ui-overlay-scroll {
    overflow: auto;
}

.ui-overlay-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ui-dialog {
    width: 100%;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12), 0 8px 24px rgba(37, 99, 235, 0.12);
    overflow: hidden;
}

.ui-dialog-sm {
    max-width: 420px;
}

.ui-dialog-md {
    max-width: 720px;
}

.ui-dialog-lg {
    max-width: 960px;
}

.ui-dialog-xl {
    max-width: 1120px;
}

/* League creation / onboarding wizard modal: adaptive desktop + mobile */
.league-wizard-overlay.ui-overlay-center {
    padding: clamp(0.5rem, 1.6vw, 1.5rem);
}

.league-wizard-dialog {
    width: min(96vw, 1320px);
    max-width: 1320px;
    height: min(92vh, 980px);
    max-height: 92vh;
}

/* Auth-state full-screen overlays: show below the fixed navbar */
#league-selection-modal,
#welcome-container,
#pending-approval-container {
    top: var(--header-height) !important;
}

/* Dark theme for welcome/pending containers */
#welcome-container {
    background: var(--theme-bg, #120f2d) !important;
}
#pending-approval-container {
    background: rgba(12,10,35,0.97) !important;
}
#pending-approval-container .bg-white {
    background: var(--theme-surface-1) !important;
    border-color: var(--theme-border) !important;
}
#pending-approval-container .text-slate-800,
#welcome-container .text-slate-800 {
    color: var(--theme-text) !important;
}
#pending-approval-container .text-slate-600,
#welcome-container .text-slate-600 {
    color: var(--theme-text-soft, var(--theme-text)) !important;
}
#pending-approval-container button.bg-white {
    background: var(--theme-surface-1) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

/* Onboarding create/join modal: enforce stronger contrast in both themes */
#league-selection-modal {
    color: var(--theme-text);
    background: var(--theme-bg, #120f2d) !important;
}

/* Fix bg-white Tailwind override inside the modal */
#league-selection-modal .bg-white,
#league-selection-modal select.bg-white {
    background: var(--theme-surface-1) !important;
    color: var(--theme-text) !important;
}

#league-selection-modal .border-gray-200 {
    border-color: var(--theme-border) !important;
}

#league-selection-modal .text-slate-800 {
    color: var(--theme-text) !important;
}

#league-selection-modal .text-gray-300 {
    color: var(--theme-text-soft) !important;
}

#league-selection-modal .text-gray-400,
#league-selection-modal .text-gray-500 {
    color: var(--theme-muted) !important;
}

#league-selection-modal .border-gray-200,
#league-selection-modal .border-gray-800 {
    border-color: var(--theme-border) !important;
}

#league-selection-modal input[type="text"],
#league-selection-modal input[type="password"],
#league-selection-modal select,
#league-selection-modal textarea {
    background: var(--theme-surface-1) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

#league-selection-modal input::placeholder,
#league-selection-modal textarea::placeholder {
    color: var(--theme-muted) !important;
    opacity: 0.95;
}

#league-selection-modal .ui-form-block {
    background: var(--theme-surface-1);
    border-color: var(--theme-border);
}

#league-selection-modal #league-verify-button,
#league-selection-modal #league-join-button,
#league-selection-modal #league-creation-confirm-btn,
#create-league-modal #league-creation-confirm-btn {
    color: #ffffff;
    border: 1px solid transparent;
}

#league-selection-modal #league-verify-button:disabled,
#league-selection-modal #league-join-button:disabled,
#league-selection-modal #league-creation-confirm-btn:disabled,
#create-league-modal #league-creation-confirm-btn:disabled {
    opacity: 1 !important;
    color: var(--theme-text-soft) !important;
    background: var(--theme-surface-3) !important;
    border-color: var(--theme-border) !important;
    box-shadow: none !important;
    text-shadow: none;
}

/* League wizard: text contrast for gray-100/200/300 that are invisible in light mode */
.league-wizard-dialog .text-gray-100,
.league-wizard-dialog .text-gray-200 {
    color: var(--theme-text) !important;
}

.league-wizard-dialog .text-gray-300 {
    color: var(--theme-text-soft) !important;
}

/* League wizard: bonus/malus rows – unify row and input backgrounds to theme tokens */
.league-wizard-dialog #league-options-calc-bonus-table > div {
    background: var(--theme-surface-1) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.league-wizard-dialog .league-bonus-malus-input {
    background: var(--theme-surface-1) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

.bm-label-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.bm-label-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex: 0 0 auto;
}

.bm-icon-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    display: inline-block;
}

.bm-mask-icon {
    background-color: var(--bm-color, #64748b);
    -webkit-mask-image: var(--bm-icon);
    mask-image: var(--bm-icon);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.bm-stat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: default;
    user-select: none;
}

.bm-stat-chip .bm-icon-img,
.bm-stat-chip .bm-mask-icon {
    width: 16px;
    height: 16px;
}

.league-wizard-dialog--split {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.league-wizard-dialog--scroll {
    overflow-y: auto;
}

.league-wizard-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 0.2rem;
    overscroll-behavior: contain;
}

@media (max-width: 1024px) {
    .league-wizard-dialog {
        width: min(98vw, 1120px);
        height: min(94vh, 920px);
        max-height: 94vh;
    }
}

@media (max-width: 768px) {
    .league-wizard-overlay.ui-overlay-center {
        padding: 0;
    }

    .league-wizard-dialog {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .league-wizard-scroll {
        padding-right: 0;
        padding-bottom: max(0.4rem, var(--safe-area-inset-bottom));
    }
}

/* League wizard content tuning (scoped to modal only) */
.league-wizard-dialog .league-options-shell {
    margin-top: 0.25rem;
}

.league-wizard-dialog .league-options-content {
    min-width: 0;
}

@media (min-width: 1025px) {
    .league-wizard-dialog .league-options-layout {
        align-items: flex-start;
    }

    .league-wizard-dialog .league-options-sidebar {
        position: sticky;
        top: 0.25rem;
    }

    .league-wizard-dialog .league-options-shell {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .league-wizard-dialog .league-options-shell {
        margin-top: 0;
        padding: 0.75rem;
        border-radius: 14px;
    }

    .league-wizard-dialog .league-options-layout {
        gap: 0.85rem;
    }

    .league-wizard-dialog .league-options-sidebar h3 {
        margin-bottom: 0.45rem;
        font-size: 1rem;
    }

    .league-wizard-dialog #league-options-stepper {
        display: flex;
        gap: 0.45rem;
        overflow-x: auto;
        padding-bottom: 0.3rem;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
    }

    .league-wizard-dialog #league-options-stepper .settings-step-button {
        width: auto;
        min-width: max-content;
        white-space: nowrap;
        font-size: 0.88rem;
        line-height: 1.15;
        padding: 0.58rem 0.72rem;
        border-radius: 10px;
        scroll-snap-align: start;
    }

    .league-wizard-dialog .settings-section-title {
        font-size: 1rem;
    }

    .league-wizard-dialog .settings-panel,
    .league-wizard-dialog .settings-toggle-card,
    .league-wizard-dialog .ui-panel,
    .league-wizard-dialog .ui-form-block {
        border-radius: 12px;
    }

    .league-wizard-dialog .league-options-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        padding-bottom: max(0.5rem, var(--safe-area-inset-bottom));
        border-top: 1px solid var(--theme-border);
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.98));
        backdrop-filter: blur(6px);
    }

    .league-wizard-dialog .league-options-actions .btn-secondary,
    .league-wizard-dialog .league-options-actions .btn-primary {
        min-height: 42px;
        font-size: 0.9rem;
    }
}

@media (max-width: 420px) {
    .league-wizard-dialog {
        padding: 0.75rem;
    }

    .league-wizard-dialog .league-options-shell {
        padding: 0.62rem;
    }

    .league-wizard-dialog #league-options-stepper .settings-step-button {
        font-size: 0.83rem;
        padding: 0.5rem 0.64rem;
    }
}

.ui-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface-2);
}

.ui-dialog-header--sticky {
    position: sticky;
    top: 0;
    z-index: 2;
}

.ui-dialog-title {
    margin: 0;
    color: var(--theme-text);
    font-weight: 700;
}

.ui-dialog-subtitle {
    margin-top: 0.25rem;
    color: var(--theme-muted);
    font-size: 0.95rem;
}

.ui-dialog-body {
    padding: 1.5rem;
}

.ui-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ui-toolbar-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
}

.ui-panel {
    background: var(--theme-surface-2);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 1rem;
}

.ui-panel-soft {
    background: var(--theme-surface-1);
}

.ui-panel-dashed {
    border-style: dashed;
}

.ui-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 0.875rem 1rem;
}

.ui-form-block {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 1rem;
}

.ui-choice-card {
    position: relative;
    text-align: left;
    padding: 1.5rem;
    border-radius: 18px;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.ui-choice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
}

.ui-choice-card-accent {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.ui-choice-card:hover .ui-choice-card-accent {
    opacity: 1;
}

.ui-choice-card-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-size: 1.8rem;
}

.ui-choice-card-icon-primary {
    background: rgba(37, 99, 235, 0.12);
    color: var(--theme-accent);
}

.ui-choice-card-icon-success {
    background: rgba(5, 150, 105, 0.12);
    color: var(--theme-success);
}

.ui-muted-link {
    color: var(--theme-muted);
    transition: color 0.18s ease;
}

.ui-muted-link:hover {
    color: var(--theme-accent);
}

/* ═══════════════════════════════════════════════════════
   NO-LEAGUE ONBOARDING — Full page layout (no dialog card)
   ═══════════════════════════════════════════════════════ */

/* 1 · Make overlay full-bleed — no floating centered card */
#league-selection-modal.league-wizard-overlay {
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    overflow-y: auto;
    background: var(--theme-bg-0, #0c0a1f) !important;
    backdrop-filter: none !important;
}

#league-selection-modal #league-selection-card {
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: var(--theme-bg-0, #0c0a1f) !important;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
}

#league-selection-modal .league-steps-wrapper {
    flex: 1;
    overflow: visible;
}

/* Step progress bar */
#league-selection-modal #league-step-progress {
    padding: .9rem 1.5rem;
    background: var(--theme-surface-1);
    border-bottom: 1px solid var(--theme-border);
    margin: 0;
}

/* 2 · Hero section - dark surface + amber accent (clearly different from blue navbar) */
.nl-hero {
    background: var(--theme-surface-1);
    border-bottom: 1px solid var(--theme-border);
    padding: 2.25rem 1.5rem 2rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Dot-grid pitch pattern */
.nl-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

/* Decorative center line (pitch) */
.nl-hero::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,.05);
    transform: translateX(-50%);
    pointer-events: none;
}

/* Football emoji above kicker */
.nl-hero-ball {
    font-size: 2.4rem;
    line-height: 1;
    display: block;
    margin-bottom: .65rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

/* Amber kicker badge */
.nl-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(251,191,36,.1);
    border: 1px solid rgba(251,191,36,.28);
    border-radius: 999px;
    padding: .28rem .85rem;
    margin-bottom: .75rem;
    position: relative;
    z-index: 1;
}

.nl-kicker-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fbbf24;
    animation: nl-pulse 1.8s ease-in-out infinite;
}

@keyframes nl-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

.nl-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    font-weight: 700;
    color: var(--theme-text);
    line-height: 1.1;
    margin-bottom: .4rem;
    position: relative;
    z-index: 1;
}

.nl-sub {
    font-size: .875rem;
    color: var(--theme-muted);
    line-height: 1.55;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 3 · Choice cards */
.nl-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 520px) {
    .nl-cards {
        grid-template-columns: 1fr 1fr;
        padding: 2rem 1.5rem;
        gap: 1.25rem;
    }
}

.nl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--theme-surface-1);
    border: 1.5px solid var(--theme-border);
    text-decoration: none;
    cursor: pointer;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), border-color .2s, box-shadow .2s;
    overflow: hidden;
}

.nl-card:hover { transform: translateY(-4px); }

.nl-card--create:hover {
    border-color: rgba(96,165,250,.55);
    box-shadow: 0 20px 48px rgba(29,78,216,.22);
}
.nl-card--join:hover {
    border-color: rgba(52,211,153,.55);
    box-shadow: 0 20px 48px rgba(16,185,129,.18);
}

.nl-card-glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}
.nl-card:hover .nl-card-glow { opacity: 1; }
.nl-card-glow--create { background: radial-gradient(ellipse at 0% 0%, rgba(59,130,246,.13) 0%, transparent 65%); }
.nl-card-glow--join   { background: radial-gradient(ellipse at 0% 0%, rgba(16,185,129,.13) 0%, transparent 65%); }

.nl-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.nl-card-icon svg { width: 26px; height: 26px; flex-shrink: 0; }

.nl-card-icon--create {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(29,78,216,.42);
}

.nl-card-icon--join {
    background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(16,185,129,.38);
}

.nl-card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--theme-text);
    margin-bottom: .4rem;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.nl-card-desc {
    font-size: .8rem;
    color: var(--theme-muted);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1.1rem;
    position: relative;
    z-index: 1;
}

.nl-card-desc code {
    font-family: 'Chakra Petch', monospace;
    font-size: .73rem;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 4px;
    padding: .1em .32em;
    color: var(--theme-text-soft, var(--theme-text));
}

.nl-card-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    position: relative;
    z-index: 1;
    transition: gap .18s;
}
.nl-card:hover .nl-card-cta { gap: .7rem; }
.nl-card-cta svg { transition: transform .18s; flex-shrink: 0; width: 14px; height: 14px; }
.nl-card:hover .nl-card-cta svg { transform: translateX(4px); }

.nl-card-cta--create { color: #60a5fa; }
.nl-card-cta--join   { color: #34d399; }

/* 4 · Step 2 — Join form */
.nl-step2-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.25rem;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.nl-step2-title-block { flex: 1; min-width: 0; }

.nl-step2-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--theme-text);
    line-height: 1.15;
    margin: 0 0 .2rem;
}

.nl-step2-sub {
    font-size: .82rem;
    color: var(--theme-muted);
    margin: 0;
}

/* Back button — prominent, left-aligned, pill */
.nl-back-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.1rem;
    border-radius: 10px;
    background: var(--theme-surface-2, rgba(255,255,255,.06));
    border: 1.5px solid var(--theme-border);
    color: var(--theme-text);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: 'Chakra Petch', sans-serif;
}
.nl-back-btn:hover {
    background: rgba(255,255,255,.1);
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

/* Form body — centered, max width */
.nl-form-body {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Input + verify button: stack on narrow screens */
.nl-join-row {
    display: flex;
    gap: .75rem;
    align-items: stretch;
}

@media (max-width: 480px) {
    .nl-join-row { flex-direction: column; }
    .nl-join-row button { width: 100%; }
}


.ui-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.ui-status-chip-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.ui-status-chip-admin {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.28);
}

.ui-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 14px;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-soft);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.ui-back-link:hover {
    color: var(--theme-accent);
    border-color: rgba(37, 99, 235, 0.26);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.settings-step-button {
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-1);
    color: var(--theme-text-soft);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.settings-step-button:hover {
    background: rgba(240, 249, 255, 0.98);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--theme-accent);
}

.settings-step-button-active {
    background: rgba(219, 234, 254, 0.68);
    border-color: rgba(37, 99, 235, 0.3);
    color: #1d4ed8;
}

.settings-section-title {
    color: var(--theme-text);
    font-size: 1.125rem;
    font-weight: 700;
}

.settings-panel {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 1rem;
}

.settings-toggle-card {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 0.85rem;
}

.settings-input,
.settings-select,
.settings-mini-input {
    background: var(--theme-surface-1);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
}

.settings-input,
.settings-select {
    width: 100%;
    padding: 0.65rem 0.85rem;
}

.settings-mini-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
}

.settings-chip {
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: var(--theme-surface-2);
    color: var(--theme-text);
    border: 1px solid var(--theme-border);
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-chip.selected {
    background: var(--theme-accent);
    color: #ffffff;
    border-color: var(--theme-accent-deep);
}

.app-settings-binary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
}

.app-settings-binary-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-settings-binary-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 9999px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-2);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.app-settings-binary-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease;
}

.app-settings-binary-input:checked + .app-settings-binary-track {
    background: rgba(37, 99, 235, 0.24);
    border-color: rgba(37, 99, 235, 0.55);
}

.app-settings-binary-input:checked + .app-settings-binary-track::after {
    transform: translateX(18px);
}

.app-settings-binary-text {
    font-size: 0.8rem;
    color: var(--theme-text-soft);
    white-space: nowrap;
}

html.dark .app-settings-binary-track {
    background: rgba(148, 163, 184, 0.18);
}

html.dark .app-settings-binary-input:checked + .app-settings-binary-track {
    background: rgba(59, 130, 246, 0.38);
    border-color: rgba(96, 165, 250, 0.7);
}

.settings-info-box {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(219, 234, 254, 0.42);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.settings-danger-panel {
    background: rgba(254, 242, 242, 0.92);
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 14px;
    padding: 1rem;
}

.settings-warning-panel {
    background: rgba(255, 247, 237, 0.92);
    border: 1px solid rgba(251, 146, 60, 0.28);
    border-radius: 14px;
    padding: 1rem;
}

/* ===================================
   UTILITY PER HTML GENERATO VIA JS
   Classi riutilizzabili applicate nei template dinamici
   =================================== */

/* Riga utente/card generica */
.ui-user-row {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

/* Separatore interno riga utente */
.ui-user-row-divider {
    border-bottom: 1px solid #e9eff8;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Elemento lista (richieste, membri, allegati) */
.ui-list-item {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 0.75rem;
}

/* Riga allegato con accento blu a sinistra */
.ui-attachment-row {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2eaf5;
    border-left: 3px solid #3b82f6;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ui-attachment-row:hover {
    background: rgba(240, 249, 255, 0.98);
    border-color: rgba(37, 99, 235, 0.3);
}

/* Timer/countdown box */
.ui-timer-box {
    background: #f1f5f9;
    border: 1px solid #e2eaf5;
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    min-width: 3rem;
    text-align: center;
}

/* Schiera Formazioni - Countdown mobile-first */
.fm-countdown-shell {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 45%, #f8fafc 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 14px;
    padding: 0.85rem;
    display: grid;
    gap: 0.75rem;
}

.fm-countdown-head {
    display: grid;
    gap: 0.2rem;
}

.fm-countdown-title {
    margin: 0;
    color: #16a34a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.fm-countdown-subtitle {
    margin: 0;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.35;
}

.fm-countdown-meta {
    margin: 0;
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.35;
}

.fm-countdown-timer-wrap {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #dcfce7;
    border-radius: 12px;
    padding: 0.6rem;
}

.fm-countdown-label {
    margin: 0 0 0.45rem;
    text-align: center;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.fm-countdown-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.fm-countdown-item {
    min-width: 64px;
    flex: 1 1 64px;
    max-width: 86px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 0.42rem 0.25rem;
    text-align: center;
}

.fm-countdown-value {
    margin: 0;
    color: #16a34a;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.fm-countdown-unit {
    margin: 0.2rem 0 0;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: lowercase;
}

@media (min-width: 768px) {
    .fm-countdown-shell {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.9rem;
    }

    .fm-countdown-timer-wrap {
        min-width: 280px;
    }

    .fm-countdown-label {
        margin-bottom: 0.5rem;
    }
}

/* Intestazione tabelle dinamiche */
.ui-table-head {
    background: var(--theme-bg-2);
    color: var(--theme-muted);
}

/* Riga generica di tabella */
.ui-table-row {
    border-top: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.ui-table-row:hover {
    background: rgba(240, 249, 255, 0.5);
}

/* Badge conteggio (es. coda file) */
.ui-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 9999px;
    background: rgba(20, 184, 166, 0.1);
    color: #0f766e;
    border: 1px solid rgba(20, 184, 166, 0.22);
    font-size: 0.7rem;
    font-weight: 700;
}

/* Cella vuota nelle tabelle */
.ui-null-cell {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Stato riga tabella – status variants */
.ui-row-active   { background: rgba(220, 252, 231, 0.55); }
.ui-row-warning  { background: rgba(254, 243, 199, 0.55); }
.ui-row-past     { background: rgba(241, 245, 249, 0.6); opacity: 0.75; }
.ui-row-upcoming { background: rgba(219, 234, 254, 0.45); }

/* File coda item – status color */
.ui-queue-item-done       { background: rgba(220, 252, 231, 0.5); border-radius: 8px; }
.ui-queue-item-processing { background: rgba(219, 234, 254, 0.5); border-radius: 8px; }
.ui-queue-item-error      { background: rgba(254, 226, 226, 0.5); border-radius: 8px; }
.ui-queue-item-default    { background: rgba(241, 245, 249, 0.5); border-radius: 8px; }

.ui-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    color: var(--theme-text-soft);
    font-size: 1.125rem;
    font-weight: 700;
}

@media (max-width: 767px) {
    .ui-dialog-header {
        padding: 1rem;
    }

    .ui-dialog-body {
        padding: 1rem;
    }
}

/* ===================================
   BOTTONI AZIONE SCHEDE COMPETIZIONE
   Usano CSS vars tema-aware (light / dark)
   =================================== */

.comp-action-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s ease, background 0.15s ease;
    line-height: 1.4;
}
.comp-action-btn:hover {
    opacity: 1;
    background: color-mix(in srgb, currentColor 12%, transparent);
}
.comp-action-btn--danger   { color: var(--theme-danger); }
.comp-action-btn--warning  { color: var(--theme-highlight); }
.comp-action-btn--info     { color: var(--theme-accent-strong); }

/* ===================================
   PULSANTI
   Ottimizzati per mobile con minimo 48x48px (Apple HIG)
   =================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-mid));
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    min-height: 48px;
    min-width: 48px;
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--btn-primary-mid), var(--btn-primary-end));
    box-shadow: 0 0 16px var(--btn-primary-glow);
}

.btn-primary:active {
    background: var(--btn-primary-end);
}

/* Effetto shimmer per i bottoni */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    min-height: 44px;
    transition: background-color 0.2s, border-color 0.2s;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-secondary:hover {
    background-color: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.45);
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    min-height: 44px;
    transition: background-color 0.2s;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-success {
    background-color: #10b981;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    min-height: 44px;
    transition: background-color 0.2s;
    cursor: pointer;
    touch-action: manipulation;
}

.btn-success:hover {
    background-color: #059669;
}

/* ===================================
   INPUT
   Ottimizzati per mobile
   =================================== */

input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
input[type="date"] {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #0f172a;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    font-size: 16px;
    /* Previene zoom automatico su iOS */
    min-height: 44px;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
input[type="date"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

/* ===================================
   SCOMMESSE
   =================================== */

.bet-option {
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background-color: #f8fafc;
    color: #1e293b;
    padding: 14px;
    min-height: 50px;
    font-size: 15px;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .bet-option {
        padding: 12px;
        font-size: 14px;
    }
}

.bet-option:hover:not(.pointer-events-none) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.35);
}

.bet-option.pointer-events-none {
    pointer-events: none;
    cursor: not-allowed;
}

.bet-option.opacity-50 {
    opacity: 0.5;
}

/* Stile per indicare la selezione attiva (prediction locale) */
.bet-option.local-selected {
    border-color: #1d4ed8;
    background-color: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

/* Stile per indicare una scommessa SALVATA in Firestore */
.bet-option.saved-bet {
    border-color: #0284c7;
    background-color: rgba(2, 132, 199, 0.1);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

/* Variante compatta per layout a tabella quote */
.bet-option-sm {
    padding: 5px 4px;
    min-height: 34px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
    display: block;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: -0.01em;
}

.bet-odds-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.45) rgba(241, 245, 249, 0.6);
    border-color: #e2eaf5;
}

.bet-odds-table {
    min-width: 760px;
    table-layout: fixed;
    width: 760px;
    background: #ffffff;
}

/* Intestazioni tabella quote */
.bet-odds-table thead tr:first-child {
    background: #1e40af;
    color: #e0eaff;
}

.bet-odds-table thead tr:nth-child(2) {
    background: #f8fafc;
    color: #475569;
}

/* Riga data separatore */
.bet-odds-date-row {
    background: #f1f5f9;
    color: #64748b;
}

/* Riga partita */
.bet-odds-table tbody tr.bet-match-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s ease;
}

.bet-odds-table tbody tr.bet-match-row:hover {
    background: rgba(240, 249, 255, 0.6);
}

.bet-odds-team-head,
.bet-odds-team-cell {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.bet-odds-odd-head,
.bet-odds-odd-cell {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.bet-odds-team-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap !important;
    min-width: 0;
}

.bet-odds-team-row img {
    flex: 0 0 auto;
}

.bet-odds-team-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .bet-odds-wrap {
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
        padding-bottom: 4px;
    }

    .bet-odds-table {
        min-width: 700px;
        width: 700px;
        font-size: 12px;
    }

    .bet-odds-team-head,
    .bet-odds-team-cell {
        width: 190px;
        min-width: 190px;
        max-width: 190px;
    }

    .bet-odds-odd-head,
    .bet-odds-odd-cell {
        width: 85px;
        min-width: 85px;
        max-width: 85px;
    }

    .bet-odds-table th,
    .bet-odds-table td {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .bet-odds-team-name {
        max-width: 110px;
        font-size: 12px;
    }

    .bet-odds-time {
        margin-bottom: 4px !important;
        font-size: 11px !important;
    }

    .bet-option-sm {
        min-height: 30px;
        padding: 4px 3px;
        font-size: 12px;
        border-radius: 3px;
    }
}

@media (max-width: 480px) {
    .bet-odds-table {
        min-width: 640px;
        width: 640px;
        display: table !important;
        white-space: normal !important;
    }

    .bet-odds-table thead {
        display: table-header-group !important;
    }

    .bet-odds-table tbody {
        display: table-row-group !important;
    }

    .bet-odds-table tr {
        display: table-row !important;
        width: auto !important;
        table-layout: auto !important;
    }

    .bet-odds-team-head,
    .bet-odds-team-cell {
        width: 170px;
        min-width: 170px;
        max-width: 170px;
    }

    .bet-odds-odd-head,
    .bet-odds-odd-cell {
        width: 78px;
        min-width: 78px;
        max-width: 78px;
    }

    .bet-odds-team-name {
        max-width: 98px;
        font-size: 11px;
    }

    .bet-option-sm {
        min-height: 28px;
        font-size: 11px;
        padding: 3px 2px;
    }
}

/* ── Hover riga partita (sostituisce Tailwind hover:bg-blue-50/40) ── */
.bet-match-hover:not(.opacity-50):hover { background: rgba(240, 249, 255, 0.6); }

/* ── Dark mode: tabella quote ── */
.dark .bet-odds-table {
    background: var(--theme-surface-1);
}
.dark .bet-odds-table thead tr:first-child {
    background: #1a2f6b;
}
.dark .bet-odds-table thead tr:nth-child(2) {
    background: var(--theme-surface-2);
    color: var(--theme-muted);
}
.dark .bet-odds-date-row {
    background: var(--theme-surface-2);
    color: var(--theme-muted);
}
.dark .bet-odds-wrap {
    border-color: var(--theme-border);
    scrollbar-color: rgba(96, 165, 250, 0.35) var(--theme-surface-2);
}
.dark .bet-odds-table tbody tr.bet-match-row {
    border-bottom-color: var(--theme-border);
}
.dark .bet-match-hover:not(.opacity-50):hover {
    background: rgba(37, 99, 235, 0.08);
}
.dark .bet-option {
    background-color: var(--theme-surface-2);
    color: var(--theme-text);
}
.dark .bet-option.local-selected {
    background-color: rgba(37, 99, 235, 0.25);
}
.dark .bet-option.saved-bet {
    background-color: rgba(2, 132, 199, 0.25);
}
.dark .bet-odds-team-name {
    color: var(--theme-text);
}
.dark .bet-odds-time {
    color: var(--theme-muted);
}

/* ===================================
   ANIMAZIONI
   =================================== */

/* Stili per il countdown animato */
@keyframes pulse-countdown {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.countdown-urgent {
    animation: pulse-countdown 2s ease-in-out infinite;
}

/* Animazioni per il sorteggio */
@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(251, 191, 36, 0.5), 0 0 10px rgba(251, 191, 36, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 30px rgba(251, 191, 36, 0.4);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.animate-scale-in {
    animation: scale-in 0.5s ease-out forwards;
}

/* Animazione fade-out per notifiche */
@keyframes fade-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.animate-fade-out {
    animation: fade-out 0.3s ease-out forwards;
}

/* Transizioni per il flusso di benvenuto */
@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out-left {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slide-in-left {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-out-right {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.slide-in-right { animation: slide-in-right 0.4s ease-out forwards; }
.slide-out-left { animation: slide-out-left 0.4s ease-out forwards; }
.slide-in-left { animation: slide-in-left 0.4s ease-out forwards; }
.slide-out-right { animation: slide-out-right 0.4s ease-out forwards; }

.league-steps-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    width: 100%;
    align-items: start;
    overflow-x: hidden;
}

.league-steps-wrapper > div {
    grid-area: 1 / 1;
    width: 100%;
}

/* ===================================
   TABELLE
   =================================== */

/* Stile specifico per l'intestazione della giornata */
.giornata-header th {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.875rem;
    color: #1d4ed8;
    border-bottom: 2px solid #bfdbfe;
}

@media (min-width: 768px) {
    .giornata-header th {
        padding: 12px 16px;
        font-size: 1rem;
    }
}

/* Ottimizzazione tabelle per mobile */
table {
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    table {
        font-size: 1rem;
    }
}

table th,
table td {
    padding: 8px 6px;
    white-space: nowrap;
}

@media (min-width: 768px) {

    table th,
    table td {
        padding: 12px 16px;
    }
}

/* Nascondi scrollbar ma mantieni funzionalitÃ  scroll */
.hide-scrollbar {
    -ms-overflow-style: none;
    /* IE e Edge */
    scrollbar-width: none;
    /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari e Opera */
}

/* ===================================
   MODALI
   =================================== */

/* Stile per la modale di conferma */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

.confirm-modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2), 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    text-align: center;
    color: #0f172a;
}

@media (min-width: 768px) {
    .confirm-modal-content {
        padding: 24px;
    }
}

/* Modifica per centrare i messaggi di notifica */
#message-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

#message-box:not(.hidden) {
    display: flex;
}

/* Progress bar container */
#progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

#progress-bar-container:not(.hidden) {
    display: flex;
}

/* ===================================
   MENU UTENTE
   =================================== */

#user-menu-toggle {
    transition: transform 0.2s;
}

#user-menu-dropdown {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s;
}

#user-menu-dropdown.open {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
}

/* ===================================
   IMMAGINI
   Ottimizzazioni per mobile
   =================================== */

/* Forza tutte le immagini a rimanere nei loro contenitori */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Contenitori di immagini - previeni overflow (escludi modal fixed e scrollabili) */
.card,
[class*="col-"] {
    overflow: hidden;
}

/* Fix specifico per container con immagini */
.card img,
td img,
th img,
div[class*="flex"] img,
div[class*="grid"] img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

/* Fix per container specifici che contengono loghi squadre */
.team-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 100%;
}

/* Previeni text overflow */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Container generale - previeni overflow orizzontale */
.container,
main,
section {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===================================
   RESPONSIVE - MOBILE
   Ottimizzazioni per schermi piccoli
   =================================== */

/* Ottimizzazioni per schermi molto piccoli (iPhone 12 mini: 375x812) */
@media (max-width: 480px) {

    /* Riduci padding verticale solo, lasciare larghezza completa */
    body {
        padding-top: 0 !important;
        padding-bottom: 8px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Card piÃ¹ compatte */
    .card {
        padding: 12px !important;
        margin-bottom: 12px;
    }

    /* Wrapper per tabelle con scroll orizzontale */
    table {
        font-size: 0.75rem !important;
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    table thead,
    table tbody,
    table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    table th,
    table td {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
    }

    /* Immagini piÃ¹ piccole nelle tabelle */
    td img,
    th img {
        max-width: 24px !important;
        max-height: 24px !important;
    }

    /* Logo header piÃ¹ piccolo */
    header img {
        max-width: 60px !important;
        max-height: 60px !important;
    }

    /* Pulsanti piÃ¹ compatti */
    button,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-success {
        padding: 10px 12px !important;
        font-size: 14px !important;
        min-height: 40px !important;
    }

    /* Grid responsive - mantieni 2 colonne ma piÃ¹ compatte */
    .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* Grid con 3+ colonne diventa 1 colonna */
    .grid:not(.grid-cols-2) {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }


    /* Text piÃ¹ piccolo dove necessario */
    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    h4 {
        font-size: 1rem !important;
    }
}

/* Ottimizzazioni per smartphone standard (fino a 768px) */
@media (max-width: 768px) {

    /* Container principale piÃ¹ stretto */
    .max-w-4xl,
    .max-w-6xl,
    .max-w-7xl {
        max-width: 100% !important;
    }

    /* Wrapper per tutte le tabelle - scroll orizzontale */
    .table-wrapper,
    .overflow-x-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* Tabelle - previeni rottura layout */
    table {
        min-width: 600px;
        /* Mantiene struttura tabella */
    }

    /* Card aspect-square piÃ¹ piccole su mobile */
    .aspect-square {
        min-height: 120px !important;
    }

    /* Padding ridotto per contenitori principali */
    .px-3,
    .px-6 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Spazi verticali ridotti */
    .space-y-6>*+* {
        margin-top: 1rem !important;
    }

    .mb-6,
    .mt-6 {
        margin-bottom: 1rem !important;
        margin-top: 1rem !important;
    }

    /* Mantieni grid a 2 colonne ma ottimizza dimensioni */
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ===================================
   TABELLE RESPONSIVE
   =================================== */

/* Wrapper per tabelle responsive - forza scroll orizzontale */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.responsive-table-wrapper table {
    width: 100%;
    min-width: max-content;
}

/* Stile per indicare che la tabella Ã¨ scrollabile */
@media (max-width: 768px) {
    .responsive-table-wrapper::after {
        content: 'â† Scorri per vedere tutto â†’';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #9ca3af;
        padding: 0.5rem;
        font-style: italic;
    }

    .responsive-table-wrapper:not(:hover)::after {
        animation: pulse 2s ease-in-out infinite;
    }
}

/* ===================================
   CLASSIFICA - MOBILE
   =================================== */

@media (max-width: 640px) {
    #standings-container {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    #standings-container table {
        font-size: 0.7rem;
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    #standings-container table th,
    #standings-container table td {
        padding: 0.4rem 0.15rem !important;
    }

    /* Colonna posizione */
    #standings-container table th:nth-child(1),
    #standings-container table td:nth-child(1) {
        width: 25px !important;
        padding: 0.4rem 0.1rem !important;
    }

    /* Colonna logo */
    #standings-container table th:nth-child(2),
    #standings-container table td:nth-child(2) {
        width: 30px !important;
        padding: 0.4rem 0.1rem !important;
    }

    /* Colonna nome squadra */
    #standings-container table th:nth-child(3),
    #standings-container table td:nth-child(3) {
        width: auto !important;
        min-width: 50px !important;
        max-width: 70px !important;
        padding: 0.4rem 0.15rem !important;
    }

    /* Colonne punti */
    #standings-container table th:nth-child(4),
    #standings-container table th:nth-child(5),
    #standings-container table td:nth-child(4),
    #standings-container table td:nth-child(5) {
        display: table-cell !important;
        width: 38px !important;
        min-width: 38px !important;
        padding: 0.4rem 0.1rem !important;
    }

    /* Logo squadra piÃ¹ piccolo su mobile */
    #standings-container table td img {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px;
        min-height: 24px;
    }

    /* Nome squadra con troncamento testo */
    #standings-container table td:nth-child(3) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Font piÃ¹ piccolo per i numeri su mobile */
    #standings-container table td:nth-child(4),
    #standings-container table td:nth-child(5) {
        font-size: 0.85rem !important;
    }
}

/* ===================================
   MOBILE CONTENT PADDING
   =================================== */

/* Desktop: compensazione navbar fixed */
@media (min-width: 769px) {
    #main-app-container #app-content-area,
    body > #app-content-area {
        padding-top: var(--header-height);
    }
}

@media (max-width: 768px) {
    #main-app-container #app-content-area,
    body > #app-content-area {
        padding-bottom: calc(5.4rem + max(0.25rem, var(--safe-area-inset-bottom)));
        padding-top: calc(var(--mobile-top-app-bar-height) + var(--safe-area-inset-top));
    }

    #home-container,
    #league-data-container,
    #betting-container,
    #profile-container,
    #admin-container,
    #league-settings-container,
    #app-settings-container,
    #user-bonus-container,
    #league-calendar-container,
    #player-stats-container,
    #squads-container,
    #league-stats-container,
    #team-stats-inline-container {
        padding-top: 0.35rem !important;
        margin-top: 0 !important;
    }

    .mobile-hide-section-name {
        display: none !important;
    }

    .mobile-hide-section-header {
        display: none !important;
    }

    .mobile-hide-league-data-main-menu {
        display: none !important;
    }

    /* Modal statistiche squadra */
    #team-stats-modal {
        z-index: 9999 !important;
    }

    #team-stats-modal .min-h-screen {
        min-height: 100%;
        padding-bottom: max(0.75rem, var(--safe-area-inset-bottom));
    }

}



/* ===================================
   MOBILE DRAWERS
   =================================== */

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(2, 6, 23, 0.55);
}

.login-app-logo {
    height: clamp(40px, 8vw, 58px);
    max-height: 58px;
    width: auto;
    max-width: min(72vw, 260px);
    object-fit: contain;
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(86vw, 340px);
    z-index: 10002;
    background: #f3f4f6;
    color: #111827;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.35);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.mobile-drawer-left {
    left: 0;
    transform: translateX(-100%);
}

.mobile-drawer-right {
    right: 0;
    transform: translateX(100%);
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    height: calc(var(--mobile-top-app-bar-height) + var(--safe-area-inset-top));
    padding: calc(var(--safe-area-inset-top) + 0.5rem) 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d1d5db;
    background: #e5e7eb;
}

.mobile-drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.mobile-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    color: #6b7280;
    background: #f9fafb;
    font-size: 1.4rem;
    line-height: 1;
}

.mobile-drawer-content {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.mobile-menu-block {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    background: #f9fafb;
}

.mobile-menu-block-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.mobile-menu-title-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

/* ===================================
   PLAYER STATS TABLE
   =================================== */

/* Sticky first column for player-stats table */
.ps-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #ffffff;
}
#player-stats-container .player-stats-head-row .ps-sticky-col {
    background: #e2e8f0;
    z-index: 3;
}
html.dark .ps-sticky-col {
    background: #0f172a;
}
html.dark #player-stats-container .player-stats-head-row .ps-sticky-col {
    background: #1e293b;
    z-index: 3;
}

#player-stats-container .player-stats-table {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #cbd5e1;
}

#player-stats-container .player-stats-head-row,
#league-sub-player-single-stats .player-stats-head-row {
    background: #e2e8f0;
    color: #334155;
}

/* ── Stats legend panel ── */
.stats-legend-details summary::-webkit-details-marker { display: none; }
.stats-legend-details[open] .stats-legend-chevron { transform: rotate(180deg); }

.stats-legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .stats-legend-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .stats-legend-grid { grid-template-columns: repeat(4, 1fr); }
}

.stats-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: var(--theme-surface-2, #2d3f6b);
    border: 1px solid var(--theme-border, rgba(255,255,255,0.08));
}
.stats-legend-abbr {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--theme-accent, #60a5fa);
    min-width: 1.75rem;
    flex-shrink: 0;
}
.stats-legend-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--theme-text, #e2e8f0);
    flex: 1;
}
.stats-legend-check {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--theme-accent, #60a5fa);
    opacity: 0.8;
}

/* Light mode overrides */
html:not(.dark) .stats-legend-item {
    background: #e8f0fb;
    border-color: #c7d8f5;
}
html:not(.dark) .stats-legend-abbr { color: #1d4ed8; }
html:not(.dark) .stats-legend-label { color: #1e293b; }
html:not(.dark) .stats-legend-check { color: #2563eb; }

#player-stats-container .player-stats-col,
#league-sub-player-single-stats .player-stats-col {
    position: relative;
    border-bottom: 1px solid #cbd5e1;
}

#player-stats-container .player-stats-col:hover,
#league-sub-player-single-stats .player-stats-col:hover {
    background: #dbeafe;
}

#player-stats-container .player-stats-col[data-col-help]:hover::after,
#league-sub-player-single-stats .player-stats-col[data-col-help]:hover::after {
    content: attr(data-col-help);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 6px);
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    min-width: 9rem;
    max-width: 16rem;
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
    z-index: 30;
    pointer-events: none;
}

html.dark #player-stats-container .player-stats-table {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

html.dark #player-stats-container .player-stats-head-row,
html.dark #league-sub-player-single-stats .player-stats-head-row {
    background: #1e293b;
    color: #cbd5e1;
}

html.dark #player-stats-container .player-stats-col,
html.dark #league-sub-player-single-stats .player-stats-col {
    border-bottom-color: #334155;
}

html.dark #player-stats-container .player-stats-col:hover,
html.dark #league-sub-player-single-stats .player-stats-col:hover {
    background: #334155;
}

.mobile-menu-block-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
}

.mobile-menu-block-icon svg {
    width: 1rem;
    height: 1rem;
}

.mobile-menu-current-league {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.mobile-menu-select {
    width: 100%;
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.07);
    color: #1e3a8a;
    border-radius: 0.7rem;
    padding: 0.66rem 0.78rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.mobile-menu-select:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.7);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(37, 99, 235, 0.1);
}

.mobile-menu-select option {
    background: #ffffff;
    color: #0f172a;
}

.mobile-menu-links {
    display: grid;
    gap: 0.4rem;
}

.mobile-menu-link {
    width: 100%;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
    border: 1px solid #d1d5db;
    border-radius: 0.55rem;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.55rem 0.65rem;
}

.mobile-menu-link-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.92;
}

.mobile-menu-link-icon svg {
    width: 1rem;
    height: 1rem;
}

.mobile-menu-link:active {
    background: #dbeafe;
}

.mobile-profile-drawer-top {
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-area-inset-top) + 0.5rem) 1rem 1rem;
    min-height: calc(var(--mobile-top-app-bar-height) + var(--safe-area-inset-top) + 34px);
}

.mobile-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
}

/* ===================================
   DESKTOP TOP NAVIGATION
   =================================== */

/* ===================================
   DESKTOP TOP NAVIGATION
   =================================== */

#desktop-top-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #0c3b8e 0%, #1d6bde 45%, #0ea5e9 100%);
    color: #eaf6ff;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 2px 24px rgba(14,165,233,0.18), 0 1px 0 rgba(255,255,255,0.06) inset;
    transition: background 0.35s ease, box-shadow 0.35s ease, min-height 0.35s ease;
}

/* Stato glassmorphism dopo lo scroll */
#desktop-top-nav.nav-scrolled {
    background: rgba(10, 28, 78, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 4px 32px rgba(0,0,0,0.28), 0 1px 0 rgba(255,255,255,0.07) inset;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

html.dark #desktop-top-nav.nav-scrolled {
    background: rgba(6, 15, 42, 0.82);
}

#desktop-top-nav::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 18%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 82%, transparent 100%);
    pointer-events: none;
}

#desktop-top-nav::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 12px, rgba(255,255,255,0) 12px 36px);
    opacity: 0.28;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.desktop-top-nav-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem max(1.25rem, var(--safe-area-inset-right)) 0.5rem max(1.25rem, var(--safe-area-inset-left));
    min-height: var(--header-height);
    transition: min-height 0.35s ease, padding 0.35s ease;
}

#desktop-top-nav.nav-scrolled .desktop-top-nav-inner {
    min-height: 54px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Logo nella nav desktop */
.desktop-nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1rem;
    padding-right: 0;
    border-right: none;
}

.desktop-nav-logo-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.desktop-nav-logo-link:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 0 8px rgba(14,165,233,0.55));
}

.desktop-nav-logo img {
    height: 44px !important;
    width: auto !important;
    object-fit: contain;
    background: transparent;
    padding: 0;
    border-radius: 0;
    filter: drop-shadow(0 1px 6px rgba(14,165,233,0.35));
    box-shadow: none;
    border: none;
    animation: logo-pulse-in 0.8s ease-out 1;
    transition: height 0.35s ease;
}

#desktop-top-nav.nav-scrolled .desktop-nav-logo img {
    height: 36px !important;
}

.desktop-nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.desktop-nav-logo-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 8px rgba(14,165,233,0.4);
    transition: font-size 0.35s ease;
}

#desktop-top-nav.nav-scrolled .desktop-nav-logo-name {
    font-size: 1.15rem;
}

.desktop-nav-logo-badge {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(14,165,233,0.95);
    text-transform: uppercase;
    background: rgba(14,165,233,0.12);
    border: 1px solid rgba(14,165,233,0.3);
    border-radius: 3px;
    padding: 0 4px;
    align-self: flex-start;
    margin-top: 2px;
}

@keyframes logo-pulse-in {
    0%   { opacity: 0.4; filter: drop-shadow(0 0 0 rgba(14,165,233,0)); transform: scale(0.92); }
    60%  { opacity: 1;   filter: drop-shadow(0 0 14px rgba(14,165,233,0.7)); transform: scale(1.06); }
    100% { opacity: 1;   filter: drop-shadow(0 1px 6px rgba(14,165,233,0.35)); transform: scale(1); }
}

@keyframes nav-link-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.desktop-top-nav-left,
.desktop-top-nav-right,
.desktop-top-nav-center {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.desktop-top-nav-right {
    margin-left: auto;
    gap: 0.5rem;
}

.desktop-top-nav-center {
    flex: 1;
    justify-content: center;
}

/* Nav link base */
.top-nav-main,
.top-nav-link {
    color: #eaf6ff;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 0.8rem;
    border-radius: 0.55rem;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-family: inherit;
    animation: nav-link-fade-in 0.25s ease-out forwards;
    will-change: opacity;
}

.top-nav-main:hover,
.top-nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    text-shadow: none;
}

.top-nav-main,
.top-nav-link {
    position: relative;
}

.top-nav-main::before,
.top-nav-link::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.25s ease;
}

.top-nav-main:hover::before,
.top-nav-link:hover::before {
    width: 55%;
}

.top-nav-main.active,
.top-nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
    text-shadow: none;
    box-shadow: none;
}

.top-nav-main.active::before,
.top-nav-link.active::before {
    width: 65%;
    background: #fff;
}

/* Icone nei link nav desktop */
.top-nav-main svg,
.top-nav-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.top-nav-main:hover svg,
.top-nav-link:hover svg,
.top-nav-main.active svg,
.top-nav-link.active svg {
    opacity: 1;
}

/* Freccia dropdown */
.top-nav-group > .top-nav-main::after {
    content: '\25B4';
    font-size: 0.75rem;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s;
    margin-left: 0.35rem;
    display: inline-block;
}

.top-nav-group:hover > .top-nav-main::after {
    transform: rotate(180deg);
    opacity: 0.9;
}

.top-nav-group.dropdown-open-delay > .top-nav-main::after,
.top-nav-group.nav-group-active > .top-nav-main::after {
    transform: rotate(180deg);
    opacity: 0.9;
}

.top-nav-group {
    position: relative;
    display: flex;
    align-items: center;
}

.top-nav-group::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
}

/* Dropdown menu â€” light */
.top-nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 0.85rem;
    padding: 0.4rem;
    box-shadow:
        0 12px 32px rgba(37, 99, 235, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 50;
    backdrop-filter: blur(10px);
}

.top-nav-group:hover .top-nav-dropdown,
.top-nav-group:focus-within .top-nav-dropdown,
.top-nav-group.dropdown-open-delay .top-nav-dropdown {
    display: block;
    animation: nav-dropdown-in 0.15s ease-out;
}

@keyframes nav-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Divisore interno dropdown */
.top-nav-dropdown-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), rgba(5, 150, 105, 0.2), transparent);
    margin: 0.3rem 0.5rem;
}

.top-nav-sub {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, padding-left 0.18s ease;
    letter-spacing: 0.015em;
    font-family: inherit;
}

.top-nav-sub svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.18s;
}

.top-nav-sub:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    padding-left: 1rem;
}

.top-nav-sub:hover svg {
    opacity: 1;
}

.top-nav-sub.active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    text-shadow: none;
}

/* Upload tab (Gestione Lega) - improve light mode contrast and visual consistency */
html:not(.dark) #league-settings-tab-upload-content.league-upload-section .card {
    background: #ffffff;
    border: 1px solid #dbe7f4;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-note {
    background: #eff6ff;
    border-color: #bfdbfe;
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-note h3,
html:not(.dark) #league-settings-tab-upload-content .league-upload-note .text-blue-400 {
    color: #1d4ed8 !important;
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-note p,
html:not(.dark) #league-settings-tab-upload-content .league-upload-note .text-gray-300 {
    color: #334155 !important;
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-card .text-gray-400,
html:not(.dark) #league-settings-tab-upload-content .league-upload-card .text-gray-500,
html:not(.dark) #league-settings-tab-upload-content .league-upload-history-card .text-gray-400,
html:not(.dark) #league-settings-tab-upload-content .league-upload-history-card .text-gray-500 {
    color: #475569 !important;
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-history-card {
    background: #f8fafc;
    border-color: #cbd5e1;
}

html:not(.dark) #league-settings-tab-upload-content .league-upload-history-card .text-yellow-400 {
    color: #a16207 !important;
}

html:not(.dark) #league-settings-tab-upload-content .text-blue-400 {
    color: #1d4ed8 !important;
}

html:not(.dark) #league-settings-tab-upload-content .text-purple-400 {
    color: #7e22ce !important;
}

html:not(.dark) #league-settings-tab-upload-content .text-green-400 {
    color: #15803d !important;
}

html:not(.dark) #league-settings-tab-upload-content .text-teal-400 {
    color: #0f766e !important;
}

html:not(.dark) #league-settings-tab-upload-content .text-teal-300 {
    color: #115e59 !important;
}

html:not(.dark) #league-settings-tab-upload-content #formations-v2-no-competitions-msg {
    color: #92400e !important;
}

html:not(.dark) #league-settings-tab-upload-content .settings-mini-input,
html:not(.dark) #league-settings-tab-upload-content select,
html:not(.dark) #league-settings-tab-upload-content input {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* League switcher — always on dark-blue nav gradient, so use white-translucent palette */
.top-nav-league-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s, background 0.2s;
}

.top-nav-league-switcher:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.18);
}

.top-nav-league-logo-wrap {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    overflow: hidden;
}

.top-nav-league-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
    border-radius: 0.55rem;
}

.top-nav-league-logo-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    color: #eaf6ff;
}

.top-nav-league-logo-fallback svg {
    width: 100%;
    height: 100%;
}

.top-nav-league-text { display: flex; flex-direction: column; gap: 0.1rem; }
.top-nav-league-label {
    font-size: 0.65rem;
    color: rgba(234, 246, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.top-nav-league-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #eaf6ff;
}
.top-nav-league-controls { display: flex; align-items: center; gap: 0.4rem; }

.top-nav-league-select {
    min-width: 155px;
    background: transparent;
    border: none;
    color: #eaf6ff;
    border-radius: 0.4rem;
    padding: 0.25rem 1.6rem 0.25rem 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaf6ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.3rem center;
    background-size: 1rem;
}

.top-nav-league-select:focus {
    outline: none;
}

.top-nav-league-select option {
    background: #1e3a6e;
    color: #eaf6ff;
}

/* Refresh button */
.top-nav-refresh-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    color: #eaf6ff;
    cursor: pointer;
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.top-nav-refresh-button svg {
    width: 1.1rem;
    height: 1.1rem;
}

.top-nav-refresh-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.top-nav-refresh-button:active {
    transform: rotate(360deg) scale(0.93);
}

/* Avatar profilo nella nav desktop — always on dark-blue nav, use white-translucent style */
.desktop-nav-profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.2);
    color: #eaf6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.22s ease;
    flex-shrink: 0;
    font-family: inherit;
    letter-spacing: 0;
    line-height: 1;
}

.desktop-nav-profile-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.15);
    transform: scale(1.06);
}

/* Hamburger button: visible only on small screens */
.nav-hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #eaf6ff;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.nav-hamburger-btn:active {
    background: rgba(255,255,255,0.22);
}
@media (min-width: 1024px) {
    .nav-hamburger-btn {
        display: none;
    }
}
/* Mobile nav: hide links, hide desktop-only controls, fix notch, center logo */
@media (max-width: 1023px) {
    /* Nav links go into the drawer */
    .desktop-top-nav-left {
        display: none !important;
    }
    /* On mobile the nav is injected into #layout-root whose height = nav height.
       Sticky would scroll away immediately — use fixed so it always stays visible. */
    #desktop-top-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding-top: calc(var(--safe-area-inset-top) + 0.6rem);
    }
    /* Push content row to bottom of the extended nav height */
    .desktop-top-nav-inner {
        position: relative;
        align-items: center;
        padding-top: 0.25rem;
        padding-bottom: 0.65rem;
    }
    /* Center FANTABIT logo horizontally */
    .desktop-nav-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-right: 0;
        pointer-events: none; /* hamburger and avatar stay clickable */
    }
    /* Hide refresh + league switcher — both accessible via the drawer */
    .top-nav-refresh-button,
    .top-nav-league-switcher {
        display: none !important;
    }
    /* Profile avatar: light styling to match the blue gradient nav */
}

/* ===================================
   LOADING BAR (loading overlay)
   =================================== */
.loading-bar-track {
    position: relative;
    height: 4px;
    background: rgba(234, 246, 255, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}
.loading-bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    background: rgba(234, 246, 255, 0.85);
    border-radius: 9999px;
    animation: loadingBarSlide 1.5s ease-in-out infinite;
}
@keyframes loadingBarSlide {
    0%   { left: -45%; }
    100% { left: 100%; }
}

/* ===================================
   DESKTOP STANDINGS TABLE
   Tabella classifica estesa per desktop
   =================================== */

/* Header colonne ordinabili */
.standings-sort-header {
    position: relative;
    user-select: none;
    white-space: nowrap;
}

.standings-sort-header:hover {
    background-color: rgba(37, 99, 235, 0.06) !important;
    color: #1d4ed8 !important;
}

.standings-sort-header:active {
    background-color: rgba(37, 99, 235, 0.12) !important;
}

/* Transizione smooth per le icone di ordinamento */
.standings-sort-header svg {
    transition: transform 0.2s, opacity 0.2s;
}

.standings-sort-header:hover svg {
    opacity: 1 !important;
}

/* Stile righe tabella desktop */
@media (min-width: 1024px) {
    #standings-container table tbody tr {
        transition: background-color 0.15s ease;
    }

    #standings-container table tbody tr:hover {
        background-color: rgba(37, 99, 235, 0.05) !important;
    }

    /* Prima colonna fissa se scroll orizzontale */
    #standings-container {
        overflow-x: auto;
    }
}

/* Stili per la barra progressione giornate */
.giornata-box {
    aspect-ratio: 1;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.giornata-box:hover {
    transform: scale(1.1);
    z-index: 10;
}

.giornata-box.chiusa {
    background-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.giornata-box.aperta {
    background-color: #f59e0b;
    color: #ffffff;
    animation: pulse-giornata 2s infinite;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.giornata-box.futura {
    background-color: #e2e8f0;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.giornata-box.current {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.8);
}

@keyframes pulse-giornata {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Tooltip per i box */
.giornata-box::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.25rem;
    z-index: 20;
}

.giornata-box:hover::after {
    opacity: 1;
}

/* ===================================
   LANDING PUBBLICA PRE-LOGIN
   =================================== */

/* ── Animazioni Landing ── */
@keyframes neon-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.65;
    }
}

@keyframes neon-border-pulse {

    0%,
    100% {
        border-color: #1d4ed8;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    }

    50% {
        border-color: rgba(37, 99, 235, 0.35);
        box-shadow: 0 0 14px rgba(5, 150, 105, 0.3), inset 0 0 10px rgba(37, 99, 235, 0.06);
    }
}

@keyframes grid-scroll {
    0% {
        background-position-y: 0;
    }

    100% {
        background-position-y: 40px;
    }
}

@keyframes sun-breathe {

    0%,
    100% {
        opacity: 0.92;
        filter: blur(0px);
    }

    50% {
        opacity: 1;
        filter: blur(1px);
    }
}

@keyframes float-badge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* â”€â”€ Perspective Grid Floor â”€â”€ */
.grid-floor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.grid-floor::before {
    content: '';
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: -10%;
    height: 60%;
    background:
        repeating-linear-gradient(90deg,
            rgba(37, 99, 235, 0.12) 0px,
            transparent 1px,
            transparent 59px,
            rgba(37, 99, 235, 0.12) 60px),
        repeating-linear-gradient(0deg,
            rgba(5, 150, 105, 0.06) 0px,
            transparent 1px,
            transparent 39px,
            rgba(5, 150, 105, 0.06) 40px);
    background-size: 60px 40px;
    transform: perspective(320px) rotateX(55deg);
    transform-origin: center bottom;
    animation: grid-scroll 3s linear infinite;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 92%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 92%);
}

/* Segmented Accent Sun */
.hero-sunset {
    position: absolute;
    width: 220px;
    height: 110px;
    right: 8%;
    bottom: 42%;
    pointer-events: none;
    z-index: 0;
    animation: sun-breathe 4s ease-in-out infinite;
}

.hero-sunset::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 220px 220px 0 0;
    background: linear-gradient(to bottom,
            #1d4ed8 0%,
            #0284c7 35%,
            #059669 70%,
            #10b981 100%);
    clip-path: polygon(0% 100%,
            0% 40%, 100% 40%,
            100% 100%,
            0% 100%,
            0% 50%, 100% 50%,
            100% 58%, 0% 58%,
            0% 64%, 100% 64%,
            100% 72%, 0% 72%,
            0% 78%, 100% 78%,
            100% 84%, 0% 84%,
            0% 88%, 100% 88%,
            100% 92%, 0% 92%,
            0% 95%, 100% 95%,
            100% 100%);
    opacity: 0.65;
}

.hero-sunset::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center bottom,
            rgba(37, 99, 235, 0.25),
            rgba(5, 150, 105, 0.12) 50%,
            transparent 75%);
    filter: blur(16px);
    z-index: -1;
}

/* Accent Text Helpers */
.accent-glow-text {
    color: #1d4ed8;
    text-shadow:
        0 0 6px rgba(37, 99, 235, 0.35),
        0 0 18px rgba(37, 99, 235, 0.15);
    font-family: 'Chakra Petch', sans-serif;
}

.gradient-text {
    background: linear-gradient(90deg, var(--theme-accent), var(--theme-accent-cyan), var(--theme-highlight));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

/* Accent Divider */
.accent-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--theme-accent-cyan),
            var(--theme-accent),
            var(--theme-accent-cyan),
            transparent);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
    margin: 0.6rem 0;
}

/* â”€â”€ Landing Container â”€â”€ */
.public-home-landing {
    display: grid;
    gap: 1rem;
}

/* â”€â”€ Hero Section â”€â”€ */
.public-home-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow:
        0 4px 20px rgba(37, 99, 235, 0.1),
        
        0 8px 24px rgba(0, 0, 0, 0.05);
}

.public-home-hero::after {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    right: -100px;
    top: -140px;
    border-radius: 9999px;
    background: radial-gradient(circle,
            rgba(37, 99, 235, 0.1),
            rgba(5, 150, 105, 0.06) 50%,
            transparent 75%);
    pointer-events: none;
    z-index: 0;
}

.public-home-hero-grid {
    display: grid;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* â”€â”€ Kicker â”€â”€ */
.public-home-kicker {
    margin: 0;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    font-family: 'Chakra Petch', sans-serif;
    text-shadow: none;
}

/* â”€â”€ Title â”€â”€ */
.public-home-title {
    margin: 0.3rem 0 0;
    font-size: clamp(1.65rem, 4.8vw, 2.7rem);
    line-height: 1.08;
    max-width: 16ch;
    font-weight: 700;
    background: linear-gradient(90deg, #1d4ed8, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: none;
}

.public-home-title span {
    -webkit-text-fill-color: #059669;
    filter: none;
}

/* â”€â”€ Subtitle â”€â”€ */
.public-home-subtitle {
    margin-top: 0.85rem;
    color: #374151;
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 62ch;
}

/* â”€â”€ CTA Buttons â”€â”€ */
.public-home-cta-row {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.public-home-cta-row .btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    border: 1px solid rgba(29, 78, 216, 0.4);
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.25);
    transition: box-shadow 0.3s, transform 0.2s;
}

.public-home-cta-row .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.4), 0 4px 12px rgba(29, 78, 216, 0.2);
    transform: translateY(-2px);
}

.public-home-cta-row .btn-secondary {
    border: 1px solid rgba(5, 150, 105, 0.4);
    background: rgba(5, 150, 105, 0.08);
    color: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    transition: box-shadow 0.3s, transform 0.2s;
}

.public-home-cta-row .btn-secondary:hover {
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
    transform: translateY(-2px);
}

/* â”€â”€ Hero Badge â”€â”€ */
.public-home-hero-badge {
    position: relative;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.08), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.22);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    animation: float-badge 5s ease-in-out infinite;
    z-index: 1;
}

.public-home-hero-badge-label {
    margin: 0;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Chakra Petch', sans-serif;
    text-shadow: none;
}

.public-home-hero-badge-value {
    margin: 0.4rem 0 0;
    color: #0f172a;
    font-size: 1.02rem;
    line-height: 1.45;
    font-weight: 600;
}

.public-home-hero-badge-note {
    margin: 0.45rem 0 0;
    color: #374151;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* â”€â”€ Service Cards Grid â”€â”€ */
.public-home-services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.public-home-service-card {
    position: relative;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: #ffffff;
    animation: none;
    transition: transform 0.25s, box-shadow 0.3s, border-color 0.3s;
}

.public-home-service-card:nth-child(2) {
    animation-delay: 0s;
}

.public-home-service-card:nth-child(3) {
    animation-delay: 0s;
}

.public-home-service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: rgba(37, 99, 235, 0.35);
}

/* â”€â”€ Service Card Icon â”€â”€ */
.public-home-service-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1;
    filter: none;
}

.public-home-service-title {
    margin: 0;
    color: #1d4ed8;
    font-size: 1.05rem;
    line-height: 1.28;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    text-shadow: none;
}

.public-home-service-text {
    margin: 0.55rem 0 0;
    color: #374151;
    font-size: 0.94rem;
    line-height: 1.5;
}

/* â”€â”€ Ad Slots â”€â”€ */
.public-home-ad-slot {
    margin-top: 0.2rem;
    padding: 0.7rem 0.9rem;
    border-style: dashed;
    border-color: rgba(37, 99, 235, 0.25);
    background: rgba(248, 250, 252, 0.9);
}

.public-home-ad-label {
    color: #94a3b8;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
}

.public-home-ad-slot ins.adsbygoogle {
    min-height: 90px;
}

/* â”€â”€ Legal Disclaimer â”€â”€ */
.legal-disclaimer-footer {
    width: min(1240px, calc(100% - 1.5rem));
    margin: 1.25rem auto max(1rem, var(--safe-area-inset-bottom));
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.07);
}

.legal-disclaimer-inner {
    padding: 0.8rem 1rem 0.9rem;
}

.legal-disclaimer-title {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(37, 99, 235, 0.65);
}

.legal-disclaimer-text {
    margin: 0.4rem 0 0;
    font-size: 0.58rem;
    line-height: 1.4;
    color: rgba(71, 85, 105, 0.7);
    transition: color 0.3s ease, opacity 0.3s ease;
}

.legal-disclaimer-footer.disclaimer-muted {
    border-color: rgba(37, 99, 235, 0.08);
    background: rgba(248, 250, 252, 0.7);
    box-shadow: none;
    opacity: 0.7;
}

.legal-disclaimer-footer.disclaimer-muted .legal-disclaimer-text,
.legal-disclaimer-footer.disclaimer-muted .legal-disclaimer-title {
    color: rgba(71, 85, 105, 0.3);
}

.legal-disclaimer-footer.disclaimer-muted:hover {
    opacity: 1;
}

.legal-disclaimer-footer.disclaimer-muted:hover .legal-disclaimer-text {
    color: rgba(71, 85, 105, 0.7);
}

.legal-disclaimer-meta {
    margin: 0.5rem 0 0;
    font-size: 0.55rem;
    line-height: 1.4;
    color: rgba(100, 116, 139, 0.5);
    border-top: 1px solid rgba(37, 99, 235, 0.1);
    padding-top: 0.4rem;
}

/* Login App Logo */
.login-app-logo {
    filter: none;
}

/* ── Login Form Cards ── */
#login-form-container,
#signup-form-container {
    border-color: rgba(37, 99, 235, 0.3) !important;
    box-shadow:
        0 0 20px rgba(37, 99, 235, 0.12),
        
        0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

/* â”€â”€ Responsive â”€â”€ */
@media (min-width: 768px) {
    .public-home-landing {
        gap: 1.15rem;
    }

    .legal-disclaimer-footer {
        margin-top: 1.45rem;
    }

    .legal-disclaimer-inner {
        padding: 1rem 1.15rem 1.1rem;
    }

    .legal-disclaimer-text {
        font-size: 0.7rem;
    }

    .public-home-hero-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
        gap: 1rem;
    }

    .public-home-services-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-home-ad-slot ins.adsbygoogle {
        min-height: 96px;
    }

    .hero-sunset {
        width: 280px;
        height: 140px;
    }
}

@media (max-width: 640px) {
    .public-home-landing {
        gap: 0.85rem;
    }

    .public-home-title {
        max-width: 100%;
    }

    .public-home-cta-row .btn-primary,
    .public-home-cta-row .btn-secondary {
        width: 100%;
    }

    .legal-disclaimer-footer {
        width: calc(100% - 0.75rem);
        margin-top: 1rem;
    }

    .legal-disclaimer-inner {
        padding: 0.9rem 0.85rem 0.95rem;
    }

    .legal-disclaimer-text {
        font-size: 0.62rem;
    }

    .hero-sunset {
        width: 160px;
        height: 80px;
        right: 4%;
        bottom: 38%;
    }

    .grid-floor::before {
        height: 50%;
    }
}

/* ===================================
   SEZIONE LOGIN - STILI PERSONALIZZATI
   =================================== */

/* Input del form login */
.auth-input {
    font-size: 16px;
    /* Previene zoom automatico su iOS */
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 0 10px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.auth-input::placeholder {
    color: #a0aec0;
}

/* Animazione di transizione tra form login e signup */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Classe per mostrare il form con animazione */
.form-show {
    display: block !important;
    animation: slideInLeft 0.3s ease-out;
}

/* Classe per nascondere il form con animazione */
.form-hide {
    display: none !important;
    animation: slideOutRight 0.3s ease-out;
}

/* Responsive adjustments per il banner */
@media (max-width: 640px) {
    #login-container {
        min-height: 100vh;
    }
}

/* Assicura che gli occhi dell'icona di password visibility siano visibili */
.password-eye {
    stroke-width: 2px;
}

/* Smooth scrolling per il form */
#login-form-container,
#signup-form-container {
    transition: all 0.3s ease;
}

/* Stilizzazione delle card per il form */
#login-form-container,
#signup-form-container {
    background-color: rgba(255, 255, 255, 0.98);
}

/* Override per i colori dei placeholder */
input::placeholder {
    color: #999 !important;
}

/* Focus visibile per l'accessibilitÃ  */
button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

input:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ===================================
   MODAL RECUPERO PASSWORD - ANIMAZIONI
   =================================== */

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scale-in 0.3s ease-out;
}

/* Stile per la modal di recupero password */
#forgot-password-modal {
    backdrop-filter: blur(4px);
}

#forgot-password-modal>div {
    max-height: 90vh;
    overflow-y: auto;
}

/* ===================================
   ROLE-BASED UI STYLING
   Stili distintivi per le diverse interfacce admin
   =================================== */

/* Badge Ruoli */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border-width: 1px;
}

.role-badge-admin {
    background-color: rgba(37, 99, 235, 0.1);
    color: rgb(30, 64, 175);
    border-color: rgba(37, 99, 235, 0.35);
}

.role-badge-admin:before {
    content: "ðŸ‘‘";
    margin-right: 0.25rem;
}

.role-badge-super {
    background-color: rgba(250, 204, 21, 0.2);
    color: rgb(250, 204, 21);
    border-color: rgba(250, 204, 21, 0.5);
}

.role-badge-super:before {
    content: "âš¡";
    margin-right: 0.25rem;
}

.role-badge-base {
    background-color: rgba(107, 114, 128, 0.2);
    color: rgb(156, 163, 175);
    border-color: rgba(107, 114, 128, 0.5);
}

.role-badge-base:before {
    content: "ðŸ‘¤";
    margin-right: 0.25rem;
}

/* Tab Settings di Lega (verde) */
.league-settings-tab-content {
    animation: fadeIn 0.2s ease-in;
}

#league-settings-container {
    background-color: rgba(240, 249, 255, 0.85);
}

#league-settings-container .card {
    border-left: none;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-surface-1);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

/* Tab Settings App */
.app-settings-tab-content {
    animation: fadeIn 0.2s ease-in;
}

#app-settings-container {
    background-color: rgba(240, 249, 255, 0.85);
}

#app-settings-container .card {
    border-left: none;
    border: 1px solid var(--theme-border);
    background-color: var(--theme-surface-1);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

/* Animazione fade in per tab */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsanti Tab Settings Lega */
#league-settings-container [id^="league-settings-tab-"] {
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}

#league-settings-container .btn-primary {
    background-color: var(--btn-primary-mid);
    border-color: var(--btn-primary-start);
}

#league-settings-container .btn-primary:hover {
    background-color: var(--btn-primary-start);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.36);
}

/* Pulsanti Tab Settings App */
#app-settings-container [id^="app-settings-tab-"] {
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}

#app-settings-container .btn-primary {
    background-color: var(--btn-primary-mid);
    border-color: var(--btn-primary-start);
}

#app-settings-container .btn-primary:hover {
    background-color: var(--btn-primary-start);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.36);
}

/* ===================================
   TEMA: Rose / Statistiche Lega / Gestione Lega / Impostazioni App
   Adattamento completo light/dark mode
   =================================== */

/* --- Container backgrounds: dark mode override --- */
html.dark #league-settings-container {
    background-color: rgba(15, 23, 42, 0.45);
}
html.dark #league-settings-container .card {
    border-color: rgba(148, 163, 184, 0.2);
    background-color: var(--theme-surface-1);
}
#league-settings-container .card {
    background-color: var(--theme-surface-1);
}

html.dark #app-settings-container {
    background-color: rgba(15, 23, 42, 0.45);
}
html.dark #app-settings-container .card {
    border-color: rgba(148, 163, 184, 0.2);
    background-color: var(--theme-surface-1);
}
#app-settings-container .card {
    background-color: var(--theme-surface-1);
}

/* --- Settings panels: dark mode --- */
html.dark .settings-danger-panel {
    background: rgba(100, 20, 20, 0.25);
    border-color: rgba(248, 113, 113, 0.25);
}
html.dark .settings-warning-panel {
    background: rgba(92, 38, 8, 0.25);
    border-color: rgba(251, 146, 60, 0.25);
}
html.dark .settings-info-box {
    background: rgba(23, 45, 110, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* --- Toggle-card option text: theme var instead of hardcoded slate-800 --- */
.settings-toggle-card .font-semibold {
    color: var(--theme-text);
}

/* --- Back buttons in settings: theme-aware colors --- */
#league-settings-container button[onclick="goBack()"],
#app-settings-container button[onclick="goBack()"] {
    color: var(--theme-muted);
}
#league-settings-container button[onclick="goBack()"]:hover,
#app-settings-container button[onclick="goBack()"]:hover {
    color: var(--theme-text);
}

/* --- Gray text in settings/stats: use theme muted color --- */
#league-settings-container .text-gray-300,
#app-settings-container .text-gray-300 {
    color: var(--theme-text-soft);
}
#league-settings-container .text-gray-400,
#league-settings-container .text-gray-500,
#app-settings-container .text-gray-400,
#app-settings-container .text-gray-500,
#league-stats-container .text-gray-400,
#league-stats-container .text-gray-500,
#squads-container .text-gray-400,
#squads-container .text-gray-500 {
    color: var(--theme-muted);
}

/* --- Borders in settings/stats: use theme border color --- */
#league-settings-container .border-gray-700,
#app-settings-container .border-gray-700,
#league-stats-container .border-gray-700 {
    border-color: var(--theme-border);
}

/* --- Reset tab dark panels: theme-aware background --- */
#league-settings-tab-reset-content h4.text-white {
    color: var(--theme-text);
}

/* --- League stats stat cards: use theme surface instead of hardcoded dark --- */
#league-stats-container [class*="bg-gray-8"] {
    background-color: var(--theme-surface-2);
}

/* --- Section headings: readable in both themes --- */
#league-stats-container h3.text-yellow-400 {
    color: #ca8a04;
}
html.dark #league-stats-container h3.text-yellow-400 {
    color: #facc15;
}
#league-stats-container h3.text-blue-400 {
    color: var(--theme-accent-strong);
}

/* --- Squads section heading: use accent instead of hardcoded purple --- */
#squads-container h2.text-purple-400 {
    color: var(--theme-accent-strong);
}

/* Accesso negato */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    text-align: center;
    background-color: rgba(239, 68, 68, 0.1);
    border: 2px solid rgb(239, 68, 68);
    border-radius: 0.75rem;
}

.access-denied-icon {
    font-size: 3rem;
    line-height: 1;
}

.access-denied-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(220, 38, 38);
}

.access-denied-message {
    font-size: 0.875rem;
    color: rgb(153, 27, 27);
}

/* Empty state per i container admin */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    color: rgb(107, 114, 128);
    background-color: rgba(107, 114, 128, 0.05);
    border-radius: 0.5rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    line-height: 1;
    opacity: 0.5;
}

.empty-state-title {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Sezione pericolo (eliminazione) */
.danger-section {
    border: 2px solid rgb(239, 68, 68);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background-color: rgba(239, 68, 68, 0.05);
}

.danger-section h3 {
    color: rgb(220, 38, 38);
    margin-bottom: 1rem;
}

.danger-section p {
    color: rgb(153, 27, 27);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.danger-section ul {
    color: rgb(153, 27, 27);
}

/* Layout responsive per le liste utenti admin */
@media (max-width: 768px) {

    #league-settings-container,
    #app-settings-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #league-settings-container .card,
    #app-settings-container .card {
        border-left: none;
        border: 1px solid var(--theme-border);
    }
}

/* ===================================
   PALETTE OVERRIDES
   Uniforma le utility Tailwind usate nel markup e nei template JS
   =================================== */

#desktop-top-nav {
    background-color: rgba(14, 14, 33, 0.92);
    border-color: var(--theme-border);
}

.mobile-drawer,
.mobile-drawer-header,
.mobile-menu-block,
.mobile-menu-link {
    background: var(--theme-surface-1);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

/* Loading overlay: nascosto immediatamente se la sessione è già in cache */
html.page-cached #loading-overlay {
    display: none !important;
}

.mobile-menu-select {
    border-color: rgba(167, 139, 250, 0.6);
    background: rgba(124, 58, 237, 0.22);
    color: var(--theme-text);
}

.mobile-drawer-title,
.mobile-menu-block-title {
    color: var(--theme-text-soft);
}

.mobile-profile-drawer-top {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-deep));
}

.bg-gray-900,
.bg-slate-900,
.bg-zinc-900,
.bg-gray-950,
.bg-slate-950 {
    background-color: var(--theme-surface-1) !important;
}

.bg-black\/95,
.bg-black\/90,
.bg-black\/85,
.bg-black\/80,
.bg-black\/60,
.bg-gray-950\/95,
.bg-gray-950\/80 {
    background-color: rgba(248, 250, 252, 0.94) !important;
}

.bg-gray-800,
.bg-slate-800,
.bg-zinc-800,
.bg-gray-800\/50,
.bg-gray-800\/70,
.bg-gray-800\/80,
.bg-gray-800\/30,
.bg-slate-800\/50,
.bg-gray-900\/70,
.bg-gray-900\/60,
.bg-slate-900\/70,
.bg-gray-700\/30,
.bg-gray-700\/50,
.bg-gray-900\/50 {
    background-color: var(--theme-surface-2) !important;
}

.bg-gray-700,
.bg-slate-700,
.bg-zinc-700,
.bg-gray-600 {
    background-color: var(--theme-surface-3) !important;
}

.bg-blue-600,
.bg-blue-500,
.bg-indigo-600,
.bg-purple-600,
.bg-purple-500,
.bg-blue-600\/20,
.bg-blue-900\/20,
.bg-blue-900\/30,
.bg-purple-600\/20 {
    background-color: rgba(255, 79, 216, 0.24) !important;
}

.bg-green-600,
.bg-green-600\/20,
.bg-green-900\/20,
.bg-green-900\/30 {
    background-color: rgba(94, 246, 181, 0.2) !important;
}

.bg-red-600,
.bg-red-600\/20,
.bg-red-900\/30,
.bg-red-500\/20 {
    background-color: rgba(255, 107, 143, 0.22) !important;
}

.bg-yellow-600\/20,
.bg-yellow-900\/20 {
    background-color: rgba(255, 200, 87, 0.2) !important;
}

.text-white,
.text-slate-200,
.text-gray-200 {
    color: var(--theme-text) !important;
}

.text-gray-500,
.text-gray-400,
.text-gray-300,
.text-slate-300,
.text-slate-400 {
    color: var(--theme-muted) !important;
}

.text-blue-400,
.text-blue-300,
.text-purple-400,
.text-purple-300,
.text-indigo-400 {
    color: var(--theme-accent-cyan) !important;
}

.text-yellow-400,
.text-yellow-300,
.text-yellow-500 {
    color: var(--theme-highlight) !important;
}

.text-green-400,
.text-green-300 {
    color: var(--theme-success) !important;
}

.text-red-400,
.text-red-300 {
    color: var(--theme-danger) !important;
}

.border-gray-700,
.border-gray-600,
.border-gray-500,
.border-slate-700,
.border-slate-600,
.border-zinc-700,
.border-zinc-600 {
    border-color: var(--theme-border) !important;
}

.border-blue-500,
.border-blue-400,
.border-purple-500,
.border-purple-400,
.border-indigo-500 {
    border-color: rgba(37, 99, 235, 0.3) !important;
}

.border-red-500,
.border-red-600 {
    border-color: var(--theme-danger) !important;
}

.border-green-500,
.border-green-600 {
    border-color: var(--theme-success) !important;
}

.border-yellow-500,
.border-yellow-400 {
    border-color: var(--theme-highlight) !important;
}

.hover\:bg-gray-700:hover,
.hover\:bg-gray-600:hover,
.hover\:bg-gray-650:hover,
.hover\:bg-gray-800:hover,
.hover\:bg-slate-700:hover,
.hover\:bg-slate-600:hover {
    background-color: var(--theme-surface-3) !important;
}

.hover\:bg-blue-700:hover,
.hover\:bg-blue-600:hover,
.hover\:bg-purple-700:hover,
.hover\:bg-red-700:hover {
    background-color: rgba(255, 79, 216, 0.35) !important;
}

.hover\:text-gray-300:hover,
.hover\:text-blue-300:hover,
.hover\:text-purple-300:hover {
    color: var(--theme-accent-cyan) !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-color: #1d4ed8;
}

/* ===================================
   SITE FOOTER — Inspired palette
   =================================== */

.site-footer {
    position: relative;
    /* deep blue -> cyan gradient to match the provided image */
    background: linear-gradient(180deg, #0f4ea6 0%, #2563eb 36%, #06b6d4 100%);
    border-top: 1px solid rgba(2, 6, 23, 0.06);
    padding: 3rem 1.5rem 2rem;
    margin-top: 3rem;
    overflow: hidden;
    color: #eaf6ff;
}

/* thin highlighted line near top */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 18%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 82%, transparent 100%);
    pointer-events: none;
}

/* subtle diagonal stripe overlay */
.site-footer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 12px, rgba(255,255,255,0) 12px 36px);
    opacity: 0.45;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 0 0.5rem;
}

/* Logo nel footer */
.site-footer-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
    transition: opacity 0.18s, transform 0.18s;
}

.site-footer-logo:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Grid link principali */
.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1.6rem;
    justify-content: center;
    align-items: center;
}

/* Title area (logo + name) */
.site-footer-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.98);
    font-size: 1.05rem;
}

.site-footer-title img {
    height: 48px;
    width: 48px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    border-radius: 0;
    filter: none;
    outline: none;
    box-shadow: none;
    border: none;
}

.site-footer-link {
    color: rgba(255,255,255,0.96);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
    background: none;
    border: none;
    padding: 0.15rem 0;
    font-family: inherit;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.site-footer-link:hover {
    color: rgba(255,255,255,1);
    transform: translateX(6px);
}

.site-footer-link.coming-soon {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

/* Separatori tra i link */
.site-footer-sep {
    color: rgba(255,255,255,0.18);
    pointer-events: none;
    font-size: 0.85rem;
    user-select: none;
}

/* Linea divisoria sottile */
.site-footer-divider {
    width: 100%;
    max-width: 420px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

/* Disclaimer legale collassabile nel footer app */
.site-footer-disclaimer {
    width: 100%;
    max-width: 1040px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    overflow: hidden;
}

.site-footer-disclaimer-toggle {
    list-style: none;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.site-footer-disclaimer-toggle::-webkit-details-marker {
    display: none;
}

.site-footer-disclaimer-toggle::after {
    content: '+';
    font-size: 0.95rem;
    line-height: 1;
    color: rgba(255,255,255,0.8);
}

.site-footer-disclaimer[open] .site-footer-disclaimer-toggle::after {
    content: '-';
}

.site-footer-disclaimer .legal-disclaimer-inner {
    padding-top: 0.15rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.site-footer-disclaimer .legal-disclaimer-text {
    color: rgba(255,255,255,0.88);
}

.site-footer-disclaimer .legal-disclaimer-meta {
    color: rgba(255,255,255,0.7);
}

/* Copyright */
.site-footer-copy {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    opacity: 0.9;
    letter-spacing: 0.04em;
    line-height: 1.6;
}

.site-footer-copy span {
    color: rgba(255,255,255,0.95);
    opacity: 1;
}

/* Footer CTA buttons */
.site-footer .btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 2px solid rgba(6,182,212,0.5);
    color: rgba(255,255,255,0.98);
    background: transparent;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.site-footer .btn-cta:hover {
    background: rgba(255,255,255,0.04);
    box-shadow: 0 10px 30px rgba(6,182,212,0.08);
    transform: translateY(-3px);
}

.site-footer .btn-cta--ghost {
    background: transparent;
    border-color: rgba(6,182,212,0.35);
    color: rgba(255,255,255,0.95);
}

/* Badge "Coming Soon" inline */
.footer-badge-soon {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--theme-highlight);
    background: rgba(255, 200, 87, 0.12);
    border: 1px solid rgba(255, 200, 87, 0.25);
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
    margin-left: 0.25rem;
    vertical-align: middle;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===================================
   BOTTOM NAVIGATION MOBILE
   =================================== */
#bottom-nav {
    display: none; /* nascosto di default, visibile solo su mobile */
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 1023px) {
    #bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        background: linear-gradient(180deg, #0f4ea6 0%, #2563eb 36%, #06b6d4 100%);
        padding-bottom: max(0.5rem, var(--safe-area-inset-bottom));
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
        box-shadow: 0 -2px 16px rgba(2, 6, 23, 0.18);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .bottom-nav-tab {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0.6rem 0.12rem 0.34rem;
        background: none;
        border: none;
        cursor: pointer;
        color: rgba(234, 246, 255, 0.6);
        font-size: 0.6rem;
        font-weight: 600;
        font-family: inherit;
        letter-spacing: 0.03em;
        text-align: center;
        line-height: 1.15;
        transition: color 0.18s ease;
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    .bottom-nav-tab span {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .bottom-nav-tab:active {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
    }

    .bottom-nav-tab.active {
        color: #ffffff;
    }

    .bottom-nav-tab.active .bottom-nav-icon {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }

    .bottom-nav-icon {
        width: 1.375rem;
        height: 1.375rem;
        flex-shrink: 0;
        display: block;
        margin: 0 auto;
        transition: transform 0.18s ease;
    }

    .bottom-nav-tab.active .bottom-nav-icon {
        transform: translateY(-2px);
    }

    /* Add bottom padding to content area on tablets too */
    @media (min-width: 769px) {
        #main-app-container #app-content-area {
            padding-bottom: calc(5.4rem + max(0.25rem, var(--safe-area-inset-bottom)));
        }
    }
}

/* Very small screens: hide labels and further reduce padding to avoid overflow */
@media (max-width: 420px) {
    #bottom-nav {
        padding-left: max(0.35rem, env(safe-area-inset-left));
        padding-right: max(0.35rem, env(safe-area-inset-right));
    }
    .bottom-nav-tab {
        padding: 0.46rem 0.08rem 0.26rem;
        font-size: 0.54rem;
    }
    .bottom-nav-tab span { display: none; }
    .bottom-nav-icon { width: 1.265rem; height: 1.265rem; }
}

/* MPA pages: bottom padding so content isn't hidden behind the fixed bottom nav */
@media (max-width: 1023px) {
    body > #app-content-area {
        padding-bottom: calc(5.4rem + max(0.5rem, var(--safe-area-inset-bottom)));
    }
}

/* Su mobile nell'app, nascondi il footer (c'è la bottom nav) */
@media (max-width: 768px) {
    #app-footer {
        display: none !important;
    }
    /* Il footer della landing page rimane visibile */
    .site-footer {
        padding: 1.75rem 1rem 1.25rem;
    }
}


@media (min-width: 769px) {
    .site-footer-links {
        gap: 0.4rem 1.5rem;
    }
}





/* ===================================================
   LIGHT THEME — TAILWIND UTILITY CLASS OVERRIDES
   Overrides Tailwind's dark-palette classes so all
   inline bg-gray-* / text-* / border-* utilities
   respect the new white-blue-green light theme.
   =================================================== */

/* Background overrides */
#main-app-container .bg-gray-900,
#main-app-container .bg-gray-800,
.bg-black\/95,
.bg-black\/90,
.bg-black\/85,
.bg-black\/80,
.bg-black\/60,
.bg-gray-950\/95,
.bg-gray-950\/80,
.modal-content .bg-gray-900,
.modal-content .bg-gray-800 { background-color: #f0f9ff !important; }

#main-app-container .bg-gray-700,
.bg-gray-800\/80,
.bg-gray-800\/70,
.bg-gray-800\/50,
.bg-gray-800\/30,
.bg-gray-900\/70,
.bg-gray-900\/60,
.bg-gray-900\/50,
.modal-content .bg-gray-700 { background-color: #ffffff !important; }

#main-app-container .bg-gray-600,
.modal-content .bg-gray-600 { background-color: #f3f4f6 !important; }

#main-app-container .bg-gray-500 { background-color: #e2e8f0 !important; }

/* Text overrides */
#main-app-container .text-white,
.modal-content .text-white { color: #0f172a !important; }

#main-app-container .text-gray-100 { color: #111827 !important; }
#main-app-container .text-gray-200 { color: #1f2937 !important; }
#main-app-container .text-gray-300 { color: #374151 !important; }
#main-app-container .text-gray-400 { color: #6b7280 !important; }

/* Border overrides */
#main-app-container .border-gray-700 { border-color: #e2e8f0 !important; }
#main-app-container .border-gray-600 { border-color: #e5e7eb !important; }
#main-app-container .border-gray-500 { border-color: #d1d5db !important; }

/* Input / select field overrides */
#main-app-container input.bg-gray-700,
#main-app-container select.bg-gray-700,
#main-app-container textarea.bg-gray-700,
input.bg-gray-700,
select.bg-gray-700,
textarea.bg-gray-700,
input.bg-gray-800,
select.bg-gray-800,
textarea.bg-gray-800,
input.bg-gray-900,
select.bg-gray-900 {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #d1d5db !important;
}

.bg-gray-700.border-gray-600,
.bg-gray-800.border-gray-700,
.bg-gray-900.border-gray-700 {
    border-color: #dbe5f1 !important;
}

/* Divide line overrides */
#main-app-container .divide-gray-700 > * + * { border-color: #e2e8f0 !important; }
#main-app-container .divide-gray-600 > * + * { border-color: #e5e7eb !important; }

/* Hover background overrides */
#main-app-container .hover\:bg-gray-700:hover { background-color: #f1f5f9 !important; }
#main-app-container .hover\:bg-gray-800:hover { background-color: #e0f2fe !important; }

/* Table row hover */
#main-app-container tr.hover\:bg-gray-800:hover,
#main-app-container tr.hover\:bg-gray-700:hover { background-color: rgba(37, 99, 235, 0.05) !important; }

/* ===================================
   APP FOOTER
   =================================== */
.app-footer {
    border-top: 1px solid var(--theme-border);
    background: var(--theme-surface-1);
    padding: 1.5rem clamp(1rem, 4vw, 3rem);
}
.app-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}
@media (min-width: 640px) {
    .app-footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}
.app-footer-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.app-footer-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: .7;
}
.app-footer-wordmark {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--theme-muted);
}
.app-footer-copy {
    font-size: .7rem;
    color: var(--theme-muted);
    opacity: .6;
}
.app-footer-links {
    display: flex;
    gap: 1.25rem;
}
.app-footer-link {
    font-size: .7rem;
    color: var(--theme-muted);
    opacity: .7;
    text-decoration: none;
    transition: opacity .15s;
}
.app-footer-link:hover { opacity: 1; }

/* ══════════════════════════════════════════
   GESTIONE LEGA — Admin Panel Components
   ══════════════════════════════════════════ */

/* ── Tab Strip ── */
.gl-tab-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--theme-surface-2, rgba(0, 0, 0, 0.03));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--theme-border);
    border-radius: 9999px;
    position: sticky;
    top: calc(var(--header-height, 64px) + 0.35rem);
    z-index: 10;
    margin-bottom: 1.2rem;
    scrollbar-width: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.gl-tab-nav::-webkit-scrollbar { display: none; }

.gl-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    padding: 0.625rem 1.05rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    outline: none;
    background: transparent;
    color: var(--theme-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 40px;
    flex-shrink: 0;
    font-family: 'Chakra Petch', sans-serif;
}
.gl-tab-btn::after {
    content: none;
}
.gl-tab-btn:hover {
    background: var(--theme-surface-1);
    color: var(--theme-text);
}
.gl-tab-btn.gl-tab-active {
    background: var(--theme-accent, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.gl-tab-btn.gl-tab-active::after {
    background: transparent;
}
.gl-tab-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Chart tab toggle (classifica.html) ── */
.chart-tab-btn {
    background: transparent;
    color: var(--theme-muted);
    border: 1.5px solid var(--theme-border);
    cursor: pointer;
}
.chart-tab-btn:hover {
    color: var(--theme-text);
    border-color: var(--theme-accent);
}
.chart-tab-btn.chart-tab-active {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
html.dark .chart-tab-btn.chart-tab-active {
    background: #15803d;
    border-color: #15803d;
}

/* ── Badge richieste pendenti ── */
.gl-badge {
    background: linear-gradient(120deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 6px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
    margin-left: 3px;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
}

/* ── Section Card (glass style allineato admin) ── */
.gl-section-card {
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.gl-section-card:hover {
    border-color: var(--theme-accent, #2563eb);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.1);
}

/* ── Hero header gestione lega ── */
.gl-hero-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 18% -20%, rgba(56, 189, 248, 0.18), transparent 44%),
        radial-gradient(circle at 82% 120%, rgba(37, 99, 235, 0.15), transparent 50%),
        var(--theme-surface-1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.gl-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-top: 3px solid rgba(37, 99, 235, 0.58);
}

.gl-hero-kicker {
    font-family: 'Chakra Petch', sans-serif;
    letter-spacing: 0.09em;
    color: var(--theme-accent);
}

html.dark .gl-hero-card {
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.34);
}

/* ── Section Title (label uppercase) ── */
.gl-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--theme-accent);
    margin-bottom: 0.875rem;
    font-family: 'Chakra Petch', sans-serif;
}

/* ── Danger button ── */
.gl-btn-danger {
    background: var(--theme-danger) !important;
    border-color: var(--theme-danger) !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25) !important;
}
.gl-btn-danger:hover {
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.4) !important;
}

/* ── Members table actions ── */
.gl-member-action-save {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.28);
}
.gl-member-action-save:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.35);
}

.gl-member-action-remove {
    background-color: rgba(245, 158, 11, 0.16) !important;
    border: 1px solid rgba(245, 158, 11, 0.48) !important;
    color: #b45309 !important;
}
.gl-member-action-remove:hover {
    background-color: rgba(245, 158, 11, 0.24) !important;
    border-color: rgba(217, 119, 6, 0.62) !important;
    color: #92400e !important;
}

html.dark .gl-member-action-save {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
html.dark .gl-member-action-remove {
    background-color: rgba(245, 158, 11, 0.24) !important;
    border-color: rgba(245, 158, 11, 0.52) !important;
    color: #fbbf24 !important;
}
html.dark .gl-member-action-remove:hover {
    background-color: rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

/* ── Campo Rosa non assegnato ── */
.gl-highlight-field {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.25) !important;
    animation: gl-highlight-pulse 1.2s ease-in-out 3;
}
@keyframes gl-highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.25); }
    50%       { box-shadow: 0 0 0 6px rgba(245,158,11,0.45); }
}

@media (max-width: 640px) {
    .gl-tab-btn { padding: 0.55rem 0.9rem; font-size: 0.76rem; gap: 0.35rem; }
    .gl-tab-nav { top: calc(var(--mobile-top-app-bar-height, 56px) + 0.3rem); }
}

html.dark .gl-tab-nav {
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

html.dark .gl-section-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* ── Section Loader ── */
.section-loader {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.25s ease;
}
html.dark .section-loader {
    background: rgba(15, 23, 42, 0.7);
}
.section-loader.hidden {
    display: none;
}
.section-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2.5rem;
    background: var(--theme-surface-1);
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14), 0 4px 16px rgba(37, 99, 235, 0.1);
    min-width: 200px;
    text-align: center;
}
.section-loader-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.section-loader-bar-wrap {
    width: 140px;
    height: 4px;
    background: var(--theme-surface-2);
    border-radius: 99px;
    overflow: hidden;
}
.section-loader-bar {
    height: 100%;
    border-radius: 99px;
    background: var(--theme-accent, #2563eb);
    animation: section-loader-progress 1.4s ease-in-out infinite;
    transform-origin: left;
}
@keyframes section-loader-progress {
    0% { transform: scaleX(0); margin-left: 0; }
    40% { transform: scaleX(0.6); margin-left: 0; }
    60% { transform: scaleX(0.4); margin-left: 40%; }
    100% { transform: scaleX(0); margin-left: 100%; }
}
.section-loader-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--theme-muted);
    margin: 0;
}

/* ── Pool tabella: giocatori non schierati ──────────────────────── */
.fm-pool-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    table-layout: fixed;
}
/*
  Colonne fisse — somma: 28+18+24+30+30+60 = 190px
  padding celle: 0px orizzontale (solo 4px left/right prima/ultima)
  → name column prende tutto lo spazio rimanente
*/
.pmrc-logo   { width: 20px; }
.pmrc-avatar { width: 28px; }
.pmrc-name   { width: 90px; }
.pmrc-role   { width: 50px; }
.pmrc-mv     { width: 30px; }
.pmrc-fm     { width: 30px; }
.pmrc-btns   { width: 60px; }

/* Header */
.pmr-th {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0 0 5px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}
.dark .pmr-th {
    color: #64748b;
    border-bottom-color: rgba(100, 116, 139, 0.35);
}
.pmr-th-name  { text-align: left; padding-left: 4px; }
.pmr-th-num   { text-align: right; }

/* Righe dati */
.fm-pool-mini-row {
    cursor: grab;
    user-select: none;
}
.fm-pool-mini-row .pmr-td {
    padding: 3px 0;
    transition: background 0.12s;
    vertical-align: middle;
    background: rgba(100, 116, 139, 0.06);
}

/* Colori per ruolo — light */
.pmr-rc-P .pmr-td { background: rgba(234, 179,  8, 0.08); }
.pmr-rc-D .pmr-td { background: rgba( 34, 197, 94, 0.08); }
.pmr-rc-C .pmr-td { background: rgba( 59, 130, 246, 0.08); }
.pmr-rc-A .pmr-td { background: rgba(239,  68,  68, 0.08); }
.pmr-rc-P:hover .pmr-td { background: rgba(234, 179,  8, 0.18); }
.pmr-rc-D:hover .pmr-td { background: rgba( 34, 197, 94, 0.18); }
.pmr-rc-C:hover .pmr-td { background: rgba( 59, 130, 246, 0.18); }
.pmr-rc-A:hover .pmr-td { background: rgba(239,  68,  68, 0.18); }

/* Colori per ruolo — dark */
.dark .pmr-rc-P .pmr-td { background: rgba(234, 179,  8, 0.14); }
.dark .pmr-rc-D .pmr-td { background: rgba( 34, 197, 94, 0.12); }
.dark .pmr-rc-C .pmr-td { background: rgba( 59, 130, 246, 0.14); }
.dark .pmr-rc-A .pmr-td { background: rgba(239,  68,  68, 0.14); }
.dark .pmr-rc-P:hover .pmr-td { background: rgba(234, 179,  8, 0.26); }
.dark .pmr-rc-D:hover .pmr-td { background: rgba( 34, 197, 94, 0.24); }
.dark .pmr-rc-C:hover .pmr-td { background: rgba( 59, 130, 246, 0.26); }
.dark .pmr-rc-A:hover .pmr-td { background: rgba(239,  68,  68, 0.26); }
.fm-pool-mini-row .pmr-td:first-child {
    border-radius: 6px 0 0 6px;
    padding-left: 4px;
}
.fm-pool-mini-row .pmr-td:last-child {
    border-radius: 0 6px 6px 0;
    padding-right: 4px;
}

/* Cella avatar */
.pmr-avatar { text-align: center; }
.pool-mini-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.2);
}
/* Wrapper avatar con badge indisponibilità */
.pmr-avatar-wrap {
    position: relative;
    display: inline-flex;
    width: 26px;
    height: 26px;
    vertical-align: middle;
}
.pmr-unavail-badge {
    position: absolute;
    bottom: -3px;
    right: -4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}
/* Infortunio: croce rossa su sfondo bianco */
.pmr-unavail-injury {
    background: transparent;
    border-color: transparent;
    width: 18px;
    height: 18px;
    bottom: -5px;
    right: -6px;
    padding: 0;
}
.pmr-unavail-injury-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
/* Squalifica: cartellino rosso su sfondo chiaro */
.pmr-unavail-suspended {
    background: #fef2f2;
    border-color: #dc2626;
}
.pmr-unavail-suspended::before {
    content: '';
    display: block;
    width: 5px;
    height: 7px;
    background: #dc2626;
    border-radius: 1px;
}
/* Cella nome */
.pmr-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}
.dark .pmr-name { color: #e2e8f0; }
/* Cella logo */
.pmr-logo { text-align: center; }
.pmr-logo img {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}
/* Cella ruolo */
.pmr-role {
    overflow: hidden;
}
.pmr-role-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    align-items: center;
    overflow: hidden;
    background: transparent;
}
.pool-mini-role {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
    color: #fff;
}
/* Colori badge ruolo Mantra — stesse tinte dei badge card */
.pool-mini-role.rt-P { background: #eab308; }
.pool-mini-role.rt-D { background: #22c55e; }
.pool-mini-role.rt-C { background: #3b82f6; }
.pool-mini-role.rt-A { background: #ef4444; }
.pmr-mantra {
    display: none; /* nascosto: info disponibile nel title del badge */
}
/* Cella MV / FM */
.pmr-mv, .pmr-fm {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
    white-space: nowrap;
}
.dark .pmr-mv,
.dark .pmr-fm { color: #cbd5e1; }
/* Cella bottoni */
.pmr-btns {
    text-align: right;
    white-space: nowrap;
}
.pmr-btns .fm-btn-tit,
.pmr-btns .fm-btn-pan {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.4;
    display: inline-block;
}
.pmr-btns .fm-btn-tit { background: rgba(37, 99, 235, 0.85); color: #fff; }
.pmr-btns .fm-btn-pan { background: rgba(217, 119, 6, 0.85); color: #fff; margin-left: 2px; }
.pmr-btns .fm-btn-tit:hover { background: rgb(37, 99, 235); }
.pmr-btns .fm-btn-pan:hover { background: rgb(217, 119, 6); }

/* ── Bottone X sovrapposto sulla card titolare ───────────────────── */
.fm-btn-excl-overlay {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    transition: background 0.12s, transform 0.1s;
}
.fm-btn-excl-overlay:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.15);
}

/* ── Score Calculator — tabella calciatori ──────────────────────── */
.sc-player-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    table-layout: fixed;
    padding: 0 4px;
}
.sc-ptc-logo   { width: 22px; }
.sc-ptc-avatar { width: 30px; }
.sc-ptc-name   { width: auto; }
.sc-ptc-bm     { width: 110px; }
.sc-ptc-v      { width: 48px; }
.sc-ptc-fv     { width: 90px; }

.sc-pt-thead .sc-pt-th {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 4px 0 4px;
    border-bottom: 1px solid rgba(100,116,139,0.2);
}
.dark .sc-pt-thead .sc-pt-th {
    color: #64748b;
    border-bottom-color: rgba(100,116,139,0.35);
}
.sc-pt-th-name  { text-align: left; padding-left: 4px; }
.sc-pt-th-center { text-align: center; }

/* Righe */
.sc-pt-row .sc-pt-td {
    padding: 3px 0;
    vertical-align: middle;
    background: rgba(100,116,139,0.05);
    transition: background 0.12s;
}
.sc-pt-row .sc-pt-td:first-child {
    border-radius: 6px 0 0 6px;
    padding-left: 4px;
}
.sc-pt-row .sc-pt-td:last-child {
    border-radius: 0 6px 6px 0;
    padding-right: 4px;
}
.sc-pt-row-inactive .sc-pt-td {
    opacity: 0.65;
    background: rgba(100,116,139,0.02);
}

/* Tinte per ruolo — light */
.pmr-rc-P .sc-pt-td { background: rgba(234,179, 8,0.08); }
.pmr-rc-D .sc-pt-td { background: rgba( 34,197,94,0.08); }
.pmr-rc-C .sc-pt-td { background: rgba( 59,130,246,0.08); }
.pmr-rc-A .sc-pt-td { background: rgba(239, 68,68,0.08); }
/* dark */
.dark .pmr-rc-P .sc-pt-td { background: rgba(234,179, 8,0.12); }
.dark .pmr-rc-D .sc-pt-td { background: rgba( 34,197,94,0.10); }
.dark .pmr-rc-C .sc-pt-td { background: rgba( 59,130,246,0.12); }
.dark .pmr-rc-A .sc-pt-td { background: rgba(239, 68,68,0.12); }

/* Logo */
.sc-pt-logo { text-align: center; }
.sc-pt-logo-img {
    width: 18px !important;
    height: 18px !important;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Avatar */
.sc-pt-avatar-cell { text-align: center; }
.sc-pt-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    background: rgba(100,116,139,0.15);
    border: 1px solid rgba(100,116,139,0.2);
}

/* Nome + badges */
.sc-pt-name { overflow: hidden; }
.sc-pt-name-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 4px;
    overflow: hidden;
}
.sc-pt-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    flex-shrink: 0;
}
.sc-role-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    color: #fff;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}
.sc-pt-playername {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.dark .sc-pt-playername { color: #e2e8f0; }
.sc-pt-replaced {
    font-size: 9px;
    color: #94a3b8;
}
.dark .sc-pt-replaced { color: #94a3b8; }

/* B/M icons column */
.sc-pt-bm {
    text-align: left;
    padding-left: 2px;
}

/* Voto column */
.sc-pt-v {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}
.dark .sc-pt-v { color: #94a3b8; }

/* FV column */
.sc-pt-fv { text-align: center; }

/* ── Match Details Split Layout ─────────────────────────────────────────── */
.mds-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.25rem 2px 2.25rem minmax(0, 1fr);
    background: #fff;
}
/* Section header row cells */
.mds-sec-hdr {
    padding: 5px 6px;
    background: #f1f5f9;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mds-sec-hdr-away {
    justify-content: flex-end;
    text-align: right;
}
.mds-col-hdr {
    padding: 5px 0;
    background: #f1f5f9;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mds-sep-hdr-cell {
    background: #e2e8f0;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}
/* Player cells */
.mds-player-cell {
    padding: 4px 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-bottom: 1px solid #e2e8f0;
    min-height: 2.75rem;
}
.mds-player-cell.mds-no-play {
    opacity: .55;
    background: #f8fafc;
}
.mds-player-cell.mds-empty-cell {
    background: #f8fafc;
}
.mds-name-row {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}
.mds-name-row-away {
    flex-direction: row-reverse;
}
.mds-player-name {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
/* Role badge size override inside split grid */
.mds-name-row span.inline-flex {
    width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
    flex-shrink: 0;
}
.mds-bonus-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding-left: 21px;
}
.mds-bonus-row-away {
    padding-left: 0;
    padding-right: 21px;
    justify-content: flex-end;
}
/* Bonus icon size override */
.mds-bonus-row .inline-flex {
    width: 14px !important;
    height: 14px !important;
    font-size: 11px !important;
}
.mds-sub-icon {
    font-size: 9px;
    color: #3b82f6;
    flex-shrink: 0;
}
.mds-head-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.mds-head-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.mds-head-team-away {
    justify-content: flex-end;
}
.mds-head-sub {
    margin-top: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.mds-head-name {
    font-size: 12px;
    color: #bfdbfe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}
.mds-head-name-away {
    text-align: right;
}
.mds-head-module-center {
    font-size: 12px;
    font-weight: 700;
    color: #bfdbfe;
    white-space: nowrap;
    text-align: center;
}
.mds-team-name {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Vote stack cells */
.mds-votes-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    gap: 2px;
    padding: 3px 0;
}
.mds-votes-stack-away {
    background: #f8fafc;
}
.mds-vote-base,
.mds-vote-fv {
    width: 1.9rem;
    height: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.35rem;
    line-height: 1;
}
.mds-vote-base {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}
.mds-vote-fv {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}
.mds-sep-cell {
    background: #cbd5e1;
    border-bottom: 1px solid #e2e8f0;
}
/* Totals bar */
.mds-totals-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    background: #eff6ff;
    border-top: 2px solid #bfdbfe;
    padding: 7px 10px;
    align-items: center;
    gap: 6px;
}
.mds-total-val {
    font-size: 14px;
    font-weight: 700;
    color: #1d4ed8;
    text-align: left;
}
.mds-total-away {
    text-align: right;
}
.mds-total-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
}
/* Dark mode overrides */
html.dark .mds-split-grid,
html.dark .mds-player-cell { background: #1e293b; }
html.dark .mds-player-cell.mds-empty-cell,
html.dark .mds-player-cell.mds-no-play { background: #0f172a; }
html.dark .mds-sec-hdr,
html.dark .mds-col-hdr,
html.dark .mds-sep-hdr-cell { background: #0f172a; border-color: #334155; }
html.dark .mds-player-name { color: #e2e8f0; }
html.dark .mds-votes-stack { background: #0f172a; border-color: #334155; }
html.dark .mds-vote-base { background: #334155; color: #cbd5e1; }
html.dark .mds-vote-fv { background: #1e3a8a; color: #93c5fd; }
html.dark .mds-sep-cell { background: #334155; border-color: #334155; }
html.dark .mds-player-cell { border-color: #334155; }
html.dark .mds-totals-bar { background: #1e3a5f; border-color: #1d4ed8; }
html.dark .mds-total-val { color: #93c5fd; }
html.dark .mds-total-label { color: #94a3b8; }
