:root {
    --bg: #0f1115; --panel: #1a1d24; --panel2: #232730; --line: #0a0c10;
    --blue: #6c8cff; --red: #ff6b6b; --gold: #ffd166; --ok: #6fcf97;
    --text: #e8eaf0; --muted: #8b90a0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; -webkit-text-size-adjust: 100%; }

.app { max-width: 760px; margin: 0 auto; padding: 0 12px 120px; }

.topbar { display: flex; align-items: baseline; gap: 10px; padding: 14px 4px 10px; position: sticky; top: 0;
    background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); }
.topbar .logo { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.topbar .by { font-size: 12px; color: var(--gold); }
.topbar .ver { display: inline-block; margin-left: 4px; font-size: 11px; color: var(--muted); background: var(--panel2); padding: 1px 7px; border-radius: 999px; }

.global { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 4px; align-items: center; font-size: 14px; }
.global label { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.global input[type=number] { width: 72px; }
.global .sw { background: var(--panel2); padding: 6px 10px; border-radius: 999px; color: var(--text); }

.tabs { display: flex; gap: 8px; margin: 6px 0 12px; position: sticky; top: 50px; background: var(--bg); padding: 6px 0; z-index: 4; }
.tabs button { flex: 1; background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
    padding: 11px; border-radius: 12px; font-size: 16px; font-weight: 700; }
.tabs button.on { background: var(--blue); color: #fff; }
.hide { display: none; }

.side { display: flex; flex-direction: column; gap: 8px; }

.grp { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.grp > summary { padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; font-size: 15px; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::before { content: "▸ "; color: var(--muted); }
.grp[open] > summary::before { content: "▾ "; }

.attr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 4px 12px 14px; }
.attr { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.attr span { padding-left: 2px; }

.sel-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 14px; }
.sel-row { display: flex; align-items: center; gap: 8px; }
.sel-name { font-size: 13px; color: var(--muted); min-width: 64px; }
.sel-row select { flex: 1; min-width: 0; }
.lvl { width: 56px; flex: none; }

input, select { background: var(--panel2); color: var(--text); border: 1px solid #333; border-radius: 9px;
    padding: 9px 10px; font-size: 15px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--blue); }

.fight { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(92%, 720px);
    background: linear-gradient(135deg, #ff7a90, #6c8cff); color: #fff; border: none; padding: 16px;
    border-radius: 14px; font-size: 18px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 10; }
.fight:disabled { opacity: .6; }

.result { margin: 14px 0 8px; padding: 12px; border-radius: 12px; font-size: 18px; font-weight: 800; text-align: center; }
.result.win { background: #18331f; color: var(--ok); }
.result.lose { background: #331818; color: var(--red); }

.log { background: #0c0e12; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
    font-size: 13px; line-height: 1.7; font-family: ui-monospace, "Cascadia Code", monospace;
    white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow-y: auto; }
.log .line { margin: 1px 0; }

#blazor-error-ui { background: #ffb454; color: #111; padding: 10px; position: fixed; bottom: 0; width: 100%; display: none; }
