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

body {
    font-family: 'VT323', monospace;
    /* background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%); */
    background-image: url(./bg.jpg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #FFFFFF;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: #FFFFFF;
    position: relative;
}

header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-shadow: 
        0 0 10px #FFFFFF,
        0 0 20px #FFFFFF,
        2px 2px 0px #000;
}

header p {
    font-size: 1.5rem;
    opacity: 1;
    text-shadow: 0 0 5px #FFFFFF;
    font-weight: bold;
    text-transform: uppercase;
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.tools-panel {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 3px solid #FFFFFF;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    min-width: 280px;
    max-width: 320px;
    position: relative;
}

.tools-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFFFFF, #ff00ff, #00ffff, #FFFFFF);
    border-radius: 17px;
    z-index: -1;
    /* animation: borderGlow 3s linear infinite; */
}

/* @keyframes borderGlow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
} */

.tool-section, .color-section, .actions-section {
    margin-bottom: 25px;
}

.tool-section h3, .color-section h3, .actions-section h3 {
    margin-bottom: 15px;
    color: #FFFFFF;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-shadow: 0 0 5px #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    padding-bottom: 8px;
    letter-spacing: 1px;
}

.tool-buttons {
    display: flex;
    gap: 10px;
}

.tool-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    box-shadow: 
        0 0 10px rgba(0, 255, 65, 0.3),
        inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.tool-btn:hover {
    border-color: #ff00ff;
    color: #ff00ff;
    transform: translateY(-2px);
    box-shadow: 
        0 0 15px rgba(255, 0, 255, 0.4),
        inset 0 0 15px rgba(255, 0, 255, 0.2);
}

.tool-btn.active {
    border-color: #00ffff;
    background: linear-gradient(145deg, #00ffff, #0080ff);
    color: #000;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        inset 0 0 20px rgba(0, 255, 255, 0.3);
    transform: scale(1.05);
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    border-color: #FFFFFF;
}

.color-swatch.selected {
    border-color: #00ffff;
    transform: scale(1.1);
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(0, 255, 255, 0.3);
}

.custom-color {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-color label {
    font-size: 1.25rem;
    color: #FFFFFF;
    font-weight: bold;
    text-shadow: 0 0 5px #FFFFFF;
}

.custom-color input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    cursor: pointer;
    background: #1a1a2e;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.action-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #FFFFFF;
    border-radius: 8px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    color: #FFFFFF;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #FFFFFF;
    box-shadow: 
        0 0 10px rgba(0, 255, 65, 0.3),
        inset 0 0 10px rgba(0, 255, 65, 0.1);
    letter-spacing: 1px;
}

.action-btn:hover {
    border-color: #ff00ff;
    color: #ff00ff;
    transform: translateY(-2px);
    box-shadow: 
        0 0 15px rgba(255, 0, 255, 0.4),
        inset 0 0 15px rgba(255, 0, 255, 0.2);
    text-shadow: 0 0 5px #ff00ff;
}

.action-btn:last-child {
    margin-bottom: 0;
}

.canvas-container {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 3px solid #FFFFFF;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFFFFF, #ff00ff, #00ffff, #FFFFFF);
    border-radius: 17px;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

.canvas-wrapper {
    position: relative;
}

#pixel-canvas {
    border: 3px solid #FFFFFF;
    border-radius: 10px;
    cursor: crosshair;
    background: white;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.4),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.canvas-grid {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 506px;
    height: 506px;
    pointer-events: none;
    z-index: 1;
}

.grid-cell {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: absolute;
    pointer-events: auto;
    cursor: crosshair;
    transition: background-color 0.1s ease;
    box-sizing: border-box;
}

.grid-cell:hover {
    background-color: rgba(0, 255, 65, 0.2);
    border-color: #00ffff;
}

.canvas-info {
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 0 5px #FFFFFF;
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    
    .tools-panel {
        order: 2;
        min-width: 100%;
        max-width: 100%;
    }
    
    .canvas-container {
        order: 1;
    }
    
    #pixel-canvas {
        width: 320px;
        height: 320px;
    }
    
    .canvas-grid {
        width: 320px;
        height: 320px;
    }
    
    .grid-cell {
        width: 10px;
        height: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }

    
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    #pixel-canvas {
        width: 256px;
        height: 256px;
    }
    
    .canvas-grid {
        width: 256px;
        height: 256px;
    }
    
    .grid-cell {
        width: 8px;
        height: 8px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}
