:root {
    --primary-color: #FF006E;
    --secondary-color: #FB5607;
    --accent-color: #FFBE0B;
    --purple-color: #8338EC;
    --blue-color: #3A86FF;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --light-text: #ffffff;
    --gray-text: #cccccc;
    --success-color: #00ff88;
    --danger-color: #ff4757;
    
    --hologram-gradient: linear-gradient(45deg, 
        var(--primary-color) 0%, 
        var(--purple-color) 25%, 
        var(--blue-color) 50%, 
        var(--secondary-color) 75%, 
        var(--accent-color) 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: var(--dark-bg);
    color: var(--light-text);
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 50%, var(--primary-color)20 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--blue-color)20 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, var(--purple-color)20 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
}

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

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid;
    border-image: var(--hologram-gradient) 1;
    padding: 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: 1.5rem;
    background: var(--hologram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 0, 110, 0.5);
}

.header-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.score-display, .best-score {
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.app-main {
    padding-top: 80px;
    padding-bottom: 80px;
    min-height: calc(100vh - 160px);
}

.main-section {
    display: none;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.main-section.active {
    display: block;
}

.section-content {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--hologram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Game Container */
.game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: var(--darker-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid;
    border-image: var(--hologram-gradient) 1;
    box-shadow: 0 0 50px rgba(255, 0, 110, 0.3);
}

#gameCanvas {
    width: 100%;
    height: auto;
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #228B22 100%);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.game-menu {
    text-align: center;
    padding: 2rem;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.game-menu h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: var(--hologram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    margin: 0.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    min-width: 200px;
    justify-content: center;
}

.game-btn.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.4);
}

.game-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 110, 0.6);
}

.game-btn.secondary {
    background: linear-gradient(45deg, var(--purple-color), var(--blue-color));
    box-shadow: 0 4px 15px rgba(131, 56, 236, 0.4);
}

.game-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(131, 56, 236, 0.6);
}

.game-info {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--gray-text);
}

.game-info p {
    margin: 0.5rem 0;
}

/* Game HUD */
.game-hud {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speed-meter, .distance-meter, .current-score {
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.pause-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Leaderboard */
.leaderboard-container {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.leaderboard-header {
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: var(--glass-bg);
    color: var(--gray-text);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.4);
}

.leaderboard-list {
    min-height: 300px;
}

.empty-leaderboard {
    text-align: center;
    padding: 3rem;
    color: var(--gray-text);
}

.empty-leaderboard i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.score-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-color);
}

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

.score-rank.first { color: var(--accent-color); }
.score-rank.second { color: #c0c0c0; }
.score-rank.third { color: #cd7f32; }

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

.score-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
}

.score-date {
    font-size: 0.8rem;
    color: var(--gray-text);
}

.clear-scores-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 2rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.clear-scores-btn:hover {
    background: #ff3742;
    transform: translateY(-2px);
}

/* Settings */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.setting-group {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.setting-group h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.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: #333;
    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: var(--primary-color);
}

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

.volume-slider {
    width: 150px;
    margin-right: 1rem;
}

.volume-value {
    min-width: 40px;
    text-align: right;
}

.controls-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--darker-bg);
    border-radius: 10px;
}

.key {
    background: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.language-select {
    padding: 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

.reset-btn {
    padding: 1rem 2rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.reset-btn:hover {
    background: #ff3742;
    transform: translateY(-2px);
}

/* FAQ */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    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: var(--glass-bg);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

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

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--gray-text);
    line-height: 1.6;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer:not([hidden]) {
    opacity: 1;
    max-height: 200px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    border-top: 2px solid;
    border-image: var(--hologram-gradient) 1;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-text);
    font-size: 0.8rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 15px;
    min-width: 60px;
}

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

.nav-item.active {
    color: var(--primary-color);
    background: var(--glass-bg);
    transform: translateY(-2px);
}

.nav-item:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    background: var(--hologram-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--darker-bg);
    border-radius: 10px;
}

.stat-label {
    color: var(--gray-text);
}

.stat-value {
    color: var(--success-color);
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-buttons .game-btn {
    flex: 1;
    min-width: 120px;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background: var(--darker-bg);
    color: var(--gray-text);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .header-stats {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .section-content {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 15px;
    }
    
    .game-menu {
        padding: 1.5rem;
    }
    
    .game-btn {
        min-width: 150px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .controls-info {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .game-btn {
        min-width: 100%;
    }
    
    #gameCanvas {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 70px 0.5rem 70px;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .bottom-nav {
        padding: 0.5rem 0;
    }
    
    .nav-item {
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

.pulse {
    animation: pulse 2s infinite;
}

.glow {
    animation: glow 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
