:root {
    color-scheme: dark;
    --bg: #090b10;
    --panel: #11151d;
    --panel2: #171c26;
    --border: #2a3240;
    --text: #edf2f7;
    --muted: #929cab;
    --accent: #ff9d32;
    --green: #62d39a;
    --red: #ff6b6b
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 Inter, Segoe UI, Arial, sans-serif
}

.app {
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0d12, #090b10)
}

header {
    height: 64px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #0d1016;
    position: sticky;
    top: 0;
    z-index: 5
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center
}

.logo {
    width: 34px;
    height: 34px;
    border: 1px solid #47515f;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #171c24;
    color: var(--accent);
    font-weight: 800
}

.brand h1 {
    font-size: 16px;
    margin: 0
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 11px
}

.actions {
    display: flex;
    gap: 8px
}

button,
.filebtn,
select,
input {
    font: inherit
}

button,
.filebtn {
    border: 1px solid var(--border);
    background: #171c24;
    color: var(--text);
    padding: 8px 11px;
    border-radius: 7px;
    cursor: pointer
}

.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #181008;
    font-weight: 700
}

.danger {
    color: #ff9999
}

.layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 300px;
    min-height: calc(100vh - 64px)
}

aside {
    border-right: 1px solid var(--border);
    padding: 16px;
    background: #0d1016
}

.right {
    border-left: 1px solid var(--border);
    border-right: 0
}

.section {
    margin-bottom: 18px
}

.section h2 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .11em;
    color: var(--muted);
    margin: 0 0 9px
}

.field {
    margin: 8px 0
}

.field label {
    display: flex;
    justify-content: space-between;
    color: #bbc3ce;
    font-size: 12px;
    margin-bottom: 5px
}

input[type=text],
input[type=number],
select {
    width: 100%;
    background: #0b0e13;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 8px
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: #cbd2dc
}

.checks input {
    accent-color: var(--accent)
}

main {
    padding: 18px;
    min-width: 0
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px
}

.drop {
    border: 1px dashed #3b4554;
    border-radius: 10px;
    background: #0d1118;
    padding: 12px
}

.drop textarea {
    width: 100%;
    height: 220px;
    resize: vertical;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e9edf2;
    font: 13px/1.55 Consolas, Monaco, monospace
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 9px
}

.toolbar .spacer {
    flex: 1
}

.preview-shell {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #06080c;
    overflow: hidden
}

.preview-top {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px
}

.preview {
    padding: 22px;
    min-height: 440px;
    overflow: auto;
    background: #111;
    transition: .2s
}

.chat {
    max-width: 1100px;
    margin: auto;
    font-family: Arial, sans-serif
}

.line {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 2px 0;
    text-shadow: 0 1px 2px #000;
    font-weight: 700;
    margin: 0
}

.timestamp {
    color: #8b929d
}

.name {
    font-weight: 700
}

.line.me,
.line.do {
    color: #c2a3da
}

.line.low,
.line.low {
    color: #9d9d9d
}

.line.whisper {
    color: #eda841
}

.line.shout,
.line.ooc,
.line.radio,
.line.ad,
.line.unknown {
    color: #f1f1f1
}

.line.ooc {
    color: #b5b5b5
}

.line.system {
    color: #aab4c2
}

.line.radio {
    color: #84d7a4
}

.line.ad {
    color: #ffd27b
}

.line.money {
    color: #84c8ff
}

.line.phone {
    color: #fbf724
}

.line.unknown {
    color: #e7e7e7
}

.line.hidden {
    display: none
}

.line em {
    font-style: normal
}

.legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px
}

.legend div {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px
}

.sample {
    height: 8px;
    width: 8px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px
}

.canvas {
    display: none;
    position: relative;
    min-height: 520px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #171717
}

.canvas img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover
}

.canvas .overlay {
    position: absolute;
    left: 30px;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, .42);
    padding: 12px;
    border-radius: 4px;
    resize: both;
    overflow: auto;
    cursor: move
}

.canvas .overlay .line {
    margin: 1px 0
}

.hint {
    color: var(--muted);
    font-size: 11px
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.stat {
    background: #0b0e13;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 9px
}

.stat b {
    font-size: 18px
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 10px
}

.line.me,
.line.do {
    color: #c2a3da
}

.line.low {
    color: #9d9d9d
}

.line.whisper {
    color: #eda841
}

.line.shout,
.line.ooc,
.line.radio,
.line.ad,
.line.unknown {
    color: #f1f1f1
}

.line.phone {
    color: #fbf724
}

.line.money,
.line.item {
    color: #56d64b
}

.line.inventory {
    color: #ffff00
}

.line.ckblue {
    color: #3896f3
}

.line.ckred {
    color: #f00000
}

.chat {
    font-family: Arial, sans-serif;
    font-weight: 700
}

.preview {
    background: #000
}

@media(max-width:1050px) {
    .layout {
        grid-template-columns: 250px minmax(0, 1fr)
    }

    .right {
        display: none
    }
}

@media(max-width:700px) {
    .layout {
        display: block
    }

    .layout>aside {
        display: none
    }

    header {
        padding: 0 10px
    }

    .brand small {
        display: none
    }

    main {
        padding: 10px
    }

    .preview {
        padding: 12px
    }

    .drop textarea {
        height: 180px
    }
}
