:root {
    --primary: #FF006E;
    --secondary: #FB5607;
    --accent: #FFBE0B;
    --purple: #8338EC;
    --blue: #3A86FF;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #eee;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --neon-glow: 0 0 20px;
}

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

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

.app-header {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--neon-glow) var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.8rem;
    color: var(--primary);
    text-shadow: var(--neon-glow) var(--primary);
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-danger {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--purple));
    color: white;
    box-shadow: var(--neon-glow) var(--primary);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary), var(--accent));
    color: white;
    box-shadow: var(--neon-glow) var(--secondary);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--neon-glow) var(--success);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
    box-shadow: var(--neon-glow) var(--warning);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--neon-glow) var(--danger);
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover, 
.btn-warning:hover, .btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

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

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

.section.active {
    display: block;
}

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

/* Game Section */
.game-info {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--primary);
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.info-item span:last-child {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.1rem;
}

.game-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid var(--blue);
    box-shadow: var(--neon-glow) var(--blue);
}

#gameCanvas {
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

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

/* Levels Section */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.level-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.level-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--neon-glow) var(--primary);
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--purple), var(--blue));
}

.level-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.level-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.level-card p {
    opacity: 0.8;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.level-stats {
    font-size: 0.9rem;
    color: var(--blue);
    font-weight: 600;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--blue);
    box-shadow: var(--neon-glow) var(--blue);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

.stat-label {
    opacity: 0.8;
    font-size: 0.9rem;
}

.achievements h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    border-color: var(--success);
    box-shadow: var(--neon-glow) var(--success);
}

.achievement-icon {
    font-size: 2rem;
    min-width: 60px;
    text-align: center;
}

.achievement-text strong {
    display: block;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.achievement-text span {
    opacity: 0.8;
    font-size: 0.9rem;
}

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

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

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

.faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.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 {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.faq-answer p {
    line-height: 1.6;
    opacity: 0.9;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary);
    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: var(--light);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
}

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 0.8rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .info-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .info-item .label {
        display: inline;
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .game-controls {
        gap: 0.3rem;
    }
    
    .game-controls button {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .achievement-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .faq-answer:not([hidden]) {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0.5rem;
        padding-bottom: 80px;
    }
    
    .game-container {
        padding: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bottom-nav {
        padding: 0.3rem 0;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
}

/* Canvas specific styles */
.canvas-container {
    position: relative;
    display: inline-block;
}

.hint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* Animation classes */
.pulse {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Success animation */
.success-flash {
    animation: successFlash 0.6s ease-in-out;
}

@keyframes successFlash {
    0% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.3); }
    100% { background-color: transparent; }
}
