:root {
    --primary-color: #FF006E;
    --secondary-color: #00FF88;
    --accent-color: #00D4FF;
    --gold-color: #FFD700;
    --pink-color: #FF0080;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --border-radius: 12px;
    --shadow-glow: 0 0 20px rgba(255, 0, 110, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a0a1a 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.app-header {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid rgba(255, 0, 110, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

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

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

.screen.active {
    display: block;
}

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

.screen-header h2 {
    font-size: 2rem;
    background: linear-gradient(45deg, var(--accent-color), var(--gold-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
    border: 2px solid rgba(255, 0, 110, 0.2);
}

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

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.game-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.game-hud > div {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.game-hud .label {
    color: var(--text-gray);
    font-size: 0.8rem;
    margin-right: 5px;
}

.game-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: all;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.control-btn.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--pink-color));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.control-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 110, 0.4);
}

.control-btn.secondary {
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.control-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.control-btn.danger {
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.control-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    border: 2px solid rgba(255, 0, 110, 0.3);
    box-shadow: var(--shadow-glow);
}

.modal-content h2 {
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-stats {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.final-stats p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1.5rem;
}

.mobile-instructions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.mobile-instructions h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

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

.instruction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.instruction-icon {
    font-size: 1.5rem;
}

.leaderboard-container,
.settings-container {
    max-width: 600px;
    margin: 0 auto;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.stat-label {
    display: block;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gold-color);
}

.leaderboard-list {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.leaderboard-list h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.scores-list {
    max-height: 300px;
    overflow-y: auto;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.score-entry:nth-child(1) { border-left-color: var(--gold-color); }
.score-entry:nth-child(2) { border-left-color: #C0C0C0; }
.score-entry:nth-child(3) { border-left-color: #CD7F32; }

.score-rank {
    font-weight: bold;
    min-width: 30px;
}

.score-details {
    flex: 1;
    text-align: center;
}

.score-value {
    font-weight: bold;
    color: var(--secondary-color);
}

.empty-state {
    text-align: center;
    color: var(--text-gray);
    font-style: italic;
    padding: 2rem;
}

.settings-group {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 2px solid rgba(0, 255, 136, 0.3);
}

.settings-group h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 10px 0;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    flex: 1;
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    appearance: none;
    width: 50px;
    height: 25px;
    background: #333;
    border-radius: 15px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.setting-item input[type="checkbox"]:checked {
    background: var(--primary-color);
}

.setting-item input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.setting-item input[type="checkbox"]:checked::before {
    transform: translateX(25px);
}

.setting-item select {
    background: var(--bg-dark);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1rem;
}

.setting-item input[type="range"] {
    flex: 1;
    margin: 0 10px;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.settings-actions,
.leaderboard-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 2rem;
}

.faq-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

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

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

.faq-question.expanded {
    background: rgba(0, 212, 255, 0.1);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    transition: var(--transition);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-gray);
    line-height: 1.6;
    animation: fadeIn 0.3s ease-out;
}

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

.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: 10px 0 calc(10px + env(safe-area-inset-bottom));
    border-top: 2px solid rgba(255, 0, 110, 0.3);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-gray);
    transition: var(--transition);
    border-radius: 8px;
    min-width: 60px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
    background: rgba(255, 0, 110, 0.1);
    transform: translateY(-2px);
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

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

footer {
    background: var(--bg-card);
    text-align: center;
    padding: 1rem;
    color: var(--text-gray);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .screen {
        padding: 0.5rem;
    }
    
    .game-hud {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .game-hud > div {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .control-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .settings-actions,
    .leaderboard-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        margin: 0 -0.5rem;
        border-radius: 0;
    }
    
    #gameCanvas {
        border-radius: 0;
    }
    
    .mobile-instructions {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }
}

.holographic-border {
    position: relative;
    overflow: hidden;
}

.holographic-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--accent-color), 
        var(--gold-color), 
        var(--pink-color)
    );
    background-size: 300% 300%;
    animation: holographicGlow 3s ease infinite;
    border-radius: inherit;
    z-index: -1;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 110, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 110, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 110, 0);
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-flash {
    animation: successFlash 0.5s ease;
}

@keyframes successFlash {
    0% { background-color: rgba(0, 255, 136, 0.2); }
    100% { background-color: transparent; }
}

.error-shake {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
