/* =============================================
   CS2 Custom Case Builder — Styles
   ============================================= */

:root {
    --cc-bg: #0a0c14;
    --cc-surface: #141824;
    --cc-surface2: #1c2030;
    --cc-border: #2a3040;
    --cc-gold: #f0c040;
    --cc-gold-dim: #8a7030;
    --cc-blue: #4a90d9;
    --cc-green: #4ade80;
    --cc-red: #f87171;
    --cc-purple: #a78bfa;
    --cc-text: #e2e8f0;
    --cc-text-dim: #8892a6;
    --cc-common: #c0c0c0;
    --cc-rare: #4169e1;
    --cc-restricted: #4169e1;
    --cc-classified: #9400d3;
    --cc-epic: #9400d3;
    --cc-covert: #eb4b4b;
    --cc-legendary: #ffd700;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Hide number input spinner buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

body.cc-body {
    background: var(--cc-bg);
    color: var(--cc-text);
    font-family: "Montserrat", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Back link */
.cc-back-link {
    position: fixed; top: 12px; left: 16px;
    z-index: 200;
    color: var(--cc-text-dim); text-decoration: none;
    font-size: 0.85rem; padding: 6px 12px;
    border-radius: 0; border: 1px solid var(--cc-border);
    background: var(--cc-surface2); transition: all 0.2s;
}
.cc-back-link:hover { color: var(--cc-gold); border-color: var(--cc-gold); }

/* Main container */
.cc-container {
    max-width: 1200px; margin: 0 auto; padding: 20px;
}

/* Header */
.cc-header {
    text-align: center; margin: 30px 0 24px;
}
.cc-header h1 {
    font-size: 2.2rem; font-weight: 800;
    font-family: "Orbitron", sans-serif;
    background: linear-gradient(135deg, var(--cc-purple), var(--cc-blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cc-header p { color: var(--cc-text-dim); margin-top: 6px; font-size: 0.9rem; }

/* Tab bar */
.cc-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    border-bottom: 1px solid var(--cc-border); padding-bottom: 0;
}
.cc-tab-btn {
    padding: 10px 24px; border: none; background: transparent;
    color: var(--cc-text-dim); font-size: 0.9rem; font-weight: 500;
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: all 0.2s; font-family: inherit;
}
.cc-tab-btn:hover { color: var(--cc-text); }
.cc-tab-btn.active {
    color: var(--cc-purple); border-bottom-color: var(--cc-purple);
}

/* Tab panels */
.cc-tab-panel { display: none; }
.cc-tab-panel.active { display: block; }

/* Main grid: left = item picker, right = case config */
.cc-builder-grid {
    display: grid; grid-template-columns: 1fr 380px; gap: 20px;
}
@media (max-width: 900px) {
    .cc-builder-grid { grid-template-columns: 1fr; }
}

/* Panels */
.cc-panel {
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    padding: 20px;
}
.cc-panel-title {
    font-size: 1rem; font-weight: 600; margin-bottom: 16px;
    color: var(--cc-text-dim); text-transform: uppercase; letter-spacing: 0.05em;
}

/* Search + Filter bar */
.cc-search-bar {
    display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.cc-search-input {
    flex: 1; min-width: 200px;
    padding: 10px 14px; border-radius: 0; border: 1px solid var(--cc-border);
    background: var(--cc-surface2); color: var(--cc-text);
    font-size: 0.9rem; font-family: inherit;
}
.cc-search-input::placeholder { color: var(--cc-text-dim); }
.cc-search-input:focus { outline: none; border-color: var(--cc-purple); }

.cc-filter-select {
    padding: 10px 14px; border-radius: 0; border: 1px solid var(--cc-border);
    background: var(--cc-surface2); color: var(--cc-text);
    font-size: 0.9rem; font-family: inherit; cursor: pointer;
    min-width: 130px;
}

/* ── Value Range Slider ── */
.cc-value-range {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: var(--cc-surface2);
    border: 1px solid var(--cc-border);
    flex-wrap: wrap;
}
.cc-value-range-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cc-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.cc-value-range-track-wrap {
    position: relative;
    flex: 1;
    min-width: 140px;
    height: 28px;
    display: flex;
    align-items: center;
}
/* Dual-thumb range inputs */
.cc-range-thumb {
    position: absolute;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
    margin: 0;
}
.cc-range-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cc-purple);
    border: 2px solid var(--cc-surface);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 0 6px rgba(167,139,250,0.4);
    transition: transform 0.1s;
}
.cc-range-thumb::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}
.cc-range-thumb::-webkit-slider-thumb:active {
    transform: scale(1.35);
}
.cc-range-thumb::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cc-purple);
    border: 2px solid var(--cc-surface);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 0 6px rgba(167,139,250,0.4);
}
/* Active track (filled between min & max) */
.cc-range-active-track {
    position: absolute;
    height: 4px;
    background: linear-gradient(90deg, var(--cc-purple), var(--cc-blue));
    border-radius: 2px;
    z-index: 1;
    pointer-events: none;
}
/* Track background (the "rail") rendered via a pseudo-element on the wrapper */
.cc-value-range-track-wrap::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: var(--cc-border);
    border-radius: 2px;
    z-index: 0;
}
.cc-value-range-labels {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--cc-gold);
}
.cc-value-range-val {
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    max-width: 85px;
    text-align: center;
    background: transparent;
    border: 1px solid var(--cc-border);
    color: var(--cc-gold);
    font-size: 0.73rem;
    font-weight: 500;
    font-family: inherit;
    padding: 3px 6px;
    border-radius: 0;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}
.cc-value-range-val::-webkit-inner-spin-button,
.cc-value-range-val::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cc-value-range-val:focus {
    outline: none;
    border-color: var(--cc-purple);
}
.cc-value-range-sep {
    color: var(--cc-text-dim);
    font-size: 0.7rem;
}
.cc-value-range-reset {
    background: none;
    border: none;
    color: var(--cc-text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s;
    line-height: 1;
}
.cc-value-range-reset:hover {
    color: var(--cc-purple);
}

/* Item grid */
.cc-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1px; min-height: 380px;
    align-content: start;
}
.cc-item-grid::-webkit-scrollbar { width: 4px; }
.cc-item-grid::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 2px; }

/* ── Pagination controls ── */
.cc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.cc-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface2);
    color: var(--cc-text);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    clip-path: polygon(12% 0, 100% 0, 88% 100%, 0% 100%);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-page-btn:hover:not(:disabled) {
    border-color: var(--cc-purple);
    color: var(--cc-purple);
}
.cc-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.cc-page-btn.active {
    background: var(--cc-purple);
    border-color: var(--cc-purple);
    color: #fff;
    font-weight: 700;
}
.cc-page-info {
    font-size: 0.75rem;
    color: var(--cc-text-dim);
    margin: 0 6px;
}

/* Item card */
.cc-item-card {
    border: 2px solid transparent; border-radius: 0;
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0% 100%);
    padding: 10px; text-align: center;
    background: var(--cc-surface2); transition: all 0.2s;
    cursor: pointer; position: relative;
}
.cc-item-card:hover { transform: translateY(-2px); border-color: var(--cc-border); }
.cc-item-card.selected { border-color: var(--cc-purple); background: rgba(167,139,250,0.08); }

/* Image wrapper with radial gradient tier backdrop */
.cc-item-img-wrap {
    width: 72px; height: 72px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-item-card img {
    width: 64px; height: 64px; object-fit: contain;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}
.cc-item-card .cc-item-name {
    font-size: 0.75rem; font-weight: 500; line-height: 1.3;
    overflow-wrap: break-word; word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cc-item-card .cc-item-wear {
    font-size: 0.6rem; color: var(--cc-text-dim, #888);
    text-transform: none; margin-top: 0;
}
.cc-item-card .cc-item-value {
    font-size: 0.7rem; color: var(--cc-gold); margin-top: 2px;
}
/* cc-item-tier text label — no longer rendered in cards; tier is shown via radial gradient on img wrapper */
.cc-item-card .cc-item-tier { display: none; }

.cc-item-card .cc-item-check {
    position: absolute; top: 6px; right: 6px;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--cc-border); background: var(--cc-surface);
    font-size: 0.6rem; display: flex; align-items: center; justify-content: center;
    color: transparent; transition: all 0.2s;
}
.cc-item-card.selected .cc-item-check {
    background: var(--cc-purple); border-color: var(--cc-purple);
    color: #fff;
}

/* Right panel: Case Config */
.cc-case-config { display: flex; flex-direction: column; gap: 16px; }

.cc-form-group { display: flex; flex-direction: column; gap: 6px; }
.cc-form-label {
    font-size: 0.8rem; font-weight: 600; color: var(--cc-text-dim);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.cc-form-input {
    padding: 10px 14px; border-radius: 0; border: 1px solid var(--cc-border);
    background: var(--cc-surface2); color: var(--cc-text);
    font-size: 0.9rem; font-family: inherit;
}
.cc-form-input:focus { outline: none; border-color: var(--cc-purple); }

.cc-color-input-wrapper {
    display: flex; align-items: center; gap: 10px;
}
.cc-color-preview {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid var(--cc-border); flex-shrink: 0;
}

/* Selected items list */
.cc-selected-items {
    max-height: 300px; overflow-y: auto;
}
.cc-selected-items::-webkit-scrollbar { width: 4px; }
.cc-selected-items::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 2px; }

.cc-selected-item {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    background: var(--cc-surface2); margin-bottom: 6px;
    overflow: hidden;
}
/* Gradient backdrop from tier color (fades left to right) */
.cc-selected-item::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(
        to right,
        var(--item-tier-color, var(--cc-purple)) 0%,
        transparent 100%
    );
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}
.cc-selected-item img {
    position: relative; z-index: 1;
    width: 32px; height: 32px; object-fit: contain; border-radius: 4px;
}
.cc-selected-item .cc-si-name {
    position: relative; z-index: 1;
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 1px;
}
.cc-si-name-row {
    font-size: 0.78rem; font-weight: 500;
    overflow-wrap: break-word; word-break: break-word;
    overflow: hidden;
}
.cc-si-name-type {
    font-size: 0.62rem; font-weight: 450;
    color: var(--cc-text-dim, #8892a6);
}
.cc-si-name-main {
    font-weight: 600;
}
.cc-si-value-row {
    font-size: 0.68rem; font-weight: 600;
    color: var(--cc-gold);
}
.cc-selected-item .cc-si-chance {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 4px;
}
.cc-si-chance input {
    width: 52px; padding: 4px 6px; border-radius: 6px;
    border: 1px solid var(--cc-border); background: var(--cc-surface);
    color: var(--cc-text); font-size: 0.8rem; text-align: center;
    font-family: inherit;
}
.cc-si-chance input:focus { outline: none; border-color: var(--cc-purple); }
.cc-si-chance span { font-size: 0.75rem; color: var(--cc-text-dim); }

.cc-si-remove {
    position: relative; z-index: 1;
    background: none; border: none; color: var(--cc-red);
    cursor: pointer; font-size: 1.1rem; padding: 2px 6px;
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
    transition: all 0.2s;
}
.cc-si-remove:hover { background: rgba(248,113,113,0.15); }

/* Chance summary bar */
.cc-chance-summary {
    margin-top: 8px; padding: 10px 14px;
    background: var(--cc-surface2);
}
.cc-chance-bar-container {
    height: 6px; border-radius: 3px; background: var(--cc-border);
    overflow: hidden; margin: 8px 0;
}
.cc-chance-bar-fill {
    height: 100%; border-radius: 3px; transition: width 0.3s, background 0.3s;
}
.cc-chance-bar-fill.valid { background: var(--cc-green); }
.cc-chance-bar-fill.invalid { background: var(--cc-red); }

.cc-chance-text {
    display: flex; justify-content: space-between; font-size: 0.78rem;
}
.cc-chance-text .cc-chance-val { font-weight: 600; }
.cc-chance-text .cc-chance-val.valid { color: var(--cc-green); }
.cc-chance-text .cc-chance-val.invalid { color: var(--cc-red); }

.cc-total-cost {
    font-size: 1.1rem; font-weight: 700; color: var(--cc-gold);
}

/* Buttons */
.cc-btn {
    padding: 12px 20px; border-radius: 0; border: none;
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
    text-align: center;
}
.cc-btn-primary {
    background: linear-gradient(135deg, var(--cc-purple), #7c3aed);
    color: #fff; width: 100%;
}
.cc-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(167,139,250,0.3); }
.cc-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.cc-btn-secondary {
    background: var(--cc-surface2); color: var(--cc-text);
    border: 1px solid var(--cc-border);
}
.cc-btn-secondary:hover { border-color: var(--cc-purple); color: var(--cc-purple); }

.cc-btn-danger {
    background: rgba(248,113,113,0.1); color: var(--cc-red);
    border: 1px solid var(--cc-red); font-size: 0.75rem; padding: 6px 12px;
}
.cc-btn-danger:hover { background: rgba(248,113,113,0.2); }

/* My Cases tab */
.cc-my-cases-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(266px, 1fr));
    gap: 12px;
}
.cc-my-case-card {
    display: flex; flex-direction: row; align-items: stretch; gap: 12px;
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-radius: 0; padding: 12px; transition: all 0.2s;
    position: relative; overflow: hidden;
}
.cc-my-case-card:hover { border-color: var(--cc-purple); }

.cc-my-case-info {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    z-index: 1;
    background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 70%);
    padding: 8px 12px; border-radius: 6px;
}

.cc-my-case-preview {
    position: absolute; top: 8px; right: 8px;
    width: 50%; height: 50%;
    z-index: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cc-my-case-preview-base {
    width: 100%; height: 100%; object-fit: cover;
}
.cc-card-preview-emoji {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 1.6rem; pointer-events: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.cc-card-preview-overlay-img {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70%; height: 70%; object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.cc-my-case-name {
    font-size: 1rem; font-weight: 600; margin-bottom: 4px;
}
.cc-my-case-meta {
    font-size: 0.75rem; color: var(--cc-text-dim); margin-bottom: 8px;
}
.cc-my-case-items {
    display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.cc-my-case-items img {
    width: 28px; height: 28px; object-fit: contain; border-radius: 4px;
    border: 1px solid var(--cc-border);
    background-color: color-mix(in srgb, var(--cc-surface2) 50%, transparent);
}
.cc-my-case-actions {
    display: flex; gap: 6px; margin-top: auto;
}
.cc-my-case-cost {
    font-size: 0.85rem; color: var(--cc-gold); font-weight: 600;
}

/* Empty state */
.cc-empty {
    text-align: center; padding: 40px 20px; color: var(--cc-text-dim);
}
.cc-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.cc-empty-text { font-size: 0.9rem; }

/* Toast */
.cc-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    color: var(--cc-text); padding: 12px 24px; border-radius: 0;
    font-size: 0.9rem; z-index: 999; opacity: 0; pointer-events: none;
    transition: opacity 0.3s; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.cc-toast.show { opacity: 1; }
.cc-toast.error { border-color: var(--cc-red); color: var(--cc-red); }
.cc-toast.success { border-color: var(--cc-green); color: var(--cc-green); }

/* Tier legend */
.cc-tier-legend {
    display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.cc-tier-dot {
    display: flex; align-items: center; gap: 4px; font-size: 0.7rem;
    color: var(--cc-text-dim);
}
.cc-tier-dot::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
}
.cc-tier-dot.tier-common::before { background: var(--cc-common); }
.cc-tier-dot.tier-rare::before { background: var(--cc-rare); }
.cc-tier-dot.tier-restricted::before { background: var(--cc-restricted); }
.cc-tier-dot.tier-classified::before { background: var(--cc-classified); }
.cc-tier-dot.tier-epic::before { background: var(--cc-epic); }
.cc-tier-dot.tier-covert::before { background: var(--cc-covert); }
.cc-tier-dot.tier-legendary::before { background: var(--cc-legendary); }

/* ═══ CASE IMAGE DESIGNER ═══ */
.cc-design-preview-container {
    position: relative;
    text-align: center;
    margin-bottom: 16px;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface2);
    clip-path: polygon(2% 0, 100% 0, 98% 100%, 0% 100%);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Base image layer — matches cc-my-case-preview-base */
.cc-design-preview-base {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Emoji overlay — matches cc-card-preview-emoji */
.cc-design-preview-emoji {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6rem;
    pointer-events: none;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6);
    line-height: 1;
}
/* Skin image overlay — matches cc-card-preview-overlay-img */
.cc-design-preview-overlay-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 40%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 3px 12px rgba(0,0,0,0.6));
}

.cc-design-layers {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cc-design-layer {
    border-top: 1px solid var(--cc-border);
    padding-top: 12px;
}

/* Base image grid */
.cc-base-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
}
.cc-base-option {
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--cc-surface2);
    clip-path: polygon(4% 0, 100% 0, 96% 100%, 0% 100%);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-base-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
}
.cc-base-option:hover { border-color: var(--cc-border); }
.cc-base-option.selected { border-color: var(--cc-purple); background: rgba(167,139,250,0.12); }

/* Overlay skin grid */
.cc-overlay-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin-top: 6px;
    max-height: 250px;
    overflow-y: auto;
}
.cc-overlay-grid::-webkit-scrollbar { width: 4px; }
.cc-overlay-grid::-webkit-scrollbar-thumb { background: var(--cc-border); border-radius: 2px; }

.cc-overlay-option {
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--cc-surface2);
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0% 100%);
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-overlay-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.cc-overlay-option:hover { border-color: var(--cc-border); }
.cc-overlay-option.selected { border-color: var(--cc-purple); background: rgba(167,139,250,0.12); }

/* Hue slider */
.cc-hue-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right,
        #ff0000 0%, #ffff00 17%, #00ff00 33%,
        #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    border-radius: 6px;
    outline: none;
    margin-top: 6px;
    border: 1px solid var(--cc-border);
}
.cc-hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--cc-purple);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(167,139,250,0.5);
}
.cc-hue-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--cc-purple);
    cursor: pointer;
}

/* Official Cases tab (admin/moderator) */
#tab-officialcases .cc-my-case-card {
    border-left: 3px solid var(--cc-gold);
}
.cc-upload-status {
    font-size: 0.7rem;
    color: var(--cc-text-dim);
    margin-left: 4px;
}

/* ── Official Cases: Exclusive value input ── */
.cc-official-ev-input {
    width: 100px;
    font-size: 0.7rem;
    padding: 3px 6px;
}

/* ── Edit Official Case Modal ── */
.cc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.cc-modal-box {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 0;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    clip-path: polygon(1% 0, 100% 0, 99% 100%, 0% 100%);
}
.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cc-border);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cc-text);
}
.cc-modal-close {
    background: none;
    border: none;
    color: var(--cc-text-dim);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    transition: color 0.2s;
}
.cc-modal-close:hover {
    color: var(--cc-red);
}
.cc-modal-body {
    padding: 16px 18px;
}
.cc-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--cc-border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.cc-edit-official-item-row {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--cc-card-bg, var(--cc-surface2));
    padding: 6px 8px;
    border-radius: 6px;
}
