:root {
    --viewport-w: 1920px;
    --viewport-h: 1080px;
    --slot-size: 68px;
    --dialog-width: 1000px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow: hidden; font-family: 'Segoe UI', Arial, sans-serif; }

/* Viewport: fixed 1920x1080 scaled to fit */
#viewport {
    width: var(--viewport-w); height: var(--viewport-h);
    position: relative; overflow: hidden;
    transform-origin: top left;
}

#background {
    width: var(--viewport-w); height: var(--viewport-h);
    object-fit: cover; position: absolute; top: 0; left: 0; z-index: 0;
}

#overlays, #hotspots, #characters { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#hotspots { z-index: 2; pointer-events: auto; }
#characters { z-index: 3; }

/* Hotspot rects */
.hotspot-rect {
    position: absolute; cursor: url('../images/ui/cursor_lupe.png') 11 11, pointer;
    border: 1.5px solid rgba(100,150,200,0.2);
    background: rgba(100,150,200,0.06);
    transition: background 0.15s, border-color 0.15s;
}
.hotspot-rect:hover {
    background: rgba(100,150,200,0.18);
    border-color: rgba(100,150,200,0.5);
}
.hotspot-rect.action-take { border-color: rgba(76,255,102,0.2); background: rgba(76,255,102,0.06); }
.hotspot-rect.action-take:hover { background: rgba(76,255,102,0.18); border-color: rgba(76,255,102,0.5); }
.hotspot-rect.action-talk { border-color: rgba(230,204,51,0.2); background: rgba(230,204,51,0.06); }
.hotspot-rect.action-talk:hover { background: rgba(230,204,51,0.18); border-color: rgba(230,204,51,0.5); }
.hotspot-rect.action-travel { border-color: rgba(255,153,51,0.2); background: rgba(255,153,51,0.06); }
.hotspot-rect.action-travel:hover { background: rgba(255,153,51,0.18); border-color: rgba(255,153,51,0.5); }
.hotspot-rect.has-item-sprite { border: none; background: none; }

/* Item sprites in hotspots */
.hotspot-item-img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; object-fit: contain; pointer-events: none;
}

/* Character sprites */
.char-sprite {
    position: absolute; transform-origin: bottom center;
    cursor: url('../images/ui/cursor_lupe.png') 11 11, pointer;
    pointer-events: auto;
}

/* Overlay sprites */
.overlay-sprite { position: absolute; pointer-events: none; }

/* Action mode buttons (top-left, 2x2 grid) */
#action-modes {
    position: absolute; top: 8px; left: 12px; z-index: 11;
    display: grid;
    grid-template-columns: 48px 48px;
    grid-template-rows: 48px 48px;
    gap: 4px;
}
.action-mode-btn {
    width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px; background: rgba(0,0,0,0.5); color: #fff;
    font-size: 22px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.action-mode-btn:hover { background: rgba(255,255,255,0.15); }
.action-mode-btn.active {
    border-color: rgba(100,200,255,0.8);
    background: rgba(40,80,140,0.6);
    box-shadow: 0 0 8px rgba(100,200,255,0.3);
}

/* Info bar (top) */
#info-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 0; min-height: 48px;
}
#description-text {
    flex: 1; color: #e0e6ee; font-size: 22px; text-shadow: 1px 1px 3px #000;
    min-height: 28px; padding: 10px 16px 10px 120px;
    background: rgba(0,0,0,0.55); border-radius: 0 0 8px 0;
    margin-right: 8px;
}
#description-text:empty { background: none; }
#info-buttons {
    padding: 8px 12px 0 0; flex-shrink: 0;
    display: grid; grid-template-columns: 48px 48px;
    gap: 4px;
}
#info-buttons button {
    width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px; background: rgba(0,0,0,0.5); color: #fff;
    font-size: 22px; cursor: pointer; position: relative;
    transition: background 0.15s;
}
#info-buttons button:hover { background: rgba(255,255,255,0.15); }
.badge {
    position: absolute; top: -4px; right: -4px;
    background: #e33; color: #fff; font-size: 11px;
    min-width: 18px; height: 18px; line-height: 18px;
    border-radius: 9px; text-align: center; padding: 0 4px;
}

/* Scene title */
#scene-title {
    position: absolute; top: 60px; left: 0; right: 0; z-index: 10;
    text-align: center; color: #e0e8f0; font-size: 28px; font-weight: 300;
    text-shadow: 2px 2px 6px #000; opacity: 0;
    transition: opacity 0.5s; pointer-events: none; letter-spacing: 2px;
}

/* Dialog panel */
#dialog-panel {
    position: absolute; left: 50%; bottom: 20px; z-index: 20;
    transform: translateX(-50%); width: var(--dialog-width);
    background: rgba(15,18,25,0.92); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 20px; color: #c8d4e0;
    backdrop-filter: blur(8px);
}
.dialog-top { display: flex; gap: 16px; margin-bottom: 12px; }
#dialog-portrait {
    width: 120px; height: 120px; min-width: 120px; border-radius: 4px;
    background: rgba(50,55,65,0.5); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    margin-top: -80px;
    border: 2px solid rgba(100,130,170,0.4);
}
#dialog-portrait img { width: 100%; height: 100%; object-fit: cover; }
.dialog-text-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
#dialog-speaker { font-size: 26px; font-weight: 600; color: #e8eff8; }
#dialog-text { font-size: 22px; line-height: 1.4; color: #b8c4d4; }
#dialog-response { font-size: 22px; line-height: 1.4; color: #b8c4d4; margin-bottom: 12px; }
#dialog-options { display: flex; flex-direction: column; gap: 6px; }
.dialog-opt-btn {
    background: none; border: none; text-align: left; padding: 6px 8px;
    font-size: 21px; cursor: pointer; border-radius: 4px;
    transition: background 0.12s; color: #7db8f0;
}
.dialog-opt-btn:hover { background: rgba(100,150,220,0.15); }
.dialog-opt-sub { padding-left: 28px; font-size: 20px; }
.dialog-opt-btn.read { color: #6a7080; }
.dialog-opt-btn.read:hover { color: #8a95a5; }
.dialog-close-btn { color: #888 !important; }
#dialog-continue {
    background: none; border: 1px solid rgba(100,130,170,0.3);
    color: #8ab4e0; font-size: 20px; padding: 8px 16px;
    cursor: pointer; border-radius: 4px; margin-top: 8px;
    transition: background 0.15s;
}
#dialog-continue:hover { background: rgba(100,150,220,0.15); }

/* Map overlay */
#map-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 25;
}
#map-bg { width: 100%; height: 100%; background: rgba(0,0,0,0.75); }
#map-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 400px; max-height: 80%; overflow-y: auto;
    background: rgba(15,18,25,0.95); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 24px; color: #c8d4e0;
}
#map-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 8px; }
#map-panel hr { border: none; border-top: 1px solid rgba(100,130,170,0.2); margin-bottom: 12px; }
#map-buttons { display: flex; flex-direction: column; gap: 4px; }
.map-btn {
    background: none; border: none; text-align: left; padding: 6px 8px;
    font-size: 19px; cursor: pointer; border-radius: 4px; color: #999;
    transition: background 0.12s;
}
.map-btn:hover { background: rgba(100,150,220,0.12); color: #fff; }
.map-btn.current { color: #66ccff; cursor: default; }
.map-btn.unvisited { color: #ffd944; }
.map-btn.unvisited:hover { color: #fff4aa; }
.map-note { font-size: 13px; color: rgba(150,150,150,0.8); padding-left: 24px; margin-bottom: 4px; }
.map-close-btn { color: #888 !important; margin-top: 8px; }

/* Item modal */
#item-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.7);
}
#item-modal-panel {
    background: rgba(20,24,32,0.95); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 28px 28px 24px; max-width: 620px; color: #c8d4e0;
    text-align: left; max-height: 85%; overflow-y: auto;
    position: relative;
}
#item-modal-close {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    background: none; border: 1px solid rgba(180,200,230,0.25);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0; color: #8ab4e0; font-size: 0;
}
#item-modal-close::before {
    content: '\00d7'; font-size: 22px; line-height: 1;
}
#item-modal-close:hover {
    background: rgba(255,100,100,0.2); border-color: rgba(255,120,120,0.5);
    color: #ff8888;
}
#item-modal-title { font-size: 24px; margin-bottom: 2px; padding-right: 36px; }
#item-modal-source { font-size: 14px; color: #707a88; margin-bottom: 12px; }
.item-modal-content { margin-bottom: 0; }
#item-modal-image-bg {
    float: left; margin: 0 16px 10px 0;
    width: 140px; height: 140px; background: rgba(80,85,95,0.4);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    min-width: 140px;
}
#item-modal-image { max-width: 128px; max-height: 128px; object-fit: contain; }
#item-modal-desc {
    text-align: left; font-size: 17px; line-height: 1.5; color: #aab4c4;
    white-space: pre-line;
}

/* Character modal */
#char-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 28;
}
#char-modal-backdrop {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
}
#char-modal-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 740px; max-height: 90%; overflow-y: auto;
    background: rgba(15,18,25,0.96); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 24px; color: #c8d4e0;
}
#char-modal-panel h3 { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
#char-modal-panel h4 { font-size: 16px; font-weight: 500; margin-bottom: 8px; color: #8898aa; margin-top: 0; }
#char-modal-panel hr { border: none; border-top: 1px solid rgba(100,130,170,0.2); margin: 12px 0; }
#char-body-area {
    display: flex; gap: 16px; align-items: flex-start;
}
#char-equip-col { flex-shrink: 0; }
#char-inv-col { flex: 1; min-width: 0; }
#char-modal-close {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    background: none; border: 1px solid rgba(180,200,230,0.25);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0; color: #8ab4e0; font-size: 0;
}
#char-modal-close::before { content: '\00d7'; font-size: 22px; line-height: 1; }
#char-modal-close:hover {
    background: rgba(255,100,100,0.2); border-color: rgba(255,120,120,0.5); color: #ff8888;
}

/* Character stats */
#char-stats { display: flex; gap: 8px; margin-bottom: 8px; justify-content: center; }
.stat-row {
    display: flex; align-items: center; gap: 6px;
    background: rgba(40,50,70,0.5); border: 1px solid rgba(100,130,170,0.2);
    border-radius: 6px; padding: 6px 12px;
}
.stat-icon { font-size: 20px; }
.stat-label { font-size: 16px; color: #8898aa; }
.stat-value { font-size: 22px; font-weight: 600; color: #a0d8ff; min-width: 24px; text-align: center; }

/* Equipment grid - body silhouette layout */
#equipment-grid {
    position: relative;
    width: 260px;
    height: 316px;
    background: url('../images/ui/silhouette.svg') center center / contain no-repeat;
}
.equip-slot {
    position: absolute;
    width: var(--slot-size); height: var(--slot-size);
    background: rgba(40,50,70,0.5); border: 1px dashed rgba(100,130,170,0.35);
    border-radius: 6px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.equip-slot:hover { border-color: rgba(180,200,230,0.6); background: rgba(60,70,90,0.6); }
.equip-slot.has-item { border-style: solid; border-color: rgba(100,200,255,0.4); background: rgba(30,50,80,0.6); }
.equip-slot-label {
    font-size: 9px; color: #556; text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
.equip-slot img {
    max-width: 52px; max-height: 52px; object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(100,200,255,0.3));
}
.equip-slot .equip-stat-hint {
    font-size: 9px; color: #6a8;
}
.equip-slot.drag-over {
    border-color: rgba(100,255,150,0.7);
    background: rgba(60,100,80,0.5);
}
.equip-slot.dragging { opacity: 0.4; }

/* Character inventory grid */
#char-inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, var(--slot-size));
    gap: 6px;
}
.char-inv-slot {
    width: var(--slot-size); height: var(--slot-size); border-radius: 4px;
    background: rgba(80,85,95,0.4); border: 1px solid rgba(90,100,120,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; transition: border-color 0.15s;
}
.char-inv-slot:hover { border-color: rgba(180,200,230,0.6); background: rgba(80,85,95,0.55); }
.char-inv-slot.dragging { opacity: 0.4; }
.char-inv-slot.drag-over { border-color: rgba(100,255,150,0.7); background: rgba(60,100,80,0.4); }
.char-inv-slot img { max-width: 56px; max-height: 56px; object-fit: contain; pointer-events: none; }
.char-inv-slot .equip-badge {
    position: absolute; top: 2px; right: 2px;
    font-size: 10px; background: rgba(40,80,140,0.8);
    color: #a0d8ff; padding: 1px 4px; border-radius: 3px;
}

/* Item selection modal */
#item-select-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 29;
}
#item-select-backdrop {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
}
#item-select-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 440px; max-height: 70%;
    background: rgba(15,18,25,0.96); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 20px; color: #c8d4e0;
    overflow-y: auto;
}
#item-select-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
#item-select-grid {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 12px;
}
.item-select-slot {
    width: var(--slot-size); height: var(--slot-size); border-radius: 4px;
    background: rgba(80,85,95,0.4); border: 1px solid rgba(90,100,120,0.5);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.item-select-slot:hover {
    border-color: rgba(100,200,255,0.7);
    background: rgba(40,80,140,0.3);
}
.item-select-slot img { max-width: 56px; max-height: 56px; object-fit: contain; pointer-events: none; }

/* Settings modal */
#settings-modal {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 28;
}
#settings-backdrop {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
}
#settings-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 340px;
    background: rgba(15,18,25,0.96); border: 1px solid rgba(100,130,170,0.3);
    border-radius: 8px; padding: 24px; color: #c8d4e0;
}
#settings-panel h3 { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
#settings-close {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    background: none; border: 1px solid rgba(180,200,230,0.25);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0; color: #8ab4e0; font-size: 0;
}
#settings-close::before { content: '\00d7'; font-size: 22px; line-height: 1; }
#settings-close:hover {
    background: rgba(255,100,100,0.2); border-color: rgba(255,120,120,0.5); color: #ff8888;
}
.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0;
}
.settings-label { font-size: 18px; color: #aab4c4; }
.settings-toggle {
    background: rgba(40,50,70,0.6); border: 1px solid rgba(100,130,170,0.3);
    color: #8898aa; font-size: 16px; padding: 6px 20px;
    border-radius: 4px; cursor: pointer; min-width: 70px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.settings-toggle:hover { background: rgba(60,80,110,0.6); }
.settings-toggle.on {
    background: rgba(40,80,140,0.6); border-color: rgba(100,200,255,0.5);
    color: #a0d8ff;
}

/* Start screen */
#start-screen {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 50;
}
#start-bg { width: 100%; height: 100%; object-fit: cover; }
#start-content {
    position: absolute; top: 12%; right: 6%; width: 46%;
    color: #c8d8ec; text-align: center;
}
#start-content h1 {
    font-size: 72px; font-weight: 300; letter-spacing: 12px;
    text-shadow: 3px 3px 12px #000; margin-bottom: 8px; color: #e8f0ff;
}
#start-content h3 {
    font-size: 22px; font-weight: 300; opacity: 0.8;
    text-shadow: 2px 2px 6px #000; margin-bottom: 30px;
}
#start-content p {
    font-size: 17px; line-height: 1.6; opacity: 0.85;
    text-shadow: 1px 1px 4px #000; margin-bottom: 36px;
}
#continue-btn {
    display: block; margin: 0 auto 12px auto;
    font-size: 28px; padding: 16px 52px; border: 2px solid rgba(100,200,255,0.6);
    background: rgba(30,60,100,0.7); color: #a0d8ff; border-radius: 6px;
    cursor: pointer; letter-spacing: 2px; transition: background 0.2s;
    backdrop-filter: blur(4px);
}
#continue-btn:hover { background: rgba(60,120,200,0.5); border-color: rgba(150,220,255,0.8); }
#start-btn {
    font-size: 26px; padding: 14px 48px; border: 1px solid rgba(200,220,255,0.4);
    background: rgba(20,30,50,0.6); color: #d0e0ff; border-radius: 6px;
    cursor: pointer; letter-spacing: 2px; transition: background 0.2s, border-color 0.2s;
    backdrop-filter: blur(4px);
}
#start-btn:hover { background: rgba(60,100,180,0.4); border-color: rgba(200,220,255,0.7); }

/* Fade rect */
#fade-rect {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #000; opacity: 0; pointer-events: none;
    transition: opacity 0.4s;
}
#fade-rect.active { opacity: 1; }

/* Act transition overlay */
#act-transition {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 45; background: #000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.6s;
}
#act-transition.visible { opacity: 1; }
.act-transition-content {
    max-width: 700px; text-align: center; padding: 40px;
}
.act-transition-title {
    font-size: 48px; font-weight: 200; letter-spacing: 8px;
    color: #a0c8ff; text-shadow: 0 0 30px rgba(100,160,255,0.3);
    margin-bottom: 32px;
}
.act-transition-text {
    font-size: 20px; line-height: 1.7; color: #8898aa;
    white-space: pre-line; margin-bottom: 40px;
}
.act-transition-btn {
    background: none; border: 1px solid rgba(100,160,255,0.4);
    color: #8ab4e0; font-size: 22px; padding: 12px 36px;
    cursor: pointer; border-radius: 4px;
    transition: background 0.2s, border-color 0.2s;
    letter-spacing: 2px;
}
.act-transition-btn:hover {
    background: rgba(100,160,255,0.15);
    border-color: rgba(150,200,255,0.7);
}

/* End screen */
#end-screen {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 45; background: #000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 1.2s;
}
#end-screen.visible { opacity: 1; }
.end-screen-content {
    max-width: 900px; padding: 40px;
    display: flex; align-items: center; gap: 40px;
}
.end-screen-alex {
    width: 280px; height: auto; flex-shrink: 0;
    filter: drop-shadow(0 0 30px rgba(100,160,255,0.3));
}
.end-screen-text-col {
    text-align: center; flex: 1;
}
.end-screen-title {
    font-size: 72px; font-weight: 200; letter-spacing: 20px;
    color: #e8f0ff; text-shadow: 0 0 40px rgba(100,160,255,0.3);
    margin-bottom: 16px;
}
.end-screen-subtitle {
    font-size: 28px; font-weight: 300; letter-spacing: 4px;
    color: #a0c8ff; margin-bottom: 32px;
}
.end-screen-text {
    font-size: 18px; line-height: 1.7; color: #8898aa;
    margin-bottom: 48px;
}
.end-screen-buttons { display: flex; gap: 16px; justify-content: center; }
.end-screen-btn {
    font-size: 22px; padding: 14px 36px;
    border: 2px solid rgba(100,200,255,0.6);
    background: rgba(30,60,100,0.7); color: #a0d8ff;
    border-radius: 6px; cursor: pointer; letter-spacing: 2px;
    transition: background 0.2s, border-color 0.2s;
}
.end-screen-btn:hover {
    background: rgba(60,120,200,0.5); border-color: rgba(150,220,255,0.8);
}
.end-screen-btn-secondary {
    background: rgba(20,30,50,0.6); border: 1px solid rgba(200,220,255,0.3);
    color: #8898aa; font-size: 20px;
}
.end-screen-btn-secondary:hover {
    background: rgba(40,60,100,0.5); border-color: rgba(200,220,255,0.6); color: #c0d0e8;
}

.hidden { display: none !important; }

/* === Debug Mode === */
body.debug-mode .hotspot-rect {
    border-width: 2px !important;
    border-style: dashed !important;
    background: rgba(255,100,100,0.15) !important;
    border-color: rgba(255,100,100,0.6) !important;
    cursor: move !important;
}
body.debug-mode .hotspot-rect:hover {
    background: rgba(255,100,100,0.3) !important;
    border-color: rgba(255,100,100,0.9) !important;
}
body.debug-mode .char-sprite {
    outline: 2px dashed rgba(100,255,100,0.6);
    cursor: move !important;
}
body.debug-mode .char-sprite:hover {
    outline-color: rgba(100,255,100,0.9);
}
body.debug-mode .overlay-sprite {
    outline: 2px dashed rgba(100,100,255,0.6);
    cursor: move !important;
    pointer-events: auto !important;
}
body.debug-mode .overlay-sprite:hover {
    outline-color: rgba(100,100,255,0.9);
}
.debug-selected {
    outline: 3px solid #ff0 !important;
    box-shadow: 0 0 12px rgba(255,255,0,0.5);
}
.debug-resize-handle {
    position: absolute;
    background: #ff0;
    border: 1px solid #000;
    z-index: 100;
    cursor: nwse-resize;
    pointer-events: auto !important;
}
.debug-resize-handle[data-dir="n"],
.debug-resize-handle[data-dir="s"] { cursor: ns-resize; }
.debug-resize-handle[data-dir="e"],
.debug-resize-handle[data-dir="w"] { cursor: ew-resize; }
.debug-resize-handle[data-dir="ne"],
.debug-resize-handle[data-dir="sw"] { cursor: nesw-resize; }

#debug-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    z-index: 99;
    width: 320px;
    background: rgba(10,10,20,0.92);
    border: 1px solid rgba(255,255,0,0.4);
    border-radius: 6px;
    padding: 12px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 900px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}
.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #ff0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,0,0.3);
    padding-bottom: 6px;
}
#debug-selected-info {
    color: #aaa;
    margin-bottom: 6px;
}
.debug-prop {
    color: #ccc;
    margin-bottom: 2px;
}
.debug-prop b {
    color: #7df;
}
.debug-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.debug-buttons button {
    background: rgba(255,255,0,0.15);
    border: 1px solid rgba(255,255,0,0.4);
    color: #ff0;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background 0.15s;
}
.debug-buttons button:hover {
    background: rgba(255,255,0,0.3);
}
#debug-output {
    margin-top: 8px;
    background: rgba(0,0,0,0.6);
    padding: 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #8f8;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(100,255,100,0.2);
}
