*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}
.answer-option{
    background:#f8f9fa;
    border:2px solid #e0e0e0;
    border-radius:10px;
    padding:15px;
    cursor:pointer;
    transition:all 0.3s ease;
}
.answer-option:hover{
    background:#e9ecef;
    border-color:#33a0f2;
}
.answer-option.correct{
    background:rgba(40, 167, 69, 0.1);
    border-color:#28a745;
}
.answer-option.incorrect{
    background:rgba(220, 53, 69, 0.1);
    border-color:#dc3545;
}
.answer-option.selected{
    background:rgba(102, 126, 234, 0.1);
    border-color:#33a0f2;
}
.answer-options{
    display:grid;
    gap:15px;
}
.battle-arena{
    background:linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-radius:20px;
    padding:30px;
    color:white;
    text-align:center;
    margin-bottom:30px;
}
.battle-participants{
    display:flex;
    justify-content:space-around;
    align-items:center;
    margin:30px 0;
}
body{
    font-family:"Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height:1.6;
    color:#333;
    background:linear-gradient(135deg, #3bb7fc 0%, #1954d1 100%);
    min-height:100vh;
}
.btn{
    display:inline-block;
    padding:12px 24px;
    border:none;
    border-radius:25px;
    font-size:0.95rem;
    font-weight:500;
    text-decoration:none;
    text-align:center;
    cursor:pointer;
    transition:all 0.3s ease;
    box-shadow:0 4px 15px rgba(0, 0, 0, 0.1);
}
.btn:hover{
    box-shadow:0 6px 20px rgba(0, 0, 0, 0.15);
}
.btn-danger{
    background:#dc3545;
    color:white;
}
.btn-info{
    background:#17a2b8;
    color:white;
}
.btn-primary{
    background:linear-gradient(135deg, #3bb7fc 0%, #1954d1 100%);
    color:white;
}
.btn-secondary{
    background:#6c757d;
    color:white;
}
.btn-small{
    padding:8px 16px;
    font-size:0.85rem;
}
.btn-success{
    background:#28a745;
    color:white;
}
.btn-warning{
    background:#ffc107;
    color:#212529;
}
.btnclass{
    position: absolute;
    top: 18px;
    right: 22px;
}
.class-tabs-container{
    padding: 20px;
}
.class-tabs{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 2px;
}
.class-tab{
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 25px 25px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
    border-bottom: none;
    margin-bottom: -2px;
}
.class-tab:hover{
    background: #e9ecef;
    border-color: #33a0f2;
    color: #33a0f2;
}
.class-tab.active{
    background: white;
    border-color: #33a0f2;
    border-top: 3px solid #33a0f2;
    color: #33a0f2;
    font-weight: 600;
}
.card{
    background: #ffffff;
    border-radius:20px;
    padding:25px;
    margin-bottom:25px;
    box-shadow:0 8px 32px rgba(0, 0, 0, 0.1);
    border:1px solid rgba(0, 0, 0, 0.05);
    transition:all 0.3s ease;
    position: relative;
    z-index: 1;
    transform: translateZ(0);
    will-change: transform;
}
.card:hover{
    box-shadow:0 12px 40px rgba(0, 0, 0, 0.15);
}
.card h2{color: #2a85e3}
.card-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    padding-bottom:15px;
    border-bottom:2px solid #f0f0f0;
    position: relative;
    isolation: isolate;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.card-header.login{
    justify-content: center;
}
.card-title{
    font-size:1.4rem;
    font-weight:600;
    color:#333;
    margin:0;
}
.character-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap:20px;
    margin-top:20px;
}
.character-image{
    width:80px;
    height:80px;
    border-radius:50%;
    margin:0 auto 15px;
    border:3px solid #33a0f2;
    object-fit:cover;
}
.character-name{
    font-weight:500;
    color:#333;
}
.character-option{
    background:rgba(255, 255, 255, 0.9);
    border:2px solid #e0e0e0;
    border-radius:15px;
    padding:20px;
    text-align:center;
    cursor:pointer;
    transition:all 0.3s ease;
}
.character-option:hover,
.character-option.selected{
    border-color:#33a0f2;
    background:rgba(102, 126, 234, 0.1);
}
.character-option img{
    width:60px;
    height:60px;
    border-radius:50%;
    margin-bottom:10px;
}
.confirm-modal{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0, 0, 0, 0.5);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:1002;
}
.confirm-modal-buttons{
    display:flex;
    gap:15px;
    justify-content:center;
    margin-top:20px;
}
.confirm-modal-content{
    background:white;
    border-radius:15px;
    padding:30px;
    max-width:400px;
    text-align:center;
    box-shadow:0 20px 60px rgba(0, 0, 0, 0.3);
}
.container{
    max-width:1200px;
    margin:0 auto;
    padding:20px;
}
.form-control{
    width:100%;
    padding: 10px 24px;
    margin: 0 10px;
    border:2px solid #e0e0e0;
    border-radius:10px;
    font-size:1rem;
    transition:all 0.3s ease;
    background:rgba(255, 255, 255, 0.9);
}
.form-control:focus{
    outline:none;
    border-color:#33a0f2;
    box-shadow:0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-control.invalid{
    border-color:#dc3545;
    box-shadow:0 0 0 3px rgba(220, 53, 69, 0.1);
}
.form-group{
    margin-bottom:20px;
}
.form-label{
    display:block;
    margin-bottom:8px;
    font-weight:500;
    color:#555;
}
.grid{
    display:grid;
    gap:25px;
}
.grid-2{
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-3{
    grid-template-columns: repeat(auto-fill, minmax(250px, 350px));
    justify-content: center;
}
.grid-4{
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
h1{
    color: #fff;
    margin-bottom: 12px;
    font-size: 28px;
}
h2{
    font-size: 18px;
    color: #d2caf9;
    margin-bottom: 30px;
}
.header{
    background:rgba(255, 255, 255, 0.95);
    backdrop-filter:blur(10px);
    box-shadow:0 2px 20px rgba(0, 0, 0, 0.1);
    padding:15px 0;
    border-bottom:1px solid #6e7ee3;
}
.header-content{
    display:flex;
    justify-content:space-between;
    align-items:center;
    max-width:1200px;
    margin:0 auto;
    padding:0 20px;
}
.icon-card{
    font-size: 4rem;
    margin-bottom: 20px;
    color: #33a0f2;
}
.input-error{
    color:#dc3545;
    font-size:0.85rem;
    margin-top:5px;
}
.loading-indicator{
    position:fixed;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%);
    z-index:1001;
    background:rgba(255, 255, 255, 0.9);
    border-radius:15px;
    padding:30px;
    box-shadow:0 8px 32px rgba(0, 0, 0, 0.1);
}
.loading-spinner{
    width:40px;
    height:40px;
    border:3px solid #f3f3f3;
    border-top:3px solid #33a0f2;
    border-radius:50%;
    animation:spin 1s linear infinite;
    margin:0 auto;
}
.logo{
    display:flex;
    align-items:center;
    text-decoration:none;
}
.logo img{
    height: 80px;
    width: auto;
    margin-left: 5px;
}
.login-logo{
    max-width:220px;
    width:100%;
    height:auto;
    margin:0 auto 10px;
}
.logout-btn{
    background:#ff6b6b;
    color:white;
    border:none;
    padding:8px 16px;
    border-radius:20px;
    text-decoration:none;
    font-size:0.9rem;
    transition:all 0.3s ease;
}
.logout-btn:hover{
    background:#ff5252;
}
.nav{
    background:rgba(255, 255, 255, 0.9);
    padding:30px 20px;
    margin-bottom:30px;
    box-shadow:0 4px 20px rgba(0, 0, 0, 0.1);
}
.nav-link{
    color:#33a0f2;
    text-decoration:none;
    padding:12px 24px;
    border-radius:25px;
    font-weight:500;
    transition:all 0.3s ease;
    border:2px solid transparent;
}
.nav-link:hover,
.nav-link.active{
    background:#33a0f2;
    color:white;
    box-shadow:0 4px 15px rgba(102, 126, 234, 0.3);
}
.nav-links{
    display:flex;
    gap:20px;
    list-style:none;
    justify-content:center;
    flex-wrap:wrap;
}
.notification{
    background:white;
    border-radius:10px;
    padding:15px 20px;
    margin-bottom:10px;
    box-shadow:0 4px 20px rgba(0, 0, 0, 0.1);
    display:flex;
    justify-content:space-between;
    align-items:center;
    animation:slideIn 0.3s ease;
}
.notification-close{
    background:none;
    border:none;
    font-size:1.2rem;
    cursor:pointer;
    color:#666;
    padding:0;
    margin-left:15px;
}
.notification-error{
    border-left:4px solid #dc3545;
}
.notification-info{
    border-left:4px solid #17a2b8;
}
.notification-success{
    border-left:4px solid #28a745;
}
.notification-warning{
    border-left:4px solid #ffc107;
}
.notifications-container{
    position:fixed;
    top:20px;
    right:20px;
    z-index:1000;
    max-width:400px;
}
p{
    margin-bottom: 10px;
}
.participant{
    text-align:center;
}
.participant-image{
    width:100px;
    height:100px;
    border-radius:50%;
    border:4px solid white;
    margin-bottom:15px;
}
.participant-name{
    font-size:1.2rem;
    font-weight:600;
}
.question-card{
    background:rgba(255, 255, 255, 0.95);
    border-radius:15px;
    padding:25px;
    margin-bottom:20px;
}
.question-text{
    font-size:1.2rem;
    font-weight:500;
    margin-bottom:20px;
    color:#333;
}
.stat-card{
    background:rgba(255, 255, 255, 0.9);
    border-radius:15px;
    padding:20px;
    text-align:center;
    border-left:4px solid #33a0f2;
    margin-bottom:25px;
}
.stat-label{
    color:#666;
    font-size:0.9rem;
}
.stat-number{
    font-size:2.5rem;
    font-weight:bold;
    color:#33a0f2;
    margin-bottom:5px;
}
.student-actions{
    display:flex;
    gap:10px;
    justify-content:center;
    flex-wrap:wrap;
}
.student-card{
    background:rgba(255, 255, 255, 0.95);
    border-radius:15px;
    padding:20px;
    text-align:center;
    transition:all 0.3s ease;
    border:2px solid transparent;
    position:relative;
    overflow:hidden;
    max-width: 258px;
}
.student-card:hover{
    border-color:#33a0f2;
    box-shadow:0 8px 30px rgba(102, 126, 234, 0.2);
}
.student-card.score-updated{
    animation:scoreUpdate 2s ease;
}
.student-level{
    font-size:0.9rem;
    color:#666;
    margin-bottom:15px;
}
.student-name{
    font-size:1.1rem;
    font-weight:600;
    margin-bottom:10px;
    color:#333;
}
.student-score{
    font-size:1.2rem;
    font-weight:bold;
    color:#33a0f2;
    margin-bottom:5px;
}
.user-info{
    display:flex;
    align-items:center;
    gap:15px;
}
.user-name{
    font-weight:600;
    color:#333;
}
.vs-text{
    font-size:2rem;
    font-weight:bold;
    color:#ffd700;
}
@keyframes scoreUpdate{
    0%{
        background:rgba(40, 167, 69, 0.1);
    }
    100%{
        background:rgba(255, 255, 255, 0.95);
    }
}
@keyframes slideIn{
    from{
        transform:translateX(100%);
        opacity:0;
    }
    to{
        transform:translateX(0);
        opacity:1;
    }
}
@keyframes spin{
    0%{
        transform:rotate(0deg);
    }
    100%{
        transform:rotate(360deg);
    }
}
@media (max-width:768px){
    .container{
        padding:15px;
    }
    .header-content{
        flex-direction:column;
        gap:15px;
        text-align:center;
    }
    .nav-links{
        flex-direction:column;
        gap:10px;
    }
    .battle-participants{
        flex-direction:column;
        gap:20px;
    }
    .vs-text{
        order:2;
        font-size:1.5rem;
    }
    .student-actions{
        flex-direction:column;
    }
    .notifications-container{
        left:10px;
        right:10px;
        max-width:none;
    }
}
@media (max-width:480px){
    .card{
        padding:20px;
    }
    .btn{
        padding:10px 20px;
        font-size:0.9rem;
    }
    .grid-2,
    .grid-3,
    .grid-4{
        grid-template-columns: 1fr;
    }
}

/* Character Selection Cards per modal studenti */
.character-selection-card {
    background: white;
    border: 4px solid #e0e0e0;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.character-selection-card:hover {
    border-color: #33a0f2;
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.character-selection-card.selected {
    border-color: #33a0f2;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}
.sex-toggle-btn{
    background: transparent;
    color: #666;
    box-shadow: none;
    transition: all 0.3s ease;
}
.sex-toggle-btn.active{
    background: #33a0f2;
    color: white;
    box-shadow: 0 2px 8px rgba(51, 160, 242, 0.3);
}
.character-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3) !important;
    border-color: #667eea !important;
}

.character-thumbnail.active {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.05);
}

#character-showcase {
    animation: fadeIn 0.5s ease-in;
    background:linear-gradient(135deg, #3bb7fc 0%, #1954d1 100%);
    padding: 40px;
    border-radius: 20px;
    margin: 20px;
    min-height: 400px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
#character-showcase h2{color:#fff!important}

/* Modal per le domande dei test */
#question-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#question-modal > div {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 95%;
    max-height: 94vh;
    overflow-y: auto;
}

#question-modal h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

#question-modal h4 {
    color: #33a0f2;
    margin-bottom: 15px;
}

/* Opzioni per domande multiple e vero/falso */
#multiple-choice-options,
#true-false-options {
    margin-bottom: 20px;
}

/* Card delle domande nella lista */
.question-card {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #33a0f2;
}

.question-card h4 {
    color: #33a0f2;
    margin-bottom: 10px;
}

.question-card .question-type-badge {
    background: #17a2b8;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.question-card .question-type-badge.true-false {
    background: #28a745;
}

.question-card .points-info {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
}

.question-card .points-info .correct {
    color: #28a745;
}

.question-card .points-info .wrong {
    color: #dc3545;
}

/* Opzioni di risposta nelle domande */
.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.question-option {
    padding: 10px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.question-option.correct {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

.question-option .check-icon {
    color: #28a745;
    margin-left: 5px;
}

/* Stili per la pagina test detail */
.test-description {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.test-meta {
    margin: 5px 0;
    color: #666;
}

.questions-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

.questions-empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #33a0f2;
}

.questions-empty h4 {
    margin-bottom: 10px;
}

.questions-empty p {
    margin-bottom: 15px;
}

.questions-list {
    /* Nessun limite di altezza - si espande completamente */
}

.question-item {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.question-header strong {
    color: #333;
}

.question-points-badge {
    background: #33a0f2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.question-text {
    margin: 0 0 10px 0;
    font-weight: 500;
}

.question-type-info {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.question-type-label {
    font-size: 0.9rem;
    color: #666;
}

.question-answer-options {
    font-size: 0.9rem;
    color: #666;
}

.question-correct-answer {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #28a745;
}

.test-actions-grid {
    display: grid;
    gap: 15px;
}

.test-warning {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
}

.test-info {
    padding: 15px;
    background: #d1ecf1;
    border-radius: 8px;
    color: #0c5460;
}

.test-results-section {
    margin-top: 20px;
}

.test-results-list {
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.result-student-name {
    font-weight: bold;
}

.result-character {
    font-size: 0.8rem;
    color: #666;
}

.result-score {
    text-align: right;
}

.result-percentage {
    font-size: 0.8rem;
}

/* Modal domande - contenuto form */
#question-modal .form-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

#question-modal .form-points-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

#question-modal .form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.points-positive {
    color: #28a745;
}

.points-negative {
    color: #dc3545;
}

/* Fix per elementi fantasma durante scroll */
body * {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.modal-content:empty,
.modal-overlay:not(.active) .modal-content {
    display: none !important;
}

/* Fix overflow e elementi larghi */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Previene elementi invisibili ma presenti */
[style*="visibility: hidden"],
[style*="opacity: 0"] {
    pointer-events: none !important;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Previene interazioni accidentali */
}

.modal-overlay.active {
    display: flex;
    pointer-events: auto; /* Riabilita interazioni solo quando attivo */
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
    opacity: 1; /* Visibile solo quando il modal è attivo */
}

.modal-content > h3 {
    padding: 30px 30px 20px 30px;
    margin: 0;
}

.modal-content form {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 30px 30px 30px;
    flex: 1;
}

/* Scrollbar personalizzata più sottile */
.modal-content form::-webkit-scrollbar {
    width: 6px;
}

.modal-content form::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.modal-content form::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.modal-content form::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    border-radius: 0 0 15px 15px;
}

/* Campo disabilitato per la classe */
.field-readonly {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 5px;
    color: #495057;
}

.field-hint {
    color: #666;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Boss Selector Styles */
#boss-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.boss-card {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    background: white;
}

.boss-card:hover {
    border-color: #90a4ae;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.boss-card.selected {
    border-color: #33a0f2;
    background-color: #f0f4ff;
}

.boss-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    border: 3px solid #d51313;
}

.boss-card-name {
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Boss Info Icons */
.boss-info-icon {
    color: #33a0f2;
    cursor: help;
}

.boss-health-icon {
    color: #17a2b8;
    cursor: help;
}

/* Alert Info Box */
.alert-info {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
}

.alert-info strong {
    display: block;
    margin-bottom: 5px;
}

.alert-info small {
    display: block;
    line-height: 1.5;
}

/* Battle System Styles */
.battle-container {
    padding: 20px;
    background: linear-gradient(135deg, #33a0f2 0%, #764ba2 100%);
    min-height: 100vh;
}

.battle-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.battle-header h2 {
    margin: 0;
    font-size: 2rem;
}

.question-counter {
    margin-top: 10px;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Arena di battaglia */
.battle-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
}

.fighter-side {
    flex: 1;
    text-align: center;
    position: relative;
}

.fighter-info h3 {
    color: #333;
    margin-bottom: 20px;
}

.fighter-avatar-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    position: relative;
}

.fighter-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid #ddd;
    background: white;
    transition: transform 0.3s;
}

.boss-avatar {
    border-color: #dc3545;
}

/* Barre di vita/punti */
.health-bar-container {
    width: 200px;
    margin: 0 auto;
}

.health-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.health-fill {
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
}

.student-bar .health-fill {
    background: linear-gradient(90deg, #4fc3f7, #29b6f6);
}

.boss-bar .health-fill {
    background: linear-gradient(90deg, #ef5350, #e53935);
}

.health-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #555;
}

/* VS Divider */
.vs-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.vs-text {
    font-size: 3rem;
    font-weight: bold;
    color: #ffc107;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    animation: vsAppear 1s forwards;
}

@keyframes vsAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Area domande */
.question-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.question-card {
    max-width: 800px;
    margin: 0 auto;
}

.question-text {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.3rem;
}

.answer-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-btn {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1rem;
}

.answer-btn:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.answer-btn.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.answer-btn.correct {
    background: #c8e6c9;
    border-color: #4caf50;
    animation: correctPulse 0.5s;
}

.answer-btn.wrong {
    background: #ffcdd2;
    border-color: #f44336;
    animation: wrongShake 0.5s;
}

.answer-btn.show-correct {
    background: #fff9c4;
    border-color: #ffc107;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.option-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #33a0f2;
    color: white;
    text-align: center;
    line-height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.true-false {
    grid-template-columns: 1fr 1fr;
}

.tf-btn {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.question-actions {
    text-align: center;
}

/* Animazioni battaglia */
.attack-animation {
    animation: attackMove 0.5s;
}

@keyframes attackMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(30px) scale(1.1); }
}

.hit-animation {
    animation: hitReaction 0.5s;
}

@keyframes hitReaction {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.heal-animation {
    animation: healGlow 1s;
}

@keyframes healGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3) hue-rotate(60deg); }
}

.shake {
    animation: screenShake 0.5s;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Testo fluttuante */
.floating-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 2s forwards;
    z-index: 100;
    left: 50%;
    top: 50%;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
}

.floating-text.gain {
    color: #4caf50;
}

.floating-text.loss {
    color: #f44336;
}

.floating-text.damage {
    color: #ff5722;
}

.floating-text.heal {
    color: #8bc34a;
}

/* Particelle di cura */
.heal-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #8bc34a;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 1s forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Risultati battaglia */
.battle-complete {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.result-message {
    margin-bottom: 30px;
}

.result-message h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.result-message.victory {
    color: #4caf50;
}

.result-message.defeat {
    color: #f44336;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.battle-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* Animazioni vittoria/sconfitta */
.victory-animation {
    animation: victoryJump 1s infinite;
}

@keyframes victoryJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px) rotate(360deg); }
}

.defeat-animation {
    animation: defeatFall 1s forwards;
    opacity: 0.5;
}

@keyframes defeatFall {
    0% { transform: rotate(0); }
    100% { transform: rotate(-90deg); }
}

/* Selezione studente */
.student-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.student-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.student-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: #33a0f2;
}

.student-card.completed {
    opacity: 0.6;
    background: #f0f0f0;
    cursor: not-allowed;
    position: relative;
}

.student-card.completed:hover {
    transform: none;
    border-color: #e0e0e0;
}

.completed-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Stili per la tabella risultati battaglie */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-primary {
    background: #33a0f2;
    color: white;
}

.badge-success {
    background: #48bb78;
    color: white;
}

.badge-danger {
    background: #f56565;
    color: white;
}

.badge-warning {
    background: #ed8936;
    color: white;
}

.text-success {
    color: #48bb78;
    font-weight: 600;
}

.text-danger {
    color: #f56565;
    font-weight: 600;
}

.student-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* Selezione multipla studenti per battaglia di gruppo */
.student-card.selectable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.student-card.selectable:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.student-card.selectable .selection-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.student-card.selectable .selection-check i {
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
}

.student-card.selectable.selected {
    border-color: #48bb78;
    background: #f0fdf4;
}

.student-card.selectable.selected .selection-check {
    background: #48bb78;
    border-color: #48bb78;
}

.student-card.selectable.selected .selection-check i {
    opacity: 1;
}

/* Battaglia di gruppo - Turni */
.current-player-banner {
    background: linear-gradient(135deg, #33a0f2 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
}

.current-player-banner h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    opacity: 0.9;
}

.current-player-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.current-player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.current-player-name {
    font-size: 2rem;
    font-weight: bold;
}

/* Lista studenti in attesa */
.waiting-students {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 15px;
    margin-top: 30px;
}

.waiting-students h4 {
    margin: 0 0 15px 0;
    color: #666;
}

.waiting-students-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.waiting-student {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid #e0e0e0;
}

.waiting-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

/* Overlay cambio turno */
.turn-change-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.turn-change-message {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    animation: slideUp 0.5s;
}

.turn-change-message h2 {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 1.5rem;
}

.turn-change-message h1 {
    margin: 0 0 30px 0;
    color: #33a0f2;
    font-size: 3rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.student-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.character-name {
    color: #33a0f2;
    font-size: 0.9rem;
}

.character-level {
    color: #999;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Group Battle Finale Styles */
.group-battle-finale {
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.finale-header {
    text-align: center;
    margin-bottom: 30px;
}

.finale-header h1 {
    color: #ff6b6b;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.boss-finale-info {
    display: inline-block;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.boss-finale-info img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.boss-finale-info img.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.boss-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 10px;
}

.boss-health-bar {
    width: 300px;
    height: 30px;
    background: #333;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bossHealthText {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.finale-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.question-display {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.question-text h3 {
    color: #007bff;
    margin-bottom: 15px;
}

.question-text p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.answer-option {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s;
}

.answer-option.correct {
    background: #d4edda;
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.answer-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

.students-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.correct-students, .wrong-students {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.correct-students h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.wrong-students h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

.students-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.student-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-result-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.student-result-card .student-name {
    font-size: 0.9em;
    font-weight: bold;
}

.student-result-card .points {
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 3px;
}

.correct-students .points {
    color: #28a745;
}

.wrong-students .points {
    color: #dc3545;
}

.finale-footer {
    margin-top: 30px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0;
    transition: width 0.3s ease;
}

.finale-controls button {
    margin: 0 10px;
}

/* Final Results Modal */
.final-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.final-results-modal .modal-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#resultTitle {
    font-size: 3em;
    margin-bottom: 30px;
    font-weight: bold;
}

#resultTitle.victory {
    color: #28a745;
    text-shadow: 2px 2px 4px rgba(40, 167, 69, 0.3);
}

#resultTitle.defeat {
    color: #dc3545;
    text-shadow: 2px 2px 4px rgba(220, 53, 69, 0.3);
}

.boss-final-state {
    margin-bottom: 30px;
}

#finalBossImage {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.5s;
}

#finalBossImage.defeated {
    filter: grayscale(100%);
    opacity: 0.5;
}

.final-health {
    font-size: 1.2em;
    font-weight: bold;
    color: #666;
}

.students-final-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.student-score-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.student-score-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.student-info .student-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.student-score {
    font-size: 1.1em;
    font-weight: bold;
    color: #666;
}

.student-score.positive {
    color: #28a745;
}

.student-score.negative {
    color: #dc3545;
}

/* Group Battle Turn Styles */
.group-battle-turn {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.students-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.student-turn-card {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    opacity: 0.6;
    transition: all 0.3s;
    position: relative;
}

.student-turn-card.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
    border: 2px solid #007bff;
}

.student-turn-card.completed {
    background: #d4edda;
    opacity: 1;
}

.student-turn-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.student-turn-card .student-name {
    font-size: 0.9em;
    font-weight: bold;
}

.check-mark {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
}

.current-turn-banner {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #33a0f2 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.current-turn-banner h2 {
    margin: 0 0 10px 0;
}

.current-turn-banner p {
    margin: 0;
    opacity: 0.9;
}

.question-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.question-card h3 {
    font-size: 1.3em;
    margin-bottom: 25px;
    color: #333;
}

.answer-options {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.answer-options.true-false {
    grid-template-columns: 1fr 1fr;
}

.answer-btn {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1em;
}

.answer-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.answer-btn.selected {
    background: #cfe2ff;
    border-color: #007bff;
}

.option-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

.tf-btn {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
}

.question-actions {
    text-align: center;
}

/* Group Battle Styles */
.group-battle-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.battle-finale {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #33a0f2 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.finale-content {
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 20px;
}

.finale-title {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.student-finale-card {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease;
}

.student-finale-card:hover {
    transform: translateY(-5px);
}

.student-finale-card.winner {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255,215,0,0.5); }
    50% { box-shadow: 0 0 40px rgba(255,215,0,0.8); }
}

.student-finale-card.loser {
    background: rgba(150, 150, 150, 0.3);
    opacity: 0.8;
}

.student-finale-name {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: bold;
}

.student-finale-score {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.score-positive {
    color: #4ade80;
}

.score-negative {
    color: #f87171;
}

.score-zero {
    color: #fbbf24;
}

.finale-boss-health {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.boss-health-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.boss-health-value {
    font-size: 2.5em;
    font-weight: bold;
}

.boss-defeated {
    color: #4ade80;
}

.boss-alive {
    color: #f87171;
}

.finale-message {
    font-size: 1.5em;
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.victory-complete {
    color: #4ade80;
    font-weight: bold;
}

.victory-partial {
    color: #fbbf24;
}

.defeat {
    color: #f87171;
}

.continue-button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 1.2em;
    background: white;
    color: #764ba2;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.continue-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.student-turn-indicator {
    background: #4ade80;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.waiting-message {
    background: #fbbf24;
    color: #333;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.1em;
}

.students-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.student-status-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.student-status-card.active {
    border-color: #4ade80;
    background: #f0fdf4;
    transform: scale(1.05);
}

.student-status-card.completed {
    opacity: 0.6;
    background: #f3f4f6;
}

.student-score-display {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 5px;
}

.boss-health-section {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
}

.boss-health-bar {
    background: rgba(255,255,255,0.2);
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.boss-health-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    height: 100%;
    transition: width 1s ease-in-out;
}

.battle-damage {
    position: fixed;
    font-size: 3em;
    font-weight: bold;
    pointer-events: none;
    z-index: 10000;
    animation: damageFloat 2s ease-out forwards;
}

@keyframes damageFloat {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.damage-dealt {
    color: #ef4444;
}

.damage-healed {
    color: #22c55e;
}

/* Additional Group Battle Styles */
.students-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.student-battle-card {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
}

.student-battle-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.student-name {
    font-weight: bold;
    font-size: 0.9em;
}

.student-score {
    color: #007bff;
    font-weight: bold;
    margin-top: 5px;
}

.boss-score {
    color: #666;
    font-size: 0.85em;
    margin-top: 3px;
}

.score-change {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    display: none;
    animation: bounce 0.5s;
}

.score-change.positive {
    background: #28a745;
    color: white;
}

.score-change.negative {
    background: #dc3545;
    color: white;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.student-battle-card.correct-answer {
    background: #d4edda;
    transform: scale(1.1);
}

.student-battle-card.wrong-answer {
    background: #f8d7da;
    transform: scale(0.9);
}

.battle-main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 300px;
}

.question-display {
    text-align: center;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.3em;
    margin: 20px 0;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.answer-option {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s;
}

.answer-option.correct {
    background: #d4edda;
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
    animation: pulse 1s;
}

.answer-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 10px;
    font-weight: bold;
}

.battle-controls {
    text-align: center;
    margin: 20px 0;
    background-color: #fff;
    padding: 20px;
    border-radius: 20px;
}

.progress-info {
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #666;
}

.boss-info-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-align: center;
}

.boss-info-panel img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.boss-name {
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 10px;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bossHealthText {
    color: white;
    font-size: 0.8em;
    font-weight: bold;
}

.final-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-results-modal .modal-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    text-align: center;
}

.victory-title {
    color: #28a745;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.partial-victory-title {
    color: #ffc107;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.defeat-title {
    color: #dc3545;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.final-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    overflow: auto;
}

.final-score-card {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.final-score-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.final-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #007bff;
    margin: 5px 0;
}

.final-boss-score {
    font-size: 0.95em;
    font-weight: bold;
    margin: 5px 0;
}

.final-result {
    margin-top: 10px;
    font-size: 0.9em;
}

.final-result.victory {
    color: #28a745;
    font-weight: bold;
}

.final-result.defeat {
    color: #dc3545;
}
@media (max-width: 768px){
    #character-showcase > div {
        flex-direction: column;
        text-align: center;
    }

    #showcase-image {
        margin: 0 auto;
    }
}