/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100vw;
}

body {
    font-family: 'Nunito', sans-serif;
    background: 
        radial-gradient(ellipse at 15% 15%, rgba(173, 216, 255, 0.6) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 20%, rgba(255, 182, 193, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(186, 225, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(255, 192, 203, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 75%, rgba(176, 224, 255, 0.5) 0%, transparent 40%),
        linear-gradient(135deg, #e0f4ff 0%, #fce4ec 25%, #bbdefb 50%, #f8bbd9 75%, #b3e5fc 100%);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Otimizações para stylus e touch */
    -webkit-tap-highlight-color: transparent;
    -ms-touch-action: manipulation;
    -ms-content-zooming: none;
    /* Fullscreen sem barras de navegação */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* Scrollbar customizada para manter a estética */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.container::-webkit-scrollbar {
    width: 6px;
}

.container::-webkit-scrollbar-track {
    background: transparent;
}

.container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.mascot {
    animation: bounce 2s infinite;
}

.mascot-svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

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

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    text-align: center;
}

.score-display {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* Menu principal */
.main-menu {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 900px;
}

.module-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(15px);
    border: 3px solid transparent;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* Otimizações para stylus */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.module-card:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 193, 7, 0.85));
    border-color: #FFD700;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.3), 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.module-card:active {
    background: rgba(255, 165, 0, 0.9);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Efeito de brilho animado */
.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.module-card:hover::before {
    left: 100%;
}

/* Pseudo-elemento para aumentar área de toque */
.module-card::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: -1;
}

/* Otimizações específicas para stylus */
@media (pointer: fine) {
    .module-card {
        transition: all 0.2s ease;
    }
    
    .module-card:hover {
        background: rgba(255, 215, 0, 0.9);
    }
}

/* Otimizações para touch */
@media (pointer: coarse) {
    .module-card {
        min-height: 180px;
        padding: 25px;
    }
    
    .module-card:active {
        background: rgba(255, 165, 0, 0.9);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
}

.module-icon {
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

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

.module-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.module-card p {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* Área de progresso */
.progress-area {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 20px;
    margin-top: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

/* Media Queries para Responsividade */

/* Tablets em modo paisagem (1024px - 1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .container {
        max-width: 1200px;
        padding: 15px;
    }
    
    .main-menu {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        max-width: 900px;
    }
    
    .module-card {
        padding: 18px;
        min-height: 160px;
    }
    
    .module-icon {
        font-size: 3rem;
        margin-bottom: 10px;
    }
    
    .module-title {
        font-size: 1rem;
    }
}

/* Tablets em modo retrato (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 12px;
    }
    
    .main-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 600px;
    }
    
    .module-card {
        padding: 16px;
        min-height: 160px;
    }
    
    .module-icon {
        font-size: 2.5rem;
    }
    
    .module-title {
        font-size: 0.95rem;
    }
    
    .title {
        font-size: 2rem;
    }
}

/* Smartphones e tablets pequenos (480px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        padding: 20px;
        text-align: center;
        gap: 15px;
    }
    
    .mascot {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        order: 1;
    }
    
    .title {
        font-size: 1.8rem;
        margin: 0;
        order: 2;
        flex-grow: 0;
    }
    
    .score-display {
        order: 3;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 400px;
    }
    
    .module-card {
        padding: 15px;
        min-height: 160px;
    }
    
    .module-card h3 {
        font-size: 1.1rem;
    }
    
    .module-card p {
        font-size: 0.9rem;
    }
    
    .module-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }
}

/* Dispositivos muito pequenos (até 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 15px;
        gap: 10px;
    }
    
    .mascot {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .score-display {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .modules-grid {
        gap: 12px;
    }
    
    .module-card {
        padding: 12px;
        min-height: 160px;
    }
    
    .module-card h3 {
        font-size: 1rem;
    }
    
    .module-card p {
        font-size: 0.8rem;
    }
    
    .module-icon {
        font-size: 1.8rem;
    }
}

/* Telas muito grandes (acima de 1366px) */
@media (min-width: 1367px) {
    .container {
        max-width: 1400px;
        padding: 25px;
    }
    
    .modules-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
        max-width: 1200px;
    }
    
    .module-card {
        padding: 25px;
        min-height: 180px;
    }
    
    .module-icon {
        font-size: 3.5rem;
    }
    
    .module-card h3 {
        font-size: 1.4rem;
    }
    
    .module-card p {
        font-size: 1.1rem;
    }
}
     
    .score-display {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .main-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 20px 0;
    }
    
    .module-card {
        padding: 15px;
        min-height: 120px;
    }
    
    .module-icon {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .module-title {
        font-size: 0.9rem;
    }
    
    .progress-area {
        margin-top: 20px;
    }
    
    .progress-circle {
        width: 80px;
        height: 80px;
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
    
    .player-stats-header {
        padding: 15px;
    }
    
    .player-stats-header .player-currency {
        gap: 10px;
    }
    
    .player-stats-header .stat-item {
        padding: 8px 12px;
        min-width: 70px;
    }
    
    .gamification-stats {
        flex-direction: column;
        gap: 10px;
    }


/* Smartphones pequenos (até 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .main-menu {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .module-card {
        padding: 20px;
        min-height: 100px;
        display: flex;
        align-items: center;
        text-align: left;
    }
    
    .module-icon {
        font-size: 2rem;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .module-title {
        font-size: 1rem;
        flex: 1;
    }
    
    .progress-circle {
        width: 60px;
        height: 60px;
    }
}

/* Orientação específica para tablets */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1024px) {
    .main-menu {
        grid-template-columns: repeat(3, 1fr);
        max-width: 800px;
    }
    
    .module-card {
        min-height: 140px;
    }
}

@media (orientation: portrait) and (min-width: 768px) and (max-width: 1024px) {
    .main-menu {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }
    
    .module-card {
        min-height: 180px;
    }
}

/* Otimizações para touch */
@media (pointer: coarse) {
    .module-card {
        min-height: 220px;
        padding: 35px;
    }
    
    .module-card h3 {
        font-size: 1.6rem;
    }
    
    .module-card p {
        font-size: 1.2rem;
    }
}

/* Animações de entrada */
.module-card {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Garantir visibilidade após carregamento */
.module-card.loaded {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.module-card:nth-child(1) { animation-delay: 0.1s; }
.module-card:nth-child(2) { animation-delay: 0.2s; }
.module-card:nth-child(3) { animation-delay: 0.3s; }
.module-card:nth-child(4) { animation-delay: 0.4s; }
.module-card:nth-child(5) { animation-delay: 0.5s; }
.module-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Efeitos visuais especiais */
.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
    border-radius: 20px;
}

.module-card:hover::before {
    transform: translateX(100%);
}

/* Suporte para stylus e desenho */
.drawing-area {
    touch-action: none;
    -ms-touch-action: none;
}

/* Feedback visual para interações */
.module-card:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Player Stats Header */
.player-stats-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.player-stats-header .player-level {
    margin-bottom: 15px;
}

.player-stats-header .level-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.player-stats-header .experience-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.player-stats-header .experience-fill {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.player-stats-header .experience-text {
    font-size: 12px;
    opacity: 0.9;
}

.player-stats-header .player-currency {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.player-stats-header .stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 10px;
    min-width: 80px;
}

.player-stats-header .stat-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

.player-stats-header .stat-value {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.player-stats-header .stat-label {
    font-size: 10px;
    opacity: 0.8;
}

/* Gamification Card Styles */
.gamification-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    min-height: 180px !important;
}

.gamification-card:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(240, 147, 251, 0.4), 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gamification-card .module-icon {
    color: white;
    position: relative;
    z-index: 2;
}

.gamification-card h3,
.gamification-card p {
    position: relative;
    z-index: 2;
}

.gamification-stats {
    display: none;
}

/* Cores específicas para cada módulo */
.module-card[data-module="abc"]:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(255, 255, 255, 0.95));
}

.module-card[data-module="silabas"]:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(255, 255, 255, 0.95));
}

.module-card[data-module="desenho"]:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.1), rgba(255, 255, 255, 0.95));
}

.module-card[data-module="cores"]:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 255, 255, 0.95));
}

.module-card[data-module="animais"]:hover {
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.1), rgba(255, 255, 255, 0.95));
}

.module-card[data-module="numeros"]:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(255, 255, 255, 0.95));
}

/* Estilos para o botão de controle de áudio */
.audio-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-left: 10px;
}

.audio-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.audio-toggle.muted {
    background: rgba(255, 0, 0, 0.1);
    border-color: #f44336;
    opacity: 0.7;
}

.audio-toggle.muted:hover {
    background: rgba(255, 0, 0, 0.2);
}