/* Loi khung WebTool dung chung (docs/webtool.md). Nguon: submodule FeatureTemplate Features/WebTool/Web~/core/tool.css —
   Tools/Feature/WebTool/Sync GHI DE file nay trong WebTool/ cua game => KHONG sua o repo game; giao dien rieng
   viet o WebTool/game.css (nap sau file nay nen de duoc). Nen trang (#14161c), font va cuon do trang khung PearzCI lo.
   Class wt-btn / wt-input / wt-row / wt-hint... game dung lai thoai mai cho editor cua minh. */
.wt-panel {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding: 16px 20px;
    color: #c9ced8;
}

.wt-panel *,
.wt-panel *::before,
.wt-panel *::after {
    box-sizing: inherit;
}

.wt-panel [hidden] { display: none !important; }

/* ---- Cot level ---- */
.wt-levels {
    flex: 0 0 228px;
    min-width: 0;
}

.wt-account {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
}

.wt-user {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.4;
    color: #8b93a3;
    overflow-wrap: anywhere;
}

.wt-user-ok { color: #6fd08c; }

.wt-list-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.wt-filter { display: flex; gap: 6px; }
.wt-levels .wt-filter .wt-input { min-width: 0; }
.wt-levels .wt-filter input { flex: 1 1 0; }

.wt-level-list {
    height: calc(100vh - 210px);
    min-height: 240px;
    margin-top: 8px;
    overflow-y: auto;
    border: 1px solid #2c313c;
    border-radius: 6px;
    background: #0d0f14;
}

.wt-level {
    /* Ten | do kho (giua, co dinh) | chu nho cua game (phai) => cac dong thang cot voi nhau. */
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 50px;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 10px;
    border: 0;
    background: none;
    color: #c9ced8;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.wt-level-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-level:hover { background: #1b1e27; }
.wt-level-off { color: #6b7280; text-decoration: line-through; }
.wt-level[aria-current="true"] { background: #2f5fc4; color: #fff; }
.wt-level:focus-visible { outline: 2px solid #6ea8fe; outline-offset: -2px; }

.wt-level-tag { text-align: center; font-size: 11px; font-weight: 700; color: #8b93a3; }
.wt-level-tag-Hard { color: #f0c36a; }
.wt-level-tag-Special { color: #ff8589; }

.wt-level-info {
    text-align: right;
    font-size: 11px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.wt-level[aria-current="true"] .wt-level-tag,
.wt-level[aria-current="true"] .wt-level-info { color: #e6ecfa; }

.wt-level-empty {
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #8b93a3;
}

/* Thu danh sach level: chi con nut mo lai. */
.wt-levels-folded .wt-levels { flex-basis: auto; }
.wt-levels-folded .wt-levels > :not(.wt-list-actions),
.wt-levels-folded .wt-list-actions > :not(#wt-levels-fold) { display: none; }

/* ---- Giua: tieu de, thanh lenh, editor cua game ---- */
.wt-center {
    flex: 1 1 420px;
    min-width: 0;
}

.wt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.wt-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #eef1f6;
    overflow-wrap: anywhere;
}

.wt-dirty {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 400;
    color: #f0c36a;
}

.wt-bar,
.wt-bar-extra {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.wt-game { margin: 6px 0 0; font-size: 13px; color: #8b93a3; }
.wt-game-ok { color: #6fd08c; }
.wt-game-error { color: #ff8589; }

.wt-editor { margin-top: 12px; }

/* ---- Cot phai ---- */
.wt-side {
    flex: 0 0 270px;
    max-width: 100%;
    min-width: 0;
}

.wt-side-title {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6ea8fe;
}

.wt-side-title:first-child { margin-top: 0; }

.wt-file { margin-top: 12px; border-top: 1px solid #2c313c; }
.wt-file summary { padding: 8px 0 0; font-size: 13px; color: #8b93a3; cursor: pointer; }
.wt-deleted { margin-top: 10px; max-height: 240px; overflow-y: auto; }

/* ---- Thanh phan dung chung (game dung lai duoc) ---- */
.wt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
    padding: 3px 0;
    border-bottom: 1px dashed #2c313c;
    font-size: 13px;
    color: #8b93a3;
}

.wt-row .wt-input { max-width: 170px; }
.wt-row-ctl { display: inline-flex; align-items: center; gap: 6px; }

.wt-label { display: block; margin-bottom: 6px; font-size: 13px; color: #8b93a3; }
.wt-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #8b93a3; }
.wt-muted { font-weight: 400; color: #8b93a3; }

.wt-input {
    padding: 6px 8px;
    border: 1px solid #2c313c;
    border-radius: 6px;
    background: #0d0f14;
    color: #e3e7ee;
    font: inherit;
    font-size: 13px;
}

.wt-num { width: 72px; }

.wt-json {
    display: block;
    width: 100%;
    min-height: 320px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

.wt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.wt-btn {
    min-width: 84px;
    padding: 8px 16px;
    border: 1px solid #353b48;
    border-radius: 6px;
    background: #232732;
    color: #e3e7ee;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.wt-btn-small { min-width: 0; padding: 5px 9px; font-size: 12px; }
.wt-btn:hover { background: #2c313e; }
.wt-btn:active { background: #1b1e27; }
.wt-btn:disabled { opacity: 0.5; cursor: default; }
.wt-btn-primary { border-color: #3d6fd6; background: #2f5fc4; color: #fff; }
.wt-btn-primary:hover { background: #3a6bd2; }
.wt-btn-primary:active { background: #2852aa; }
.wt-btn-danger { color: #ff8589; }

.wt-input:focus-visible,
.wt-btn:focus-visible {
    outline: 2px solid #6ea8fe;
    outline-offset: 1px;
}

.wt-status {
    min-height: 1.5em;
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.wt-status-ok { color: #6fd08c; }
.wt-status-warn { color: #f0c36a; }
.wt-status-error { color: #ff8589; }
