* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.header-text {
    text-align: center;
    flex: 1;
    min-width: 300px;
}

.header-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 300;
}

.date {
    font-size: 1.1em;
    opacity: 0.9;
}

.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    position: relative;
}

.login-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
}

.login-status-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #dc3545;
}

.logout-btn {
    padding: 8px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.scoreboard {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.team {
    flex: 1;
    text-align: center;
}

.team h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.score-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat .label {
    font-weight: 600;
    color: #666;
}

.stat .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.vs {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin: 0 30px;
}

.winner-display {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
}

.winner-display.victory {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #2d5016;
}

.winner-display.tie {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #6c5ce7;
}

.matches-summary {
    margin-top: 30px;
}

.matches-summary h3 {
    margin-bottom: 15px;
    color: #333;
}

.match-card {
    background: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.match-card.completed {
    border-left-color: #28a745;
}

.match-card h4 {
    margin-bottom: 10px;
    color: #333;
}

.match-result {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
}

.match-form {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.match-form h4 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.3em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.deadline-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #856404;
}

.quote-info {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.quote-info h4 {
    margin-bottom: 10px;
    color: #333;
}

.quote-info ul {
    list-style-position: inside;
    line-height: 1.8;
}

.price-hidden {
    display: none;
}

#prenotazione-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.prenotazioni-list h4 {
    margin-bottom: 15px;
    color: #333;
}

.prenotazione-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prenotazione-item .info {
    flex: 1;
}

.prenotazione-item .delete-btn {
    padding: 5px 15px;
    background: #dc3545;
    font-size: 0.9em;
}

.statistiche-box {
    background: linear-gradient(135deg, #e7f3ff 0%, #d0e7ff 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #667eea;
}

.statistica-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.stat-label {
    color: #333;
}

.stat-value {
    color: #667eea;
    font-size: 1.2em;
}

.statistica-dettaglio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.dettaglio-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    border-left: 3px solid #667eea;
}

.dettaglio-item span:last-child {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.totals {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.total-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1.1em;
    border-bottom: 1px solid #ddd;
}

.total-item:last-child {
    border-bottom: none;
}

.total-grande {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #667eea;
}

.regolamento-content {
    line-height: 1.8;
}

.regolamento-content h4 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.regolamento-content p {
    margin-bottom: 15px;
}

.regolamento-content ul,
.regolamento-content ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

.regolamento-content li {
    margin-bottom: 8px;
}

.reset-btn {
    padding: 12px 25px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    background: #c82333;
}

.reset-btn:active {
    transform: translateY(0);
}

/* Login Modal */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.password-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 20px;
    text-align: center;
}

.password-input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.cancel-btn {
    padding: 12px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.cancel-btn:hover {
    background: #5a6268;
}

.login-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-message {
    color: #dc3545;
    margin-top: 15px;
    font-size: 0.9em;
    min-height: 20px;
}

.locked-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.lock-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.locked-message h3 {
    color: #333;
    margin-bottom: 10px;
}

.locked-message p {
    color: #666;
    margin-bottom: 20px;
}

.login-prompt-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-prompt-btn:hover {
    transform: translateY(-2px);
}

.download-pdf-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.download-pdf-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.download-pdf-btn:active {
    transform: translateY(0);
}

/* Responsive per smartphone - CARATTERI MOLTO PIU PICCOLI */
@media (max-width: 768px) {
    body {
        padding: 5px;
        font-size: 11px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 10px 15px;
    }
    
    header h1 {
        font-size: 1.3em;
        margin-bottom: 5px;
    }
    
    header h2 {
        font-size: 1em;
        margin-bottom: 5px;
    }
    
    .date {
        font-size: 0.75em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-image {
        max-width: 100px;
        max-height: 100px;
    }
    
    .download-pdf-btn {
        padding: 6px 12px;
        margin-top: 8px;
        font-size: 0.7em;
    }
    
    .scoreboard {
        flex-direction: column;
        padding: 10px;
        margin: 10px 0;
    }
    
    .team h3 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .score-display {
        gap: 8px;
    }
    
    .stat {
        padding: 8px;
        font-size: 0.75em;
    }
    
    .stat .label {
        font-size: 0.85em;
    }
    
    .stat .value {
        font-size: 1em;
    }
    
    .vs {
        margin: 10px 0;
        font-size: 1.5em;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        font-size: 0.65em;
        padding: 8px 5px;
    }
    
    .login-status {
        padding: 0 8px;
    }
    
    .login-status-text {
        font-size: 0.65em;
    }
    
    .logout-btn {
        padding: 4px 8px;
        font-size: 0.65em;
    }
    
    .tab-content {
        padding: 10px;
    }
    
    .tab-content h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .tab-content h4 {
        font-size: 0.85em;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .form-group {
        font-size: 0.8em;
    }
    
    .form-group label {
        margin-bottom: 3px;
        font-size: 0.85em;
    }
    
    .form-group input,
    .form-group select {
        padding: 6px;
        font-size: 0.8em;
    }
    
    button {
        padding: 8px 15px;
        font-size: 0.8em;
    }
    
    .match-card {
        padding: 8px;
        margin: 6px 0;
        font-size: 0.8em;
    }
    
    .match-card h4 {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    
    .match-result {
        font-size: 0.8em;
    }
    
    .match-form {
        padding: 12px;
        margin: 12px 0;
    }
    
    .match-form h4 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .prenotazione-item {
        padding: 8px;
        font-size: 0.75em;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .prenotazione-item .info {
        width: 100%;
        font-size: 0.85em;
    }
    
    .prenotazione-item .delete-btn {
        padding: 4px 10px;
        font-size: 0.75em;
    }
    
    .statistiche-box {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .statistica-item {
        padding: 8px;
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    
    .stat-label {
        font-size: 0.85em;
    }
    
    .stat-value {
        font-size: 0.9em;
    }
    
    .statistica-dettaglio {
        gap: 6px;
        margin-top: 10px;
    }
    
    .dettaglio-item {
        padding: 6px;
        font-size: 0.75em;
    }
    
    .dettaglio-item span:last-child {
        font-size: 0.9em;
    }
    
    .totals {
        padding: 10px;
        margin-top: 15px;
    }
    
    .total-item {
        font-size: 0.8em;
        padding: 6px 0;
    }
    
    .total-grande {
        font-size: 0.9em;
        padding-top: 10px;
    }
    
    .regolamento-content {
        font-size: 0.75em;
        line-height: 1.5;
    }
    
    .regolamento-content h4 {
        font-size: 0.9em;
        margin-top: 12px;
        margin-bottom: 6px;
    }
    
    .regolamento-content p {
        margin-bottom: 10px;
        font-size: 0.8em;
    }
    
    .regolamento-content ul,
    .regolamento-content ol {
        margin-left: 20px;
        margin-bottom: 10px;
        font-size: 0.8em;
    }
    
    .regolamento-content li {
        margin-bottom: 5px;
    }
    
    .quote-info {
        padding: 10px;
        margin-bottom: 15px;
        font-size: 0.8em;
    }
    
    .quote-info h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
    
    .quote-info ul {
        line-height: 1.5;
        font-size: 0.8em;
    }
    
    .deadline-warning {
        padding: 8px;
        margin-bottom: 15px;
        font-size: 0.75em;
    }
    
    .winner-display {
        padding: 10px;
        margin: 10px 0;
        font-size: 0.85em;
    }
    
    .matches-summary {
        margin-top: 15px;
    }
    
    .matches-summary h3 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    #prenotazione-form {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .prenotazioni-list h4 {
        font-size: 0.9em;
        margin-bottom: 10px;
    }
    
    .modal-content {
        padding: 20px 15px;
        max-width: 95%;
    }
    
    .modal-content h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .modal-content p {
        font-size: 0.8em;
        margin-bottom: 15px;
    }
    
    .password-input {
        padding: 8px;
        font-size: 0.8em;
        margin-bottom: 15px;
    }
    
    .login-btn,
    .cancel-btn {
        padding: 8px 15px;
        font-size: 0.8em;
    }
    
    .locked-message {
        padding: 30px 10px;
    }
    
    .lock-icon {
        font-size: 2.5em;
        margin-bottom: 15px;
    }
    
    .locked-message h3 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .locked-message p {
        font-size: 0.8em;
        margin-bottom: 15px;
    }
    
    .login-prompt-btn {
        padding: 8px 20px;
        font-size: 0.8em;
    }
    
    .reset-btn {
        padding: 6px 12px;
        font-size: 0.75em;
    }
}
