/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

:root {
    --neon-green: #00ff00;
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --neon-yellow: #ffff00;
    --arcade-red: #ff0000;
    --arcade-blue: #0000ff;
    --screen-bg: #000000;
    --cabinet-color: #1a0033;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(180deg, #0a0015 0%, #1a0033 50%, #0a0015 100%);
    color: var(--neon-green);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.5rem;
}

/* ==================== CRT Effects ==================== */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 9998;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 3px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* ==================== Arcade Frame ==================== */
.arcade-frame {
    width: 100%;
    max-width: 800px;
    background: linear-gradient(135deg, #1a0033 0%, #0d001a 50%, #1a0033 100%);
    border: 8px solid #ff00ff;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.5),
                inset 0 0 30px rgba(255, 0, 255, 0.2);
    padding: 1rem;
    position: relative;
    transform: scale(0.95);
    transform-origin: center top;
}

/* ==================== Top Navigation Bar ==================== */
.top-nav-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.top-nav-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--neon-yellow);
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px var(--neon-yellow);
}

.top-portfolio-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(180deg, var(--neon-yellow) 0%, #ccaa00 100%);
    border: 3px solid var(--neon-yellow);
    color: #000;
    text-decoration: none;
    cursor: pointer;
    text-shadow: none;
    box-shadow: 0 0 20px var(--neon-yellow),
                inset 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border-radius: 8px;
    display: inline-block;
    white-space: nowrap;
}

.top-portfolio-btn:hover {
    background: var(--neon-yellow);
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--neon-yellow),
                0 5px 20px rgba(0, 0, 0, 0.3),
                inset 0 0 15px rgba(255, 255, 255, 0.4);
}

.top-portfolio-btn:active {
    transform: translateY(0);
}

.arcade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.coin-slot {
    font-size: 0.6rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    animation: blink 1.5s ease-in-out infinite;
}

.game-title {
    font-size: 1.2rem;
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
    letter-spacing: 0.1em;
}

.high-score {
    font-size: 0.6rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* ==================== Game Screen ==================== */
.game-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000000;
    border: 5px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5),
                inset 0 0 50px rgba(0, 255, 0, 0.1);
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* ==================== HUD - Classic Galaga Style ==================== */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
}

.hud-1up, .hud-high, .hud-wave {
    text-align: center;
}

.hud-label {
    font-size: 0.5rem;
    color: #FF0000;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.hud-score {
    font-size: 0.7rem;
    color: #FFFFFF;
    letter-spacing: 0.2em;
}

.hud-bottom {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
}

.hud-lives {
    display: flex;
    gap: 0.5rem;
}

#lives-display {
    font-size: 1rem;
    color: #FFFFFF;
}

/* ==================== Start Screen ==================== */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.start-screen.hidden {
    display: none;
}

.start-content {
    text-align: center;
    animation: fadeIn 1s ease;
}

.title-text {
    font-size: 2.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px var(--neon-cyan),
                 0 0 50px var(--neon-cyan);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    animation: glow 2s ease-in-out infinite;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--neon-pink);
    margin-bottom: 2rem;
    letter-spacing: 0.2em;
}

.player-preview {
    margin: 2rem 0;
}

.player-preview canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 10px #00ff00);
    animation: float 2s ease-in-out infinite;
}

.instructions {
    margin: 2rem 0;
    font-size: 0.7rem;
    line-height: 2;
    color: var(--neon-yellow);
}

.enemy-roster {
    margin: 2rem 0;
    font-size: 0.6rem;
}

.enemy-row {
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.enemy-row canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.enemy {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px var(--neon-green));
}

.credits {
    margin-top: 2rem;
    font-size: 0.5rem;
    color: rgba(0, 255, 0, 0.5);
}

/* ==================== Game Over ==================== */
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.game-over.active {
    display: flex;
}

.game-over-content {
    text-align: center;
}

.game-over-content h1 {
    font-size: 3rem;
    color: var(--arcade-red);
    text-shadow: 0 0 30px var(--arcade-red);
    margin-bottom: 2rem;
}

.final-score, .collected-items {
    font-size: 0.8rem;
    margin: 1rem 0;
    color: var(--neon-cyan);
}

/* ==================== Pause Screen ==================== */
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 100;
}

.pause-screen.active {
    display: flex;
}

.pause-screen h1 {
    font-size: 2rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 30px var(--neon-yellow);
    margin-bottom: 1rem;
}

.pause-screen p {
    font-size: 0.7rem;
    color: var(--neon-green);
}

/* ==================== Buttons ==================== */
.arcade-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 1rem 2rem;
    margin: 0.5rem;
    background: linear-gradient(180deg, var(--neon-green) 0%, #00aa00 100%);
    border: 3px solid var(--neon-green);
    color: #000;
    cursor: pointer;
    text-shadow: none;
    box-shadow: 0 0 20px var(--neon-green),
                inset 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
    position: relative;
}

.arcade-btn:hover {
    background: var(--neon-green);
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--neon-green);
}

.arcade-btn:active {
    transform: scale(0.95);
}

.arcade-btn.small {
    font-size: 0.6rem;
    padding: 0.75rem 1.5rem;
}

/* ==================== Control Panel ==================== */
.control-panel {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid var(--neon-pink);
    margin-top: 0.75rem;
}

.control-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.3rem;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #ff0000 0%, #aa0000 100%);
    border: 4px solid #ff0000;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 0 #550000,
                0 0 30px rgba(255, 0, 0, 0.5),
                inset 0 5px 10px rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.control-btn:active,
.control-btn.pressed {
    transform: translateY(5px);
    box-shadow: 0 0 0 #550000,
                0 0 30px rgba(255, 0, 0, 0.7),
                inset 0 5px 10px rgba(0, 0, 0, 0.3);
}

.control-btn.fire {
    width: 85px;
    height: 85px;
    font-size: 0.7rem;
    background: radial-gradient(circle, #00ff00 0%, #00aa00 100%);
    border-color: #00ff00;
    box-shadow: 0 5px 0 #005500,
                0 0 30px rgba(0, 255, 0, 0.5),
                inset 0 5px 10px rgba(255, 255, 255, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.control-btn.fire:active,
.control-btn.fire.pressed {
    box-shadow: 0 0 0 #005500,
                0 0 30px rgba(0, 255, 0, 0.7);
}

/* ==================== Footer ==================== */
.arcade-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.footer-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.footer-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
}

/* ==================== Traditional View Section ==================== */
.traditional-view-section {
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid var(--neon-yellow);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.3);
}

.traditional-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--neon-yellow);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px var(--neon-yellow);
}

.traditional-btn {
    display: inline-block;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(180deg, var(--neon-yellow) 0%, #ccaa00 100%);
    border: 4px solid var(--neon-yellow);
    color: #000;
    text-decoration: none;
    cursor: pointer;
    text-shadow: none;
    box-shadow: 0 0 30px var(--neon-yellow),
                inset 0 0 15px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.traditional-btn:hover {
    background: var(--neon-yellow);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 50px var(--neon-yellow),
                inset 0 0 20px rgba(255, 255, 255, 0.5);
}

.traditional-btn:active {
    transform: scale(0.98) translateY(0);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 30px var(--neon-yellow),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 50px var(--neon-yellow),
                    0 0 70px var(--neon-yellow),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
}

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

.modal.active {
    display: flex;
}

.arcade-modal {
    background: #000000;
    border: 5px solid var(--neon-pink);
    padding: 2rem;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 0 50px var(--neon-pink);
    position: relative;
}

.arcade-modal.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--neon-cyan);
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 20px var(--neon-cyan);
}

.modal-close {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    background: var(--arcade-red);
    border: 2px solid var(--arcade-red);
    color: #fff;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 0 20px var(--arcade-red);
}

.modal-close:hover {
    background: #fff;
    color: var(--arcade-red);
}

.info-icon {
    font-size: 4rem;
    margin: 2rem 0;
    text-align: center;
    filter: drop-shadow(0 0 20px var(--neon-green));
}

.info-content {
    font-size: 0.7rem;
    line-height: 2;
    color: var(--neon-green);
    margin: 2rem 0;
}

.info-content h3 {
    color: var(--neon-cyan);
    margin-bottom: 1rem;
}

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

/* ==================== Collection Grid ==================== */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.collection-item {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid rgba(0, 255, 0, 0.3);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.collection-item.collected {
    border-color: var(--neon-green);
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.collection-item.collected .item-icon {
    filter: none;
}

.item-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: grayscale(100%) brightness(0.3);
}

.item-name {
    font-size: 0.5rem;
    color: var(--neon-green);
}

/* ==================== Achievements ==================== */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid rgba(0, 255, 0, 0.3);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-item.unlocked {
    border-color: var(--neon-green);
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.achievement-icon {
    font-size: 2rem;
    filter: grayscale(100%) brightness(0.3);
}

.achievement-item.unlocked .achievement-icon {
    filter: none;
    animation: bounce 0.5s ease;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-size: 0.7rem;
    color: var(--neon-cyan);
    margin-bottom: 0.5rem;
}

.achievement-desc {
    font-size: 0.5rem;
    color: rgba(0, 255, 0, 0.7);
}

/* ==================== Animations ==================== */
@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0; }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px var(--neon-cyan),
                     0 0 40px var(--neon-cyan);
    }
    50% {
        text-shadow: 0 0 30px var(--neon-cyan),
                     0 0 60px var(--neon-cyan),
                     0 0 80px var(--neon-cyan);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.blink {
    animation: blink 1s ease-in-out infinite;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .game-title {
        font-size: 0.8rem;
    }
    
    .arcade-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .title-text {
        font-size: 1.5rem;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }
    
    .control-btn.fire {
        width: 80px;
        height: 80px;
        font-size: 0.6rem;
    }
    
    .arcade-footer {
        flex-direction: column;
    }
    
    .arcade-btn {
        font-size: 0.6rem;
        padding: 0.75rem 1.5rem;
    }
    
    .traditional-view-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .traditional-text {
        font-size: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .traditional-btn {
        font-size: 0.6rem;
        padding: 1rem 1.5rem;
    }
    
    .top-nav-bar {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .top-nav-text {
        font-size: 0.4rem;
    }
    
    .top-portfolio-btn {
        font-size: 0.5rem;
        padding: 0.5rem 0.8rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
}



