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

body {
    background: #0a0a0a;
    color: #ff9933;
    font-family: 'Press Start 2P', monospace;
    overflow-x: hidden;
    position: relative;
}

/* 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: 1000;
}

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

@keyframes scanline-flicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.95; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #ff6600, 0 0 20px #ff6600;
}

.title {
    font-size: 2.5rem;
    color: #ff6600;
    letter-spacing: 0.3em;
    margin-bottom: 10px;
    text-transform: uppercase;
    animation: title-glow 2s ease-in-out infinite alternate;
}

@keyframes title-glow {
    from { text-shadow: 0 0 10px #ff6600, 0 0 20px #ff6600; }
    to { text-shadow: 0 0 20px #ff6600, 0 0 40px #ff6600, 0 0 60px #ff3300; }
}

.subtitle {
    font-size: 0.7rem;
    color: #ffaa00;
    letter-spacing: 0.2em;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.canvas-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
    background: #1a1a1a;
    border: 4px solid #666;
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.8),
        0 0 20px rgba(255, 102, 0, 0.3);
    padding: 10px;
}

#mainCanvas {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #000;
}

.info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6600;
    padding: 10px;
    font-size: 0.5rem;
    line-height: 1.8;
    color: #33cccc;
}

.info-line {
    color: #ffaa00;
}

.info-line span {
    color: #33cccc;
}

/* Control Panel */
.control-panel {
    width: 300px;
    background: #1a1a1a;
    border: 4px solid #666;
    padding: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.control-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    font-size: 0.7rem;
    color: #ff6600;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

/* Buttons */
button {
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 0.6rem;
    background: linear-gradient(180deg, #ff8833 0%, #ff6600 100%);
    border: 3px solid #ffaa00;
    color: #000;
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 4px 0 #cc5500;
    margin-bottom: 10px;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffaa44 0%, #ff8833 100%);
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.5),
        0 4px 0 #cc5500;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.3),
        0 2px 0 #cc5500;
}

.btn-secondary, .btn-preset {
    width: 100%;
    padding: 10px;
    font-size: 0.5rem;
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border: 2px solid #888;
    color: #ffaa00;
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.2),
        0 3px 0 #222;
    margin-bottom: 8px;
}

.btn-secondary:hover, .btn-preset:hover {
    background: linear-gradient(180deg, #777 0%, #555 100%);
    color: #ffcc33;
}

.btn-secondary:active, .btn-preset:active {
    transform: translateY(2px);
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.2),
        0 1px 0 #222;
}

/* Sliders */
.slider-group {
    margin: 15px 0;
}

.slider-group label {
    display: block;
    font-size: 0.5rem;
    color: #ffaa00;
    margin-bottom: 8px;
}

.slider-group span {
    color: #33cccc;
}

input[type="range"] {
    width: 100%;
    height: 20px;
    background: #333;
    border: 2px solid #666;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #ff6600;
    border: 2px solid #ffaa00;
    cursor: pointer;
    box-shadow: 0 0 5px #ff6600;
}

input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #ff6600;
    border: 2px solid #ffaa00;
    cursor: pointer;
    box-shadow: 0 0 5px #ff6600;
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.5rem;
    color: #ffaa00;
    margin: 10px 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Select */
.palette-selector {
    margin-top: 15px;
}

.palette-selector label {
    display: block;
    font-size: 0.5rem;
    color: #ffaa00;
    margin-bottom: 8px;
}

select {
    width: 100%;
    padding: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    background: #333;
    border: 2px solid #666;
    color: #33cccc;
    cursor: pointer;
}

/* Footer */
footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px;
    border-top: 2px solid #333;
}

.tribute {
    font-size: 0.5rem;
    color: #666;
    margin-bottom: 10px;
}

.credit {
    font-size: 0.5rem;
    color: #888;
}

.credit a {
    color: #ff6600;
    text-decoration: none;
    transition: color 0.2s;
}

.credit a:hover {
    color: #ffaa00;
    text-shadow: 0 0 10px #ff6600;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.5rem;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.generating {
    animation: pulse 0.5s ease-in-out infinite;
}