body { 
    background-color: #800020; 
    color: #f5f5dc; 
    overflow: hidden; 
    touch-action: none; 
    font-family: 'Lora', serif; 
}
h1, h2, h3, h4, .font-heading {
    font-family: 'Cinzel', serif;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #5a0016; } 
::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 4px; border: 1px solid #800020; }
::-webkit-scrollbar-thumb:hover { background: #e0e0e0; }

* {
    -webkit-tap-highlight-color: transparent;
}
::selection {
    background-color: rgba(192, 192, 192, 0.4);
    color: #f5f5dc;
}

.asset-card { 
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out; 
    cursor: grab; 
    background-color: #f5f5dc; 
    color: #800020; 
    border: 2px solid #c0c0c0; 
    border-radius: 8px;
    user-select: none;
}
.asset-card:hover {
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3); 
    border-color: #e0e0e0;
}
.asset-card:active { cursor: grabbing; transform: scale(0.95); }

.layer-item {
    background-color: rgba(245, 245, 220, 0.05); 
    border: 1px solid rgba(192, 192, 192, 0.3); 
    border-radius: 6px;
}
.layer-item.selected { 
    border-color: #c0c0c0; 
    background-color: rgba(192, 192, 192, 0.15); 
}
.layer-item:hover:not(.selected) {
    background-color: rgba(245, 245, 220, 0.1);
}

#mainCanvas {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    background-image: 
        linear-gradient(45deg, #5a0016 25%, transparent 25%), 
        linear-gradient(-45deg, #5a0016 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #5a0016 75%), 
        linear-gradient(-45deg, transparent 75%, #5a0016 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #3b000e; 
    border: 2px solid #c0c0c0; 
}

.btn-primary {
    background-color: #f5f5dc;
    color: #800020;
    border: 1px solid #c0c0c0;
    font-family: 'Cinzel', serif;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: #e8e8c8;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: #f5f5dc;
    border: 1px solid #c0c0c0;
    font-family: 'Cinzel', serif;
}
.btn-secondary:hover {
    background-color: rgba(192, 192, 192, 0.1);
}

.btn-danger {
    background-color: #a02040; 
    color: #f5f5dc;
    border: 1px solid #f5f5dc;
    font-family: 'Cinzel', serif;
}
.btn-danger:hover {
    background-color: #c03050;
}

input[type="number"], input[type="range"], select {
    background-color: #5a0016; /* Solid dark burgundy */
    color: #f5f5dc;
    border: 1px solid rgba(192, 192, 192, 0.5);
    font-family: 'Lora', serif;
}
option {
    background-color: #800020; /* Dark burgundy for the dropdown list */
    color: #f5f5dc;
}
input[type="number"]:focus, select:focus {
    border-color: #c0c0c0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(192, 192, 192, 0.2);
}

.checkerboard {
    background-image: 
        linear-gradient(45deg, rgba(128,0,32,0.1) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(128,0,32,0.1) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(128,0,32,0.1) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(128,0,32,0.1) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    background-color: #f5f5dc;
}

.logo-svg path { fill: currentColor; }
.logo-svg .accent { fill: #c0c0c0; }

datalist {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    writing-mode: vertical-lr;
    width: 100%;
}
option {
    padding: 0;
    font-size: 10px;
}
/* Updated Accordion Logic: Flex-friendly */
.accordion-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.accordion-content.collapsed {
    display: none !important;
}
.chevron-icon {
    transition: transform 0.3s ease-in-out;
}
.chevron-icon.rotated {
    transform: rotate(-90deg);
}

/* Search & Chips */
.chip {
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid rgba(192, 192, 192, 0.4);
    color: #c0c0c0;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.chip.active {
    background-color: #c0c0c0;
    color: #800020;
    border-color: #f5f5dc;
}
.chip:hover:not(.active) {
    background-color: rgba(192, 192, 192, 0.1);
    border-color: #c0c0c0;
}
.search-input {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(192, 192, 192, 0.3);
    color: #f5f5dc;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: #c0c0c0;
}

/* Contextual Help */
.help-trigger {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s;
    border: 1px solid rgba(192, 192, 192, 0.3);
}
.help-trigger:hover {
    background-color: #c0c0c0;
    color: #800020;
}
.help-popover {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    width: 200px;
    background-color: #f5f5dc;
    color: #800020;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
    font-size: 10px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
    border: 2px solid #c0c0c0;
}
.help-popover::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 10px;
    border: 6px solid transparent;
    border-right-color: #c0c0c0;
}
.help-wrapper:hover .help-popover {
    opacity: 1;
    transform: translateX(0);
}
