/* ===================================
   IDENTIFIQUE AS VOGAIS V2 - CSS
   Design moderno para jogo de identificação
   =================================== */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4ECDC4;
    --error-color: #FF6B6B;
    --warning-color: #FFE66D;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: clamp(8px, 2vw, 20px);
    --spacing-unit: clamp(15px, 3vw, 30px);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container Principal */
.game-container {
    background: var(--bg-gradient);
    border-radius: var(--border-radius);
    padding: var(--spacing-unit);
    margin: var(--spacing-unit) 0;
    box-shadow: var(--card-shadow);
    position: relative;
    min-height: 500px;
    overflow: hidden;
    /* Performance optimizations */
    contain: layout style;
    will-change: transform;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><text x="10" y="40" font-size="30" opacity="0.1">AEIOU</text><text x="10" y="80" font-size="30" opacity="0.1">AEIOU</text></svg>');
    pointer-events: none;
    opacity: 0.3;
    /* Prevent repaints */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===================================
   FULLSCREEN BUTTON
   =================================== */

.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

/* Enhanced fullscreen support */
.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    padding: 20px;
    /* Performance for fullscreen */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Mobile fullscreen optimizations */
.game-container.is-fullscreen-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.game-container.is-fullscreen-mobile .level-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    grid-template-columns: none !important;
    max-width: 100% !important;
}

/* ===================================
   LEVEL SELECTION SCREEN
   =================================== */

.level-selection {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 20px;
}

.level-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-family: var(--font-primary);
}

.level-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-family: var(--font-secondary);
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.level-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transition: left 0.5s;
}

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

.level-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.level-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.level-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-family: var(--font-primary);
}

.level-description {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    font-family: var(--font-secondary);
}

.level-age {
    font-size: 28px;
    margin: 10px 0;
}

.level-info {
    font-size: 14px;
    color: #777;
    font-style: italic;
}

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

/* ===================================
   GAME PLAY SCREEN
   =================================== */

.game-play {
    position: relative;
    z-index: 1;
}

/* Game Header Stats */
.game-header {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

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

.stat-label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-primary);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-family: var(--font-primary);
}

/* ===================================
   WORD DISPLAY
   =================================== */

.word-display {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    border-radius: 20px;
    padding: 40px 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.word-container {
    text-align: center;
}

.word-image {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

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

.word-letters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px auto;
    max-width: 100%;
}

.letter {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 42px;
    font-weight: 700;
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    font-family: var(--font-primary);
    text-transform: uppercase;
}

.letter:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.letter.vowel-hint {
    animation: hintPulse 1s ease-in-out;
    box-shadow: 0 0 0 4px rgba(255, 230, 109, 0.6),
                0 5px 15px rgba(0,0,0,0.2);
}

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

.letter.clicked {
    pointer-events: none;
    cursor: default;
}

.letter.correct {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    animation: correctBounce 0.6s ease;
}

@keyframes correctBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(10deg); }
}

.letter.correct::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: #4ECDC4;
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.letter.incorrect {
    background: linear-gradient(135deg, #FF6B6B, #C92A2A);
    animation: incorrectShake 0.5s ease;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.letter.incorrect::after {
    content: '✗';
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    color: #FF6B6B;
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.vowels-found {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 20px;
    font-family: var(--font-primary);
}

#vowelsFound {
    font-size: 32px;
    font-weight: 700;
    color: var(--success-color);
}

/* ===================================
   ACTION BUTTONS
   =================================== */

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-action {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: var(--font-primary);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-action:active {
    transform: translateY(-1px);
}

.btn-hint {
    background: linear-gradient(135deg, #FFE66D, #FFCC00);
    color: #333;
    border-color: #FFD700;
}

.btn-skip {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #764ba2;
}

.btn-quit {
    background: linear-gradient(135deg, #FF6B6B, #C92A2A);
    border-color: #C92A2A;
}

.btn-hint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================================
   RESULT SCREEN
   =================================== */

.result-screen {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 20px;
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: resultAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.result-title {
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-family: var(--font-primary);
}

.result-message {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-family: var(--font-secondary);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.result-stat {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.result-stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-primary);
}

.result-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-family: var(--font-primary);
}

.result-medal {
    font-size: 80px;
    margin: 30px 0;
    animation: medalSpin 1s ease-in-out;
}

@keyframes medalSpin {
    0% {
        transform: rotateY(0deg) scale(0);
    }
    50% {
        transform: rotateY(180deg) scale(1.2);
    }
    100% {
        transform: rotateY(360deg) scale(1);
    }
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-restart {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    border-color: #44A08D;
}

.btn-levels {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #764ba2;
}

/* ===================================
   PARTICLES (Efeito visual)
   =================================== */

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* ===================================
   ADS OPTIMIZATION STYLES
   =================================== */

.ad-sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Performance */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.ad-native-game {
    margin: var(--spacing-unit) 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    border-radius: 16px;
    border: 1px solid rgba(102,126,234,0.2);
    transition: var(--transition-smooth);
    /* Performance */
    contain: layout style;
}

.ad-native-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.15);
}

.ad-label {
    text-align: center;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-primary);
}

/* Lazy loading placeholder */
.adsbygoogle:not([data-ad-rendered]) {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: adLoading 1.5s ease-in-out infinite;
}

@keyframes adLoading {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}

/* ===================================
   BREADCRUMB NAVIGATION
   =================================== */

.breadcrumb-nav {
    background: rgba(0,0,0,0.05);
    padding: 10px 0;
    font-family: var(--font-primary);
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 5px 15px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding: 0 8px;
    color: #999;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #666;
}

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        border-radius: 15px;
    }

    .level-title {
        font-size: 24px;
    }

    .level-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .level-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .level-card {
        padding: 25px 15px;
    }

    .level-icon {
        font-size: 50px;
    }

    .level-name {
        font-size: 20px;
    }

    .game-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .word-image {
        font-size: 60px;
    }

    .word-letters {
        gap: 6px;
    }

    .letter {
        font-size: 36px;
        width: 50px;
        height: 60px;
    }

    .letter.correct::after,
    .letter.incorrect::after {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }

    .vowels-found {
        font-size: 18px;
    }

    #vowelsFound {
        font-size: 28px;
    }

    .action-buttons {
        gap: 10px;
    }

    .btn-action {
        padding: 12px 20px;
        font-size: 14px;
    }

    .result-icon {
        font-size: 80px;
    }

    .result-title {
        font-size: 32px;
    }

    .result-message {
        font-size: 18px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-stat-value {
        font-size: 28px;
    }

    .result-medal {
        font-size: 60px;
    }

    .fullscreen-btn {
        top: 10px;
        right: 10px;
        padding: 10px;
    }

    .fullscreen-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .letter {
        font-size: 32px;
        width: 45px;
        height: 55px;
    }

    .word-letters {
        gap: 4px;
    }

    .game-header {
        padding: 15px;
    }

    .word-display {
        padding: 30px 15px;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.letter:focus {
    outline: 3px solid var(--warning-color);
    outline-offset: 3px;
}

.btn-action:focus {
    outline: 3px solid white;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   ADS OPTIMIZATION STYLES
   =================================== */

.ad-sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Performance */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.ad-native-game {
    margin: var(--spacing-unit) 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
    border-radius: 16px;
    border: 1px solid rgba(102,126,234,0.2);
    transition: var(--transition-smooth);
    /* Performance */
    contain: layout style;
}

.ad-native-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.15);
}

.ad-label {
    text-align: center;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-primary);
}

/* Lazy loading placeholder */
.adsbygoogle:not([data-ad-rendered]) {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: adLoading 1.5s ease-in-out infinite;
}

@keyframes adLoading {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}

/* ===================================
   BREADCRUMB NAVIGATION
   =================================== */

.breadcrumb-nav {
    background: rgba(0,0,0,0.05);
    padding: 10px 0;
    font-family: var(--font-primary);
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 5px 15px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    padding: 0 8px;
    color: #999;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #666;
}

/* Enhanced mobile fullscreen support */
.game-container.is-fullscreen-mobile {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    padding: 15px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.game-container.is-fullscreen-mobile .level-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    grid-template-columns: none !important;
    max-width: 100% !important;
}

.game-container.is-fullscreen-mobile .game-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}
