:root {
    --bg: #0f1115;
    --surface: #1a1d24;
    --surface-light: #20242d;
    --surface-hover: #2a2f39;

    --border: #2d3340;

    --text: #ffffff;
    --muted: #b0b3c0;
    --subtle: #6c7280;

    --accent: #4da3ff;

    --radius: 14px;
    --radius-small: 10px;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
}

/* LAYOUT */

#editor {
    display: grid;
    grid-template-rows: 64px 1fr 240px;
    height: 100vh;
}

/* TOPBAR */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 20px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar h1 {
    font-size: 1.1rem;
}

.map-name {
    color: var(--muted);
    font-size: 0.9rem;
}

.topbar-mid {
    display: flex;
    gap: 10px;
}

.main-page {
    color: white;
    text-decoration: none;
}

.main-page:hover {
    text-decoration: underline;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}


/* WORKSPACE */

.workspace {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    overflow: hidden;
}

/* PANELS */

.panel {
    background: var(--surface);
    border-right: 1px solid var(--border);

    overflow-y: auto;
    padding: 18px;
}

.inspector-panel {
    border-right: none;
    border-left: 1px solid var(--border);
}

.panel-title {
    font-size: 1rem;
    margin-bottom: 18px;
}

.panel-section {
    margin-bottom: 26px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 12px;
}

.section-title {
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* VIEWPORT */

.viewport-area {
    display: flex;
    flex-direction: column;
    background: #090b0f;
    overflow: hidden;
}

.viewport-toolbar {
    display: flex;
    gap: 10px;

    padding: 12px 16px;

    background: rgba(26, 29, 36, 0.95);
    border-bottom: 1px solid var(--border);
}

#canvas {
    flex: 1;
    position: relative;
}

#canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.statusbar {
    display: flex;
    justify-content: space-between;

    padding: 10px 16px;

    background: var(--surface);
    border-top: 1px solid var(--border);

    color: var(--subtle);
    font-size: 0.85rem;
}

/* LISTS */

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list div {
    background: var(--surface-light);

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    padding: 10px 12px;

    transition: 0.2s ease;

    cursor: pointer;
}

.list div:hover {
    background: var(--surface-hover);
    border-color: var(--border);
}

/* FIELDS */

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;

    color: var(--muted);
    font-size: 0.9rem;
}

input,
textarea,
select {
    width: 100%;

    background: #0d1015;
    color: white;

    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 10px 12px;

    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
}

textarea {
    resize: none;
    height: 100%;
    font-family: monospace;
}

/* BUTTONS */

.btn,
.tool-btn,
.mini-btn {
    border: none;
    cursor: pointer;

    transition: 0.2s ease;
}

.btn {
    background: var(--surface-light);
    color: white;

    padding: 10px 14px;

    border-radius: 10px;
}

.btn:hover {
    background: var(--surface-hover);
}

.btn.primary {
    background: var(--accent);
    color: white;
}

.btn.primary:hover {
    filter: brightness(1.1);
}

.btn.small {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.tool-btn {
    background: var(--surface-light);

    color: var(--muted);

    padding: 8px 12px;

    border-radius: 10px;
}

.tool-btn.active,
.tool-btn:hover {
    background: var(--accent);
    color: white;
}

.mini-btn {
    width: 28px;
    height: 28px;

    border-radius: 8px;

    background: var(--surface-light);
    color: white;
}

.mini-btn:hover {
    background: var(--accent);
}

/* BOTTOM PANEL */

.bottom-panel {
    display: flex;
    flex-direction: column;

    background: var(--surface);

    border-top: 1px solid var(--border);

    padding: 16px;

    overflow: hidden;
}

.bottom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 12px;
}

/* FILE INPUT */

.file-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* SCROLLBAR */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0b0d11;
}

::-webkit-scrollbar-thumb {
    background: #2d3340;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4252;
}

/* MOBILE */

@media (max-width: 1100px) {

    .workspace {
        grid-template-columns: 260px 1fr;
    }

    .inspector-panel {
        display: none;
    }
}

@media (max-width: 800px) {

    #editor {
        grid-template-rows: 64px 1fr;
    }

    .bottom-panel {
        display: none;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .left-panel {
        display: none;
    }
}