/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #e0e0e0;
    user-select: none;
    -webkit-user-select: none;
}

a { color: inherit; text-decoration: none; }

/* ─── Navbar ────────────────────────────────────────────────── */
.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    border-bottom: 1px solid #222;
    padding: 0 20px;
    height: 48px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ff9f00;
    box-shadow: 12px 0 #1a1a1a, 0 12px #1a1a1a, 12px 12px #ff9f00;
    flex-shrink: 0;
}

.app-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.app-nav-actions a {
    color: #aaa;
    transition: color 0.2s;
}

.app-nav-actions a:hover { color: #fff; }

.nav-btn {
    background: #ff9f00;
    color: #111 !important;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background 0.15s !important;
}

.nav-btn:hover { background: #e08e00 !important; }

.nav-user {
    color: #aaa;
    font-size: 12px;
}

/* ─── Layout ────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: 160px;
    flex-shrink: 0;
    background: #111;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    border-right: 1px solid #2a2a2a;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid #2a2a2a;
}

.sidebar h6 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin: 0 0 12px 4px;
}

.drawing-card {
    display: block;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    transition: border-color 0.2s, transform 0.15s;
    background: #1a1a1a;
}

.drawing-card:hover {
    border-color: #ff9f00;
    transform: translateY(-1px);
}

.drawing-card img {
    display: block;
    width: 100%;
    height: 100px;
    object-fit: contain;
    background: #fff;
}

.drawing-card-name {
    font-size: 10px;
    color: #bbb;
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Main canvas area ──────────────────────────────────────── */
.canvas-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    align-items: center;
    padding: 16px 12px;
}

/* ─── Toolbar ───────────────────────────────────────────────── */
.canvas-toolbar {
    width: 100%;
    max-width: 560px;
    background: #222;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #aaa;
}

.toolbar-row:last-child { margin-bottom: 0; }

.toolbar-row label:not(.color-pick-label) {
    flex-shrink: 0;
    font-size: 12px;
    color: #aaa;
    width: 110px;
}

.toolbar-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 5px 8px;
    font-size: 12px;
    outline: none;
}

.toolbar-input:focus { border-color: #ff9f00; }
.toolbar-input:disabled { color: #888; cursor: default; }

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #bbb;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.tool-btn:hover { background: #333; color: #fff; }
.tool-btn-active { background: #ff9f00 !important; color: #111 !important; border-color: #ff9f00 !important; }

.tool-btn-primary {
    background: #ff9f00;
    border-color: #ff9f00;
    color: #fff;
}

.tool-btn-primary:hover { background: #e08e00; }

.tool-btn-danger { border-color: #c0392b; color: #e74c3c; }
.tool-btn-danger:hover { background: #c0392b; color: #fff; }

.toolbar-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #777;
    cursor: pointer;
}

.toolbar-check input[type="checkbox"] { accent-color: #ff9f00; cursor: pointer; }


.color-pick-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #aaa;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    margin: 0;
    width: 80px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.color-pick-label:hover { border-color: #555; color: #fff; }

#color {
    width: 24px;
    height: 20px;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: none;
    display: block;
}

#color::-webkit-color-swatch-wrapper { padding: 0; }
#color::-webkit-color-swatch { border: none; border-radius: 2px; }

/* ─── Canvas wrap ───────────────────────────────────────────── */
.canvas-wrap {
    position: relative;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

canvas { display: block; }

/* ─── Start overlay ─────────────────────────────────────────── */
#start-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

#start-overlay h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 3px;
    border: 2px solid #ff9f00;
    padding: 16px 40px;
    border-radius: 4px;
    background: rgba(108, 99, 255, 0.15);
    transition: background 0.2s;
    user-select: none;
}

#start-overlay:hover h2 { background: rgba(108, 99, 255, 0.35); }

/* ─── Canvas hint ───────────────────────────────────────────── */
.canvas-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #888;
    text-align: center;
}

.canvas-hint strong { color: #777; }

/* ─── View-only (non-owner) ─────────────────────────────────── */
.view-info {
    width: 100%;
    max-width: 560px;
    margin-bottom: 12px;
    background: #222;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 14px 18px;
}

.view-info .art-title {
    font-size: 20px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.view-info .art-author {
    font-size: 13px;
    color: #777;
    margin-bottom: 12px;
}

.view-info a {
    display: inline-block;
    background: #ff9f00;
    color: #fff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
}

.view-info a:hover { background: #e08e00; }

/* ─── Sidebar scrollbar ─────────────────────────────────────── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── Mobile ────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .app-layout { flex-direction: column; height: auto; overflow: visible; }
    .sidebar { width: 100%; height: auto; border: none; border-top: 1px solid #2a2a2a; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; }
    .sidebar-right { border-left: none; }
    .sidebar h6 { display: none; }
    .drawing-card { min-width: 100px; margin-bottom: 0; }
    .drawing-card img { height: 70px; }
    .canvas-main { padding: 10px 8px; }
    .canvas-toolbar { max-width: 100%; }
}

/* ─── Color picker ──────────────────────────────────────────── */
.picker-bottom { color: #000; background: #fff; font-size: 12px; padding: 5px; }
