/* ═══════════════════════════════════════════════════════════════
   ScorlyBoard — color-picker.css
   Styles du sélecteur de couleur HSV partagé (joueurs & thèmes).
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.cp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.cp-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Bottom sheet ── */
.cp-sheet {
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 36px;
    width: 100%;
    max-width: 460px;
    transform: translateY(28px);
    transition: transform 0.22s ease;
    user-select: none;
    -webkit-user-select: none;
}

.cp-overlay.open .cp-sheet {
    transform: translateY(0);
}

.cp-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 0 auto 14px;
}

.cp-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: 18px;
}

/* ── Saturation / Value square ── */
.cp-sv {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3;
    border-radius: 10px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    margin-bottom: 14px;
}

.cp-sv-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.cp-sv-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, #000);
}

.cp-sv-cursor {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
    transition: background 0.05s;
}

/* ── Hue bar ── */
.cp-hue {
    position: relative;
    height: 18px;
    border-radius: 9px;
    background: linear-gradient(to right,
    hsl(0,100%,50%),   hsl(30,100%,50%),
    hsl(60,100%,50%),  hsl(90,100%,50%),
    hsl(120,100%,50%), hsl(150,100%,50%),
    hsl(180,100%,50%), hsl(210,100%,50%),
    hsl(240,100%,50%), hsl(270,100%,50%),
    hsl(300,100%,50%), hsl(330,100%,50%),
    hsl(360,100%,50%));
    cursor: pointer;
    touch-action: none;
    margin-bottom: 16px;
}

.cp-hue-cursor {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.5);
    background: transparent;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ── Bottom row : preview + hex ── */
.cp-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.cp-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: background 0.07s;
}

.cp-hex-input {
    flex: 1;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'DM Mono', 'Courier New', monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    outline: none;
    transition: border-color 0.15s;
}

.cp-hex-input:focus {
    border-color: var(--accent, #9b59f5);
}

/* ── Buttons ── */
.cp-btn-confirm {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--accent, #9b59f5);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: opacity 0.15s;
}

.cp-btn-confirm:active { opacity: 0.82; }

.cp-btn-cancel {
    display: block;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: var(--sub);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ── "Couleur libre" dot in player color picker ── */
.color-dot-picker {
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px dashed var(--border) !important;
    color: var(--sub);
    transition: border-color 0.15s, background 0.15s;
}

.color-dot-picker.selected {
    border-style: solid !important;
    border-color: white !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}