:root {
    --primary-color: #FF006E;
    --secondary-color: #FB5607;
    --accent-color: #FFBE0B;
    --purple-color: #8338EC;
    --blue-color: #3A86FF;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --shadow-glow: rgba(255, 0, 110, 0.3);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, var(--primary-color) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--blue-color) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, var(--purple-color) 0%, transparent 50%);
    opacity: 0.1;
    z-index: -2;
    animation: backgroundPulse 10s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 40% 70%, white, transparent),
        radial-gradient(1px 1px at 90% 40%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(2px 2px at 80% 10%, white, transparent);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px, 180px 180px;
    animation: starsMove 20s linear infinite;
    z-index: -1;
    opacity: 0.8;
}

@keyframes backgroundPulse {
    0% { opacity: 0.1; }
    100% { opacity: 0.2; }
}

@keyframes starsMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.game-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-color);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.logo-ship svg path {
    stroke: var(--text-light);
}

.logo-ship {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.4rem;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 10px var(--primary-color); }
    100% { text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

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

/* App-like page transitions */
.screen {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
}

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

.screen.active {
    display: block;
}

/* Home Screen */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    text-align: center;
}

.title-container {
    margin-bottom: 3rem;
}

.neon-title {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--primary-color);
    animation: neonPulse 3s ease-in-out infinite;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

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

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.06);
    color: var(--text-light);
    font-size: 0.8rem;
}

.badge-accent {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

@keyframes neonPulse {
    0%, 100% { 
        text-shadow: 0 0 30px var(--primary-color);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 40px var(--primary-color), 0 0 60px var(--secondary-color);
        transform: scale(1.05);
    }
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.home-sections {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.home-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 360px;
}

.quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.quick-btn:hover {
    background: rgba(255,255,255,0.12);
}

.home-highlights {
    list-style: none;
    padding: 0.75rem 1rem;
    margin: 0;
    display: grid;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    max-width: 520px;
}

.home-highlights li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
}

.home-highlights i {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 60px;
}

/* Floating Action Button (Home) */
.fab {
    position: fixed;
    bottom: 68px;
    right: 16px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 20px var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 1200;
}

.fab:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 20px var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

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

/* Game Screen */
#game {
    padding: 0;
    position: relative;
}

.game-hud {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: transparent; /* sem background na aba game */
    backdrop-filter: none;
    border-radius: 0;
    padding: 0.5rem 0.5rem;
    border: none;
}

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

.score-display, .level-display, .lives-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hud-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#scoreValue, #levelValue {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#livesValue {
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#gameCanvas {
    width: 100%;
    height: calc(100vh - 160px);
    background: transparent;
    display: block;
}

.mobile-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.control-left, .control-right {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:active {
    background: var(--primary-color);
    transform: scale(0.95);
}

.pause-btn {
    position: absolute;
    bottom: 7rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    z-index: 11;
    border: 1px solid var(--border-color);
}

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

/* Instructions Screen */
.instructions-content {
    max-width: 600px;
    margin: 0 auto;
}

.instructions-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    border: 1px solid var(--border-color);
}

.instructions-card h3 {
    color: var(--accent-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.instructions-card h3:first-child {
    margin-top: 0;
}

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

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

.instr-icon {
    stroke: var(--text-light);
    opacity: 0.9;
}

.instr-icon.rotate { stroke: var(--accent-color); }
.instr-icon.thrust { stroke: var(--primary-color); }
.instr-icon.shoot  { stroke: var(--blue-color); }

.key {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.instructions-card ul {
    list-style: none;
    padding: 0;
}

.instructions-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.instructions-card li::before {
    content: '⚡';
    position: absolute;
    left: 0;
}

/* High Scores Screen */
.highscores-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.score-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.stat-card .stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.stat-card .stat-value {
    display: block;
    font-weight: bold;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.highscores-list {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
    border: 1px solid var(--border-color);
    min-height: 260px;
}

.highscores-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.highscore-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

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

.highscore-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-light);
}

.highscore-level {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.no-scores {
    color: var(--text-muted);
    font-style: italic;
    padding: 3rem;
}

/* Game Over Screen */
.gameover-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}

.final-stats {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    border: 1px solid var(--border-color);
    width: 100%;
}

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

.stat:last-child {
    border-bottom: none;
}

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

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
}

.achievement {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: bold;
    animation: achievementPulse 2s ease-in-out infinite;
}

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

.gameover-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Pause Screen */
.pause-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    text-align: center;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
    margin-top: 2rem;
}

/* Settings Screen */
.settings-content {
    max-width: 500px;
    margin: 0 auto;
}

.settings-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem 0;
    border: 1px solid var(--border-color);
}

/* Config shortcuts (navegação) */
.settings-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.settings-shortcuts .quick-btn {
    width: 100%;
}

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

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

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.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.2);
    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, var(--primary-color), var(--secondary-color));
}

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

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

.setting-select option {
    background: var(--dark-bg);
    color: var(--text-light);
}

/* FAQ Screen */
.faq-content {
    max-width: 700px;
    margin: 0 auto;
}

.faq-container {
    margin: 2rem 0;
}

.faq-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    margin-bottom: 0.85rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-light);
    padding: 1.1rem 1.25rem;
    text-align: left;
    font-size: 1.1rem;
    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.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.25rem 1.1rem;
    color: var(--text-muted);
    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 removida */

/* Footer */
footer {
    position: fixed;
    bottom: 12px;
    left: 0;
    right: 0;
    background: transparent;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    z-index: 999;
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent-color); }

.footer-bar {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

/* Responsive Design */
@media (min-width: 768px) {
    .neon-title {
        font-size: 4rem;
    }
    
    .home-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        max-width: 600px;
    }

    .home-quick {
        grid-template-columns: repeat(2, 1fr);
        max-width: 520px;
    }
    
    .home-highlights {
        grid-template-columns: repeat(3, 1fr);
        padding: 1rem 1.25rem;
    }
    
    .mobile-controls {
        display: none;
    }
    .fab { bottom: 24px; right: 24px; }
    
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gameover-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
    
    .pause-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
        max-width: 500px;
    }
    
    .bottom-nav {
        padding: 1rem 0;
    }
    
    .nav-item {
        max-width: 120px;
    }
    
    .nav-item span {
        font-size: 0.9rem;
    }
    
    footer {
        bottom: 80px;
    }
    .highscores-content {
        max-width: 640px;
    }
    .score-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .app-main {
        padding-top: 100px;
        padding-bottom: 100px;
    }
    
    .screen {
        padding: 2rem;
    }
    
    #gameCanvas {
        height: calc(100vh - 200px);
    }
}

/* Theme Variations */
.theme-neon {
    --primary-color: #00ff88;
    --secondary-color: #ff0088;
    --accent-color: #ffff00;
    --purple-color: #8800ff;
    --blue-color: #0088ff;
}

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

/* Focus styles for keyboard navigation */
.btn:focus,
.nav-item:focus,
.faq-question:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
