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

body {
    font-family: 'Press Start 2P', cursive;
    background: #1a1a1a;
    color: #fff;
    overflow-x: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#game-container {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Status Bar */
#status-bar {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 40px;
    border-bottom: 4px solid #3a3a3a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.status-icon {
    font-size: 20px;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.8));
}

/* Main Content */
#main-content {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    position: relative;
}

#canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#game-canvas {
    border: 4px solid #3a3a3a;
    background: #0a0a0a;
    box-shadow: 0 8px 16px rgba(0,0,0,0.8);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

#game-canvas.scanlines {
    position: relative;
}

#game-canvas.scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

#hover-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    padding: 10px 20px;
    border: 2px solid #4a4a4a;
    font-size: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

#hover-info.visible {
    opacity: 1;
}

/* Side Controls */
#side-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 120px;
}

.control-btn {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border: 3px solid #3a3a3a;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.control-btn:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
    border-color: #6a6a6a;
    transform: translateY(-2px);
}

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

.control-btn img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.emoji-icon {
    font-size: 24px;
}

/* Tower Palette */
#tower-palette {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    border-top: 4px solid #3a3a3a;
    box-shadow: 0 -4px 8px rgba(0,0,0,0.5);
    flex-wrap: wrap;
}

.tower-card {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 3px solid #4a4a4a;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-width: 120px;
}

.tower-card:hover {
    border-color: #6a6a6a;
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.8);
}

.tower-card.selected {
    border-color: #ffd700;
    background: linear-gradient(180deg, #4a4a2a 0%, #3a3a1a 100%);
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.tower-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    image-rendering: pixelated;
}

.tower-name {
    font-size: 10px;
    margin-bottom: 5px;
}

.tower-cost {
    font-size: 9px;
    color: #ffd700;
    margin-bottom: 5px;
}

.tower-desc {
    font-size: 7px;
    color: #aaa;
}

/* Toast */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 20px 40px;
    border: 3px solid #4a4a4a;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#toast.show {
    opacity: 1;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 4px solid #4a4a4a;
    padding: 30px;
    max-width: 500px;
    text-align: center;
}

.modal-content h2 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #ffd700;
}

.modal-content p {
    font-size: 10px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.easter-egg {
    color: #888;
    font-size: 8px;
    margin-top: 20px;
}

.modal-content button {
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border: 3px solid #6a6a6a;
    color: #fff;
    padding: 15px 30px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    margin-top: 20px;
}

.modal-content button:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
}

/* Footer */
footer {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    padding: 20px;
    text-align: center;
    border-top: 4px solid #3a3a3a;
    font-size: 8px;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

footer a {
    color: #ff69b4;
    text-decoration: none;
}

footer a:hover {
    color: #ff1493;
}

/* Responsive */
@media (max-width: 1024px) {
    #main-content {
        flex-direction: column;
    }
    
    #side-controls {
        flex-direction: row;
        min-width: auto;
        justify-content: center;
    }
    
    .status-item {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #status-bar {
        gap: 20px;
        padding: 10px;
    }
    
    .status-item {
        font-size: 10px;
    }
    
    .status-icon {
        font-size: 16px;
    }
    
    #tower-palette {
        padding: 10px;
        gap: 10px;
    }
    
    .tower-card {
        min-width: 90px;
        padding: 10px;
    }
    
    .tower-icon {
        width: 48px;
        height: 48px;
    }
    
    .control-btn {
        font-size: 7px;
        padding: 8px;
    }
    
    .control-btn img {
        width: 24px;
        height: 24px;
    }
}

/* Loading animation */
.bounce {
    animation: bounce 0.3s ease-in-out;
}

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

/* Placement animations */
.placed {
    animation: placeAnim 0.3s ease-out;
}

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