/* GAMME Art Studio — Game UI Builder shell (Fase 1.1) */
#gart-root {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #0c0c10;
    color: #e8e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
}

#gart-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 48px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #12121a;
}
#gart-topbar .brand strong { color: #fff; }
#gart-topbar .brand span { color: #f97316; font-weight: 600; }
#gart-topbar .spacer { flex: 1; }
#gart-project-title {
    min-width: 140px;
    max-width: 220px;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
}

.gart-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.gart-btn:hover { background: rgba(255, 255, 255, 0.14); }
.gart-btn.primary { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.gart-btn.success { background: linear-gradient(135deg, #059669, #10b981); }
.gart-btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.12); }
.gart-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gart-btn.is-active { background: rgba(124, 58, 237, 0.35); border: 1px solid rgba(168, 85, 247, 0.4); }

#gart-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#gart-main {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Left: tool rail + library */
#gart-left {
    display: flex;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.gart-edit-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.gart-tool-icon {
    min-width: 36px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1;
}
.gart-danger:hover { background: rgba(239, 68, 68, 0.25) !important; border-color: rgba(239, 68, 68, 0.45) !important; }
.gart-zoom-label { font-size: 11px; opacity: 0.6; min-width: 3ch; text-align: right; }
.gart-muted { font-size: 11px; opacity: 0.55; margin: 0 0 8px; line-height: 1.4; }
.gart-code { font-size: 10px; color: #a5b4fc; }
.gart-check { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 10px; opacity: 0.75; }
.gart-btn-block { width: 100%; margin-top: 8px; }
.gart-subtitle { margin: 14px 0 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; }

#gart-tool-rail {
    width: 60px;
    background: #0f0f14;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 6px;
}
.gart-tool-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.gart-tool-btn:hover,
.gart-tool-btn.is-active {
    background: rgba(124, 58, 237, 0.25);
    color: #fff;
}
#gart-library {
    width: 200px;
    background: #101015;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#gart-library h4 {
    margin: 10px 10px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.5;
}
#gart-preset-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 12px;
}
.gart-preset-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #e2e8f0;
    font-size: 11px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: grab;
}
.gart-preset-item:hover {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
}
.gart-tpl-load {
    width: calc(100% - 16px);
    margin: 0 8px 10px;
}

/* Center canvas */
#gart-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #08080c;
}
#gart-editor-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
#gart-canvas-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gart-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
}
.gart-tab.is-active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
#gart-canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font-size: 10px;
    opacity: 0.7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#gart-editor-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 16px;
    box-sizing: border-box;
    background-color: #0a0a0f;
    background-image:
        linear-gradient(45deg, #14141c 25%, transparent 25%),
        linear-gradient(-45deg, #14141c 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #14141c 75%),
        linear-gradient(-45deg, transparent 75%, #14141c 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
#gart-editor-canvas {
    display: block;
    flex-shrink: 0;
    max-width: none;
    max-height: none;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65);
    cursor: default;
    image-rendering: auto;
}
#gart-sprite-panel {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}
#gart-sprite-panel.is-active { display: flex; }
#gart-editor-view.is-hidden { display: none; }

/* Right: properties + AI */
#gart-right {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    background: #101015;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
#gart-props {
    flex: 0 1 42%;
    min-height: 120px;
    max-height: 48%;
    overflow-y: auto;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#gart-props h3,
#gart-ai-panel h3 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
}
#gart-props label,
#gart-ai-panel label {
    display: block;
    font-size: 10px;
    opacity: 0.65;
    margin: 8px 0 3px;
}
#gart-props input,
#gart-props select,
#gart-ai-panel input {
    width: 100%;
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    box-sizing: border-box;
}
#gart-ai-panel {
    flex: 1 1 58%;
    min-height: 240px;
    overflow-y: auto;
    padding: 12px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(15, 15, 20, 0.4));
    border-top: 1px solid rgba(168, 85, 247, 0.2);
}
.gart-publish-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}
.gart-publish-status.is-ok { color: #6ee7b7; }
.gart-publish-status.is-err { color: #fb7185; }
.gart-ai-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.35);
    font-size: 11px;
    color: #e9d5ff;
}
.gart-ai-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(168, 85, 247, 0.25);
    border-top-color: #c084fc;
    border-radius: 50%;
    animation: gart-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes gart-spin { to { transform: rotate(360deg); } }
.gart-ai-done {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-size: 11px;
}
.gart-ai-done p { margin: 0 0 8px; }
.gart-ai-recents {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.gart-ai-recent-item {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    text-align: left;
    color: #e2e8f0;
    font-size: 10px;
}
.gart-ai-recent-item:hover,
.gart-ai-recent-item.is-active {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(124, 58, 237, 0.15);
}
.gart-ai-recent-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #000;
    border-radius: 6px;
    flex-shrink: 0;
}
.gart-ai-recents-empty { font-size: 10px; opacity: 0.45; }
.gart-prop-row {
    display: flex;
    gap: 6px;
}
.gart-prop-row input { flex: 1; }
.gart-state-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.gart-state-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}
.gart-state-chip.is-on {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
    color: #fff;
}

/* Bottom timeline + layers */
#gart-bottom {
    height: 108px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f0f14;
    display: flex;
}
#gart-layers {
    width: 220px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    padding: 8px;
}
.gart-layer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}
.gart-layer-row.is-selected {
    background: rgba(124, 58, 237, 0.22);
}
#gart-timeline {
    flex: 1;
    padding: 8px 12px;
    overflow-x: auto;
    display: none;
}
#gart-root.is-sprite-tab #gart-timeline[data-sprite-only] {
    display: block;
}
.gart-timeline-hint { margin: 0 0 8px; font-size: 10px; }
.gart-anim-preview {
    margin-top: 6px;
    min-height: 24px;
    max-height: 32px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: grid;
    place-items: center;
    padding: 4px 8px;
    font-size: 9px;
    text-align: center;
    overflow: hidden;
}
#gart-timeline .gart-anim-btns {
    gap: 4px;
}
#gart-timeline .gart-anim-btn {
    padding: 4px 8px;
    font-size: 9px;
}
#gart-timeline h4 {
    margin: 0 0 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.5;
}
.gart-anim-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gart-anim-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #cbd5e1;
    cursor: pointer;
}
.gart-anim-btn.is-on {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.45);
}

.gart-checker-wrap {
    background-color: #1a1a22;
    background-image:
        linear-gradient(45deg, #252530 25%, transparent 25%),
        linear-gradient(-45deg, #252530 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #252530 75%),
        linear-gradient(-45deg, transparent 75%, #252530 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.gart-visual-style-label {
    font-size: 11px;
    opacity: 0.65;
    margin-right: 4px;
}
.gart-visual-style-select {
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    margin-right: 8px;
}

.gart-chroma-panel {
    margin-top: 4px;
}

#gart-canvas-wrap.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2;
}
#gart-canvas-wrap.is-loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(168, 85, 247, 0.25);
    border-top-color: #c084fc;
    border-radius: 50%;
    animation: gart-spin 0.8s linear infinite;
    z-index: 3;
}
.gart-slot-opt.active { background: rgba(124, 58, 237, 0.28) !important; }
.gart-slot-opt.suggested { outline: 1px dashed rgba(250, 204, 21, 0.6); }

#gart-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    z-index: 9999;
}
#gart-toast.show { opacity: 1; }

.gart-game-context {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.22), rgba(56, 189, 248, 0.12));
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
    color: #e2e8f0;
}
.gart-game-context-slot { color: #c4b5fd; }
