/* Estilos Gerais */
* {
    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;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Tela de Boas-vindas */
.welcome-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

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

/* Tela de Configuração */
.setup-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.team-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
    height: 100%;
    transition: transform 0.3s ease;
}

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

.team-card h3 {
    margin-bottom: 1rem;
    font-weight: bold;
}

.team-card input {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    color: #333;
}

.team-card input::placeholder {
    color: #666;
}

/* Tela do Jogo */
.game-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.team-score {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.team-score h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.score-display {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.5rem;
}

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

.score-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.game-info {
    text-align: center;
    color: white;
}

.game-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level-info {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.round-info {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: inline-block;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.audio-controls {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-audio {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.btn-audio:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.btn-audio.muted {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.3);
}

.btn-exit {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    margin-left: 10px;
}

.btn-exit:hover {
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.6);
    transform: scale(1.1);
}

.btn-audio.muted:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
}

.timer.warning {
    background: rgba(255, 87, 34, 0.8);
    animation: pulse 1s infinite;
}

.timer.danger {
    background: rgba(244, 67, 54, 0.9);
    animation: pulse 0.5s infinite;
}

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

.game-content {
    padding: 2rem 0;
}

.question-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: slideIn 0.5s ease;
}

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

.question-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.question-options {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.option-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.option-btn.correct {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    animation: correctAnswer 0.6s ease;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    animation: incorrectAnswer 0.6s ease;
}

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

@keyframes incorrectAnswer {
    0%, 25%, 50%, 75%, 100% { transform: translateX(0); }
    12.5%, 37.5%, 62.5%, 87.5% { transform: translateX(-5px); }
}

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

/* Tela de Resultados */
.results-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

.trophy-container {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.final-scores {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
}

.final-team-score {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    min-width: 200px;
}

.final-team-score h3 {
    margin-bottom: 1rem;
    font-weight: bold;
}

.final-score-display {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
}

.final-score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    display: block;
}

.final-score-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.vs-separator {
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.winner-announcement h3 {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsividade */
@media (max-width: 768px) {
    .welcome-card, .setup-card, .results-card {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .game-header .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .final-scores {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs-separator {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Animações adicionais */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* Botões personalizados */
.btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Efeitos de hover */
.team-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.question-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: levelUpPulse 0.6s ease;
    text-align: center;
    min-width: 300px;
}

.level-up-content {
    position: relative;
}

.level-up-content h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.level-up-content p {
    font-size: 1.1rem;
    margin: 0;
}

@keyframes levelUpPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Tela de Ranking */
.ranking-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

.ranking-header {
    position: relative;
}

.ranking-header i {
    animation: crownShine 2s infinite;
}

@keyframes crownShine {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

.ranking-filters {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
}

.ranking-filters .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    color: #333;
    font-weight: 600;
}

.ranking-stats {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.ranking-stats .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.ranking-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.ranking-item {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.ranking-item.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.ranking-item.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.ranking-item.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e4a853 100%);
    color: white;
}

.ranking-position {
    font-size: 2rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    margin-right: 1rem;
}

.ranking-position.gold {
    color: #b8860b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ranking-position.silver {
    color: #808080;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ranking-position.bronze {
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ranking-team-info {
    flex: 1;
}

.ranking-team-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.ranking-team-members {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.ranking-team-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.ranking-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ranking-score {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

.ranking-score.gold {
    color: #b8860b;
}

.ranking-score.silver {
    color: #808080;
}

.ranking-score.bronze {
    color: #8b4513;
}

.ranking-medal {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.5rem;
}

.ranking-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.ranking-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Scrollbar personalizada */
.ranking-list::-webkit-scrollbar {
    width: 8px;
}

.ranking-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.ranking-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Footer */
.game-footer {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-text:hover {
    opacity: 1;
}

.footer-link {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.footer-link:hover {
    color: #ffed4e;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

.game-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Tela de Seleção de Curso */
.course-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

.course-header {
    position: relative;
}

.course-header i {
    animation: float 3s ease-in-out infinite;
}

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

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.course-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.course-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

.course-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.course-item:hover::before {
    animation: courseShine 0.6s ease;
}

@keyframes courseShine {
    0% {
        transform: rotate(45deg) translateY(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotate(45deg) translateY(100%);
        opacity: 0;
    }
}

.course-icon {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(2) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-item:nth-child(3) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.course-item:nth-child(4) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.course-item:nth-child(5) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(5) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-item:nth-child(6) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(6) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.course-item:nth-child(7) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(7) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.course-item:nth-child(8) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(8) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.course-item:nth-child(9) .course-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.course-item:nth-child(9) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.course-info h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.course-info p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
}

/* Responsivo */
@media (max-width: 768px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .course-item {
        padding: 1.5rem;
    }
    
    .course-icon {
        width: 80px;
        height: 80px;
    }
    
    .course-info h3 {
        font-size: 1.3rem;
    }
}
