/* =============================================
   ASCEND — Level Editor Styles
   ============================================= */

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

html,
body {
    width: 100%;
    height: 100%;
    background: #050510;
    color: #ccc;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

/* ── NAV ── */
#nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(5, 5, 16, 0.92);
    border-bottom: 1px solid #1a1a3a;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 200;
}

.nav-title {
    color: #00ffcc;
    font-size: 15px;
    letter-spacing: 3px;
    font-weight: bold;
}

.nav-sep {
    width: 1px;
    height: 18px;
    background: #2a2a4a;
}

.nav-btn {
    background: none;
    border: 1px solid #333;
    color: #999;
    font-family: inherit;
    font-size: 12px;
    padding: 4px 14px;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 1px;
    transition: all .15s;
    text-decoration: none;
}

.nav-btn:hover {
    border-color: #00ffcc;
    color: #00ffcc;
}

.nav-btn.active {
    border-color: #00ffcc;
    color: #00ffcc;
    background: rgba(0, 255, 204, 0.08);
}

.nav-spacer {
    flex: 1;
}

/* ── LAYOUT ── */
#editor-layout {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

/* ── LEFT: GRID ── */
#grid-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1a1a3a;
}

#grid-header {
    padding: 10px 16px;
    background: rgba(10, 10, 20, 0.8);
    border-bottom: 1px solid #1a1a3a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#grid-header label {
    font-size: 11px;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.size-input {
    width: 50px;
    background: #111;
    border: 1px solid #333;
    color: #ccc;
    font-family: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 2px;
    text-align: center;
}

.header-sep {
    width: 1px;
    height: 20px;
    background: #222;
}

#grid-scroll {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #080814;
}

#grid-canvas {
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    border: 1px solid #1a1a3a;
}

/* ── TOOLBAR ── */
#toolbar {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tool-btn {
    width: 34px;
    height: 34px;
    background: #111;
    border: 2px solid #333;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-family: inherit;
}

.tool-btn:hover {
    border-color: #666;
    color: #fff;
}

.tool-btn.active {
    border-color: #00ffcc;
    color: #00ffcc;
    background: rgba(0, 255, 204, 0.1);
}

.tool-btn .preview {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

/* ── RIGHT: ASCII ── */
#ascii-panel {
    width: 380px;
    display: flex;
    flex-direction: column;
}

#ascii-header {
    padding: 10px 16px;
    background: rgba(10, 10, 20, 0.8);
    border-bottom: 1px solid #1a1a3a;
    font-size: 11px;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ascii-textarea {
    flex: 1;
    resize: none;
    background: #0a0a14;
    border: none;
    color: #88ccaa;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.45;
    padding: 12px 16px;
    outline: none;
    letter-spacing: 1px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* ── BOTTOM BAR ── */
#bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50px;
    background: rgba(5, 5, 16, 0.95);
    border-top: 1px solid #1a1a3a;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    z-index: 200;
}

.bar-btn {
    background: none;
    border: 1px solid #333;
    color: #888;
    font-family: inherit;
    font-size: 13px;
    padding: 6px 18px;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 2px;
    transition: all .15s;
}

.bar-btn:hover {
    border-color: #888;
    color: #fff;
}

.bar-btn.primary {
    border-color: #00ffcc;
    color: #00ffcc;
}

.bar-btn.primary:hover {
    background: rgba(0, 255, 204, 0.12);
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.2);
}

.bar-sep {
    width: 1px;
    height: 24px;
    background: #222;
}

#preset-dropdown {
    background: #111;
    border: 1px solid #333;
    color: #aaa;
    font-family: inherit;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 3px;
}

#status-msg {
    font-size: 11px;
    color: #555;
    letter-spacing: 1px;
    margin-left: auto;
}

/* ── LEGEND ── */
#legend {
    padding: 10px 16px;
    background: rgba(10, 10, 20, 0.6);
    border-bottom: 1px solid #1a1a3a;
    font-size: 11px;
    line-height: 2;
    color: #555;
}

#legend code {
    color: #88ccaa;
    background: rgba(0, 255, 204, 0.06);
    padding: 1px 4px;
    border-radius: 2px;
}

/* ── HOST BUTTON ── */
.bar-btn.host-btn {
    border-color: #c77dff;
    color: #c77dff;
}

.bar-btn.host-btn:hover {
    background: rgba(199, 125, 255, 0.12);
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.2);
}

/* ── MAP MANAGER MODAL ── */
#map-manager-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

#map-manager-overlay.active {
    display: flex;
}

.map-manager {
    background: #0c0c18;
    border: 1px solid #1a1a3a;
    border-radius: 8px;
    padding: 20px;
    width: 360px;
    max-height: 70vh;
    overflow-y: auto;
}

.map-manager-title {
    font-size: 14px;
    color: #00ffcc;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.map-manager-list {
    list-style: none;
    padding: 0;
}

.map-manager-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #1a1a3a;
}

.map-manager-list li:last-child {
    border-bottom: none;
}

.map-manager-list .map-name {
    flex: 1;
    color: #ccc;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-manager-list .bar-btn {
    padding: 3px 10px;
    font-size: 11px;
}