/* ============ GLOBAL STYLES ============ */
:root {
    --surface-50: 248 249 250;
    --surface-100: 30 30 46;
    --surface-200: 24 24 37;
    --surface-300: 17 17 27;
    --surface-400: 13 13 21;
    --surface-500: 10 10 18;
    --accent-100: 203 166 247;
    --accent-200: 180 190 254;
    --accent-300: 137 180 250;
    --accent-400: 116 199 236;
    --accent-500: 148 226 213;
    --text-100: 205 214 244;
    --text-200: 186 194 222;
    --text-300: 166 173 200;
    --text-400: 88 91 112;
    --rose: 243 139 168;
    --peach: 250 179 135;
    --green-accent: 166 227 161;
    --yellow-accent: 249 226 175;
    --viewport-bg: 10 10 18;
    --scene-bg: 24 24 37;
    --scene-stroke: 88 91 112;
    --scene-label: 166 173 200;
    --scene-broadcast: 243 139 168;
}

:root[data-theme="ember"],
body[data-theme="ember"] {
    --surface-50: 250 245 240;
    --surface-100: 44 32 27;
    --surface-200: 36 27 23;
    --surface-300: 28 22 19;
    --surface-400: 24 19 17;
    --surface-500: 19 15 13;
    --accent-100: 245 142 91;
    --accent-200: 244 184 122;
    --accent-300: 233 109 74;
    --accent-400: 219 160 86;
    --accent-500: 206 198 124;
    --text-100: 242 225 210;
    --text-200: 224 201 182;
    --text-300: 188 163 142;
    --text-400: 122 101 88;
    --rose: 232 116 98;
    --peach: 243 162 110;
    --green-accent: 160 199 134;
    --yellow-accent: 235 203 121;
    --viewport-bg: 19 15 13;
    --scene-bg: 44 32 27;
    --scene-stroke: 122 101 88;
    --scene-label: 188 163 142;
    --scene-broadcast: 232 116 98;
}

:root[data-theme="sage"],
body[data-theme="sage"] {
    --surface-50: 244 248 244;
    --surface-100: 29 41 36;
    --surface-200: 23 33 29;
    --surface-300: 19 27 24;
    --surface-400: 15 22 20;
    --surface-500: 12 17 15;
    --accent-100: 143 201 167;
    --accent-200: 174 220 193;
    --accent-300: 110 177 152;
    --accent-400: 132 196 182;
    --accent-500: 170 211 174;
    --text-100: 223 234 226;
    --text-200: 191 211 198;
    --text-300: 153 176 162;
    --text-400: 96 121 108;
    --rose: 216 137 146;
    --peach: 216 173 132;
    --green-accent: 165 215 150;
    --yellow-accent: 216 206 138;
    --viewport-bg: 12 17 15;
    --scene-bg: 29 41 36;
    --scene-stroke: 96 121 108;
    --scene-label: 153 176 162;
    --scene-broadcast: 216 137 146;
}

:root[data-theme="midnight"],
body[data-theme="midnight"] {
    --surface-50: 242 244 249;
    --surface-100: 20 26 43;
    --surface-200: 16 21 36;
    --surface-300: 12 17 29;
    --surface-400: 10 14 24;
    --surface-500: 8 11 20;
    --accent-100: 120 169 255;
    --accent-200: 145 190 255;
    --accent-300: 92 148 248;
    --accent-400: 83 181 222;
    --accent-500: 121 211 223;
    --text-100: 223 231 247;
    --text-200: 188 201 225;
    --text-300: 141 158 190;
    --text-400: 91 106 136;
    --rose: 237 128 160;
    --peach: 245 171 121;
    --green-accent: 144 216 174;
    --yellow-accent: 238 214 128;
    --viewport-bg: 8 11 20;
    --scene-bg: 20 26 43;
    --scene-stroke: 91 106 136;
    --scene-label: 141 158 190;
    --scene-broadcast: 237 128 160;
}

:root[data-theme="dawn"],
body[data-theme="dawn"] {
    --surface-50: 255 252 246;
    --surface-100: 54 40 36;
    --surface-200: 45 34 31;
    --surface-300: 36 28 26;
    --surface-400: 31 24 22;
    --surface-500: 24 19 17;
    --accent-100: 255 164 108;
    --accent-200: 255 197 137;
    --accent-300: 240 127 87;
    --accent-400: 236 168 104;
    --accent-500: 209 201 140;
    --text-100: 247 230 214;
    --text-200: 230 206 185;
    --text-300: 194 167 145;
    --text-400: 129 106 92;
    --rose: 237 132 126;
    --peach: 247 177 120;
    --green-accent: 168 200 145;
    --yellow-accent: 241 218 134;
    --viewport-bg: 24 19 17;
    --scene-bg: 54 40 36;
    --scene-stroke: 129 106 92;
    --scene-label: 194 167 145;
    --scene-broadcast: 237 132 126;
}

:root[data-theme="ocean"],
body[data-theme="ocean"] {
    --surface-50: 241 248 251;
    --surface-100: 24 39 48;
    --surface-200: 20 33 41;
    --surface-300: 16 27 34;
    --surface-400: 13 22 28;
    --surface-500: 10 18 22;
    --accent-100: 96 196 224;
    --accent-200: 130 214 235;
    --accent-300: 80 171 204;
    --accent-400: 111 201 190;
    --accent-500: 150 218 176;
    --text-100: 219 235 242;
    --text-200: 183 211 223;
    --text-300: 142 174 191;
    --text-400: 92 121 136;
    --rose: 220 142 169;
    --peach: 232 178 130;
    --green-accent: 147 216 171;
    --yellow-accent: 232 214 141;
    --viewport-bg: 10 18 22;
    --scene-bg: 24 39 48;
    --scene-stroke: 92 121 136;
    --scene-label: 142 174 191;
    --scene-broadcast: 220 142 169;
}

:root[data-theme="moss"],
body[data-theme="moss"] {
    --surface-50: 244 248 242;
    --surface-100: 34 42 31;
    --surface-200: 28 35 26;
    --surface-300: 23 30 22;
    --surface-400: 19 25 18;
    --surface-500: 14 19 14;
    --accent-100: 158 199 117;
    --accent-200: 181 213 138;
    --accent-300: 125 170 98;
    --accent-400: 146 186 117;
    --accent-500: 186 207 142;
    --text-100: 224 232 214;
    --text-200: 193 207 181;
    --text-300: 157 176 143;
    --text-400: 102 124 91;
    --rose: 207 145 137;
    --peach: 217 177 132;
    --green-accent: 156 214 132;
    --yellow-accent: 220 210 142;
    --viewport-bg: 14 19 14;
    --scene-bg: 34 42 31;
    --scene-stroke: 102 124 91;
    --scene-label: 157 176 143;
    --scene-broadcast: 207 145 137;
}

:root[data-theme="dracula"],
body[data-theme="dracula"] {
    --surface-50: 248 248 242;
    --surface-100: 40 42 54;
    --surface-200: 35 37 49;
    --surface-300: 30 32 42;
    --surface-400: 26 28 37;
    --surface-500: 21 23 31;
    --accent-100: 189 147 249;
    --accent-200: 215 187 255;
    --accent-300: 139 233 253;
    --accent-400: 80 250 123;
    --accent-500: 241 250 140;
    --text-100: 248 248 242;
    --text-200: 222 224 216;
    --text-300: 189 191 182;
    --text-400: 98 114 164;
    --rose: 255 121 198;
    --peach: 255 184 108;
    --green-accent: 80 250 123;
    --yellow-accent: 241 250 140;
    --viewport-bg: 21 23 31;
    --scene-bg: 40 42 54;
    --scene-stroke: 98 114 164;
    --scene-label: 189 191 182;
    --scene-broadcast: 255 121 198;
}

:root[data-theme="nord"],
body[data-theme="nord"] {
    --surface-50: 236 239 244;
    --surface-100: 46 52 64;
    --surface-200: 59 66 82;
    --surface-300: 67 76 94;
    --surface-400: 76 86 106;
    --surface-500: 36 41 51;
    --accent-100: 136 192 208;
    --accent-200: 129 161 193;
    --accent-300: 94 129 172;
    --accent-400: 143 188 187;
    --accent-500: 163 190 140;
    --text-100: 236 239 244;
    --text-200: 229 233 240;
    --text-300: 216 222 233;
    --text-400: 129 161 193;
    --rose: 191 97 106;
    --peach: 208 135 112;
    --green-accent: 163 190 140;
    --yellow-accent: 235 203 139;
    --viewport-bg: 36 41 51;
    --scene-bg: 46 52 64;
    --scene-stroke: 129 161 193;
    --scene-label: 216 222 233;
    --scene-broadcast: 191 97 106;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

/* ============ SCROLLBAR ============ */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgb(var(--text-300) / 0.15);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--text-300) / 0.3);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============ ANIMATIONS ============ */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-in {
    animation: modal-in 0.2s ease-out;
}

@keyframes modal-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
}

.animate-modal-out {
    animation: modal-out 0.16s ease-in forwards;
}

@keyframes context-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-context-in {
    animation: context-in 0.12s ease-out;
}

@keyframes context-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.96);
    }
}

.animate-context-out {
    animation: context-out 0.12s ease-in forwards;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-overlay-in {
    animation: overlay-fade-in 0.16s ease-out;
}

@keyframes overlay-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.animate-overlay-out {
    animation: overlay-fade-out 0.14s ease-in forwards;
    pointer-events: none;
}

@keyframes lore-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.lore-spinner {
    animation: lore-spin 0.8s linear infinite;
}

@keyframes editor-exit {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: scale(0.985);
        filter: blur(1.5px);
    }
}

.editor-screen-exit {
    animation: editor-exit 0.18s ease-in forwards;
}

/* Removed flashy background animations */

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 6s ease-in-out infinite;
}

/* ============ DYNAMIC BACKGROUND ORBS ============ */
/* Orb styles removed */

/* Title Responsive */
@media (max-width: 640px) {
    #campaign-screen h1 {
        font-size: 5rem !important;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

@keyframes shine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(200%);
    }
}

.animate-shine {
    animation: shine 1.5s ease-in-out infinite;
}

/* ============ GRADIENT RADIAL ============ */
.bg-gradient-radial {
    background: radial-gradient(circle, var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to));
}

/* ============ CONTEXT MENU ITEMS ============ */
.ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    font-size: 13px;
    color: rgb(var(--text-100) / 1);
    border: none;
    background: none;
    cursor: pointer;
    transition: background-color 0.1s;
    text-align: left;
}

.ctx-item:hover {
    background-color: rgb(var(--accent-100) / 0.1);
}

.ctx-item.text-rose {
    color: rgb(var(--rose) / 1);
}

.ctx-item.text-rose:hover {
    background-color: rgb(var(--rose) / 0.1);
}

/* ============ ASSET TYPE BUTTONS ============ */
.asset-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgb(var(--surface-100) / 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.asset-type-btn:hover {
    border-color: rgb(var(--accent-100) / 0.3);
    background: rgb(var(--accent-100) / 0.05);
    transform: translateY(-2px);
}

/* ============ CAMPAIGN CARDS ============ */
.campaign-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgb(var(--text-400) / 0.1);
    background: rgb(var(--surface-100) / 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.campaign-card:hover {
    border-color: rgb(var(--accent-100) / 0.3);
    background: rgb(var(--accent-100) / 0.05);
    transform: none;
    /* Removed scaling */
    box-shadow: 0 4px 12px rgb(var(--surface-500) / 0.35);
}

/* ============ MAIN SETTINGS MODAL ============ */
.main-settings-section {
    border: 1px solid rgb(var(--text-400) / 0.12);
    background: rgb(var(--surface-200) / 0.45);
    border-radius: 12px;
    padding: 14px;
}

.main-settings-section-head {
    margin-bottom: 12px;
}

.main-settings-section-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 3px 0;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(var(--text-200) / 1);
}

.main-settings-section-head p {
    margin: 0;
    font-size: 11px;
    color: rgb(var(--text-400) / 1);
}

.main-settings-label,
.settings-label {
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgb(var(--text-400) / 1);
}

.settings-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-range-legend {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-family: 'Inter', monospace;
    text-transform: uppercase;
    color: rgb(var(--text-400) / 0.85);
}

.settings-inline-number {
    width: 72px;
    background: rgb(var(--surface-300) / 0.9);
    border: 1px solid rgb(var(--text-400) / 0.18);
    border-radius: 8px;
    padding: 6px 8px;
    font-family: 'Inter', monospace;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: rgb(var(--accent-100) / 1);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-inline-number:focus {
    border-color: rgb(var(--accent-100) / 0.6);
    box-shadow: 0 0 0 2px rgb(var(--accent-100) / 0.15);
}

.settings-toggle-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgb(var(--surface-200) / 0.5);
    border: 1px solid rgb(var(--text-400) / 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.settings-toggle-chip:hover {
    background: rgb(var(--surface-200) / 0.9);
    border-color: rgb(var(--text-400) / 0.2);
}

.settings-reset-btn {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgb(var(--text-400) / 1);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 8px;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.settings-reset-btn:hover {
    color: rgb(var(--accent-100) / 1);
    background: rgb(var(--surface-200) / 0.8);
    border-color: rgb(var(--text-400) / 0.1);
}

.settings-modal-section {
    border: 1px solid rgb(var(--text-400) / 0.12);
    background: rgb(var(--surface-200) / 0.45);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-settings-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    color: rgb(var(--text-300) / 1);
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.main-settings-nav-link:hover {
    color: rgb(var(--text-100) / 1);
    background: rgb(var(--accent-100) / 0.08);
    border-color: rgb(var(--accent-100) / 0.22);
}


.campaign-card .icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgb(var(--surface-300) / 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgb(var(--text-100) / 0.03);
    color: rgb(var(--text-200) / 1);
}

.campaign-card:hover .icon-wrapper {
    background: rgb(var(--accent-100) / 0.1);
    color: rgb(var(--accent-100) / 1);
    transform: none;
}

/* ============ ASSET GRID ITEMS ============ */
.asset-grid-tile {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgb(var(--text-400) / 0.15);
    background: rgb(var(--surface-300) / 0.5);
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.asset-grid-tile:hover {
    border-color: rgb(var(--accent-100) / 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(var(--surface-500) / 0.45);
}

.asset-grid-tile.selected {
    border-color: rgb(var(--accent-100) / 0.5);
    background: rgb(var(--accent-100) / 0.08);
}

.asset-grid-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.asset-grid-tile .tile-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asset-grid-tile .tile-label {
    font-size: 10px;
    color: rgb(var(--text-200) / 1);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    position: relative;
    z-index: 1;
}

.asset-grid-tile .type-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Folder tile */
.asset-grid-tile.folder-tile {
    background: rgb(var(--surface-100) / 0.4);
    border-style: dashed;
    cursor: pointer;
}

.asset-grid-tile.folder-tile:hover {
    background: rgb(var(--accent-100) / 0.06);
}

.asset-grid-tile.folder-tile.drag-over {
    background: rgb(var(--accent-100) / 0.15);
    outline: 2px dashed rgb(var(--accent-100) / 0.4);
}

/* Asset tile */
.asset-grid-tile.asset-tile {
    cursor: grab;
}

.asset-grid-tile.asset-tile:active {
    cursor: grabbing;
}

.asset-grid-tile.asset-tile .tile-label {
    background: linear-gradient(transparent, rgb(var(--surface-500) / 0.82));
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 6px;
    text-align: left;
    max-width: 100%;
}

/* ── Asset list view ── */
#asset-grid-inner.list-view {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#asset-grid-inner.list-view .asset-grid-tile {
    aspect-ratio: unset;
    flex-direction: row;
    justify-content: flex-start;
    padding: 6px 8px;
    gap: 8px;
    height: 36px;
    border-radius: 8px;
}

#asset-grid-inner.list-view .asset-grid-tile img {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    flex-shrink: 0;
    object-position: top center;
    inset: unset;
}

#asset-grid-inner.list-view .asset-grid-tile .tile-label {
    position: relative;
    font-size: 11px;
    bottom: unset;
    left: unset;
    right: unset;
    background: none;
    padding: 0;
    max-width: unset;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

#asset-grid-inner.list-view .asset-grid-tile .type-badge {
    position: relative;
    top: unset;
    right: unset;
    margin-left: auto;
}

#asset-grid-inner.list-view .folder-tile {
    height: 36px;
    aspect-ratio: unset;
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 8px;
}

#asset-grid-inner.list-view .folder-tile .tile-icon {
    width: 22px;
    height: 22px;
}

#asset-grid-inner.list-view .folder-tile .tile-label {
    font-size: 11px;
    max-width: unset;
    flex: 1;
    text-align: left;
}

/* Grid col variants */
#asset-grid-inner.cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

#asset-grid-inner.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#asset-grid-inner.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#asset-grid-inner.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: rgb(var(--text-200) / 1);
    transition: all 0.15s;
    user-select: none;
}

.layer-item:hover {
    background: rgb(var(--accent-100) / 0.06);
}

.layer-item.selected {
    background: rgb(var(--accent-100) / 0.12);
    color: rgb(var(--accent-100) / 1);
}

.layer-item.scene-header {
    background: rgb(var(--surface-100) / 0.4);
    border: 1px solid rgb(var(--text-400) / 0.2);
    margin-top: 6px;
    margin-bottom: 2px;
    padding: 6px 8px;
    font-weight: 600;
    color: rgb(var(--text-100) / 1);
}

.layer-item.scene-header.broadcasting {
    border-color: rgb(var(--rose) / 1) !important;
    background: rgb(var(--rose) / 0.1);
    box-shadow: 0 0 15px rgb(var(--rose) / 0.15) inset, 0 0 0 1px rgb(var(--rose) / 0.3);
}

.layer-item.scene-header.broadcasting .scene-name-label {
    color: rgb(var(--rose) / 1);
    font-weight: 800;
}

.layer-item.scene-header:first-child {
    margin-top: 0;
}

.layer-item.scene-header:hover {
    background: rgb(var(--accent-100) / 0.08);
    border-color: rgb(var(--accent-100) / 0.15);
}

.layer-item .layer-actions {
    margin-left: auto;
    display: flex;
    gap: 1px;
    opacity: 0;
    transition: opacity 0.15s;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

.layer-item .layer-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.1s;
}

.layer-item .layer-actions button:hover {
    background: rgb(var(--accent-100) / 0.15);
    color: rgb(var(--accent-100) / 1);
}

.layer-item .layer-actions button.del-btn:hover {
    background: rgb(var(--rose) / 0.15);
    color: rgb(var(--rose) / 1);
}

/* Layer drag */
.layer-item.drag-over-top {
    border-top: 2px solid rgb(var(--accent-100) / 1);
}

.layer-item.drag-over-bottom {
    border-bottom: 2px solid rgb(var(--accent-100) / 1);
}

.layer-item.dragging {
    opacity: 0.4;
}

/* ============ RANGE INPUT ============ */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgb(var(--text-400) / 0.3);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgb(var(--accent-100) / 1);
    cursor: pointer;
    border: 2px solid rgb(var(--surface-100) / 1);
    box-shadow: 0 0 6px rgb(var(--accent-100) / 0.4);
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: rgb(var(--text-400) / 0.3);
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgb(var(--accent-100) / 1);
    border: 2px solid rgb(var(--surface-100) / 1);
    box-shadow: 0 0 6px rgb(var(--accent-100) / 0.4);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    opacity: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

body.number-scrubbing,
body.number-scrubbing * {
    cursor: ew-resize !important;
    user-select: none !important;
}

/* ============ CANVAS ============ */
.canvas-container {
    position: absolute !important;
    top: 0;
    left: 0;
    background: rgb(var(--viewport-bg) / 1);
}

/* ============ TOOLTIP ============ */
.tooltip {
    position: absolute;
    background: rgb(var(--surface-100) / 1);
    color: rgb(var(--text-100) / 1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgb(var(--surface-500) / 0.55);
    border: 1px solid rgb(var(--text-400) / 0.15);
    z-index: 9999;
}

/* ============ SNAP GUIDES ============ */
.snap-guide {
    position: absolute;
    background: rgb(var(--accent-100) / 1);
    z-index: 100;
    pointer-events: none;
}

.snap-guide-h {
    height: 1px;
    left: 0;
    right: 0;
}

.snap-guide-v {
    width: 1px;
    top: 0;
    bottom: 0;
}

/* ============ BROADCAST FRAME ============ */
.broadcast-active {
    box-shadow: 0 0 0 3px rgb(var(--rose) / 1), 0 0 30px rgb(var(--rose) / 0.3) !important;
}

/* ============ SHORTCUTS TABLE ============ */
.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    background: rgb(var(--text-400) / 0.3);
    border: 1px solid rgb(var(--text-400) / 0.4);
    border-radius: 6px;
    font-family: 'Inter', monospace;
    font-size: 11px;
    font-weight: 600;
    color: rgb(var(--text-100) / 1);
    box-shadow: 0 1px 2px rgb(var(--surface-500) / 0.45);
}

/* ============ ASSET VIEW TOGGLE BUTTONS ============ */
.asset-view-btn,
.main-asset-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    background: rgb(var(--text-400) / 0.15);
    border: 1px solid rgb(var(--text-400) / 0.2);
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    color: rgb(var(--text-300) / 1);
    cursor: pointer;
    transition: all 0.15s;
}

.asset-view-btn:hover,
.main-asset-view-btn:hover {
    background: rgb(var(--accent-100) / 0.15);
    border-color: rgb(var(--accent-100) / 0.3);
    color: rgb(var(--accent-100) / 1);
}

.asset-view-btn.active,
.main-asset-view-btn.active {
    background: linear-gradient(135deg, rgb(var(--accent-100) / 0.25), rgb(var(--accent-300) / 0.25));
    border-color: rgb(var(--accent-100) / 1);
    color: rgb(var(--accent-100) / 1);
    box-shadow: 0 0 8px rgb(var(--accent-100) / 0.2);
}

/* ============ CUSTOM SELECT OPTIONS ============ */
.native-select-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
}

.custom-select-host {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgb(var(--text-400) / 0.32);
    background: rgb(var(--surface-200) / 0.95);
    color: rgb(var(--text-100) / 1);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
}

.custom-select-trigger:hover {
    border-color: rgb(var(--accent-100) / 0.45);
}

.custom-select-trigger:focus {
    outline: none;
    border-color: rgb(var(--accent-100) / 0.58);
    box-shadow: none;
}

.custom-select-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--accent-100) / 1);
}

.custom-select-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgb(var(--text-400) / 0.35);
    border-radius: 10px;
    background: rgb(var(--surface-100) / 0.98);
    box-shadow: 0 18px 32px rgb(var(--surface-500) / 0.55);
    z-index: 12000;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgb(var(--accent-100) / 0.5) rgb(var(--surface-300) / 0.5);
}

.custom-select-menu-portal {
    z-index: 25000 !important;
}

.custom-select-menu::-webkit-scrollbar {
    width: 8px;
}

.custom-select-menu::-webkit-scrollbar-track {
    background: rgb(var(--surface-300) / 0.5);
    border-radius: 8px;
}

.custom-select-menu::-webkit-scrollbar-thumb {
    background: rgb(var(--accent-100) / 0.5);
    border-radius: 8px;
}

.custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--accent-100) / 0.7);
}

.custom-select-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: rgb(var(--text-200) / 1);
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.custom-select-item:hover {
    background: rgb(var(--accent-100) / 0.14);
    color: rgb(var(--text-100) / 1);
}

.custom-select-item.active {
    background: rgb(var(--accent-300) / 0.16);
    color: rgb(var(--accent-300) / 1);
}

/* ============ CAMPAIGN ICON PICKER ============ */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    padding: 4px;
    justify-items: center;
}

.icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgb(var(--text-300) / 0.1);
    background: rgb(var(--surface-100) / 0.5);
    cursor: pointer;
    transition: all 0.2s;
    color: rgb(var(--text-200) / 1);
}

.icon-option:hover {
    background: rgb(var(--accent-100) / 0.15);
    border-color: rgb(var(--accent-100) / 0.3);
}

.icon-option.selected {
    background: linear-gradient(135deg, rgb(var(--accent-100) / 0.25), rgb(var(--accent-300) / 0.25));
    border-color: rgb(var(--accent-100) / 1);
    box-shadow: 0 0 12px rgb(var(--accent-100) / 0.2);
}

/* ============ MUSIC PLAYER ============ */
.music-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background 0.12s;
    min-height: 34px;
}

.music-row:hover {
    background: rgb(var(--accent-100) / 0.06);
}

.music-row.active {
    background: rgb(var(--accent-100) / 0.10);
}

.music-row-actions {
    opacity: 0;
    transition: opacity 0.15s;
}

.music-row:hover .music-row-actions {
    opacity: 1;
}

.music-row-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 3px 4px;
    border-radius: 5px;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--text-400) / 1);
}

.music-row-btn:hover {
    background: rgb(var(--accent-100) / 0.15);
    color: rgb(var(--accent-100) / 1);
}

.music-row-btn.text-rose:hover {
    background: rgb(var(--rose) / 0.15);
    color: rgb(var(--rose) / 1);
}

.music-ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-ctrl-btn:hover {
    background: rgb(var(--accent-100) / 0.1);
    color: rgb(var(--accent-100) / 1) !important;
}

.music-bc-btn:hover {
    color: rgb(var(--accent-100) / 1);
}

.music-seek-bar,
.music-vol-bar {
    accent-color: rgb(var(--accent-100) / 1);
    cursor: pointer;
}

.music-seek-bar::-webkit-slider-thumb,
.music-vol-bar::-webkit-slider-thumb {
    width: 11px;
    height: 11px;
}

/* Drag & drop */
.music-dragging {
    opacity: 0.4;
}

.music-drag-over {
    background: rgb(var(--accent-100) / 0.15) !important;
    outline: 2px dashed rgb(var(--accent-100) / 0.4);
    border-radius: 6px;
}

.music-drop-before {
    border-top: 2px solid rgb(var(--accent-100) / 1);
}

.music-drop-after {
    border-bottom: 2px solid rgb(var(--accent-100) / 1);
}

.selected-track {
    background: rgb(var(--accent-300) / 0.06) !important;
}

.music-row.selected-playing {
    background: linear-gradient(90deg, rgb(var(--green-accent) / 0.14), rgb(var(--accent-300) / 0.10)) !important;
    box-shadow: inset 0 0 0 1px rgb(var(--green-accent) / 0.45);
}

.music-row .music-track-play-btn {
    opacity: 1;
    transition: opacity 0.15s;
}

.music-row:hover .music-track-play-btn,
.music-row.active .music-track-play-btn,
.music-row.selected-track .music-track-play-btn,
.music-row.selected-playing .music-track-play-btn {
    opacity: 1;
}


