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

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460);
    color: #00FFFF;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Scan lines effect */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 0%,
        rgba(0, 255, 255, 0.03) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.power-indicator {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
}

.led {
    width: 12px;
    height: 12px;
    background: #00FF00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00FF00;
    animation: pulse 2s infinite;
}

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

.title {
    font-size: 24px;
    color: #FF1493;
    text-shadow: 2px 2px 0 #00FFFF, 4px 4px 8px rgba(255, 20, 147, 0.5);
    margin-bottom: 10px;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 0 #00FFFF, 4px 4px 8px rgba(255, 20, 147, 0.5); }
    to { text-shadow: 2px 2px 0 #00FFFF, 4px 4px 16px rgba(255, 20, 147, 0.8); }
}

.subtitle {
    font-size: 12px;
    color: #FFA500;
}

/* Main content */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Canvas section */
.canvas-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#mainCanvas {
    border: 4px solid #00FFFF;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.preview-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#previewCanvas {
    border: 2px solid #FF1493;
    border-radius: 4px;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.character-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
}

.stat-bar span {
    width: 30px;
    color: #FFA500;
}

.bar {
    flex: 1;
    height: 12px;
    background: #333;
    border: 1px solid #666;
    border-radius: 2px;
    overflow: hidden;
}

.fill {
    height: 100%;
    transition: width 0.5s ease;
}

.hp-fill { background: linear-gradient(90deg, #FF0000, #FF6666); }
.mp-fill { background: linear-gradient(90deg, #0066FF, #6699FF); }
.str-fill { background: linear-gradient(90deg, #FFD700, #FFFF66); }

/* Controls section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-zone {
    border: 3px dashed #00FFFF;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 255, 255, 0.05);
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: #FF1493;
    background: rgba(255, 20, 147, 0.1);
    transform: scale(1.02);
}

.upload-content .upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.upload-content p {
    font-size: 10px;
    margin-bottom: 5px;
}

.file-info {
    color: #FFA500;
}

.upload-content small {
    font-size: 8px;
    color: #666;
}

/* Background selector */
.background-selector h3 {
    font-size: 12px;
    margin-bottom: 15px;
    color: #FFA500;
}

.bg-thumbnails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bg-thumb {
    padding: 15px 10px;
    border: 2px solid #666;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    font-size: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.bg-thumb:hover {
    border-color: #00FFFF;
    transform: scale(1.05);
}

.bg-thumb.active {
    border-color: #FF1493;
    background: rgba(255, 20, 147, 0.2);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
}

/* Customization panel */
.customization-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 8px;
    color: #FFA500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #FF1493;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #FF1493;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
}

.control-group select {
    padding: 8px;
    background: #333;
    border: 1px solid #666;
    border-radius: 4px;
    color: #00FFFF;
    font-family: inherit;
    font-size: 8px;
}

.control-group select:focus {
    border-color: #FF1493;
    outline: none;
}

#pixelSizeValue {
    font-size: 8px;
    color: #00FFFF;
    text-align: center;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(45deg, #FF1493, #FF69B4);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.6);
}

.btn.secondary {
    background: linear-gradient(45deg, #00FFFF, #40E0D0);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
}

.btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.6);
}

.btn.tertiary {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.btn.tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.6);
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    border: 1px solid #00FFFF;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FFFF, #FF1493);
    transition: width 2s ease;
    border-radius: 10px;
}

#loadingText {
    font-size: 10px;
    color: #FFA500;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Message overlay */
.message-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #00FFFF;
    padding: 20px 30px;
    border-radius: 8px;
    border: 2px solid #FF1493;
    font-size: 12px;
    z-index: 2000;
    animation: messageSlide 0.5s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

.footer p {
    font-size: 8px;
    color: #666;
}

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

.footer a:hover {
    color: #00FFFF;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    #mainCanvas {
        width: 100%;
        height: auto;
    }
    
    .preview-section {
        flex-direction: column;
        align-items: center;
    }
    
    .bg-thumbnails {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 14px;
    }
    
    .power-indicator {
        position: static;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .upload-zone {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 8px;
    }
}