/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Style Script', Tahoma, Geneva, Verdana, sans-serif;
    background: #2097ff;
    min-height: 100vh;
    color: #333;
}

/* Container principal */
.game-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    grid-template-rows: auto auto 1fr;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Cabeçalho */
.header {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    text-align: center;
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: #2097ff;
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Informações do nível */
.level-info {
    grid-column: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.level-info h3 {
       font-size: 1.8rem;
    color: #4a5568;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.level-info p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Barra de progresso */
.progress-container {
    width: 100%;
    height: 40px; /* Aumentado de 25px para 40px */
    background: #e2e8f0;
    border-radius: 20px; /* Ajustado proporcionalmente */
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 20px; /* Ajustado proporcionalmente */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* Texto branco */
    font-weight: bold;
    font-size: 1.1rem; /* Tamanho do texto ajustado */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Sombra para melhor legibilidade */
}

.progress-fill.success { 
    background: linear-gradient(90deg, #48bb78, #38a169); 
}
.progress-fill.warning { 
    background: linear-gradient(90deg, #ed8936, #dd6b20); 
}
.progress-fill.danger { 
    background: linear-gradient(90deg, #f56565, #e53e3e); 
}

.progress-text {
    font-weight: 600;
    color: #4a5568;
}

/* Área principal do jogo */
.game-area {
    grid-column: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.word-display {
    margin-bottom: 40px;
    width: 100%;
}

.word-display h2 {
    font-size: 1.8rem;
    color: #4a5568;
    margin-bottom: 20px;
}

.current-word {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3748; /* Cor sólida em vez de gradiente */
    /* REMOVIDO: background, -webkit-background-clip, -webkit-text-fill-color, background-clip */
    padding: 30px;
    border-radius: 15px;
    border: 3px dashed #e2e8f0;
    min-height: 200px;
    max-height: 400px;
    margin-bottom: 30px;
    line-height: 1.6;
    word-wrap: break-word;
    hyphens: auto;
    text-align: left;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f5f9;
    white-space: pre-wrap;
    /* Adicionar fundo sólido em vez de gradiente no texto */
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
}

/* Estilo específico para textos longos no nível 4 */
.current-word.long-text {
    font-size: 1.2rem;
    line-height: 1.7;
    text-align: justify;
    padding: 20px;
    max-height: 450px;
    min-height: 300px;
    color: #1a202c; /* Cor mais escura para melhor legibilidade */
}

/* Melhorar a barra de rolagem */
.current-word::-webkit-scrollbar {
    width: 10px;
}

.current-word::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.current-word::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

.current-word::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Botão principal FALAR com figurinha e fundo laranja */
.main-speak-btn {
    background: #fdb92e;
    color: white;
    border: none;
    padding: 25px 50px;
    border-radius: 1000px;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(245, 166, 35, 0.4);
    min-width: 250px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    margin-bottom: 50px;
}

.main-speak-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.main-speak-btn:hover::before {
    left: 100%;
}

.main-speak-btn:hover {
    background: linear-gradient(135deg, #E65100 0%, #FF6F00 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(245, 166, 35, 0.5);
}

.main-speak-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.main-speak-btn.recording {
    background: linear-gradient(135deg, var(--primary-pink) 0%, #C2185B 100%);
    animation: pulse-recording 1.5s infinite;
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.5);
}

@keyframes pulse-recording {
    0% { 
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(233, 30, 99, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(233, 30, 99, 0.7);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(233, 30, 99, 0.5);
    }
}

/* Ícone do microfone no botão */
.speak-btn-icon {
    width: 152px;
    height: 152px;
    object-fit: contain;    
    transition: all 0.3s ease;
}

.main-speak-btn:hover .speak-btn-icon {
    transform: scale(1.1) rotate(5deg);
}

.main-speak-btn.recording .speak-btn-icon {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* REMOVIDO: todos os estilos .stop-btn das linhas 248-262 e 610-633 */

.main-speak-btn:active {
    transform: translateY(-1px);
}

.main-speak-btn.recording {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    animation: pulse 1.5s infinite;
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.4);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Botões secundários */
.secondary-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Mensagens */
.message {
    padding: 15px 25px;
    border-radius: 15px;
    font-weight: 600;
    text-align: center;
    margin-top: 20px;
    display: none;
    backdrop-filter: blur(10px);
    min-height: 60px;
    align-items: center;
    justify-content: center;
}

.message.success {
    background: rgba(72, 187, 120, 0.9);
    color: white;
    border: 2px solid #38a169;
    display: flex;
}

.message.error {
    background: rgba(245, 101, 101, 0.9);
    color: white;
    border: 2px solid #e53e3e;
    display: flex;
}

.message.info {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: 2px solid #5a67d8;
    display: flex;
}

.message.warning {
    background: rgba(237, 137, 54, 0.9);
    color: white;
    border: 2px solid #dd6b20;
    display: flex;
}

/* Sidebar */
.sidebar {
    grid-column: 2;
    grid-row: 2 / -1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Seletor de níveis */
.level-selector {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.level-selector h3 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.level-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.level-card {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.level-card.active {
    background: #86abfc;
    color: white;
    border-color: #5a67d8;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Ícone do título do nível */
.title-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 6px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.level-info h3:hover .title-icon {
    transform: scale(1.1);
}

/* Ajuste responsivo */
@media (max-width: 768px) {
    .title-icon {
        width: 200px;
        height: 200px;
    }
}

.level-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.level-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.level-points {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.7;
}

/* Cards de informação */
.info-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

/* Lista de instruções */
.instruction-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.instruction-icon {
    font-size: 1.5rem;
    min-width: 30px;
}

.instruction-text {
    font-weight: 500;
    color: #4a5568;
}

/* Lista de conquistas */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(72, 187, 120, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.achievement-item:hover {
    background: rgba(72, 187, 120, 0.2);
    transform: translateX(5px);
}

.achievement-icon {
    font-size: 1.3rem;
    min-width: 25px;
}

.achievement-text {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
}

/* Responsividade */
@media (max-width: 1200px) {
    .game-container {
        grid-template-columns: 1fr 300px;
    }
    
    .current-word {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        padding: 15px;
        gap: 15px;
    }
    
    .sidebar {
        grid-column: 1;
        grid-row: 4;
    }
    
    .level-info {
        grid-row: 2;
    }
    
    .game-area {
        grid-row: 3;
        padding: 30px 20px;
    }
    
    .current-word {
        font-size: 2.5rem;
        padding: 20px;
        min-height: 120px;
    }
    
    .main-speak-btn {
        font-size: 1.5rem;
        padding: 20px 80px;
        min-width: 250px;
    }
    
    .secondary-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .secondary-btn {
        width: 200px;
    }
    
    .level-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stats {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .current-word {
        font-size: 2rem;
    }
    
    .main-speak-btn {
        font-size: 1.3rem;
        padding: 18px 35px;
        min-width: 220px;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 150px;
    }
}

/* Estilos específicos para níveis 1 e 2 - palavras centralizadas e maiores */
.current-word.level-1,
.current-word.level-2 {
    font-size: 3.5rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 300px;
    padding: 40px;
    line-height: 1.2;
    overflow: hidden; /* Remove scroll para palavras simples */
}

/* Fonte especial para o nível 2 */
/* Fonte especial para o nível 2 */
.current-word.level-2 {
    font-family: 'Helvetica', 'Times New Roman', serif;    
    font-size: 4rem; /* Ligeiramente maior para compensar a fonte script */
}

/* Manter estilos originais para níveis 3 e 4 */
.current-word.level-3,
.current-word.level-4 {
    font-size: 1.8rem;
    text-align: left;
    overflow-y: auto;
    white-space: pre-wrap;
}

.stop-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    margin-left: 10px;
}

.stop-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.stop-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

/* Animações para o overlay de sucesso */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
    70% {
        transform: scale(0.9) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Estilo para o overlay de sucesso */
#success-overlay {
    font-family: 'Arial', sans-serif;
}

#success-overlay img {
    max-width: 100%;
    height: auto;
    border: 3px solid #4CAF50;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    #success-overlay img {
        width: 250px;
    }
    
    #success-overlay h2 {
        font-size: 1.5rem !important;
    }
    
    #success-overlay p {
        font-size: 1rem !important;
    }
}

/* Adicionar ao final do arquivo CSS */

/* Container do título com logo */
.title-container {
       display: flex;
    align-items: center;    
    flex-direction: row;
    justify-content: center;
}

/* Logo no cabeçalho */
.header-logo {
    width: 400px;
    height: auto;
    border-radius: 8px;
   
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Ajustar responsividade */
@media (max-width: 768px) {
    .header-logo {
        width: 200px;
    }
    
    .title-container {
        gap: 10px;
    }
    
    .title-container h1 {
        font-size: 1.5rem;
    }
}

/* Imagens dos níveis */
.level-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.level-card:hover .level-image {
    transform: scale(1.1);
}

/* Imagens das instruções */
.instruction-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.instruction-item:hover .instruction-image {
    transform: scale(1.05);
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .level-image {
        width: 35px;
        height: 35px;
    }
    
    .instruction-image {
        width: 28px;
        height: 28px;
    }
}

/* Adicionar efeito de brilho nas imagens */
.level-image, .instruction-image {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.level-card.active .level-image {
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}
