* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Toolbar --- */

#toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 1000;
    user-select: none;
}

#toolbar .back {
    color: #666;
    text-decoration: none;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s;
}

#toolbar .back:hover { color: #ccc; }

#toolbar .title {
    font-size: 14px;
    font-weight: 500;
    color: #999;
    flex: 1;
}

#toolbar .tools {
    display: flex;
    gap: 8px;
}

#toolbar button, #toolbar label {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #aaa;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

#toolbar button:hover, #toolbar label:hover {
    background: #252525;
    border-color: #555;
    color: #ddd;
}

.zoom-display {
    font-size: 11px;
    color: #555;
    min-width: 40px;
    text-align: right;
}

/* --- Canvas --- */

#canvas-viewport {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    cursor: grab;
}

#canvas-viewport.panning { cursor: grabbing; }
#canvas-viewport.placing { cursor: crosshair; }

#canvas-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    width: 1px;
    height: 1px;
}

/* --- Items --- */

.item {
    position: absolute;
    cursor: move;
    user-select: none;
    transition: box-shadow 0.15s;
}

.item:hover { z-index: 100; }
.item.dragging {
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* Image items */
.item-image {
    background: #111;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.item-image img {
    display: block;
    max-width: 100%;
    height: auto;
    pointer-events: none;
}

.item-image .resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.15s;
}

.item-image:hover .resize-handle { opacity: 1; }

.item-image .resize-handle::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
}

/* Note items */
.item-note {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 14px;
    min-width: 120px;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.item-note .note-text {
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
    outline: none;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.item-note .note-text:empty::before {
    content: 'Type something...';
    color: #444;
}

.item-note .note-text:focus {
    color: #eee;
}

/* Delete button */
.item .delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 50%;
    color: #999;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.item:hover .delete-btn { opacity: 1; }
.item .delete-btn:hover {
    background: #c44;
    border-color: #c44;
    color: #fff;
}

/* Colors for notes */
.item-note.color-yellow { background: #2a2820; border-color: #4a4530; }
.item-note.color-blue { background: #1a2030; border-color: #2a3550; }
.item-note.color-green { background: #1a2a1a; border-color: #2a4a2a; }
.item-note.color-pink { background: #2a1a25; border-color: #4a2a40; }
