/* CSS COMPLETO - TAÇA DA COPA EXPERIÊNCIA IMERSIVA - FUNDO PRETO */

/* RESET E CONFIGURAÇÕES GERAIS */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #000000; /* Fundo preto sólido */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: white;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000000; /* Fundo preto */
}

#canvas-container canvas {
    background: #000000 !important; /* Forçar fundo preto no canvas */
}

/* FADE TO WHITE */
#fade-to-white {
    position: fixed;
    inset: 0;
    background: black;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 1.2s ease-out;
}

/* POPUP INICIAL */
#intro-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 20px;
    background: rgba(0, 0, 0, 0.95); /* Fundo escuro para contraste */
}

#intro-modal.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a); /* Fundo escuro */
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 100px rgba(0,0,0,0.8);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

/* BANNER ENCOSTADO NO TOPO */
.logo-banner {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 0;
}

/* SEÇÃO PANINI */
#panini-section {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border-radius: 0;
    padding: 22px;
    margin: 0;
    border: none;
    border-top: 4px solid #FFD700;
    border-bottom: 4px solid #FFD700;
    box-shadow: 0 8px 32px rgba(26, 35, 126, 0.3);
}

.panini-logo-popup {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 15px;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.panini-content {
    text-align: center;
    color: white;
}

#panini-section h2 {
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    color: #FFD700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

#panini-section p {
    font-size: 1rem;
    margin: 10px 0;
    line-height: 1.4;
    color: #e8eaf6;
}

#panini-section strong {
    color: #FFD700;
    font-weight: 700;
}

/* TÍTULO DO POPUP */
.modal-content h1 {
    color: #FFD700; /* Amarelo dourado */
    margin: 25px 20px 20px;
    font-size: 2.3rem;
    padding: 0 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* BOTÃO COM 90% DE LARGURA */
#start-quiz-btn {
    background: linear-gradient(145deg, #FFD700, #FFC107);
    color: #000000; /* Texto preto para contraste */
    border: none;
    padding: 1.3rem;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(212,175,55,0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 90%;
    max-width: 320px;
    margin: 25px auto 30px;
    display: block;
    letter-spacing: 0.5px;
}

#start-quiz-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(212,175,55,0.6);
    background: linear-gradient(145deg, #FFC107, #FFB300);
}

/* TELA INICIAL (APÓS POPUP) */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 1s ease;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
}

#start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.title {
    font-size: 4.5rem;
    color: #FFD700; /* Amarelo dourado */
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
    font-weight: 800;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.9); /* Branco com transparência */
    margin-bottom: 200px;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
    font-weight: 300;
}

#start-button {
    background: linear-gradient(145deg, #FFD700, #FFC107);
    color: #000000; /* Texto preto para contraste */
    border: none;
    padding: 1.6rem 4.5rem;
    font-size: 1.8rem;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 50px;
    position: relative;
    overflow: hidden;
}

#start-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.6);
    background: linear-gradient(145deg, #FFC107, #FFB300);
}

#start-button:active {
    transform: translateY(-2px) scale(1.02);
}

/* LOADING */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 1.5rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.9);
    padding: 2.5rem 4rem;
    border-radius: 20px;
    display: none;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* OVERLAY DA SELEÇÃO DE PAÍSES */
#quiz-overlay {
    position: absolute;
    inset: 0;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    padding: 20px;
    box-sizing: border-box;
    z-index: 50;
    background: rgba(0, 0, 0, 0.95); /* Fundo preto translúcido */
}

#quiz-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.quiz-container {
    background: rgba(20, 20, 20, 0.9); /* Fundo escuro translúcido */
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 35px;
    max-width: 900px;
    width: 95%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Logo da Copa no quiz */
.world-cup-logo {
    margin-bottom: 25px;
    text-align: center;
}

.world-cup-logo img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* Título do quiz modificado */
#quiz-title {
    color: #FFD700; /* Amarelo dourado */
    font-size: 2.2rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.selection-info {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 400;
}

/* PAÍSES SELECIONADOS */
.selected-countries {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.selected-country {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.selected-country.has-selection {
    border: 2px solid #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.selected-country span {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.selected-country.has-selection span {
    color: #FFFFFF;
    font-weight: 600;
}

.selected-country.has-selection img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4CAF50;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* BOTÃO DE REMOVER SELEÇÃO (X) - SEMPRE VISÍVEL QUANDO HÁ SELEÇÃO */
.remove-selection {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 1;
    transition: all 0.3s ease;
    z-index: 2;
}

.remove-selection:hover {
    background: rgb(255, 59, 48);
    transform: scale(1.1);
}

/* GRID DE PAÍSES */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    max-height: 400px;
    overflow-y: auto;
    padding: 25px;
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.country-btn {
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    overflow: hidden;
    position: relative;
}

.country-btn:hover {
    border-color: #FFD700;
    background: rgba(255,255,255,0.12);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}

.country-btn.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    transform: translateY(-3px) scale(1.02);
}

.country-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.country-btn.disabled:hover {
    transform: none;
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    box-shadow: none;
}

.country-btn img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 15px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.country-btn.selected img {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.country-name {
    font-size: 1rem;
    color: white;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* BOTÕES DE SELEÇÃO */
.selection-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.confirm-btn,
.back-btn {
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 250px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.confirm-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.confirm-btn:not(:disabled):hover {
    background: linear-gradient(145deg, #45a049, #3d8b40);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.6);
}

.confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* POPUP DO VENCEDOR */
/* POPUP DO VENCEDOR COM SCROLL */
#winner-selection-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    padding: 20px;
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.5s ease;
    background: rgba(0, 0, 0, 0.95);
}

#winner-selection-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.winner-container {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 32px;
    padding: 40px 35px;
    max-width: 800px;
    width: 95%;
    max-height: 90vh; /* Limita a altura máxima */
    overflow-y: auto; /* Habilita scroll vertical */
    text-align: center;
    box-shadow: 0 30px 90px rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.2);
    scrollbar-width: thin; /* Para Firefox */
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1); /* Para Firefox */
}

/* Estilização da scrollbar para Chrome/Edge/Safari */
.winner-container::-webkit-scrollbar {
    width: 8px;
}

.winner-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin: 10px;
}

.winner-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.winner-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.winner-container h2 {
    color: #FFD700;
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: -0.5px;
    position: sticky; /* Mantém o título fixo */
    top: 0;
    background: rgba(20, 20, 20, 0.9); /* Fundo para sobrepor o conteúdo */
    padding: 15px 0;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.final-match {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 40px 0 60px; /* Aumentei a margem inferior */
    flex-wrap: wrap;
}

.winner-text {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.95);
    margin: 0 0 40px; /* Ajuste da margem */
    font-weight: 600;
    line-height: 1.4;
    padding: 0 20px;
}

/* Container dos botões */
.winner-buttons-container {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    position: sticky;
    bottom: 0;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
}

.finalist {
    flex: 1;
    min-width: 200px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.finalist:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.finalist.selected-winner {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.4);
}

.flag-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    border: 4px solid #FFD700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: all 0.3s ease;
}

.finalist:hover .flag-wrapper img {
    transform: scale(1.05);
}

.finalist.selected-winner .flag-wrapper img {
    border-color: #4CAF50;
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.6);
}

.finalist .country-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    margin-top: 10px;
}

.vs {
    font-size: 4rem;
    font-weight: 900;
    color: #FFD700;
    min-width: 80px;
    text-shadow: 0 3px 10px rgba(0,0,0,0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.winner-text {
    font-size: 1.6rem;
    color: rgba(255,255,255,0.95);
    margin: 50px 0 40px;
    font-weight: 600;
    line-height: 1.4;
}

.back-btn {
    background: linear-gradient(145deg, #666, #555);
    color: white;
    padding: 20px 40px;
    font-size: 1.2rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 280px;
    margin-top: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    font-weight: 600;
}

.back-btn:hover {
    background: linear-gradient(145deg, #555, #444);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

/* EFEITOS DE GLOW E ANIMAÇÕES */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.country-btn.selected {
    animation: float 3s ease-in-out infinite;
}

/* SCROLL PERSONALIZADO */
.countries-grid::-webkit-scrollbar {
    width: 10px;
}

.countries-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.countries-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.countries-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* MEDIA QUERIES PARA MOBILE */
@media (max-width: 768px) {
    /* Popup Inicial - ajustes mobile */
    .modal-content {
        width: 95%;
        max-width: 380px;
        border-radius: 20px;
    }
    
    .modal-content h1 {
        font-size: 1.9rem;
        margin: 20px 15px 15px;
    }
    
    #panini-section {
        padding: 18px;
    }
    
    #panini-section h2 {
        font-size: 1.3rem;
    }
    
    #panini-section p {
        font-size: 0.95rem;
    }
    
    #start-quiz-btn {
        font-size: 1.2rem;
        padding: 1.1rem;
        width: 88%;
        border-radius: 12px;
        margin: 20px auto 25px;
    }
    
    /* Seleção de países mobile */
    .quiz-container {
        padding: 25px 20px;
        border-radius: 22px;
        width: 98%;
    }
    
    #quiz-title {
        font-size: 1.7rem;
    }
    
    .selection-info {
        font-size: 1.1rem;
    }
    
    .selected-countries {
        gap: 15px;
    }
    
    .selected-country {
        min-width: 140px;
        padding: 20px 15px;
        min-height: 120px;
        border-radius: 18px;
    }
    
    .selected-country.has-selection img {
        width: 60px;
        height: 60px;
    }
    
    .selected-country.has-selection span {
        font-size: 1.1rem;
    }
    
    .countries-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
        max-height: 320px;
        padding: 20px;
    }
    
    .country-btn {
        padding: 18px 12px;
        min-height: 120px;
        border-radius: 14px;
    }
    
    .country-btn img {
        width: 55px;
        height: 55px;
    }
    
    .country-name {
        font-size: 0.95rem;
    }
    
    .selection-buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .confirm-btn {
        width: 100%;
        max-width: 320px;
        padding: 18px 25px;
        font-size: 1.1rem;
    }
    
    /* Tela inicial mobile */
    .title { 
        font-size: 3.2rem; 
        margin-bottom: 1.8rem; 
    }
    
    .subtitle { 
        font-size: 1.3rem; 
        margin-bottom: 160px; 
        padding: 0 25px; 
    }
    
    #start-button { 
        padding: 1.4rem 3.5rem; 
        font-size: 1.6rem; 
        margin-top: 40px; 
        width: 90%; 
        max-width: 320px; 
        border-radius: 50px;
    }
    
    #start-screen { 
        justify-content: flex-start; 
        padding-top: 35vh; 
    }
    
    /* Popup do vencedor mobile */
    .winner-container {
        padding: 35px 25px;
        border-radius: 26px;
    }
    
    .winner-container h2 {
        font-size: 2rem;
    }
    
    .final-match {
        gap: 20px;
        margin: 40px 0;
    }
    
    .finalist {
        min-width: 160px;
        padding: 25px 20px;
    }
    
    .flag-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .finalist .country-name {
        font-size: 1.5rem;
    }
    
    .vs {
        font-size: 3rem;
    }
    
    .winner-text {
        font-size: 1.4rem;
        margin: 40px 0 35px;
        padding: 0 15px;
    }
    
    .back-btn {
        width: 100%;
        max-width: 320px;
        padding: 18px 25px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* Popup Inicial - telas muito pequenas */
    .modal-content {
        width: 92%;
        border-radius: 18px;
    }
    
    .modal-content h1 {
        font-size: 1.7rem;
        margin: 15px 12px 12px;
    }
    
    #panini-section {
        padding: 15px;
    }
    
    #panini-section h2 {
        font-size: 1.2rem;
    }
    
    #panini-section p {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    #start-quiz-btn {
        font-size: 1.1rem;
        padding: 1rem;
        width: 85%;
    }
    
    /* Seleção de países - telas muito pequenas */
    .quiz-container {
        padding: 20px 15px;
    }
    
    #quiz-title {
        font-size: 1.5rem;
    }
    
    .selection-info {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .selected-country {
        min-width: 130px;
        padding: 18px 12px;
        min-height: 110px;
        border-radius: 16px;
    }
    
    .selected-country.has-selection img {
        width: 50px;
        height: 50px;
    }
    
    .selected-country span {
        font-size: 0.9rem;
    }
    
    .countries-grid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 280px;
        gap: 12px;
        padding: 15px;
    }
    
    .country-btn {
        min-height: 110px;
        padding: 15px 10px;
        border-radius: 12px;
    }
    
    .country-btn img {
        width: 50px;
        height: 50px;
    }
    
    .country-name {
        font-size: 0.9rem;
    }
    
    .confirm-btn {
        font-size: 1rem;
        padding: 16px 20px;
    }
    
    /* Tela inicial - telas muito pequenas */
    .title { 
        font-size: 2.5rem; 
        margin-bottom: 1.2rem; 
    }
    
    .subtitle { 
        font-size: 1.1rem; 
        margin-bottom: 120px; 
        padding: 0 20px; 
    }
    
    #start-button { 
        padding: 1.2rem 3rem; 
        font-size: 1.4rem; 
        margin-top: 30px; 
        width: 90%; 
        max-width: 300px; 
    }
    
    #loading { 
        font-size: 1.3rem; 
        padding: 1.8rem 2.5rem; 
        width: 85%; 
        border-radius: 15px;
    }
    
    /* Popup do vencedor - telas muito pequenas */
    .winner-container {
        padding: 30px 20px;
    }
    
    .winner-container h2 {
        font-size: 1.7rem;
    }
    
    .final-match {
        gap: 15px;
        margin: 30px 0;
        flex-direction: column;
    }
    
    .finalist {
        min-width: 140px;
        padding: 20px 15px;
        width: 100%;
        max-width: 250px;
    }
    
    .flag-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .finalist .country-name {
        font-size: 1.3rem;
    }
    
    .vs {
        font-size: 2.5rem;
        margin: 10px 0;
    }
    
    .winner-text {
        font-size: 1.3rem;
        margin: 35px 0 30px;
    }
    
    .back-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
}

/* ORIENTAÇÃO PAISAGEM EM MOBILE */
@media (max-height: 600px) and (orientation: landscape) {
    #intro-modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .logo-banner {
        max-height: 90px;
        object-fit: contain;
    }
    
    #panini-section {
        padding: 12px 15px;
        margin: 0;
    }
    
    .modal-content h1 {
        margin: 12px 15px 10px;
        font-size: 1.5rem;
    }
    
    #start-quiz-btn {
        margin: 15px auto 20px;
        padding: 0.9rem;
        font-size: 1rem;
    }
    
    /* Seleção de países landscape */
    .quiz-container {
        max-height: 85vh;
        padding: 20px 15px;
    }
    
    .countries-grid {
        max-height: 200px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .selected-country {
        min-height: 100px;
        padding: 15px 10px;
    }
    
    /* Popup do vencedor landscape */
    .winner-container {
        max-height: 85vh;
        overflow-y: auto;
        padding: 25px;
    }
    
    .final-match {
        margin: 30px 0;
    }
    
    .flag-wrapper {
        width: 100px;
        height: 100px;
    }
    
    #start-screen { 
        padding-top: 25vh; 
    }
    
    #start-button { 
        margin-top: 30px; 
    }
}

/* AJUSTES ESPECÍFICOS PARA IOS */
@supports (-webkit-touch-callout: none) {
    #start-quiz-btn,
    #start-button,
    .country-btn,
    .winner-btn,
    .confirm-btn,
    .reset-btn,
    .back-btn {
        -webkit-appearance: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
    
    .modal-content,
    .quiz-container,
    .winner-container {
        max-height: -webkit-fill-available;
    }
    
    .countries-grid {
        -webkit-overflow-scrolling: touch;
    }
}

/* PREVENIR ZOOM EM INPUTS NO MOBILE */
@media (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}