/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Holographic Effects */
.holographic {
    background: linear-gradient(45deg, #FF006E, #00FF88, #00D4FF, #FFD700, #FF0080);
    background-size: 400% 400%;
    animation: holographicShift 3s ease-in-out infinite;
}

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

.holographic-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.holographic-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF006E, #00FF88, #00D4FF, #FFD700, #FF0080);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: holographicShift 3s ease-in-out infinite;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #FF006E, #00FF88, #00D4FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content */
.app-main {
    padding-bottom: 80px;
    min-height: calc(100vh - 140px);
}

.section {
    display: none;
    padding: 1rem;
    min-height: calc(100vh - 200px);
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    background: linear-gradient(45deg, #FF006E, #00FF88, #00D4FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Game Container */
.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.game-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.score-display,
.level-display,
.timer-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.game-area {
    position: relative;
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

.start-screen,
.game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.start-screen h2,
.game-over-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #FF006E, #00FF88, #00D4FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.start-btn,
.play-again-btn {
    background: linear-gradient(45deg, #FF006E, #00FF88);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.start-btn:hover,
.play-again-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 0, 110, 0.4);
}

.tap-target {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: targetPulse 1s ease-in-out infinite, targetFade 2s ease-out forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

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

@keyframes targetFade {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.tap-target.hit {
    animation: targetHit 0.3s ease-out forwards;
}

@keyframes targetHit {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

.game-controls {
    text-align: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.final-score,
.best-score {
    font-size: 1.2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Leaderboard */
.leaderboard-container {
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(45deg, #FF006E, #00FF88);
    border-color: transparent;
    transform: translateY(-2px);
}

.leaderboard-list {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 1rem;
    margin-bottom: 2rem;
    min-height: 200px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.score-item:last-child {
    border-bottom: none;
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.score-rank {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 40px;
}

.score-details {
    flex: 1;
    margin-left: 1rem;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00FF88;
}

.score-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.clear-btn {
    background: linear-gradient(45deg, #FF006E, #FF0080);
    border: none;
    padding: 1rem 2rem;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

/* Settings */
.settings-container {
    max-width: 600px;
    margin: 0 auto;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.setting-item label {
    font-size: 1.1rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(45deg, #00FF88, #00D4FF);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.setting-item select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 1rem;
}

.setting-item input[type="range"] {
    width: 150px;
    margin-right: 1rem;
}

.reset-btn {
    background: linear-gradient(45deg, #FFD700, #FF0080);
    border: none;
    padding: 1rem 2rem;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem auto 0;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* FAQ */
.faq-container {
    max-width: 600px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    color: white;
    font-size: 1.1rem;
    text-align: left;
    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.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

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

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
}

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

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

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

.nav-item.active,
.nav-item:hover {
    color: #00FF88;
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 80px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.bounce {
    animation: bounce 0.6s ease;
}

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

.pulse {
    animation: pulse 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .game-header {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .game-area {
        height: 300px;
    }
    
    .tap-target {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .setting-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .leaderboard-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 0.5rem;
    }
    
    .game-container {
        padding: 0.5rem;
    }
    
    .game-area {
        height: 250px;
    }
    
    .tap-target {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .start-screen h2,
    .game-over-screen h2 {
        font-size: 1.4rem;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tap-target {
        border-width: 4px;
    }
    
    .holographic-border::before {
        opacity: 0.8;
    }
}

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