:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f3f4f6;
    --text-muted: #9ca3af;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 25%);
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

main {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

canvas {
    max-width: 100%;
    max-height: 512px;
    border-radius: 1rem;
    image-rendering: pixelated;
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.2);
}

.controls {
    width: 100%;
    margin-top: 2rem;
    padding: 0 2rem;
}

.integrated-settings {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.integrated-settings .settings-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.integrated-settings label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.integrated-settings button {
    flex-basis: 100px;
    height: 48px;
    margin-top: auto;
}

.integrated-settings input[type=range] {
    margin-top: 0.5rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.upload-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.preset-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.6rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.preset-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.preset-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.primary-btn {
    flex: 1;
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
    padding: 0.8rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 0.8rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.status-bar.show {
    opacity: 1;
}

.pulse-border {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { border-color: var(--border); }
    50% { border-color: rgba(99, 102, 241, 0.5); }
    100% { border-color: var(--border); }
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
}
