/* Coloring Book — game-specific styles */

/* Structure selector tabs */
.cb-structure-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.cb-structure-tab {
    background-color: var(--mp-cream);
    border: 1px solid var(--mp-tan-light);
    color: var(--mp-olive);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-family: var(--mp-font-ui);
    transition: background-color 0.15s;
}
.cb-structure-tab:hover {
    background-color: var(--mp-cream-dark);
}
.cb-structure-tab.active {
    background-color: var(--mp-btn-bg);
    color: #ffffff;
    border-color: var(--mp-btn-bg);
}

/* Canvas container — cream paper background */
.cb-canvas-wrap {
    position: relative;
    background-color: #FEFAF0;
    border: 1px solid var(--mp-tan);
    min-height: 600px;
    cursor: crosshair;
}
.cb-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Tool picker (Fill / Marker / Pencil / Eraser) */
.cb-tool-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.cb-tool-pick-btn {
    text-align: center;
    font-size: 0.8rem;
    padding: 0.35rem 0.25rem;
}
.cb-tool-pick-btn.active {
    background-color: var(--mp-btn-bg);
    color: #ffffff;
    border-color: var(--mp-btn-bg);
}

/* Brush size slider */
#brushSizeGroup {
    margin-bottom: 0.5rem;
}
#brushSizeGroup label {
    font-size: 0.8rem;
    color: var(--mp-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}
.cb-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--mp-tan-light, #cccc99);
    border-radius: 3px;
    outline: none;
}
.cb-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--mp-btn-bg, #666633);
    border-radius: 50%;
    cursor: pointer;
}
.cb-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--mp-btn-bg, #666633);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.cb-mode-desc {
    font-size: 0.75rem;
    color: var(--mp-text-light);
    line-height: 1.3;
}

/* Color palette grid */
.cb-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
}
.cb-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
}
.cb-color-swatch:hover {
    transform: scale(1.1);
    border-color: #666;
}
.cb-color-swatch.active {
    border-color: #333;
    box-shadow: 0 0 0 2px #333;
    transform: scale(1.1);
}

/* Tools */
.cb-tools {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.cb-tool-btn {
    width: 100%;
    text-align: center;
}

/* Legend */
.cb-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.cb-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.cb-legend-swatch {
    width: 20px;
    height: 12px;
    border: 1px solid #999;
    border-radius: 2px;
    flex-shrink: 0;
}
.cb-legend-helix {
    background-color: #f0f0e8;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.06) 3px
    );
}
.cb-legend-strand {
    background-color: #f0f0e8;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.06) 2px,
        rgba(0,0,0,0.06) 3px
    );
}
.cb-legend-loop {
    background-color: #f0f0e8;
}

/* Hover tooltip for segments */
.cb-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
    font-family: var(--mp-font-ui);
    display: none;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .cb-canvas-wrap {
        min-height: 400px;
    }
    .game-sidebar {
        margin-top: 0.5rem;
    }
    .game-sidebar .mp-game-panel {
        margin-bottom: 0.5rem;
        padding: 0.75rem;
    }
}
