* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "MS Sans Serif", "Tahoma", sans-serif;
    user-select: none;
}

body {
    background-color: #1a1a1a; 
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    overflow: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://cdn.discordapp.com/attachments/876798609851572245/1506478871606984815/GnfrzPpXAAA0hGq.jpg?ex=6a0e6948&is=6a0d17c8&hm=b2d3bdfaf7a4d20efdb628fa50e39e5095a47433249ba22f7e98407850f18806&');
    background-size: cover;
    background-position: center;
    filter: blur(4px); 
    z-index: -1; 
    opacity: 0.6; 
}

.win98-window {
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 1300px; 
}

.title-bar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #ffffff;
    padding: 4px 6px;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
}

#btn-close {
    background: #c0c0c0;
    color: #000;
    padding: 0 4px;
    border: 1px outset #fff;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
}

.dev-notice-wrapper {
    padding: 8px 12px;
    background-color: #c0c0c0;
    border-bottom: 2px solid #808080;
}

.dev-notice-main { font-weight: bold; font-size: 16px; margin-bottom: 2px; color: #000; }
.dev-notice-sub { font-size: 12px; color: #000; }

.main-content {
    display: flex;
    flex: 1;
    padding: 3px;
    gap: 3px;
    overflow: hidden;
}

.toolbar {
    width: 210px;
    background-color: #c0c0c0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 3px;
    overflow-y: auto; 
}

.tool-section {
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-section span.label {
    font-size: 11px;
    color: #000;
    text-decoration: underline;
    font-weight: bold;
}

.btn {
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf;
    padding: 3px 6px; 
    font-size: 11px;    
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    color: #000;
    text-decoration: none;
    display: block;
    width: 100%;
}

.btn:active, .btn.active {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #dfdfdf;
    padding: 4px 5px 2px 7px;
    background-color: #dfdfdf;
}

.layer-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.btn-sm {
    padding: 4px;
    font-size: 12px;
    width: auto;
    flex: 1;
    display: inline-block;
}

.layers-list {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background-color: #ffffff;
    height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; 
}

.layer-item {
    padding: 4px 6px;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-item:hover { background-color: #f0f0f0; }
.layer-item.active { background-color: #000080; color: #ffffff; }
.layer-item.drag-over { outline: 1px dashed #000080; }
.layer-item.dragging { opacity: 0.6; }

.color-palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.color-swatch { width: 100%; aspect-ratio: 1; cursor: pointer; border: 1px solid #808080; }
.color-swatch.active { border: 2px solid #000; outline: 1px solid #fff; }

.custom-color-wrapper { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.custom-color-wrapper span { font-size: 11px; color: #000; }
input[type="color"] { border: 1px solid #808080; width: 28px; height: 28px; cursor: pointer; padding: 0; }
input[type="range"] { width: 100%; cursor: pointer; }
input[type="number"] {
    width: 64px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    text-align: right;
}
.brush-size .range-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 6px;
    background-color: #d4d4d4;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
}
.brush-size .range-value {
    display: flex;
    align-items: center;
    gap: 4px;
}
.brush-size .unit {
    font-size: 11px;
    font-weight: bold;
    color: #000;
    padding-right: 2px;
}
.brush-size .range-track {
    padding: 4px 6px;
    background-color: #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}
select {
    width: 100%;
    padding: 3px 4px;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
}

.spacer { flex-grow: 1; }

.canvas-wrapper {
    flex: 1;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background-color: #ffffff;
    display: flex;
    overflow: hidden;
    position: relative; 
    touch-action: none;
}

.canvas-wrapper.cursor-active { cursor: none; }
.canvas-wrapper.cursor-active canvas { cursor: none; }

#cursor-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6);
    background: rgba(255,255,255,0.05);
    z-index: 20;
    transform: translate(-50%, -50%);
}

#cursor-preview.eraser {
    border-color: #000000;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
}

canvas {
    background-color: transparent; 
    cursor: crosshair;
    touch-action: none;
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

canvas:first-child {
    background-color: #ffffff;
}   