:root {
    --bg: #050505;
    --panel: #111;
    --accent: #ffffff;
    --border: #222;
    --text: #888;
}

body {
    background: var(--bg);
    color: white;
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 300px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sidebar.hidden { margin-left: -300px; }

.sidebar-header { padding: 25px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 14px; letter-spacing: 3px; margin: 0; }

.scroll-area { padding: 20px; overflow-y: auto; flex-grow: 1; }

section { margin-bottom: 30px; }
.label-group { font-size: 10px; color: var(--text); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 15px; }

.control { margin-bottom: 15px; }
label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: #ccc; }

input[type="range"] { width: 100%; accent-color: var(--accent); }
select, input[type="text"] { 
    width: 100%; background: #1a1a1a; border: 1px solid var(--border); 
    color: white; padding: 8px; border-radius: 4px; font-size: 13px;
}

.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
input[type="color"] { width: 100%; height: 30px; border: none; background: none; cursor: pointer; }

#toggle-btn {
    position: fixed; left: 310px; top: 20px;
    background: white; border: none; width: 40px; height: 40px;
    border-radius: 5px; cursor: pointer; z-index: 100; transition: left 0.3s;
}
#sidebar.hidden + #toggle-btn { left: 20px; }

#viewport { flex-grow: 1; display: flex; align-items: center; justify-content: center; position: relative; }
canvas { max-width: 90%; max-height: 90%; transform: scaleX(-1); border: 1px solid var(--border); }

.hidden { display: none; }
.btn-main { 
    width: 100%; padding: 12px; background: white; border: none; 
    font-weight: bold; cursor: pointer; margin-top: 10px; 
}

.back-btn-container {
    margin-top: 10px;
    padding-left: 20px;
}

.back-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    overflow: hidden;
}

.back-btn img {
    width: 70%;
    height: auto;
}

.back-btn:hover {
    transform: scale(1.1) rotate(-20deg);
}