/* ==========================================================================
   Base layout & UI
   ========================================================================== */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #0f0f12;
    color: #f5f5f5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #17171c;
    border-bottom: 1px solid #2a2a33;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar .title {
    font-weight: 700;
    letter-spacing: .3px;
}

.topbar .controls button {
    margin-left: 8px;
    background: #2b2b34;
    color: #fff;
    border: 1px solid #3a3a47;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.topbar .controls button:hover {
    background: #3a3a47;
}

#gameRoot {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px;
}

#sceneContainer {
    position: relative;
    aspect-ratio: 16/9;
    background: #111;
    border: 1px solid #2a2a33;
    border-radius: 14px;
    overflow: hidden;
}

#sceneImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#hotspotLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.hotspot {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0);
    cursor: pointer;
}

.hotspot:focus {
    outline: none;
}

.hotspot.require {
    outline: 2px dashed rgba(255, 255, 0, .8);
}

#uiBar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

#inventory {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1b1b22;
    border: 1px solid #2c2c37;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    color: #f5f5f5;
}

.item span {
    color: inherit;
}

.item:active {
    transform: translateY(1px);
    opacity: .9;
}

.item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

#msg {
    opacity: .9;
}

.hidden {
    display: none !important;
}

#modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    width: min(520px, 92vw);
    background: #18181d;
    border: 1px solid #30303b;
    border-radius: 14px;
    padding: 14px;
}

.modal-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-body input[type=text], .modal-body input[type=password] {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #343444;
    background: #101014;
    color: #fff;
}

/* Editor overlay (scene/puzzle editor) */
#editorOverlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 20;
}

.editor-on #hotspotLayer .hotspot {
    pointer-events: none !important;
    border-color: rgba(0, 200, 255, .75);
}

.editor-toolbar {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 1000;
    pointer-events: auto;
    background: #15151a;
    border: 1px solid #2a2a33;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    gap: 6px;
}

.editor-toolbar button {
    background: #2b2b34;
    color: #fff;
    border: 1px solid #3a3a47;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
}

.editor-hint {
    position: absolute;
    left: 10px;
    top: 10px;
    background: rgba(0, 0, 0, .45);
    padding: 6px 8px;
    border-radius: 8px;
}

.hs-label {
    font-size: 10px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    padding: 2px 4px;
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
}

.editor-jsonpanel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1001;
    pointer-events: auto;
    width: min(320px, 90vw);
    background: #15151a;
    border: 1px solid #2a2a33;
    border-radius: 10px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.editor-jsonpanel-title {
    font-weight: 700;
}

.editor-jsonpanel-text {
    width: 100%;
    resize: vertical;
    min-height: 110px;
    background: #0f0f12;
    color: #f5f5f5;
    border: 1px solid #343444;
    border-radius: 8px;
    padding: 8px;
}

.editor-jsonpanel-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.editor-jsonpanel-actions button {
    background: #2b2b34;
    color: #fff;
    border: 1px solid #3a3a47;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

/* Strong hotspot reset to avoid theme collisions */
#hotspotLayer .hotspot {
    position: absolute;
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

#hotspotLayer .hotspot:focus, #hotspotLayer .hotspot:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.editor-on #hotspotLayer .hotspot {
    border: 2px dashed rgba(0, 200, 255, .9) !important;
    background: rgba(0, 200, 255, .12) !important;
}

.editor-on #hotspotLayer .hotspot.require {
    border-style: dashed;
    border-color: rgba(255, 255, 0, .9) !important;
    background: rgba(255, 255, 0, .12) !important;
}

/* Toasts */
.toast-container {
    position: fixed !important;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9000; /* Higher than puzzle overlay (8000) */
    pointer-events: none;
}

.toast {
    max-width: min(640px, 90vw);
    background: rgba(20, 20, 26, .95);
    color: #f5f5f5;
    border: 1px solid #2a2a33;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    transition: opacity .3s ease, transform .3s ease;
    opacity: 1;
    transform: none;
}

.toast.hide {
    opacity: 0;
    transform: translateY(6px);
}

.hs-glow {
    position: absolute;
    pointer-events: none;
    z-index: 50;
    border-radius: 12px;
    background: radial-gradient(ellipse at center,
    rgba(0, 200, 255, .18) 0%,
    rgba(0, 200, 255, .12) 60%,
    rgba(0, 200, 255, 0) 100%);
    box-shadow: 0 0 .8rem rgba(0, 200, 255, .35), 0 0 2.2rem rgba(0, 200, 255, .25);
    animation: hs-pulse 1.4s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes hs-pulse {
    0% {
        opacity: .65;
        transform: scale(.98);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: .65;
        transform: scale(.98);
    }
}

/* Inventory: selected item & use-mode pointer */
.item.selected {
    outline: 2px solid rgba(30, 144, 255, .9);
    outline-offset: 2px;
}

body.use-on #hotspotLayer {
    cursor: crosshair;
}

/* ==========================================================================
   Dialog UI – portraits pinned to the panel
   ========================================================================== */

.dlg-overlay {
    position: absolute; /* inside #sceneContainer */
    inset: 0;
    z-index: 1100;
    display: grid;
    grid-template-rows: 1fr auto; /* stage, panel */
    pointer-events: none; /* Allow children to control their own pointer-events */
}

/* Background blocker - blocks hotspots (z-index: 50) but is UNDER dialog panel */
.dlg-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    pointer-events: auto; /* CRITICAL: Block hotspots behind dialog */
    z-index: 1099; /* Between hotspots (50) and dialog panel (1101) */
}

.dlg-overlay.hidden {
    display: none !important;
}

/* Stage holds two portrait anchors that sit on the panel's top edge */
.dlg-stage {
    position: relative;
    min-height: 0;
    overflow: hidden;
    pointer-events: none; /* Transparent for portraits */
    z-index: 1100;
}

/* Portrait columns */
.dlg-char {
    position: absolute;
    left: 2vw;
    right: auto;
    bottom: 0;
    height: 100%;
    width: min(42vw, 380px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    user-select: none;
    transform: translateY(0) scale(1);
    transition: transform .18s ease, filter .18s ease;
    will-change: transform, filter;
}

.dlg-char.right {
    left: auto;
    right: 2vw;
}

.dlg-char-img {
    width: 100%;
    height: auto;
    max-height: calc(100% - 6px);
    object-fit: contain;
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .45));
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Speaker emphasis: subtle lift + slight scale */
.dlg-char.speaking {
    transform: translateY(-6px) scale(1.02);
}

.dlg-char.speaking .dlg-char-img {
    filter: drop-shadow(0 12px 34px rgba(0, 0, 0, .55)) saturate(1.04);
}

/* Non-speaker: mild attenuation, no opacity fade */
.dlg-char:not(.speaking) .dlg-char-img {
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .45)) brightness(.95);
}

/* Dialog panel - HIGHER z-index than blocker, allows interactions */
.dlg-panel {
    position: relative;
    width: min(1100px, 100%);
    margin: 0 auto;
    background: rgba(17, 17, 20, .92);
    border: 1px solid #2a2a33;
    border-radius: 14px 14px 0 0;
    padding: 12px 14px 32px 14px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
    pointer-events: auto; /* CRITICAL: Enable all interactions */
    z-index: 1101; /* CRITICAL: Above blocker (1099) to allow hover */
}

/* Speaker nameplate */
.dlg-nameplate {
    position: absolute;
    left: 16px;
    top: -26px;
    background: rgba(17, 17, 20, .92);
    border: 1px solid #2a2a33;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 6px 10px;
    font-weight: 700;
    color: #f0f0f6;
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text */
.dlg-text {
    min-height: 56px;
    line-height: 1.45;
    color: #f5f5f5;
}

/* Compact mode tweaks */
.dlg-compact .dlg-char {
    width: min(36vw, 300px);
}

@media (max-width: 720px) {
    .dlg-char {
        width: min(46vw, 300px);
    }
}

/* Keep scene hotspots invisible while puzzle editor is active */
.editor-puzzle-mode #hotspotLayer > .hotspot {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ==========================================================================
   Dialog choices – unified with puzzle buttons
   - Scoped to .dlg-overlay to prevent global leaks
   - Pill buttons around text (no 100% width)
   - Green hover/confirm to match OK/correct visuals
   ========================================================================== */

.dlg-overlay {
    /* Stable dialog-scoped tokens (optionally reading from puzzles.css) */
    --dlg-choice-bg: rgba(255, 255, 255, 0.10);
    --dlg-choice-border: rgba(255, 255, 255, 0.35);
    --dlg-choice-text: rgba(255, 255, 255, 0.95);
    --dlg-choice-radius: 12px;

    /* Green look aligned with OK/correct - EXPLICIT VALUES */
    --dlg-choice-hover-bg: rgba(80, 200, 120, 0.25);
    --dlg-choice-hover-border: rgba(80, 200, 120, 0.65);
    --dlg-choice-selected-bg: rgba(80, 200, 120, 0.30);
    --dlg-choice-selected-border: rgba(80, 200, 120, 0.75);

    --dlg-t: 250ms ease;
}

/* Choices container: vertical, centered, with spacing */
.dlg-overlay .dlg-choices {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    margin-top: 10px;
}

/* Ensure the “tap to continue” hint never blocks hover */
.dlg-overlay .dlg-continue {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 12px;
    opacity: .75;
    user-select: none;
    pointer-events: none;
}

/* Choice pills – compact, not full-width */
.dlg-overlay .dlg-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    max-width: min(92%, 780px);
    padding: 10px 18px;
    background: var(--dlg-choice-bg);
    color: var(--dlg-choice-text);
    border: 1px solid var(--dlg-choice-border);
    border-radius: var(--dlg-choice-radius);
    text-align: center;
    white-space: normal;
    cursor: pointer;
    pointer-events: auto;
    transition: background var(--dlg-t), border-color var(--dlg-t),
    box-shadow var(--dlg-t), transform 80ms ease;
}

/* CRITICAL FIX: Green hover with highest specificity */
.dlg-overlay .dlg-choice:hover:not([disabled]),
.dlg-overlay .dlg-choice:focus-visible:not([disabled]) {
    outline: none;
    background: var(--dlg-choice-hover-bg) !important;
    border-color: var(--dlg-choice-hover-border) !important;
    box-shadow: 0 0 0 2px var(--dlg-choice-hover-border),
    0 0 0 4px rgba(0, 0, 0, .15);
    transform: translateY(-1px);
}

.dlg-overlay .dlg-choice:active:not([disabled]) {
    transform: translateY(1px);
}

/* Confirmed selection (JS toggles .dlg-choice--selected) */
.dlg-overlay .dlg-choice.dlg-choice--selected {
    background: var(--dlg-choice-selected-bg) !important;
    border-color: var(--dlg-choice-selected-border) !important;
    box-shadow: 0 0 0 2px var(--dlg-choice-selected-border),
    0 0 0 6px rgba(0, 0, 0, .18);
    animation: token-pulse-correct .35s ease;
}

/* Disabled while flashing to prevent double taps/clicks */
.dlg-overlay .dlg-choice[disabled] {
    cursor: not-allowed;
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .18);
    opacity: .65;
    pointer-events: none;
}

/* Compact viewport: slightly tighter paddings */
.dlg-overlay.dlg-compact .dlg-choice {
    padding: 8px 14px;
}

/* Mirroring utility for dialog characters (flips horizontally) */
.dlg-char-img.is-mirrored {
    transform: scaleX(-1);
}

/* ======================================================================
   Inspect Item — minimal, safe tweaks (no global restyle)
   - Keep modal size sensible and above dialogs overlay
   - Add tiny helpers for image, text blocks and inline actions
   - Unified .btn (scoped to #modal only), + blue "action" variant for Use
   ====================================================================== */

/* Make sure the modal is above any dialog overlay */
#modal {
    z-index: 1300;
}

/* Prevent tall bodies from overflowing viewport */
#modal .modal-content {
    max-height: 90vh;
    overflow: auto;
}

#modal .modal-content.modal--item {
    position: relative;
    padding-top: 16px; /* rezerva pod křížek */
}

#modal .modal-content.modal--item .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

/* Circled GNOME-like X */
#modal .modal-content.modal--item .modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    display: inline-block;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .08s ease;
}

/* Drawing close btn */
#modal .modal-content.modal--item .modal-close::before,
#modal .modal-content.modal--item .modal-close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 2px;
    background: #d7d7d9;
    border-radius: 1px;
    transform-origin: center;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}

#modal .modal-content.modal--item .modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Hover/focus: red button close X */
#modal .modal-content.modal--item .modal-close:hover,
#modal .modal-content.modal--item .modal-close:focus-visible {
    outline: none;
    background: rgba(220, 60, 60, 0.16);
    border-color: rgba(220, 60, 60, 0.55);
    box-shadow: 0 0 0 2px rgba(220, 60, 60, 0.35);
}

#modal .modal-content.modal--item .modal-close:hover::before,
#modal .modal-content.modal--item .modal-close:hover::after,
#modal .modal-content.modal--item .modal-close:focus-visible::before,
#modal .modal-content.modal--item .modal-close:focus-visible::after {
    background: #fff;
}

/* Active click to close btn */
#modal .modal-content.modal--item .modal-close:active {
    transform: translateY(1px);
}

#modal .item-inspect .modal-img {
    width: 100%;
    max-height: 40vh;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin-bottom: 10px;
}

#modal .item-inspect .modal-word {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 6px 0 2px 0;
}

#modal .item-inspect .modal-desc {
    line-height: 1.45;
    opacity: .95;
    margin-top: 6px;
}

/* Small inline actions dock inside modal body (left-aligned) */
#modal .item-ops {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 10px;
}

/* Scoped pill buttons for modal only (no leakage to topbar/toolbars) */
#modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8ch;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.24);
    text-align: center;
    user-select: none;
    cursor: pointer;
    transition: background 220ms ease, border-color 220ms ease,
    box-shadow 120ms ease, transform 120ms ease;
}

#modal .btn:hover,
#modal .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

#modal .btn:active {
    transform: translateY(1px);
}

/* Use button: neutral by default; turns blue on hover/focus */
#modal .btn--action {
    /* inherit base neutral styles from #modal .btn */
    /* intentionally no custom background/border here */
}

#modal .btn--action:hover,
#modal .btn--action:focus-visible {
    background: #2a3b6a;
    border-color: #2d72ff;
    box-shadow: 0 0 0 2px rgba(45, 114, 255, 0.25) inset,
    0 0 0 2px rgba(45, 114, 255, 0.30);
}

#modal .btn[disabled],
#modal .btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.15);
    box-shadow: none !important;
}

/* ==========================================================================
   HOTSPOT STATES SYSTEM
   ========================================================================== */

/* Content container inside hotspot (text, icon) - Centered by default */
.hotspot .hs-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-weight: 700;
    font-size: 2.2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
    z-index: 10;
    white-space: nowrap;
}

/* Image overlay inside hotspot - Fills the area */
.hotspot .hs-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    z-index: 5;
}

/* --- STATE: SUCCESS ---
   Generic style for completed tasks/slots.
*/
#hotspotLayer .hotspot.state-success {
    border: 2px solid rgba(88, 197, 154, 0.9) !important;
    background: rgba(88, 197, 154, 0.25) !important;
    box-shadow: 0 0 20px rgba(88, 197, 154, 0.6), inset 0 0 15px rgba(88, 197, 154, 0.3) !important;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);

    cursor: default !important;
    opacity: 1 !important;
}

.hotspot.state-success .hs-content {
    color: #58c59a;
    animation: hs-pop-success 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hs-pop-success {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* --- STATE: LOCKED --- */
#hotspotLayer .hotspot.state-locked {
    background: rgba(200, 50, 50, 0.15) !important;
    border: 2px dashed rgba(200, 50, 50, 0.6) !important;
}

/* ==========================================================================
   VIDEO PLAYER OVERLAY
   ========================================================================== */

.video-overlay {
    position: absolute;
    z-index: 9500; /* Above dialogs (1100) and highlights (9000) */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fullscreen Mode */
.video-overlay.mode-fullscreen {
    inset: 0;
    width: 100vw;
    height: 100vh;
    position: fixed; /* Fixes viewport issues on mobile */
}

/* Rect Mode (Embedded in scene) */
.video-overlay.mode-rect {
    position: absolute;
    /* Position is set inline by JS based on rect % */
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    background: #000;
}

.video-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure aspect ratio is preserved */
    display: block;
}

/* Skip Button */
.video-skip {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.video-skip:hover {
    background: rgba(200, 50, 50, 0.9);
    border-color: rgba(255,255,255,0.9);
    transform: scale(1.1);
}

/* ==========================================================================
   ITEM DRAG & DROP SYSTEM
   ========================================================================== */

/* Item being dragged */
.item.is-dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: none !important;
}

/* Body state when dragging an item */
body.item-dragging {
    cursor: grabbing;
}

body.item-dragging .hotspot {
    /* Make hotspots more visible during drag */
    transition: all 0.2s ease;
}

/* Hotspot that can accept the dragged item */
#hotspotLayer .hotspot.accepts-drop {
    border: 2px dashed rgba(88, 197, 154, 0.7) !important;
    background: rgba(88, 197, 154, 0.15) !important;
    animation: pulse-accept 1.2s ease-in-out infinite;
}

@keyframes pulse-accept {
    0%, 100% {
        box-shadow: 0 0 10px rgba(88, 197, 154, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(88, 197, 154, 0.6);
    }
}

/* Hotspot currently under the drag cursor */
#hotspotLayer .hotspot.drop-target {
    border: 3px solid rgba(88, 197, 154, 1) !important;
    background: rgba(88, 197, 154, 0.35) !important;
    box-shadow: 0 0 30px rgba(88, 197, 154, 0.8), inset 0 0 15px rgba(88, 197, 154, 0.4) !important;
    transform: scale(1.02);
}

/* Touch drag ghost element */
.item-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 22, 28, 0.95);
    border: 2px solid rgba(88, 197, 154, 0.8);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(88, 197, 154, 0.4);
    max-width: 200px;
    animation: ghost-appear 0.15s ease-out;
}

@keyframes ghost-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.item-drag-ghost img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
}

.item-drag-ghost span {
    font-size: 14px;
    color: #f5f5f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Prevent text selection and default touch actions during drag */
body.item-dragging * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Touch device specific: prevent accidental scrolling during item drag */
@media (hover: none) and (pointer: coarse) {
    .item {
        touch-action: manipulation;
    }

    body.item-dragging {
        overflow: hidden;
        touch-action: none;
    }
}