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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#device-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

#pixter-device {
    background: linear-gradient(145deg, #ff6b9d, #f06292);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 2px 8px rgba(255,255,255,0.3),
        inset 0 -2px 8px rgba(0,0,0,0.2);
    border: 3px solid #e91e63;
    position: relative;
    transform: perspective(1000px) rotateX(5deg);
    max-width: 500px;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 15px;
}

.mattel-logo {
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.pixter-title {
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.battery-indicator {
    width: 30px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 3px;
    position: relative;
    background: rgba(0,0,0,0.2);
}

.battery-level {
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 1px;
}

.battery-indicator::after {
    content: '';
    width: 3px;
    height: 6px;
    background: #fff;
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 2px 2px 0;
}

.screen-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.screen-bezel {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 
        inset 0 4px 8px rgba(0,0,0,0.5),
        inset 0 -2px 4px rgba(255,255,255,0.1);
    position: relative;
}

#drawing-canvas {
    background: #9BBB59;
    border: 2px solid #1a1a1a;
    border-radius: 5px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

.scan-lines {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 288px;
    height: 192px;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0,0,0,0.03) 1px,
        rgba(0,0,0,0.03) 3px
    );
    border-radius: 5px;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.left-controls, .right-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-panel, .color-panel, .size-panel {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 15px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.tool-label {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.tool-btn, .color-btn, .size-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    margin: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.2),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.tool-btn:hover, .color-btn:hover, .size-btn:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.3),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.tool-btn.active, .color-btn.active, .size-btn.active {
    transform: translateY(1px);
    box-shadow: 
        inset 0 3px 6px rgba(0,0,0,0.3),
        inset 0 -1px 2px rgba(255,255,255,0.3);
}

.dpad {
    display: grid;
    grid-template-areas: 
        ". up ."
        "left center right"
        ". down .";
    gap: 2px;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 15px;
}

.dpad-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 2px rgba(255,255,255,0.8);
    transition: all 0.1s ease;
}

.dpad-btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.dpad-btn.up { grid-area: up; }
.dpad-btn.left { grid-area: left; }
.dpad-btn.center { 
    grid-area: center; 
    background: linear-gradient(145deg, #ff4757, #ff3742);
    color: white;
    font-size: 16px;
}
.dpad-btn.right { grid-area: right; }
.dpad-btn.down { grid-area: down; }

.center-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 10px;
    color: #333;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.2),
        inset 0 1px 2px rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.3),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.action-btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.3);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.color-btn {
    border: 2px solid #666;
}

.size-btn {
    font-size: 8px;
    font-weight: 700;
    color: #333;
}

.device-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.speaker-grille {
    width: 40px;
    height: 15px;
    background: repeating-linear-gradient(
        90deg,
        #333,
        #333 1px,
        transparent 1px,
        transparent 3px
    );
    border-radius: 3px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

#volume-slider {
    width: 50px;
    height: 15px;
}

#gallery-panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 250px;
}

#gallery-panel h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.gallery-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    border-radius: 5px;
    margin-bottom: 5px;
}

.gallery-controls {
    display: flex;
    gap: 5px;
}

.gallery-controls button {
    flex: 1;
    padding: 4px;
    border: none;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    color: #333;
    transition: all 0.2s ease;
}

.gallery-controls button:hover {
    transform: translateY(-1px);
}

#startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2c3e50, #4a90e2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.startup-content {
    text-align: center;
    color: #fff;
}

.mattel-logo-large {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.pixter-logo-large {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #ff6b9d;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    letter-spacing: 4px;
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin: 20px auto;
    overflow: hidden;
}

.loading-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #4a90e2);
    border-radius: 4px;
    transition: width 2s ease;
}

.startup-text {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    #device-container {
        flex-direction: column;
        align-items: center;
    }
    
    #pixter-device {
        transform: none;
        max-width: 90vw;
    }
    
    .controls-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .left-controls, .right-controls {
        flex-direction: row;
        justify-content: space-around;
    }
    
    #gallery-panel {
        width: 90vw;
        max-width: none;
    }
}

/* Retro glow effects */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 107, 157, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 157, 0.8); }
}

.tool-btn.active, .color-btn.active, .size-btn.active {
    animation: glow 2s infinite;
}

/* Pixel art styling for small elements */
.tool-btn, .color-btn, .size-btn, .action-btn {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}