:root {
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --panel-border: #333;
    --accent-color: #4a9eff;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --max-width: 450px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden; 
}

.picker-layout {
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Top Section: Wheel + Alpha --- */
.top-section {
    display: grid;
    grid-template-columns: 1fr 40px; 
    gap: 15px;
    align-items: stretch;
}

.canvas-wrapper {
    position: relative;
    background: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    touch-action: none; 
}

/* --- RGB Sliders --- */
.sliders-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rgb-wrapper {
    height: 120px;
}

/* --- Result --- */
.result-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: var(--panel-bg);
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    justify-content: space-between;
    border: 1px solid var(--panel-border);
}

.preview-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    background-image: 
        linear-gradient(45deg, #555 25%, transparent 25%), 
        linear-gradient(-45deg, #555 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #555 75%), 
        linear-gradient(-45deg, transparent 75%, #555 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    overflow: hidden;
    flex-shrink: 0;
}

#previewInner { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%;
}

#colorText {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-right: 10px;
}

/* --- Additional Controls --- */
.controls-section {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.format-selector {
    display: flex;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--panel-border);
}

.format-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.format-btn.active {
    background: var(--accent-color);
    color: white;
}

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

.action-btn {
    padding: 6px 12px;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #2a2a2a;
}

/* --- Value Display --- */
.value-display {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.value-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px;
}

.value-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.value-number {
    font-family: monospace;
    font-size: 0.9rem;
    background: var(--panel-bg);
    padding: 6px 10px;
    border-radius: 6px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--panel-border);
}

/* --- Presets --- */
.presets-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.preset-color {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.preset-color:hover {
    transform: scale(1.1);
}

.preset-color.active {
    border-color: white;
    transform: scale(1.1);
}

.footer-text {
    text-align: center;
    font-size: 8px;
    font-family: monospace;
    opacity: 0.7;
}
