@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Julius+Sans+One&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #0f1108; /* Deep ink / moss dark */
    --bg-surface: rgba(20, 24, 15, 0.7);
    --bg-card: rgba(35, 40, 25, 0.5);
    
    --primary-color: #8da03f;
    --primary-hover: #a1b84a;
    --accent-gold: #3e4b12; /* Rich Dark Olive Green */
    --danger-color: #e63946;
    
    --text-main: #f5f5f0; /* Off-white / parchment paper */
    --text-muted: #b0b5a8;
    
    --glass-border: rgba(141, 160, 63, 0.2);
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
    --glass-blur: blur(15px);
    
    --nav-height: 70px;
    --bottom-bar-height: 80px;
    
    --font-heading: 'Julius Sans One', sans-serif;
    --font-body: 'Julius Sans One', sans-serif;
}

* {
    font-family: 'Julius Sans One', sans-serif;
}

/* Consent Checkbox Custom Styling */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    line-height: 1.4;
    color: var(--text-main);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(141, 160, 63, 0.1);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--bg-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

@keyframes inkReveal {
    from { opacity: 0; filter: blur(5px); transform: translateY(10px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Parchment texture overlay */
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(141, 160, 63, 0.05), transparent),
        url('https://www.transparenttextures.com/patterns/p6.png');
    overscroll-behavior-y: none;
    -webkit-user-select: none;
    user-select: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 600;
}

#app-container {
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: var(--bottom-bar-height);
    background: var(--bg-dark);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    display: block !important;
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.card:active {
    transform: scale(0.98);
}

/* Typography & Colors */
.text-primary { color: var(--primary-color); }
.hidden { display: none !important; }
.text-accent { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #8da03f !important; /* Solid Green */
    color: #0f1108 !important; /* Solid Dark Text */
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    opacity: 1 !important;
}

.btn:hover {
    background: #a1b84a !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #333 !important;
    color: #666 !important;
    cursor:not-allowed;
    box-shadow: none;
    opacity: 0.6 !important;
}

.btn-secondary {
    background: #232819 !important; /* Solid dark/surface */
    border: 2px solid #8da03f !important;
    color: #f5f5f0 !important;
}

/* Navigations */
.top-nav {
    display: none;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.bottom-bar {
    height: var(--bottom-bar-height);
    background: rgba(15, 17, 8, 0.95);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 15px;
    gap: 15px;
    scrollbar-width: none;
}

.bottom-bar::-webkit-scrollbar {
    display: none;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    transition: all 0.3s ease;
    padding: 5px;
    flex: 0 0 calc(28% - 10px);
    max-width: 100px;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
}

.tab-item i {
    font-size: 1.1rem;
}

.tab-item.active {
    color: var(--primary-color);
}

/* Tooltips (Desktop only) */
@media screen and (min-width: 1024px) {
    .bottom-bar {
        overflow: visible !important;
    }

    .tab-item {
        position: relative;
        flex: 0 0 auto;
        max-width: none;
    }

    .tab-item::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 110%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        background: var(--primary-color);
        color: white;
        padding: 8px 14px;
        border-radius: 12px;
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        box-shadow: 0 10px 25px rgba(0,0,0,0.4);
        z-index: 2000;
        border: 1px solid rgba(255,255,255,0.1);
    }

    .tab-item:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .tab-item:hover i {
        transform: translateY(-5px);
        color: var(--primary-color);
    }

    .tab-item i {
        transition: transform 0.3s ease, color 0.3s ease;
    }
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-dark);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-menu.active {
    left: 0;
}

.side-menu.hidden-pre-login {
    display: none !important;
}

.side-menu.sidebar-collapsed {
    width: 80px;
}

.side-menu.sidebar-collapsed .menu-link span,
.side-menu.sidebar-collapsed .sidebar-title,
.side-menu.sidebar-collapsed .sidebar-subtitle {
    display: none;
}

.side-menu.sidebar-collapsed .menu-header {
    padding: 20px 10px;
}

.side-menu.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 15px 0;
}

.side-menu.sidebar-collapsed .menu-link i {
    margin: 0;
    font-size: 1.5rem;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    z-index: 1999;
    backdrop-filter: blur(5px);
}

.menu-overlay.active {
    display: block;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.menu-link:hover, .menu-link.active {
    background: rgba(141, 160, 63, 0.1);
    color: var(--primary-color);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-dark);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-menu.active {
    left: 0;
}

.side-menu.hidden-pre-login {
    display: none !important;
}

.side-menu.sidebar-collapsed {
    width: 80px;
}

.side-menu.sidebar-collapsed .menu-link span,
.side-menu.sidebar-collapsed .sidebar-title,
.side-menu.sidebar-collapsed .sidebar-subtitle {
    display: none;
}

.side-menu.sidebar-collapsed .menu-header {
    padding: 20px 10px;
}

.side-menu.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 15px 0;
}

.side-menu.sidebar-collapsed .menu-link i {
    margin: 0;
    font-size: 1.5rem;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    z-index: 1999;
    backdrop-filter: blur(5px);
}

.menu-overlay.active {
    display: block;
}

.menu-header {
    padding: 40px 20px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.menu-items {
    list-style: none;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.menu-link:hover, .menu-link.active {
    background: rgba(141, 160, 63, 0.1);
    color: var(--primary-color);
}

.admin-tab-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(141, 160, 63, 0.4);
}

.side-menu .admin-tab-btn.active {
    background: rgba(141, 160, 63, 0.1) !important;
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color) !important;
}

.hidden { display: none !important; }

/* Views */
.view {
    display: none;
    padding: 20px;
    animation: inkReveal 0.5s ease-out;
}

.view.active {
    display: block;
}

/* Home Section Styles */
.logo-container {
    max-width: 280px;
    width: 100%;
    margin: 30px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-circle {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.fanta-logo-glow {
    filter: drop-shadow(0px 0px 12px rgba(255, 255, 255, 0.45)) drop-shadow(0px 0px 4px rgba(255, 255, 255, 0.25));
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

/* Author Cards & Selection */
.author-card {
    padding: 15px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float 4s infinite ease-in-out;
    text-align: center;
    border: 1px solid rgba(141, 160, 63, 0.2);
}

.author-card:hover {
    transform: translateY(-8px) rotate(1deg);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.author-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid #fff; /* Polaroid white border */
    background: #fff;
}

.author-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.budget-container {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    position: sticky;
    top: 80px;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.budget-bar-bg {
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    background: var(--primary-color);
    width: 100%;
    transition: width 0.5s ease;
}

.budget-status {
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

/* Contact Page Refined */
.contact-split {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-left {
    background: var(--primary-color);
    color: var(--bg-dark);
    padding: 30px;
    border-radius: 20px;
}

.contact-left h2 {
    color: var(--bg-dark);
    margin-bottom: 15px;
}

.contact-left p {
    font-size: 0.95rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.avatar-circle-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 25px auto;
}

.avatar-circle {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: transparent;
    border: none;
    box-shadow: none;
}

.contact-email-box {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1rem;
}

.email-icon-circle {
    width: 36px;
    height: 36px;
    background: var(--bg-dark);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-right {
    background: var(--bg-dark);
    padding: 20px;
}

/* Common Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.rules-list li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 5px;
}

.rules-list li::marker {
    color: var(--primary-color);
}

.menu-btn {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    backdrop-filter: blur(10px);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: white;
}

.menu-btn.hidden-pre-login {
    display: none !important;
}

/* Legal Modals Styling */
.modal-legal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Reduced for mobile */
    animation: inkReveal 0.4s ease-out;
}

.modal-legal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* Increased slightly */
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    border-radius: 20px;
}

.modal-legal-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
}

.modal-legal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.close-legal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    padding: 0 10px;
}

.close-legal:hover {
    color: var(--primary-color);
}

.modal-legal-body {
    padding: 25px;
    overflow-y: auto;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-legal-body h4 {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.modal-legal-body p {
    margin-bottom: 15px;
}

.modal-legal-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

/* Responsive Desktop Layout */
@media screen and (min-width: 1024px) {
    /* DEFAULT LAYOUT (Sidebar visible) - e.g. Admin */
    .side-menu {
        left: 0 !important;
        box-shadow: none;
        border-right: 1px solid var(--glass-border);
    }
    
    .menu-overlay {
        display: none !important;
    }
    
    .top-nav, main, .bottom-bar {
        margin-left: 280px;
        width: calc(100% - 280px) !important;
        max-width: none !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-collapsed ~ .top-nav,
    .sidebar-collapsed ~ main,
    .sidebar-collapsed ~ .bottom-bar {
        margin-left: 80px;
        width: calc(100% - 80px) !important;
    }

    /* APP-SPECIFIC LAYOUT (No Sidebar, Bottom Bar only) - index.html */
    body.no-sidebar .side-menu, 
    body.no-sidebar .menu-btn, 
    body.no-sidebar .menu-overlay {
        display: none !important;
    }
    
    body.no-sidebar .top-nav,
    body.no-sidebar main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: none !important; /* Flush design */
        margin: 0;
    }
    
    body.no-sidebar .bottom-bar {
        display: flex !important;
        justify-content: center;
        gap: 15px;
        position: fixed;
        bottom: 20px; /* Floating from bottom */
        left: 50%;
        transform: translateX(-50%);
        width: max-content !important;
        min-width: 500px;
        max-width: 90vw;
        height: 70px;
        padding: 0 30px;
        border-radius: 40px; /* Rounded Dock */
        background: rgba(15, 17, 8, 0.85);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid var(--glass-border);
        box-shadow: 0 15px 35px rgba(0,0,0,0.5);
        margin-left: 0 !important;
        z-index: 1500;
        overflow: visible !important;
    }

    body.no-sidebar .tab-item {
        min-width: 70px;
        padding: 10px;
    }

    body.no-sidebar .tab-item span {
        display: none; /* Hide labels on Dock to look more premium, using Tooltips instead */
    }

    body.no-sidebar .tab-item i {
        font-size: 1.5rem; /* Larger icons on Dock */
    }

    body.no-sidebar #app-container {
        padding-bottom: 100px !important;
    }
    
    .menu-btn {
        display: none;
    }
}
    
    #app-container {
        max-width: none !important;
        box-shadow: none;
    }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MODE BADGES — Badge colorato per modalità
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.mode-badge.mode-green {
    background: rgba(141, 160, 63, 0.15);
    border: 1px solid rgba(141, 160, 63, 0.4);
    color: #a1b84a;
}

.mode-badge.mode-orange {
    background: rgba(212, 114, 26, 0.15);
    border: 1px solid rgba(212, 114, 26, 0.4);
    color: #e88a3a;
}

.mode-badge.mode-gold {
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid rgba(201, 162, 39, 0.4);
    color: #d4af37;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MODE SELECTOR BUTTONS — Selezione modalità
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mode-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.mode-selector-btn {
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    color: var(--text-main);
    font-family: var(--font-body);
}

.mode-selector-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.mode-selector-btn.active-green {
    border-color: #8da03f;
    background: rgba(141, 160, 63, 0.1);
    box-shadow: 0 0 15px rgba(141, 160, 63, 0.2);
}

.mode-selector-btn.active-orange {
    border-color: #d4721a;
    background: rgba(212, 114, 26, 0.1);
    box-shadow: 0 0 15px rgba(212, 114, 26, 0.2);
}

.mode-selector-btn.active-gold {
    border-color: #c9a227;
    background: rgba(201, 162, 39, 0.1);
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.2);
}

.mode-selector-btn .mode-btn-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mode-selector-btn .mode-btn-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.mode-selector-btn .mode-btn-title.color-green { color: #a1b84a; }
.mode-selector-btn .mode-btn-title.color-orange { color: #e88a3a; }
.mode-selector-btn .mode-btn-title.color-gold   { color: #d4af37; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SECTION LABEL — Label sezione hoverable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(141, 160, 63, 0.5);
    border: 1px solid rgba(141, 160, 63, 0.15);
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 15px;
    cursor: default;
    transition: all 0.3s ease;
    float: right;
    clear: both;
}

.section-label:hover {
    color: #a1b84a;
    border-color: rgba(141, 160, 63, 0.5);
    background: rgba(141, 160, 63, 0.08);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   WIP MODAL — Stiamo lavorando
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.modal-wip {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: inkReveal 0.4s ease-out;
}

.modal-wip.active {
    display: flex;
}

.modal-wip-content {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 35px 30px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.modal-wip-emoji {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

.modal-wip-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.modal-wip-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-wip-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(141, 160, 63, 0.1);
    border: 1px solid rgba(141, 160, 63, 0.3);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a1b84a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LEADERBOARD MODE TABS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.leaderboard-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.lb-mode-tab {
    flex: 1;
    min-width: 90px;
    padding: 8px 6px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.lb-mode-tab:hover { border-color: rgba(141,160,63,0.3); color: var(--text-main); }
.lb-mode-tab.active-green { border-color: #8da03f; color: #a1b84a; background: rgba(141,160,63,0.1); }
.lb-mode-tab.active-orange { border-color: #d4721a; color: #e88a3a; background: rgba(212,114,26,0.1); }
.lb-mode-tab.active-gold { border-color: #c9a227; color: #d4af37; background: rgba(201,162,39,0.1); }

/* Rank item */
.rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.rank-item:hover { background: rgba(255,255,255,0.02); }
.rank-num {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 30px;
    text-align: center;
}
.rank-item:nth-child(1) .rank-num { color: #ffd700; }
.rank-item:nth-child(2) .rank-num { color: #c0c0c0; }
.rank-item:nth-child(3) .rank-num { color: #cd7f32; }
.rank-name { flex: 1; font-weight: 500; font-size: 0.95rem; }
.rank-points { font-weight: 700; color: var(--primary-color); font-size: 1rem; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ADMIN MODE FILTER TABS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.admin-mode-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.admin-mode-filter-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-mode-filter-btn.f-green  { border-color: #8da03f;  color: #a1b84a; background: rgba(141,160,63,0.1); }
.admin-mode-filter-btn.f-orange { border-color: #d4721a;  color: #e88a3a; background: rgba(212,114,26,0.1); }
.admin-mode-filter-btn.f-gold   { border-color: #c9a227;  color: #d4af37; background: rgba(201,162,39,0.1); }
.admin-mode-filter-btn.f-all    { border-color: rgba(255,255,255,0.3); color: var(--text-main); background: rgba(255,255,255,0.05); }

/* Admin Stat Cards (Dashboard Style) */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.admin-stat-card {
    background: white;
    padding: 1.2rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.admin-stat-card.active {
    border-color: var(--primary-color);
    background: rgba(144, 161, 79, 0.05);
}

.admin-stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.admin-stat-card .stat-label {
    font-size: 0.7rem;
    color: #888;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-stat-card.active .stat-label {
    color: var(--primary-color);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AUTHOR SLOT with REMOVE BUTTON
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.author-slot-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.author-slot-wrapper .author-slot-btn {
    flex: 1;
}

.author-remove-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.1) !important;
    border: 1px solid rgba(230, 57, 70, 0.3) !important;
    color: #e63946 !important;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.author-remove-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.author-remove-btn:hover {
    background: rgba(230, 57, 70, 0.25) !important;
    transform: scale(1.1);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SHARE MODAL & STUDENT CODE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.share-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.share-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.share-btn i {
    font-size: 1.5rem;
}

.share-btn.whatsapp i   { color: #25D366; }
.share-btn.classroom i  { color: #ffca28; }
.share-btn.teams i      { color: #4b53bc; }
.share-btn.copy i       { color: var(--text-muted); }

.code-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(141, 160, 63, 0.05);
    border: 1px dashed var(--primary-color);
}

.student-code-input {
    letter-spacing: 4px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: monospace;
    max-width: 200px;
}

.join-code-badge {
    background: var(--bg-dark);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    border: 1px solid var(--primary-color);
    font-size: 1.1rem;
    margin-left: 10px;
}

/* International Authors Stylings (Red Cards) */
.card-international {
    border: 1px solid var(--danger-color) !important;
    background: rgba(230, 57, 70, 0.05) !important;
}

.card-international .text-primary,
.card-international .author-cost {
    color: var(--danger-color) !important;
}

.card-international img {
    border: 2px solid var(--danger-color);
}

.mode-gold {
    background: var(--accent-gold);
    color: #fff;
}

.mode-orange {
    background: #d4721a;
    color: #fff;
}

.mode-green {
    background: #8da03f;
    color: #fff;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AUTHOR SCHEDA STYLING
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.scheda-intro {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 800;
    text-transform: uppercase;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
    animation: inkReveal 0.6s ease-out;
}

.scheda-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scheda-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(141, 160, 63, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.scheda-list li:hover {
    background: rgba(141, 160, 63, 0.08);
    border-color: rgba(141, 160, 63, 0.3);
    transform: translateX(5px);
}

.scheda-list li strong {
    color: var(--primary-color);
    font-weight: 700;
    margin-right: 5px;
}

@media screen and (max-width: 600px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Card di selezione interattive per LIM */
.pres-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.pres-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pres-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.pres-card.active {
    background: rgba(141, 160, 63, 0.15) !important;
    border: 2.5px solid var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(141, 160, 63, 0.25);
}

.pres-card-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.pres-card:hover .pres-card-icon {
    transform: scale(1.1);
}

.pres-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-color);
    margin-top: 4px;
}

.pres-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CINEMATIC PRESENTATION SYSTEM (LIM)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#presentation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #050603; /* Extra dark green-black */
    z-index: 4000;
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-main);
    user-select: none;
}

#pres-bg-video, #pres-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.20; /* Very low opacity for contrast */
    pointer-events: none;
}

#presentation-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(5, 6, 3, 0.85) 90%);
    z-index: 2;
    pointer-events: none;
}

.pres-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.pres-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.pres-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pres-close-btn:hover {
    color: var(--danger-color);
    background: rgba(230, 57, 70, 0.15);
    border-color: rgba(230, 57, 70, 0.3);
    transform: rotate(90deg);
}

#pres-content-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 80px 32px 70px 32px;
    z-index: 5;
    overflow: hidden;
}

#pres-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    scrollbar-width: none;
}
#pres-content::-webkit-scrollbar {
    display: none;
}

.pres-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pres-slide-num {
    background: rgba(141, 160, 63, 0.15);
    border: 1px solid var(--glass-border);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--primary-hover);
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.pres-nav-tip {
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.pres-nav-tip strong {
    color: var(--primary-color);
}

/* Slide elements styling */
.pres-slide-text {
    font-family: var(--font-body);
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 4px 15px rgba(0,0,0,0.9);
    width: 100%;
    max-width: 100%;
    color: var(--text-main);
    text-transform: uppercase;
    font-weight: 800;
    font-style: normal !important;
    animation: inkReveal 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    padding: 0 20px;
}

.pres-slide-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.5rem);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
    text-align: center;
    font-weight: 800;
    font-style: normal !important;
    width: 100%;
}

.pres-slide-card {
    background: rgba(20, 24, 15, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    backdrop-filter: var(--glass-blur);
    animation: inkReveal 0.6s ease-out;
}

/* ─────────────────────────────────────────
   Author Reveal Slide — nuova struttura:
   header fisso (avatar + nome) in cima,
   corpo scrollabile sotto
   ───────────────────────────────────────── */

/* Wrapper verticale che occupa tutto lo spazio disponibile */
.pres-slide-author {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: 1;
    animation: inkReveal 0.6s ease-out;
    gap: 0;
}

/* Header fisso: avatar + info autore in riga orizzontale */
.pres-author-sticky-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 28px;
    background: rgba(15, 17, 8, 0.95);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
    position: sticky;
    top: -10px; /* Counteract #pres-content padding */
    z-index: 10;
}

.pres-author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.8);
    background: #fff;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease;
}

.pres-author-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.pres-author-name {
    font-family: var(--font-body);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 800;
    font-style: normal !important;
    color: var(--primary-hover);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    text-transform: uppercase;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pres-author-role {
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: var(--text-muted);
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pres-author-points-badge {
    background: linear-gradient(135deg, #f1c40f, #d35400);
    color: #000;
    font-weight: 900;
    font-size: clamp(1.1rem, 1.6vw, 1.7rem);
    padding: 8px 22px;
    border-radius: 30px;
    box-shadow: 0 6px 18px rgba(241, 196, 15, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulseGlow 2s infinite;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Corpo scorrevole: intro + bonus */
.pres-author-body {
    flex: 1;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 12, 6, 0.45);
    border-radius: 0 0 16px 16px;
}

.pres-author-intro {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    line-height: 1.5;
    font-style: normal !important;
    font-weight: 700;
    color: var(--text-main);
    border-left: 5px solid var(--primary-color);
    padding-left: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.pres-bonus-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(141, 160, 63, 0.15);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    font-weight: 700;
    font-style: normal !important;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease-out;
}

.pres-bonus-item.revealed {
    opacity: 1;
    transform: translateX(0);
}

.pres-bonus-item.positive {
    border-left: 4px solid #2ecc71;
}

.pres-bonus-item.negative {
    border-left: 4px solid #e74c3c;
}

.pres-bonus-item.neutral {
    border-left: 4px solid #7f8c8d;
}

/* Leaderboard Podium */
.pres-podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 25px;
    height: 45vh;
    min-height: 250px;
    max-height: 420px;
    width: 100%;
    max-width: 100%;
    margin-top: 20px;
}

.pres-podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    max-width: 200px;
}

.pres-podium-team-name {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    font-style: normal !important;
    margin-bottom: 12px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.9);
    color: #fff;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.pres-podium-step {
    width: 100%;
    border-radius: 15px 15px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--font-body);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    text-align: center;
}

.pres-podium-col.p1 .pres-podium-step {
    height: 220px;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 3px solid #fff;
    color: #000;
}

.pres-podium-col.p2 .pres-podium-step {
    height: 165px;
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    border: 1px solid rgba(255,255,255,0.6);
    color: #000;
}

.pres-podium-col.p3 .pres-podium-step {
    height: 120px;
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border: 1px solid rgba(255,255,255,0.3);
    color: #000;
}

.pres-podium-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.pres-podium-pts {
    font-size: 1.2rem;
    font-weight: 800;
    margin-top: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pres-podium-col.p1 .pres-podium-pts { color: #5c4308; }
.pres-podium-col.p2 .pres-podium-pts { color: #2c3e50; }
.pres-podium-col.p3 .pres-podium-pts { color: #5e2700; }

/* Leaderboard List Rows */
.pres-leaderboard-list {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: none; /* Firefox */
}
.pres-leaderboard-list::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.pres-leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.4rem;
    font-style: normal !important;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(141, 160, 63, 0.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpReveal 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.pres-leaderboard-row.highlight {
    background: rgba(141, 160, 63, 0.15);
    border-color: var(--primary-color);
}

.pres-row-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pres-row-rank {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 800;
    font-style: normal !important;
    color: var(--primary-color);
    width: 45px;
}

.pres-row-name {
    font-weight: 700;
}

.pres-row-points {
    font-weight: 800;
    color: var(--primary-hover);
}

/* Animations */
@keyframes slideUpReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 8px 20px rgba(241, 196, 15, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(241, 196, 15, 0.7);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 8px 20px rgba(241, 196, 15, 0.4);
        transform: scale(1);
    }
}

/* Adapting presentation styles on tablet/mobile if projected from smaller screens */
@media screen and (max-width: 768px) {
    #pres-content-wrapper {
        padding: 68px 14px 60px 14px;
    }

    .pres-author-sticky-header {
        padding: 12px 16px;
        gap: 14px;
        border-radius: 12px 12px 0 0;
    }

    .pres-author-avatar {
        width: 64px;
        height: 64px;
    }
    
    .pres-author-body {
        padding: 14px 16px;
    }

    .pres-slide-text {
        font-size: 1.4rem;
    }
    
    .pres-podium-container {
        height: 300px;
        gap: 10px;
    }
    
    .pres-podium-team-name {
        font-size: 0.95rem;
    }
    
    .pres-podium-num {
        font-size: 1.8rem;
    }
}

/* =========================================
   LOCANDINE TAB
   ========================================= */

.locandine-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 12, 8, 0.97);
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.locandine-panel {
    width: 100%;
    max-width: 1100px;
    background: rgba(20, 24, 15, 0.9);
    border: 1px solid rgba(230, 126, 34, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    overflow: hidden;
    animation: inkReveal 0.35s ease both;
}

.locandine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(230, 126, 34, 0.15);
    background: rgba(230, 126, 34, 0.05);
}

.locandine-close-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-main);
    width: 38px; height: 38px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.locandine-close-btn:hover {
    background: rgba(230,126,34,0.25);
    transform: scale(1.1);
}

.locandine-body {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 0;
    min-height: 400px;
}

.locandine-config {
    border-right: 1px solid rgba(255,255,255,0.07);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    max-height: 80vh;
}

.locandine-section {
    /* container per ogni sezione config */
}

.locandine-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e67e22;
    margin-bottom: 14px;
}

/* Type Cards (Inizio / Semifinali / Finali) */
.locandine-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.locandine-type-card {
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.locandine-type-card:hover {
    border-color: rgba(230,126,34,0.5);
    background: rgba(230,126,34,0.07);
    transform: translateY(-2px);
}
.locandine-type-card.active {
    border-color: #e67e22;
    background: rgba(230,126,34,0.12);
    box-shadow: 0 0 0 2px rgba(230,126,34,0.2);
}
.locandine-type-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
    color: #e67e22;
}
.locandine-type-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-main);
}
.locandine-type-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* Download Button */
.locandine-download-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.04em;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 6px 20px rgba(230,126,34,0.35);
}
.locandine-download-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.locandine-download-btn:active {
    transform: translateY(0);
}

/* Preview Panel */
.locandine-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0,0,0,0.25);
}

.locandine-canvas-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.locandine-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: block;
}

.locandine-canvas-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 800px) {
    .locandine-body {
        grid-template-columns: 1fr;
    }
    .locandine-config {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        max-height: none;
    }
    .locandine-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .locandine-preview {
        padding: 20px;
    }
}

/* MUSIC PLAYER POPUP */
#music-player-popup.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

#music-player-popup .music-control-btn:hover {
    color: var(--accent-gold) !important;
}

#music-player-popup .music-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(212,175,55,0.7) !important;
}

#music-player-popup .music-shuffle-btn:hover {
    color: var(--accent-gold) !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MODAL MINIGIOCHI & RESPONSIVE LAYOUTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.minigame-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 5, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.minigame-modal-card {
    background: rgba(15, 18, 10, 0.98);
    border: 1px solid rgba(141, 160, 63, 0.4);
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(141, 160, 63, 0.15);
    max-width: 900px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    margin: auto;
    position: relative;
}

.minigame-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(25, 28, 15, 0.6);
    flex-shrink: 0;
    gap: 12px;
}

.minigame-modal-title {
    font-family: var(--font-heading);
    color: #f5c53c;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 700;
}

.minigame-close-btn {
    width: auto !important;
    flex-shrink: 0;
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f5f5f0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.minigame-close-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.minigame-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* Turn Banner */
.minigame-turn-banner {
    background: rgba(141, 160, 63, 0.15);
    border: 1px solid #8da03f;
    border-radius: 10px;
    padding: 8px 14px;
    text-align: center;
    margin: 12px 20px 0 20px;
    flex-shrink: 0;
}
.minigame-turn-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.minigame-turn-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #f5c53c;
    font-weight: bold;
}

/* Specific Minigame Layouts */
/* Impiccato Grid */
.minigame-impiccato-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    align-items: center;
}

.minigame-gallows-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(141, 160, 63, 0.3);
}

/* Versi Grid */
.minigame-versi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Responsive Media Queries (Mobile & Small Viewports) */
@media (max-width: 768px), (max-height: 650px) {
    .minigame-modal-overlay {
        padding: 8px;
    }
    .minigame-modal-card {
        max-height: 96vh;
        border-radius: 14px;
    }
    .minigame-modal-header {
        padding: 12px 16px;
    }
    .minigame-modal-body {
        padding: 14px 16px;
    }
    .minigame-impiccato-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .minigame-gallows-box {
        max-width: 160px;
        margin: 0 auto;
        padding: 8px;
    }
    .minigame-versi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ==========================================
   MIGLIORIE APP-FRIENDLY E MOBILE
   ========================================== */
@media (max-width: 768px) {
    /* SPAZIO TITOLO: riduce padding-top della view su schermi ridotti per avvicinare alla barra */
    .view {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* Su smartphone non usiamo "card", ma un layout piatto fluido come le app native */
    .glass {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 10px 5px !important;
        margin-bottom: 15px !important;
    }
    
    .bottom-bar .tab-item span {
        text-transform: lowercase !important;
        white-space: nowrap !important;
        font-size: 0.58rem !important;
    }
}

/* Admin navigation bar styling (pulsanti compatti affiancati grandi quanto il testo) */
.admin-main-nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 15px;
    margin-top: 10px;
    margin-bottom: 22px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.admin-main-nav-container .btn,
.admin-tab-btn {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding: 7px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
}

.admin-main-nav-container .btn i,
.admin-tab-btn i {
    font-size: 0.9rem !important;
    margin: 0 !important;
}

.admin-main-nav-container .btn:hover,
.admin-tab-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

@media (max-width: 768px) {
    .admin-main-nav-container {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0 10px;
        margin-top: 6px;
        margin-bottom: 16px;
    }
    
    .admin-main-nav-container .btn,
    .admin-tab-btn {
        padding: 6px 11px !important;
        font-size: 0.78rem !important;
        border-radius: 6px !important;
        gap: 4px !important;
    }
    
    .admin-main-nav-container .btn i,
    .admin-tab-btn i {
        font-size: 0.8rem !important;
    }
}

/* =========================================
   CALENDARIO MENSILE SOCIAL / GOOGLE CALENDAR STYLE
========================================= */
.admin-cal-grid-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
    text-align: center;
}

.admin-cal-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.admin-cal-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.admin-cal-day-cell {
    min-height: 105px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 7px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
}

.admin-cal-day-cell:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.admin-cal-day-cell.other-month {
    opacity: 0.25;
    background: transparent;
}

.admin-cal-day-cell.today {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.08);
}

.admin-cal-day-cell.has-event {
    background: rgba(255, 255, 255, 0.03);
}

.admin-cal-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.admin-cal-day-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.admin-cal-day-cell.today .admin-cal-day-num {
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.25);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 800;
}

.admin-cal-event-pill {
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.admin-cal-event-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

.admin-cal-event-pill.mode-orange {
    background: linear-gradient(135deg, rgba(212, 114, 26, 0.35), rgba(212, 114, 26, 0.55));
    border: 1px solid #d4721a;
    color: #ffd8a8;
}

.admin-cal-event-pill.mode-green {
    background: linear-gradient(135deg, rgba(141, 160, 63, 0.35), rgba(141, 160, 63, 0.55));
    border: 1px solid #8da03f;
    color: #e9fac8;
}

.admin-cal-event-status {
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .admin-cal-day-cell {
        min-height: 70px;
        padding: 3px;
    }
    .admin-cal-event-pill {
        font-size: 0.65rem;
        padding: 3px;
    }
    .admin-cal-weekday {
        font-size: 0.65rem;
        padding: 4px 0;
    }
}

