/* ============================================================
   ОБЩИЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #08080f;
    color: #e0e0e0;
    user-select: none;
    -webkit-user-select: none;
}
body {
    display: flex;
}

/* ============================================================
   ПАНЕЛЬ РЕДАКТОРА
   ============================================================ */
.panel {
    width: 350px;
    min-width: 350px;
    background: #101020;
    border-right: 1px solid #222240;
    display: flex;
    flex-direction: column;
    height: 100vh;
    z-index: 10;
    transition: opacity .2s, pointer-events .2s;
}
.panel-head {
    padding: 12px 14px;
    border-bottom: 1px solid #222240;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-head h1 {
    font-size: 15px;
    font-weight: 700;
    color: #9088ff;
    letter-spacing: -.3px;
}
.badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}
.badge-ed {
    background: #1a1a30;
    color: #9088ff;
}
.badge-pl {
    background: #0f2a15;
    color: #4cdf7a;
}

/* ============================================================
   ВКЛАДКИ
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid #222240;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.tab {
    flex: 1;
    min-width: 50px;
    padding: 9px 2px;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: .12s;
}
.tab:hover {
    color: #999;
    background: #161630;
}
.tab.on {
    color: #9088ff;
    border-bottom-color: #9088ff;
    background: #13132a;
}

/* ============================================================
   КОНТЕНТ ВКЛАДОК
   ============================================================ */
.tc {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}
.tp {
    display: none;
}
.tp.on {
    display: block;
}

.fg {
    margin-bottom: 8px;
}
.fg label {
    display: block;
    font-size: 10px;
    margin-bottom: 2px;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.fg input,
.fg select {
    width: 100%;
    padding: 5px 7px;
    background: #181830;
    border: 1px solid #2a2a44;
    border-radius: 3px;
    color: #ddd;
    font-size: 12px;
    outline: none;
    transition: border .12s;
}
.fg input:focus,
.fg select:focus {
    border-color: #9088ff;
}
.fr {
    display: flex;
    gap: 6px;
}
.fr .fg {
    flex: 1;
}

.cg {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-bottom: 8px;
}
.cg label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
}
.cg input[type=checkbox] {
    width: 13px;
    height: 13px;
    accent-color: #9088ff;
    cursor: pointer;
}

hr {
    border: none;
    border-top: 1px solid #222240;
    margin: 12px 0;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.b {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: .12s;
    letter-spacing: .3px;
}
.bp {
    background: #6c5ce7;
    color: #fff;
}
.bp:hover {
    background: #5b4bd4;
}
.bd {
    background: #d63031;
    color: #fff;
}
.bd:hover {
    background: #b72728;
}
.bs {
    background: #00b894;
    color: #fff;
}
.bs:hover {
    background: #009d82;
}
.bg {
    background: #252540;
    color: #bbb;
}
.bg:hover {
    background: #35355a;
}
.br {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}
.br .b {
    flex: 1;
}

/* ============================================================
   СПИСКИ ОБЪЕКТОВ И УРОВНЕЙ
   ============================================================ */
.ol {
    max-height: 140px;
    overflow-y: auto;
    margin-top: 8px;
    border: 1px solid #222240;
    border-radius: 3px;
    background: #0c0c1a;
}
.oi {
    padding: 4px 7px;
    font-size: 10px;
    cursor: pointer;
    border-bottom: 1px solid #181830;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background .08s;
}
.oi:last-child {
    border-bottom: none;
}
.oi:hover {
    background: #161630;
}
.oi.sel {
    background: #1e1e40;
    color: #9088ff;
}
.oi .x {
    color: #d63031;
    cursor: pointer;
    font-weight: 900;
    font-size: 13px;
    padding: 0 2px;
}

.level-item {
    padding: 6px 10px;
    border-bottom: 1px solid #181830;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}
.level-item:last-child {
    border-bottom: none;
}
.level-item:hover {
    background: #161630;
}
.level-item .b {
    padding: 2px 8px;
    font-size: 9px;
}
.level-item .level-name {
    cursor: pointer;
    flex: 1;
}
.level-item .level-name:hover {
    color: #9088ff;
}

/* ============================================================
   ОБЛАСТЬ CANVAS
   ============================================================ */
.cw {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #08080f;
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hud {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .8);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    color: #4cdf7a;
    font-weight: 700;
    pointer-events: none;
    letter-spacing: .5px;
}
.hud.off {
    display: none;
}
.death-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, .8);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    color: #d63031;
    font-weight: 700;
    pointer-events: none;
}
.death-counter.off {
    display: none;
}

/* ============================================================
   СКРОЛЛБАР
   ============================================================ */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: #0c0c1a;
}
::-webkit-scrollbar-thumb {
    background: #2a2a44;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444;
}