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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f0f0f0;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 0.5rem;
}

h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title-icon {
    width: 2rem;
    height: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.input-section {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 0.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 0.35rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.dimensions-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

button {
    display: block;
    width: 100%;
    padding: 0.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.canvas-container {
    background-color: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    text-align: center;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

canvas {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    image-rendering: pixelated;
}

.legend {
    background-color: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.legend h3 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 0.5rem;
    justify-items: center;
    margin-bottom: 0.5rem;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    justify-content: center;
}

.color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.digit-label {
    font-size: 1rem;
    font-weight: bold;
    min-width: 1.25rem;
    text-align: center;
}

.legend-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.secondary-button {
    background-color: #95a5a6;
    padding: 0.35rem 0.75rem;
    width: auto;
}

.secondary-button:hover {
    background-color: #7f8c8d;
}

@media (max-width: 768px) {
    .dimensions-group {
        grid-template-columns: 1fr;
    }
    
    .color-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legend-controls {
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }
} 