/* Walls Paint — "Now with 16 million colors (8 supported)" */
.paint-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1a1a2e;
    color: #d4d4d4;
    user-select: none;
}

/* ── Menu bar ── */
.paint-menubar {
    display: flex;
    gap: 0;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}

.paint-menu-item {
    padding: 5px 12px;
    font-size: 12px;
    color: #8899bb;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.paint-menu-item:hover {
    background: #0f3460;
    color: #fff;
}

/* ── Toolbar ── */
.paint-toolbar {
    display: flex;
    align-items: stretch;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
    padding: 4px 6px;
    gap: 2px;
}

.paint-tool-group {
    display: flex;
    gap: 2px;
    padding: 0 6px;
    border-right: 1px solid #0f3460;
}

.paint-tool-group:last-child {
    border-right: none;
}

.paint-tool-group-label {
    font-size: 9px;
    color: #556;
    text-align: center;
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
}

.paint-tool-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    background: transparent;
    color: #8899bb;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, border-color 0.1s;
    position: relative;
}

.paint-tool-btn:hover {
    background: #0f3460;
    border-color: #1a5276;
    color: #fff;
}

.paint-tool-btn.active {
    background: #0f3460;
    border-color: #e94560;
    color: #e94560;
    box-shadow: 0 0 6px rgba(233, 69, 96, 0.3);
}

.paint-tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #0a0a18;
    color: #ccc;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 999;
    margin-top: 4px;
    border: 1px solid #333;
    pointer-events: none;
}

/* ── Size slider ── */
.paint-size-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-right: 1px solid #0f3460;
}

.paint-size-label {
    font-size: 10px;
    color: #667;
    white-space: nowrap;
}

.paint-size-slider {
    width: 60px;
    accent-color: #e94560;
}

.paint-size-val {
    font-size: 10px;
    color: #8899bb;
    min-width: 20px;
    text-align: center;
}

/* ── Color palette ── */
.paint-palette {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #121a30;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.paint-palette-label {
    font-size: 10px;
    color: #556;
    margin-right: 4px;
}

.paint-swatch {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.1s, transform 0.1s;
}

.paint-swatch:hover {
    border-color: #888;
    transform: scale(1.15);
}

.paint-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 4px rgba(255,255,255,0.4);
    transform: scale(1.15);
}

.paint-current-colors {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding-left: 8px;
    border-left: 1px solid #0f3460;
}

.paint-fg-bg {
    position: relative;
    width: 30px;
    height: 30px;
}

.paint-fg-swatch {
    width: 20px;
    height: 20px;
    border: 2px solid #aaa;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
    border-radius: 2px;
}

.paint-bg-swatch {
    width: 20px;
    height: 20px;
    border: 2px solid #666;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 1;
    cursor: pointer;
    border-radius: 2px;
}

.paint-swap-btn {
    background: none;
    border: none;
    color: #667;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
}

.paint-swap-btn:hover {
    color: #e94560;
}

/* ── Canvas area ── */
.paint-canvas-wrap {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    background-image:
        linear-gradient(45deg, #111827 25%, transparent 25%),
        linear-gradient(-45deg, #111827 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #111827 75%),
        linear-gradient(-45deg, transparent 75%, #111827 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    position: relative;
}

.paint-canvas {
    border: 1px solid #333;
    cursor: crosshair;
    image-rendering: pixelated;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ── Status bar ── */
.paint-status {
    display: flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    color: #667;
    background: #16213e;
    border-top: 1px solid #0f3460;
    flex-shrink: 0;
    gap: 12px;
}

.paint-status-pos {
    min-width: 100px;
}

.paint-status-size {
    min-width: 100px;
}

.paint-status-msg {
    flex: 1;
    text-align: right;
    color: #556;
    font-style: italic;
}

/* ── Zoom controls in status ── */
.paint-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.paint-zoom-btn {
    background: none;
    border: 1px solid #333;
    color: #8899bb;
    font-size: 12px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paint-zoom-btn:hover {
    background: #0f3460;
    color: #fff;
}

.paint-zoom-label {
    font-size: 10px;
    color: #667;
    min-width: 36px;
    text-align: center;
}

/* ── Text input overlay ── */
.paint-text-input {
    position: absolute;
    background: transparent;
    border: 1px dashed #e94560;
    color: #fff;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    outline: none;
    resize: none;
    min-width: 40px;
    min-height: 20px;
    z-index: 10;
}

/* ── Dialogs ── */
.paint-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.paint-dialog {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.paint-dialog h3 {
    margin: 0 0 12px 0;
    color: #e94560;
    font-size: 14px;
}

.paint-dialog p {
    color: #889;
    font-size: 12px;
    margin: 0 0 12px 0;
}

.paint-dialog-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.paint-dialog-btn {
    padding: 6px 16px;
    border: 1px solid #333;
    background: #16213e;
    color: #8899bb;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
}

.paint-dialog-btn:hover {
    background: #0f3460;
    color: #fff;
}

.paint-dialog-btn.primary {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}

.paint-dialog-btn.primary:hover {
    background: #d63851;
}

/* ── Canvas resize fields ── */
.paint-resize-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: center;
    margin-bottom: 12px;
}

.paint-resize-fields label {
    font-size: 12px;
    color: #889;
}

.paint-resize-fields input {
    background: #0d1117;
    border: 1px solid #333;
    color: #d4d4d4;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
    width: 80px;
}
