/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2196F3;
    --success: #4CAF50;
    --warning: #FFC107;
    --danger: #F44336;
    --purple: #9C27B0;
    --dark: #1a1a1a;
    --light: #f5f5f5;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --gradient: linear-gradient(135deg, var(--primary), var(--purple));
    --holographic: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.holographic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--holographic);
    background-size: 400% 400%;
    animation: holographicMove 8s ease infinite;
    opacity: 0.1;
    z-index: -1;
}

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

.container {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(33, 150, 243, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid var(--primary);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.language-switch {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-bottom: 0; /* Removido padding extra */
}

.section {
    display: none;
    flex: 1;
    padding: 1rem;
}

.section.active {
    display: flex;
    flex-direction: column;
}

.game-hud {
    background: rgba(0,0,0,0.8);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hud-item {
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.hud-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.hud-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.game-area {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    position: relative;
    min-height: 400px;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.target {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid white;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    animation: targetPulse 1s ease-in-out infinite;
}

.target.first-tap {
    background: var(--warning);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
    transform: scale(0.8);
}

.target.bonus {
    background: var(--purple);
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.5);
    animation: bonusTarget 1s ease-in-out infinite;
}

.target.penalty {
    background: var(--danger);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

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

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

.game-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.mode-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.3);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mode-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.mode-description {
    opacity: 0.8;
    font-size: 0.9rem;
}

.level-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.level-btn {
    aspect-ratio: 1;
    border: 2px solid var(--primary);
    background: rgba(33, 150, 243, 0.2);
    color: var(--primary);
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn.unlocked {
    background: var(--primary);
    color: white;
}

.level-btn.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.level-btn:hover {
    transform: scale(1.1);
}

.settings-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.setting-item {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    font-weight: bold;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255,255,255,0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(30px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    opacity: 0.8;
}

.faq-section {
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.faq-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary);
    font-size: 1.5rem;
}

.faq-container {
    display: grid;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.2);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    color: var(--light);
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255,255,255,0.05);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    transition: transform 0.3s ease;
    min-width: 24px;
    text-align: center;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    opacity: 0.9;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: rgba(0,0,0,0.2);
}

.faq-answer.show {
    max-height: 300px;
    padding: 1.5rem;
}

.faq-answer p {
    margin: 0;
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    border-top: 2px solid var(--primary);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 10px;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: bold;
}

footer {
    background: var(--dark);
    color: var(--light);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 1001; /* Acima do bottom-nav */
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--light);
    text-decoration: underline;
}

/* Espaçamento para separar footer do bottom-nav */
footer {
    margin-bottom: 70px; /* Altura do bottom-nav + espaçamento */
}

.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s ease;
}

.feedback.show {
    opacity: 1;
    animation: feedbackPop 0.8s ease;
}

@keyframes feedbackPop {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--dark);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--primary);
    max-width: 90%;
    width: 400px;
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-stats {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.modal-stat {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Additional responsive styles and enhancements */

@media (max-width: 768px) {
    .game-hud {
        font-size: 0.9rem;
    }
    
    .target {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
    
    .level-selector {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    /* Estilos responsivos para FAQ */
    .faq-section {
        padding: 0.5rem;
        margin-top: 1.5rem;
    }
    
    .faq-section h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .faq-container {
        gap: 0.8rem;
    }
    
    .faq-question {
        padding: 1.2rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1.2rem;
    }
    
    .faq-answer.show {
        padding: 1.2rem;
    }
    
    .faq-icon {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .language-switch {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .game-hud {
        padding: 0.8rem;
        gap: 0.5rem;
    }
    
    .hud-value {
        font-size: 1rem;
    }
    
    .target {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.8rem;
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .mode-icon {
        font-size: 2.5rem;
    }
    
    .mode-title {
        font-size: 1.1rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .game-area {
        min-height: 500px;
    }
    
    .target {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
        margin: 0 auto;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .game-area {
        min-height: 300px;
    }
    
    .game-hud {
        margin-bottom: 0.5rem;
    }
    
    .game-controls {
        margin-top: 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0066cc;
        --success: #008800;
        --warning: #cc8800;
        --danger: #cc0000;
        --purple: #8800cc;
    }
    
    .target {
        border-width: 4px;
    }
    
    .mode-card {
        border-width: 3px;
    }
}

/* Print styles */
@media print {
    .bottom-nav,
    .game-area,
    .game-controls,
    .holographic-bg {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

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