:root { --bg: #14211a; --panel: #1d2c23; --panel2: #24352b; --ink: #ede6d6; --muted: #a7b3a8; --line: #33463a; --accent: #e6c22e; --accent2: #7cc243; --red: #e0483a; --blue: #4f7fe0; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#app { display: flex; flex-direction: column; min-height: 100vh; }
header { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header h1 { font-size: 20px; margin: 0; letter-spacing: 0.2px; }
header h1 .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.spacer { flex: 1; }
button { background: var(--panel2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #221a05; border-color: var(--accent); font-weight: 600; }
button.on { background: var(--accent2); color: #10200a; border-color: var(--accent2); }
button:disabled { opacity: 0.5; cursor: default; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; padding: 14px 16px; flex: 1; }
#stage { position: relative; background: #1f4128; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 420px; }
#view { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: manipulation; }
#banner { position: absolute; left: 12px; top: 10px; padding: 6px 12px; background: rgba(20, 33, 26, 0.82); border-radius: 8px; font-size: 14px; pointer-events: none; }
#banner:empty { display: none; }
#tip { position: absolute; padding: 4px 8px; background: rgba(20, 33, 26, 0.9); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; pointer-events: none; white-space: nowrap; }
#tip:empty { display: none; }
aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card h2 { font-size: 14px; margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.6px; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.ctl { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.ctl label { flex: 0 0 96px; color: var(--muted); font-size: 13px; }
.ctl select, .ctl input { flex: 1; background: var(--panel2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; min-width: 0; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
.score.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.score .name { font-size: 13px; color: var(--muted); }
.score .pts { font-size: 22px; font-weight: 700; }
.score .cnt { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.kv b { color: var(--muted); font-weight: 500; }
.kv span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: 12.5px; }
#log li { padding: 3px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
#log li.me { color: var(--ink); }
#log li.fault { color: #f0a09a; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; flex-wrap: wrap; }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 0; max-width: min(860px, 94vw); width: 860px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dlg { padding: 18px 22px; max-height: 84vh; overflow: auto; }
.dlg h2 { margin: 0 0 10px; font-size: 20px; }
.dlg h3 { margin: 18px 0 6px; font-size: 15px; color: var(--accent); }
.dlg p, .dlg li { font-size: 14px; line-height: 1.5; }
.dlg table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.dlg th, .dlg td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.dlg td.n, .dlg th.n { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dlg .live { color: var(--accent2); }
.dlg .warn { color: #f0a09a; }
.dlg blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); color: var(--muted); }
.prov { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }
.swatch { display: inline-block; width: 46px; height: 8px; border-radius: 4px; vertical-align: middle; background: #e9d7ad; position: relative; overflow: hidden; }
.swatch i { position: absolute; top: 0; bottom: 0; width: 5px; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } #stage { min-height: 360px; } }
