/* Patchwork Realm — battle UI */
#bt { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
#ui #bt.pass { pointer-events: none; }
#bt > * { pointer-events: auto; }
#bt .pass { pointer-events: none; }

/* party cards */
#bt .bt-party { position: absolute; left: 1%; bottom: 2.5%; width: 60%; display: flex; gap: 0.6%; align-items: flex-end; pointer-events: none; }
#bt .bt-card { position: relative; flex: 1 1 0; min-width: 0; max-width: 25%; padding: 0.3em 0.45em 0.4em; transition: transform 0.18s, box-shadow 0.18s, filter 0.2s; pointer-events: none; }
#bt .bt-card::before { inset: 3px; }
#bt .bt-card.act { transform: translateY(-0.7em); box-shadow: inset 0 0 0 3px #3d3b66, 0 0 0.9em 0.15em var(--mustard), 0 5px 0 rgba(10, 8, 24, 0.55); border-color: var(--mustard); }
#bt .bt-card.dead { filter: grayscale(1) brightness(0.55); }
#bt .bt-card .nm { font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 var(--ink), 1px 0 var(--ink), -1px 0 var(--ink); }
#bt .bar { position: relative; height: 0.95em; margin-top: 0.2em; background: #14132b; border: 2px solid var(--ink); border-radius: 5px; overflow: hidden; }
#bt .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#a9c898, #6f8f5f); transition: width 0.35s; }
#bt .bar.low i { background: linear-gradient(#e0775e, #b0452f); }
#bt .bar.mp i { background: linear-gradient(#8fbbe8, #4d6a8f); }
#bt .bar b { position: absolute; left: 0; right: 0; top: 0; bottom: 0; font-size: 0.75em; line-height: 1; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 0 1px 0 var(--ink), 1px 0 var(--ink), -1px 0 var(--ink), 0 -1px 0 var(--ink); }
#bt .bar.mp { height: 0.85em; }
#bt .bar.mp b { font-size: 0.62em; }
#bt .pills { display: flex; flex-wrap: wrap; gap: 2px; min-height: 0.9em; margin-top: 0.15em; }
#bt .pill { font-size: 0.6em; line-height: 1.2; padding: 0 0.45em; border-radius: 99px; border: 2px solid var(--ink); background: var(--madder); color: #fff; white-space: nowrap; }
#bt .pill.good { background: var(--sage); color: var(--ink); }

/* command menu */
#bt .bt-menu { position: absolute; right: 1.2%; bottom: 2.5%; width: 19%; display: flex; flex-direction: column; gap: 0.45em; }
#bt .bt-menu .btn { width: 100%; font-size: 1em; }
#bt .bt-list { position: absolute; right: 1.2%; bottom: 2.5%; width: 31%; }
#bt .bt-list .grid { display: grid; grid-template-columns: 1fr; gap: 0.35em; max-height: 7.6em; overflow-y: auto; padding: 0.3em 0.3em 0.5em; touch-action: pan-y; }
#bt .bt-list .btn { justify-content: space-between; font-size: 0.9em; padding: 0.3em 0.6em; min-width: 0; }
#bt .bt-list .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bt .bt-list .btn .c { margin-left: 0.4em; color: #b8d4f0; flex: none; }
#bt .bt-list .btn.focus .c { color: var(--indigo); }
#bt .bt-list .desc { font-size: 0.85em; min-height: 2.5em; padding: 0.2em 0.4em; line-height: 1.25; }
#bt .bt-list .back { width: 100%; margin-top: 0.3em; }
#bt .bt-tp { position: absolute; right: 1.2%; bottom: 2.5%; width: 19%; text-align: center; }
#bt .bt-tp .t { font-size: 0.9em; margin-bottom: 0.5em; line-height: 1.25; }
#bt .bt-tp .btn { width: 100%; }

/* top bar */
#bt .bt-order { position: absolute; top: 2.4%; left: 14%; display: flex; gap: 0.3em; max-width: 46%; overflow: hidden; pointer-events: none; }
#bt .chip { font-size: 0.8em; padding: 0.1em 0.55em; border-radius: 99px; border: 2px solid var(--ink); white-space: nowrap; max-width: 5.5em; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 var(--ink), 1px 0 var(--ink), -1px 0 var(--ink); }
#bt .chip.p { background: var(--denim); }
#bt .chip.e { background: var(--madder); }
#bt .chip.first { border-color: var(--mustard); box-shadow: 0 0 0.5em var(--mustard); transform: scale(1.12); }
#bt .bt-tog { position: absolute; top: 1.8%; right: 72px; display: flex; gap: 8px; }
#bt .bt-tog .btn { min-width: 48px; min-height: 48px; font-size: 0.9em; padding: 0.2em 0.5em; }
#bt .bt-tog .btn.on { background: linear-gradient(#e9c25a, #c99a2a); color: var(--ink); text-shadow: none; }

/* announcements */
#bt .bt-ann { position: absolute; top: 12%; left: 50%; transform: translateX(-50%); font-size: 1.25em; white-space: nowrap; color: var(--linen); animation: ann-in 0.25s ease-out both; pointer-events: none; }
@keyframes ann-in { 0% { transform: translateX(-50%) scale(1.6); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }

/* enemy hp bars */
#bt .bt-eb { position: absolute; left: 0; top: 0; width: 4.6em; transform: translate(-50%, -100%); text-align: center; pointer-events: none; }
#bt .bt-eb .nm { font-size: 0.8em; white-space: nowrap; display: none; }
#bt .bt-eb.hl .nm { display: block; }
#bt .bt-eb .bar { height: 0.55em; margin: 0 auto; border-width: 2px; }
#bt .bt-eb.hl .bar { height: 0.7em; }
#bt .bt-eb .pills { justify-content: center; min-height: 0; }
#bt .bt-eb .pill { font-size: 0.55em; }
#bt .bt-eb.hide { display: none; }

/* results */
#bt .bt-res { left: 20%; top: 8%; width: 60%; text-align: center; z-index: 5; }
#bt:has(.bt-res) .bt-order, #bt:has(.bt-res) .bt-tog, #bt:has(.bt-res) .bt-party, #bt:has(.bt-res) .bt-eb { visibility: hidden; }
#bt .bt-res h2 { margin: 0 0 0.2em; font-size: 2em; color: var(--mustard); letter-spacing: 0.05em; }
#bt .bt-res .line { font-size: 1.05em; margin: 0.15em 0; }
#bt .bt-res .line img { height: 1.2em; vertical-align: middle; margin-right: 0.2em; }
#bt .bt-res .rows { margin: 0.5em 0; display: flex; flex-direction: column; gap: 0.35em; }
#bt .bt-res .row { display: flex; align-items: center; gap: 0.5em; text-align: left; }
#bt .bt-res .row .n { width: 4.5em; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bt .bt-res .row .lv { width: 2.8em; font-size: 0.85em; color: var(--mustard); }
#bt .bt-res .row .bar { flex: 1; margin: 0; }
#bt .bt-res .row .bar i { width: 0; background: linear-gradient(#f0d070, #c99a2a); }
#bt .bt-res .row .up { width: 7.5em; font-size: 0.8em; color: var(--mustard); opacity: 0; white-space: nowrap; }
#bt .bt-res .row .up.show { animation: slam 0.4s ease-out both; }
@keyframes slam { 0% { transform: scale(3); opacity: 0; } 60% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
#bt .bt-res .btn { min-width: 8em; margin-top: 0.3em; }
