/* [claude code] 2026-10-19 v0.4 戰鬥畫面:上半戰場(左我右敵)· 戰鬥紀錄兩行 · 下半指令區。顏色一律用 theme.css 的變數。 */
#battle { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.bt-top { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.bt-round { font-size: 13px; white-space: nowrap; }
.bt-spacer { flex: 1; }
html[data-ui-skin] #battle .bt-toggle { min-height: 36px; min-width: 44px; padding: 4px 8px; font-size: 13px; }
html[data-ui-skin] #battle .bt-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.bt-toggle[hidden] { display: none; }

/* 戰場 */
.bt-field { position: relative; flex: 1; min-height: 240px; overflow: hidden; background: var(--surface-2) center / cover no-repeat; }
.bt-field::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--field-shade)); pointer-events: none; }
.bt-layer { position: absolute; inset: 0; z-index: 1; }
.bt-unit { position: absolute; width: 22%; max-width: 104px; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; cursor: default; transition: opacity .2s, filter .2s; }
.bt-unit .bt-img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.bt-unit.enemy .bt-img { transform: scaleX(-1); }
.bt-ring { position: absolute; left: 50%; bottom: 10px; width: 80%; height: 16px; transform: translateX(-50%); border-radius: 999px; background: transparent; }
.bt-unit.acting .bt-ring { background: var(--ring); box-shadow: 0 0 12px var(--ring); }
.bt-unit.acting { z-index: 3; }
.bt-unit.selected .bt-ring { background: var(--ring); opacity: .55; }
.bt-unit.targetable { cursor: pointer; filter: drop-shadow(0 0 6px var(--target)); }
.bt-unit.targetable .bt-ring { background: var(--target); }
.bt-unit.dim { opacity: .45; }
.bt-unit.dead { opacity: .25; filter: grayscale(1); }
.bt-bar { position: relative; width: 80%; height: 6px; margin-top: 2px; border-radius: 999px; background: var(--hp-back); overflow: hidden; }
.bt-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--hp-ally); transition: width .2s; }
.bt-unit.enemy .bt-bar i { background: var(--hp-enemy); }
.bt-bar b { position: absolute; left: 0; top: 0; height: 2px; background: var(--shield-c); }
.bt-tags { display: flex; gap: 2px; min-height: 0; }
.bt-tags i { padding: 0 4px; border-radius: 8px; font-style: normal; font-size: 11px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.bt-tags .tag-stun, .bt-tags .tag-down { color: var(--danger); }
.bt-tags .tag-up, .bt-tags .tag-shield { color: var(--accent); }
.bt-name { display: none; margin-top: 2px; padding: 0 8px; border-radius: 999px; font-size: 11px; background: var(--text); color: var(--ink); white-space: nowrap; }
.bt-unit.acting .bt-name, .bt-unit.targetable .bt-name, .bt-unit.selected .bt-name { display: block; }

.bt-num { position: absolute; z-index: 5; transform: translate(-50%, 0); font-size: 15px; font-weight: 700; white-space: nowrap; pointer-events: none; color: var(--hurt); -webkit-text-stroke: 1px var(--hurt-edge); paint-order: stroke fill; }
.bt-num.crit { font-size: 20px; color: var(--crit); }
.bt-num.heal { color: var(--heal-c); -webkit-text-stroke: 1px var(--accent-deep); }
.bt-num.shield { font-size: 13px; color: var(--shield-c); -webkit-text-stroke: 1px var(--accent-deep); }
.bt-proj { position: absolute; z-index: 4; width: 14px; height: 14px; border-radius: 999px; background: var(--proj); box-shadow: 0 0 10px var(--proj); pointer-events: none; }

/* 戰鬥紀錄(兩行,點開看全部) */
html[data-ui-skin] #battle .bt-log { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 40px; padding: 4px 12px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--surface); text-align: left; }
.bt-log span { font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-log span:last-child { color: var(--text); }
.bt-logsheet { position: absolute; inset: 8px; z-index: 6; display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.bt-logsheet[hidden] { display: none; }
.bt-logsheet h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: 15px; }
.bt-loglist { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding-left: 20px; font-size: 13px; }

/* 指令區 */
.bt-panel { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-top: 1px solid var(--border); background: var(--surface); }
.bt-panel.locked .bt-cmds, .bt-panel.locked .bt-actions { opacity: .6; }
.bt-roster { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
html[data-ui-skin] #battle .bt-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 4px; border-radius: 8px; background: var(--surface-2); }
html[data-ui-skin] #battle .bt-chip.sel { border: 2px solid var(--accent); }
.bt-chip.off { filter: grayscale(1); }
.bt-chip img { width: 40px; height: 40px; object-fit: contain; }
.bt-chip-bar { width: 100%; height: 4px; border-radius: 999px; background: var(--hp-back); overflow: hidden; }
.bt-chip-bar i { display: block; height: 100%; background: var(--hp-ally); }
.bt-chip-cmd { position: absolute; top: 2px; right: 4px; font-size: 11px; color: var(--accent); }
.bt-cmds { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 1.4fr)); align-items: center; gap: 4px; min-height: 44px; }
.bt-cmds .note { grid-column: 1 / -1; text-align: center; }
.bt-who { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-ui-skin] #battle .bt-cmd.sel, html[data-ui-skin] #battle .bt-tal.sel { border: 2px solid var(--accent); color: var(--accent); background: var(--surface); }
.bt-tals { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.bt-tals[hidden] { display: none; }
.bt-tals-t { font-size: 11px; color: var(--mute); white-space: nowrap; }
html[data-ui-skin] #battle .bt-tal { min-height: 36px; padding: 4px 12px; white-space: nowrap; border-radius: 999px; }
html[data-ui-skin] #battle .bt-hint { min-height: 28px; padding: 0; border: 0; background: transparent; font-size: 11px; color: var(--gold-ink); }
.bt-hint[hidden] { display: none; }
.bt-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; }
html[data-ui-skin] #battle .bt-actions button { min-height: 48px; }
@media (prefers-reduced-motion: reduce) { .bt-bar i, .bt-unit { transition: none; } }
