@font-face {
    font-family: 'MS Sans Serif';
    src: local('MS Sans Serif'), local('Microsoft Sans Serif'), local('Tahoma'), local('Arial');
}

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

body {
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    background: #008080;
    overflow: hidden;
    image-rendering: pixelated;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    width: 1000px;
    height: 700px;
    display: flex;
    flex-direction: column;
}

.title-bar {
    background: linear-gradient(90deg, #000080 0%, #000040 100%);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.window-button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
}

.window-button:active {
    border: 1px inset #c0c0c0;
}

.menu-bar {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 2px;
    display: flex;
    gap: 4px;
}

.menu-item {
    padding: 4px 8px;
    cursor: pointer;
    border: 1px transparent;
}

.menu-item:hover {
    border: 1px outset #c0c0c0;
    background: #e0e0e0;
}

.main-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.toolbox {
    width: 60px;
    background: #c0c0c0;
    border-right: 2px inset #c0c0c0;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    align-content: start;
}

.tool {
    width: 24px;
    height: 24px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool:hover {
    background: #d0d0d0;
}

.tool.active {
    border: 2px inset #c0c0c0;
    background: #a0a0a0;
}

.tool-icon {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.select-icon {
    border: 1px dashed #000;
    border-radius: 2px;
}

.freeselect-icon {
    border: 1px dashed #000;
    border-radius: 50% 20% 50% 20%;
}

.pencil-icon {
    background: linear-gradient(45deg, #ffff00 0%, #ffff00 40%, #8B4513 40%, #8B4513 100%);
    border-radius: 0 0 2px 0;
    transform: rotate(45deg);
}

.brush-icon {
    background: linear-gradient(45deg, #8B4513 0%, #8B4513 60%, #000 60%, #000 100%);
    border-radius: 2px 2px 0 0;
    transform: rotate(45deg);
}

.spray-icon {
    background: radial-gradient(circle, #000 30%, transparent 30%);
    background-size: 3px 3px;
}

.text-icon {
    font-weight: bold;
    font-size: 12px;
    color: #000;
}

.line-icon {
    width: 16px;
    height: 1px;
    background: #000;
    transform: rotate(45deg);
}

.curve-icon {
    border: 1px solid #000;
    border-radius: 50% 0;
    border-color: #000 transparent transparent #000;
}

.rect-icon {
    border: 2px solid #000;
}

.ellipse-icon {
    border: 2px solid #000;
    border-radius: 50%;
}

.fill-icon {
    background: linear-gradient(45deg, #ffff00 0%, #ffff00 70%, #8B4513 70%, #8B4513 100%);
    border-radius: 0 2px 2px 0;
}

.eyedropper-icon {
    background: linear-gradient(145deg, transparent 40%, #000 40%, #000 60%, transparent 60%);
}

.canvas-area {
    flex: 1;
    background: #ffffff;
    border: 2px inset #c0c0c0;
    position: relative;
    margin: 4px;
    overflow: hidden;
}

#canvas {
    background: #ffffff;
    cursor: crosshair;
    image-rendering: pixelated;
}

.brush-options {
    width: 100px;
    background: #c0c0c0;
    border-left: 2px inset #c0c0c0;
    padding: 8px;
}

.brush-size-label {
    font-size: 10px;
    margin-bottom: 8px;
}

.brush-sizes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brush-size {
    width: 40px;
    height: 20px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brush-size.active {
    border: 2px inset #c0c0c0;
    background: #a0a0a0;
}

.size-dot {
    background: #000;
}

.size-1 { width: 1px; height: 1px; }
.size-3 { width: 3px; height: 3px; }
.size-5 { width: 5px; height: 5px; }
.size-8 { width: 8px; height: 8px; }

.color-palette {
    background: #c0c0c0;
    border-top: 2px inset #c0c0c0;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60px;
}

.color-indicators {
    position: relative;
    width: 40px;
    height: 40px;
}

.color-indicator {
    position: absolute;
    border: 2px inset #c0c0c0;
    cursor: pointer;
}

.color-indicator.primary {
    width: 28px;
    height: 28px;
    top: 0;
    left: 0;
    z-index: 2;
}

.color-indicator.secondary {
    width: 20px;
    height: 20px;
    bottom: 0;
    right: 0;
    z-index: 1;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 20px);
    gap: 2px;
}

.color {
    width: 20px;
    height: 20px;
    border: 1px inset #c0c0c0;
    cursor: pointer;
}

.color:hover {
    border: 1px outset #c0c0c0;
}

.status-bar {
    background: #c0c0c0;
    border-top: 2px inset #c0c0c0;
    padding: 2px 8px;
    font-size: 10px;
    display: flex;
    gap: 16px;
}

.status-section {
    border: 1px inset #c0c0c0;
    padding: 2px 4px;
    background: #f0f0f0;
}

.scrollbar-h, .scrollbar-v {
    position: absolute;
    background: #c0c0c0;
}

.scrollbar-h {
    bottom: 0;
    left: 0;
    right: 16px;
    height: 16px;
    border-top: 1px solid #808080;
}

.scrollbar-v {
    top: 0;
    right: 0;
    bottom: 16px;
    width: 16px;
    border-left: 1px solid #808080;
}

.scrollbar-track {
    width: 100%;
    height: 100%;
    background: #c0c0c0;
    position: relative;
}

.scrollbar-thumb {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    position: absolute;
}

/* Disable text selection */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#canvas {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}