:root {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --purple: #8338EC;
    --blue: #3A86FF;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #e94560;
    --text: #ffffff;
    --text-secondary: #b8b8b8;
}

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

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

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, var(--primary) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--blue) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--purple) 0%, transparent 50%);
    opacity: 0.1;
    z-index: -1;
    animation: holographicShift 20s ease-in-out infinite;
}

@keyframes holographicShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-10px); }
    50% { transform: translateX(20px) translateY(10px); }
    75% { transform: translateX(-10px) translateY(20px); }
}

header {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px var(--primary)); }
    to { filter: drop-shadow(0 0 20px var(--primary)); }
}

main {
    padding: 1rem;
    padding-bottom: 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

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

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.score-display {
    display: flex;
    gap: 2rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.score-display span {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.power-ups-display {
    display: flex;
    gap: 0.5rem;
    min-height: 30px;
    align-items: center;
}

.power-up-icon {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: powerUpPulse 1s ease-in-out infinite;
}

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

#gameCanvas {
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 0 20px var(--primary),
        inset 0 0 20px rgba(255, 0, 110, 0.1);
    max-width: 100%;
    height: auto;
}

.game-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

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

.control-btn:hover::before {
    left: 100%;
}

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

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

.control-btn:not(.primary):not(.danger) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.control-btn:not(.primary):not(.danger):hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

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

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

.game-instructions {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
}

.game-instructions h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.game-instructions p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.content-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent);
    font-size: 2rem;
    text-shadow: 0 0 10px var(--accent);
}

.high-scores-list {
    margin-bottom: 2rem;
}

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

.score-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.score-rank {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.2rem;
    min-width: 50px;
}

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

.settings-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.setting-item label {
    font-weight: bold;
    color: var(--text);
}

.setting-item input[type="checkbox"] {
    width: 50px;
    height: 25px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.setting-item select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.setting-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.faq-section {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent);
    font-size: 2rem;
    text-shadow: 0 0 10px var(--accent);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: bold;
    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.1);
}

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

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer:not([hidden]) {
    max-height: 200px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.6;
}

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

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

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

.nav-item.active {
    color: var(--primary);
    background: rgba(255, 0, 110, 0.2);
}

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

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

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

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .score-display {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .game-controls {
        gap: 0.5rem;
    }
    
    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .content-container {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .settings-grid {
        gap: 1rem;
    }
    
    .setting-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    #gameCanvas {
        width: 100%;
        height: auto;
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .score-display {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .control-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    .game-container {
        padding: 0.5rem;
    }
    
    .game-info {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .nav-item {
        padding: 0.75rem 0.5rem;
        min-height: 44px;
    }
}

.game-over-screen,
.level-complete-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 0 50px var(--primary);
}

.game-over-screen h2,
.level-complete-screen h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--primary);
}

.game-over-screen p,
.level-complete-screen p {
    color: var(--text);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-100px);
    }
}
