/* ============================================================
   🎵 3D MUSIC PLAYER — Immersive Game-like HUD
   ============================================================ */

/* RESET */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    color: #e0e6f0;
    cursor: default;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ============================================================
   3D CANVAS
   ============================================================ */
#main-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* ============================================================
   HUD OVERLAY — Game-style UI
   ============================================================ */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- TOP BAR --- */
#hud-top {
    pointer-events: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-left: 280px;
    padding: 0;
    background: none;
}

/* LED bar — full width, positioned as background behind title */
#spectrum-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    border-radius: 0;
    max-width: none;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    box-shadow:
        0 0 20px rgba(51, 136, 255, 0.3),
        0 0 6px rgba(255, 50, 100, 0.2),
        inset 0 0 8px rgba(0, 0, 0, 0.9);
    border: none;
    border-bottom: 1px solid rgba(51, 136, 255, 0.2);
}

#now-playing {
    position: relative;
    z-index: 1;
    text-align: center;
    min-width: 250px;
    padding: 10px 20px;
}

#track-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 1),
        0 1px 4px rgba(0, 0, 0, 0.9),
        0 0 14px rgba(51, 136, 255, 0.9),
        0 0 35px rgba(51, 136, 255, 0.5),
        0 0 60px rgba(51, 136, 255, 0.2);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 6px rgba(0,0,0,1), 0 1px 4px rgba(0,0,0,0.9), 0 0 14px rgba(51,136,255,0.9), 0 0 35px rgba(51,136,255,0.5); }
    100% { text-shadow: 0 0 6px rgba(0,0,0,1), 0 1px 4px rgba(0,0,0,0.9), 0 0 18px rgba(255,51,102,0.9), 0 0 45px rgba(255,51,102,0.5); }
}

#track-folder {
    font-size: 0.85em;
    color: #bbddff;
    margin-top: 4px;
    font-weight: 300;
    text-shadow: 0 0 5px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* --- URL INPUT (wklej link) --- */
#url-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px auto 0;
    max-width: 500px;
    width: 100%;
}

#url-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(51,136,255,0.25);
    color: #e0e6f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85em;
    outline: none;
    transition: border-color 0.2s;
}

#url-input:focus {
    border-color: rgba(51,136,255,0.6);
    box-shadow: 0 0 8px rgba(51,136,255,0.2);
}

#url-input::placeholder {
    color: #556688;
}

#url-play-btn {
    background: rgba(20, 30, 60, 0.6);
    border: 1px solid rgba(51,136,255,0.3);
    color: #33ccff;
    font-size: 1em;
    width: 34px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#url-play-btn:hover {
    background: rgba(51,136,255,0.25);
    border-color: rgba(51,136,255,0.6);
    color: #fff;
    box-shadow: 0 0 10px rgba(51,136,255,0.3);
}

#url-play-btn:active {
    transform: scale(0.93);
    background: rgba(51,136,255,0.4);
}

/* (LED BAR #spectrum-bar styles now defined above with #hud-top) */

/* --- BOTTOM BAR --- */
#hud-bottom {
    pointer-events: auto;
    padding: 10px 20px 16px;
    margin-left: 280px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,5,20,0.6) 60%, rgba(0,0,0,0) 100%);
    backdrop-filter: blur(6px);
    border-top: 1px solid rgba(51,136,255,0.15);
}

/* TRANSPORT */
#transport {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

#transport button {
    background: rgba(20, 30, 60, 0.6);
    border: 1px solid rgba(51,136,255,0.3);
    color: #ccd8f0;
    font-size: 1.4em;
    width: 48px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#transport button:hover {
    background: rgba(51,136,255,0.25);
    border-color: rgba(51,136,255,0.6);
    color: #fff;
    box-shadow: 0 0 15px rgba(51,136,255,0.3), inset 0 0 10px rgba(51,136,255,0.1);
    transform: scale(1.08);
}

#transport button:active {
    transform: scale(0.95);
    background: rgba(51,136,255,0.4);
}

#transport .toggle-btn.active {
    background: rgba(51,136,255,0.3);
    border-color: rgba(51,200,255,0.7);
    color: #fff;
    box-shadow: 0 0 12px rgba(51,200,255,0.4);
}

/* PROGRESS */
#progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

#time-current, #time-total {
    font-family: 'Orbitron', monospace;
    font-size: 0.8em;
    color: #88aacc;
    min-width: 42px;
    text-align: center;
}

#progress-wrapper {
    flex: 1;
    position: relative;
    height: 8px;
    cursor: pointer;
}

#progress-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

#progress-fill {
    position: absolute;
    top: 0; left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3388ff, #ff3366);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(51,136,255,0.5);
    transition: width 0.1s linear;
}

#progress-bar {
    position: absolute;
    top: -6px; left: 0;
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3388ff;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(51,136,255,0.6);
    cursor: pointer;
}

#progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3388ff;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(51,136,255,0.6);
    cursor: pointer;
}

/* BOTTOM ROW */
#bottom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#vol-icon {
    font-size: 1.2em;
}

#volume-slider {
    width: 90px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #33ccff;
    border: 1px solid #fff;
    box-shadow: 0 0 6px rgba(51,204,255,0.5);
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #33ccff;
    border: 1px solid #fff;
}

#viz-select-wrap select {
    background: rgba(20,30,60,0.6);
    border: 1px solid rgba(51,136,255,0.3);
    color: #ccd8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
}

#viz-select-wrap select:hover {
    border-color: rgba(51,136,255,0.6);
    background: rgba(51,136,255,0.15);
}

#viz-select-wrap select option {
    background: #0a1025;
    color: #ccd8f0;
}

/* Effect (LED) selector */
#effect-select-wrap select {
    background: rgba(40,15,50,0.6);
    border: 1px solid rgba(200,80,255,0.3);
    color: #e0c8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9em;
    cursor: pointer;
}

#effect-select-wrap select:hover {
    border-color: rgba(200,80,255,0.6);
    background: rgba(200,80,255,0.15);
}

#effect-select-wrap select option,
#effect-select-wrap select optgroup {
    background: #150a25;
    color: #e0c8f0;
}

#effect-select-wrap select optgroup {
    font-weight: 700;
    color: rgba(200,150,255,0.8);
    font-size: 0.9em;
}

#btn-fullscreen {
    background: rgba(20,30,60,0.6);
    border: 1px solid rgba(51,136,255,0.3);
    color: #ccd8f0;
    font-size: 1.2em;
    width: 40px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#btn-fullscreen:hover {
    background: rgba(51,136,255,0.2);
    border-color: rgba(51,136,255,0.6);
    box-shadow: 0 0 10px rgba(51,136,255,0.3);
}

/* ============================================================
   PLAYLIST PANEL — stale widoczna po lewej
   ============================================================ */
#playlist-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 20;
    background: rgba(5, 10, 30, 0.88);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(51,136,255,0.2);
    box-shadow: 5px 0 30px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

#playlist-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    color: #5599cc;
    letter-spacing: 1px;
    flex-shrink: 0;
}

#playlist-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(51,136,255,0.15);
}

#search-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(51,136,255,0.25);
    color: #e0e6f0;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: rgba(51,136,255,0.6);
    box-shadow: 0 0 8px rgba(51,136,255,0.2);
}

#search-input::placeholder {
    color: #556688;
}

/* ============================================================
   PONY REACTION SLIDER
   ============================================================ */
#pony-react-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

#pony-react-icon {
    font-size: 1em;
}

#pony-react-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(200, 100, 255, 0.25);
    border-radius: 2px;
    cursor: pointer;
}

#pony-react-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cc66ff;
    border: 1px solid #fff;
    box-shadow: 0 0 6px rgba(200, 100, 255, 0.5);
}

#pony-react-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cc66ff;
    border: 1px solid #fff;
}

#pony-react-label {
    font-size: 0.7em;
    color: #cc88ff;
    font-family: 'Orbitron', monospace;
    min-width: 30px;
}

/* Amplitude & Sensitivity sliders */
#amp-wrap, #sens-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

#amp-icon, #sens-icon {
    font-size: 1em;
}

#amp-slider, #sens-slider {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 180, 50, 0.25);
    border-radius: 2px;
    cursor: pointer;
}

#amp-slider::-webkit-slider-thumb,
#sens-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffaa33;
    border: 1px solid #fff;
    box-shadow: 0 0 6px rgba(255, 170, 50, 0.5);
}

#amp-slider::-moz-range-thumb,
#sens-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffaa33;
    border: 1px solid #fff;
}

#amp-label, #sens-label {
    font-size: 0.65em;
    color: #ffaa66;
    font-family: 'Orbitron', monospace;
    min-width: 28px;
}

#playlist-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Scrollbar */
#playlist-list::-webkit-scrollbar {
    width: 6px;
}
#playlist-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
#playlist-list::-webkit-scrollbar-thumb {
    background: rgba(51,136,255,0.3);
    border-radius: 3px;
}
#playlist-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51,136,255,0.5);
}

/* Folder header */
.pl-folder {
    font-family: 'Orbitron', monospace;
    font-size: 0.75em;
    color: #5588bb;
    padding: 10px 8px 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(51,136,255,0.1);
}

/* Track item */
.pl-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.pl-item:hover {
    background: rgba(51,136,255,0.1);
    border-color: rgba(51,136,255,0.2);
}

.pl-item.active {
    background: rgba(51,136,255,0.2);
    border-color: rgba(51,136,255,0.4);
    box-shadow: 0 0 10px rgba(51,136,255,0.15);
}

.pl-item.active .pl-name {
    color: #fff;
    text-shadow: 0 0 6px rgba(51,136,255,0.4);
}

.pl-badge {
    font-size: 1.1em;
    flex-shrink: 0;
}

.pl-name {
    flex: 1;
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #bbc8dd;
}

.pl-ext {
    font-size: 0.7em;
    color: #556688;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
}

.pl-error {
    color: #ff6688;
    text-align: center;
    padding: 20px;
}

/* ============================================================
   DECORATIVE — Corner frames (game-like)
   ============================================================ */
#hud::before,
#hud::after {
    content: '';
    position: fixed;
    width: 60px;
    height: 60px;
    border-color: rgba(51,136,255,0.25);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    z-index: 11;
}

#hud::before {
    top: 10px;
    left: 10px;
    border-top-width: 2px;
    border-left-width: 2px;
}

#hud::after {
    top: 10px;
    right: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
}

#hud-bottom::before,
#hud-bottom::after {
    content: '';
    position: fixed;
    width: 60px;
    height: 60px;
    border-color: rgba(51,136,255,0.25);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    z-index: 11;
}

#hud-bottom::before {
    bottom: 10px;
    left: 10px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

#hud-bottom::after {
    bottom: 10px;
    right: 10px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* ============================================================
   RESPONSIVE — SMARTPHONE PORTRAIT
   ============================================================ */

/* Playlist toggle button (only visible on mobile) */
#playlist-toggle {
    display: none;
}

@media (max-width: 768px) {

    /* --- PLAYLIST: hidden by default, slide-in overlay --- */
    #playlist-panel {
        width: 85vw;
        max-width: 320px;
        height: 100%;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 50;
        border-right: 1px solid rgba(51,136,255,0.3);
        box-shadow: 5px 0 30px rgba(0,0,0,0.6);
    }

    #playlist-panel.open {
        transform: translateX(0);
    }

    /* Overlay behind open playlist */
    #playlist-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 45;
    }

    #playlist-overlay.visible {
        display: block;
    }

    /* Playlist toggle button */
    #playlist-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 8px;
        left: 8px;
        z-index: 40;
        width: 40px;
        height: 40px;
        background: rgba(20, 30, 60, 0.8);
        border: 1px solid rgba(51,136,255,0.4);
        border-radius: 8px;
        color: #ccd8f0;
        font-size: 1.3em;
        cursor: pointer;
        pointer-events: auto;
        backdrop-filter: blur(8px);
        box-shadow: 0 0 10px rgba(0,0,0,0.4);
    }

    #playlist-toggle:active {
        background: rgba(51,136,255,0.3);
    }

    /* --- HUD: remove playlist margin --- */
    #hud-top {
        margin-left: 0;
        padding: 0;
    }

    #hud-top #now-playing {
        padding: 6px 10px;
        padding-left: 55px; /* room for toggle button */
    }

    #hud-bottom {
        margin-left: 0;
        padding: 6px 10px 10px;
    }

    /* --- TITLE: smaller --- */
    #track-title {
        font-size: 0.9em;
        letter-spacing: 1px;
    }

    #track-folder {
        font-size: 0.7em;
    }

    /* --- LED BAR: full width behind title on mobile --- */
    #spectrum-bar {
        max-width: none;
        height: 100%;
        margin: 0;
    }

    /* --- TRANSPORT: compact --- */
    #transport {
        gap: 4px;
        margin-bottom: 5px;
    }

    #transport button {
        width: 38px;
        height: 36px;
        font-size: 1em;
        border-radius: 6px;
    }

    /* --- PROGRESS: thinner time labels --- */
    #progress-row {
        gap: 6px;
        margin-bottom: 5px;
    }

    #time-current, #time-total {
        font-size: 0.65em;
        min-width: 32px;
    }

    /* --- BOTTOM ROW: wrap into 2 lines --- */
    #bottom-row {
        flex-wrap: wrap;
        gap: 6px 10px;
        justify-content: center;
    }

    #volume-wrap {
        order: 1;
    }

    #volume-slider {
        width: 55px;
    }

    #vol-icon {
        font-size: 1em;
    }

    /* Hide pony reactivity slider on very small screens */
    #pony-react-wrap {
        order: 4;
    }

    #pony-react-slider {
        width: 50px;
    }

    #pony-react-label {
        font-size: 0.6em;
    }

    #amp-slider, #sens-slider {
        width: 40px;
    }

    #amp-label, #sens-label {
        font-size: 0.55em;
    }

    #viz-select-wrap {
        order: 2;
    }

    #viz-select-wrap select,
    #effect-select-wrap select {
        padding: 4px 6px;
        font-size: 0.8em;
    }

    #effect-select-wrap {
        order: 3;
    }

    #btn-fullscreen {
        order: 5;
        width: 34px;
        height: 32px;
        font-size: 1em;
    }

    /* --- PONY: duży, wycentrowany nad kontrolkami, przysłania wizualizer --- */
    #pony-canvas {
        max-width: 95vw !important;
        max-height: 75vh !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 180px !important;
        z-index: 14 !important;
        opacity: 0.92;
    }

    /* --- Corner decorations: hide on mobile --- */
    #hud::before, #hud::after,
    #hud-bottom::before, #hud-bottom::after {
        display: none;
    }
}

/* Extra small phones (< 400px) */
@media (max-width: 400px) {
    #track-title {
        font-size: 0.75em;
    }

    #transport button {
        width: 34px;
        height: 32px;
        font-size: 0.9em;
    }

    #pony-react-wrap {
        display: none;
    }

    #amp-wrap, #sens-wrap {
        display: none;
    }

    #pony-canvas {
        max-width: 90vw !important;
        max-height: 67vh !important;
        bottom: 160px !important;
    }

    #spectrum-bar {
        height: 100%;
    }
}

/* ============================================================
   3D OBJECT EDITOR
   ============================================================ */
#obj-editor-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 25;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(20, 30, 60, 0.85);
    border: 1px solid rgba(51, 136, 255, 0.4);
    color: #33ccff;
    font-size: 1.4em;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 0 12px rgba(51, 136, 255, 0.3);
    line-height: 1;
}
#obj-editor-toggle:hover {
    background: rgba(51, 136, 255, 0.3);
    box-shadow: 0 0 20px rgba(51, 136, 255, 0.5);
    transform: scale(1.1);
}

#obj-editor-panel {
    display: none;
    position: fixed;
    top: 56px;
    right: 12px;
    width: 310px;
    max-height: calc(100vh - 70px);
    z-index: 24;
    background: rgba(8, 12, 30, 0.94);
    border: 1px solid rgba(51, 136, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.7), 0 0 20px rgba(51,136,255,0.15);
    backdrop-filter: blur(12px);
    font-family: 'Rajdhani', sans-serif;
    pointer-events: auto;
}
#obj-editor-panel.open { display: flex; flex-direction: column; }

#obj-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(51,136,255,0.1);
    border-bottom: 1px solid rgba(51,136,255,0.2);
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    font-weight: 700;
    color: #33ccff;
    letter-spacing: 1px;
}
#obj-editor-close {
    background: none;
    border: none;
    color: #ff5566;
    font-size: 1.1em;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
#obj-editor-close:hover { background: rgba(255,85,102,0.2); }

#obj-editor-body {
    padding: 10px 14px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    scrollbar-width: thin;
    scrollbar-color: rgba(51,136,255,0.3) transparent;
}

.obj-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.obj-section:last-child { border-bottom: none; }
.obj-section > label {
    display: block;
    font-size: 0.75em;
    font-weight: 700;
    color: #88aacc;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-family: 'Orbitron', monospace;
}

.obj-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.obj-row > span:first-child {
    font-size: 0.72em;
    color: #7799bb;
    min-width: 50px;
    text-align: right;
}
.obj-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(51,136,255,0.15);
    border-radius: 2px;
    cursor: pointer;
}
.obj-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #33ccff;
    border: 1px solid #fff;
    box-shadow: 0 0 6px rgba(51,204,255,0.5);
}
.obj-row input[type="color"] {
    width: 32px; height: 22px;
    border: 1px solid rgba(51,136,255,0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}
.obj-row input[type="checkbox"] {
    accent-color: #33ccff;
}
.obj-row select {
    flex: 1;
    background: rgba(10,15,35,0.8);
    border: 1px solid rgba(51,136,255,0.25);
    color: #cde;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.78em;
    font-family: 'Rajdhani', sans-serif;
}
.obj-val {
    font-size: 0.65em;
    color: #55aadd;
    min-width: 30px;
    text-align: left;
    font-family: 'Orbitron', monospace;
}

#obj-type, #obj-list {
    width: 100%;
    background: rgba(10,15,35,0.8);
    border: 1px solid rgba(51,136,255,0.25);
    color: #cde;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.85em;
    margin-bottom: 6px;
    font-family: 'Rajdhani', sans-serif;
}
#obj-list {
    min-height: 60px;
}
#obj-list option {
    padding: 3px 6px;
}
#obj-list option:checked {
    background: rgba(51,136,255,0.3);
}

.obj-btn-primary, .obj-btn, .obj-btn-danger {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.78em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
    margin: 2px;
}
.obj-btn-primary {
    background: rgba(51,136,255,0.25);
    border-color: rgba(51,136,255,0.5);
    color: #33ccff;
}
.obj-btn-primary:hover { background: rgba(51,136,255,0.45); }
.obj-btn {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: #aabbcc;
}
.obj-btn:hover { background: rgba(255,255,255,0.12); }
.obj-btn-danger {
    background: rgba(255,50,70,0.15);
    border-color: rgba(255,50,70,0.35);
    color: #ff6677;
}
.obj-btn-danger:hover { background: rgba(255,50,70,0.3); }
.obj-btn-row {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.obj-hint {
    font-size: 0.65em;
    color: #556688;
    margin-top: 6px;
    line-height: 1.5;
    padding: 5px 8px;
    background: rgba(51,136,255,0.05);
    border-radius: 4px;
    border: 1px solid rgba(51,136,255,0.1);
}

#obj-drag-toggle.active {
    background: rgba(51,136,255,0.4);
    border-color: rgba(51,204,255,0.6);
    color: #fff;
    box-shadow: 0 0 8px rgba(51,204,255,0.4);
}

@media (max-width: 768px) {
    #obj-editor-panel {
        width: calc(100vw - 20px);
        right: 10px;
        top: 52px;
        max-height: calc(100vh - 60px);
    }
    #obj-editor-toggle {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        font-size: 1.2em;
    }
}

/* ============================================================
   PONY CANVAS
   ============================================================ */
#pony-canvas {
    position: fixed;
    bottom: 80px;
    right: 10px;
    z-index: 15;
    pointer-events: none;
    max-width: 375px;
    max-height: 525px;
    filter: drop-shadow(0 0 15px rgba(150, 50, 255, 0.4));
    transition: filter 0.3s;
}
