/* D227: the ability hotbar (abilities/hotbar.js). Square slots with a generated icon, rarity border,
   cooldown ring and key; a thin energy bar; the locker as a panel (desktop) or bottom sheet (phone). */
.ability-bar { display: flex; flex-direction: column; gap: 3px; max-width: 360px; pointer-events: auto; }
.hb-row { display: flex; gap: 5px; align-items: flex-end; }
.hb-slot {
  position: relative; width: 46px; height: 46px; padding: 0; border: 1px solid var(--rc, #9aa7b8);
  background: rgba(4, 7, 12, 0.78); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); cursor: pointer;
}
.hb-icon { position: absolute; inset: 5px; width: 36px; height: 36px; image-rendering: pixelated; }
.hb-ring { position: absolute; inset: -1px; width: 46px; height: 46px; transform: rotate(-90deg); pointer-events: none; }
.hb-ring circle { fill: none; stroke-width: 2.4; }
.hb-track { stroke: rgba(255, 255, 255, 0.07); }
.hb-sweep { stroke: var(--fc, #7fd4ff); opacity: 0.9; stroke-linecap: butt; }
.hb-slot kbd {
  position: absolute; left: -1px; top: -1px; min-width: 12px; padding: 0 2px; font: 12px/12px var(--mono, monospace);
  color: #0a0f18; background: var(--rc, #9aa7b8); border: 0;
}
.hb-cd { position: absolute; inset: 0; display: grid; place-items: center; font: 600 14px var(--mono, monospace); font-style: normal; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.hb-name { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px; font-size: 11px; letter-spacing: 0.06em; color: var(--faint, #8a96a8); white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; display: none; }
.hb-slot:hover .hb-name, .hb-slot:focus-visible .hb-name { display: block; }
.hb-slot[data-state="cooling"] .hb-icon, .hb-slot[data-state="low"] .hb-icon, .hb-slot[data-state="jam"] .hb-icon { filter: saturate(0.25) brightness(0.55); }
.hb-slot[data-state="low"] { border-style: dashed; }
.hb-slot[data-state="ready"] { box-shadow: 0 0 6px -1px var(--fc, #7fd4ff), inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
.hb-slot[data-state="ready"] .hb-sweep { opacity: 0.35; }
.hb-slot:disabled { cursor: default; }
.hb-pop { animation: hb-pop 0.35s ease-out; }
@keyframes hb-pop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
.hb-jam .hb-slot { animation: hb-jam 0.18s steps(2) infinite; }
@keyframes hb-jam { 50% { border-color: #ff5d5d; } }
.hb-open { width: 26px; height: 46px; font-size: 12px; color: var(--faint, #8a96a8); border: 1px solid var(--line, #2a3446); background: rgba(4, 7, 12, 0.7); }
.hb-open.on { color: var(--amber, #ffb347); border-color: var(--amber, #ffb347); }
.hb-energy { width: 100%; max-width: 220px; height: 3px; background: rgba(255, 255, 255, 0.08); }
.hb-energy i { display: block; height: 100%; background: linear-gradient(90deg, #4fb8ff, #a0f0ff); transition: width 0.25s linear; }
.hb-locker {
  width: min(360px, 92vw); max-height: 46vh; overflow: auto; padding: 8px; font-size: 12px; color: var(--ink, #d8e2f0);
  background: rgba(6, 10, 18, 0.95); border: 1px solid var(--line, #2a3446);
}
.hb-locker header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hb-locker header span { flex: 1; color: var(--faint, #8a96a8); font-size: 12px; letter-spacing: 0.05em; }
.hb-locker header button { border: 0; background: none; color: var(--faint, #8a96a8); font-size: 16px; }
.hb-locker h4 { margin: 8px 0 4px; font: 12px var(--mono, monospace); letter-spacing: 0.12em; color: var(--faint, #8a96a8); font-weight: 400; }
.hb-card { display: flex; gap: 8px; padding: 6px; margin-bottom: 5px; border-left: 2px solid var(--rc, #9aa7b8); background: rgba(255, 255, 255, 0.03); }
.hb-card img, .hb-bar-list img { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.hb-bar-list img { width: 20px; height: 20px; vertical-align: middle; margin-right: 4px; }
.hb-card b { color: var(--rc, #fff); font-weight: 500; }
.hb-card small { display: block; color: var(--faint, #8a96a8); font-size: 11px; letter-spacing: 0.06em; margin: 2px 0; }
.hb-card p { margin: 2px 0; line-height: 1.35; }
.hb-card ul { margin: 2px 0; padding-left: 12px; color: #b9c8db; }
.hb-card nav, .hb-bar-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.hb-locker button[data-hb="equip"], .hb-locker button[data-hb="stow"], .hb-locker button[data-hb="learn"] {
  padding: 3px 7px; font-size: 12px; color: var(--green, #74f0b0); border: 1px solid rgba(116, 240, 176, 0.35); background: rgba(4, 7, 12, 0.7);
}
.hb-bar-list span, .hb-chip { display: flex; align-items: center; gap: 6px; }
.hb-empty { color: var(--faint, #8a96a8); }
/* Phone: four small squares, no names, the locker is a bottom sheet. */
.ability-bar.hb-phone .hb-slot { width: 38px; height: 38px; }
.ability-bar.hb-phone .hb-icon { inset: 4px; width: 30px; height: 30px; }
.ability-bar.hb-phone .hb-ring { width: 38px; height: 38px; }
.ability-bar.hb-phone .hb-open { height: 38px; width: 22px; }
.ability-bar.hb-phone .hb-energy { max-width: 176px; height: 2px; }
.ability-bar.hb-phone .hb-name { display: none !important; }
.ability-bar.hb-phone .hb-locker { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 52vh; z-index: 400; padding-bottom: 10px; background: #060a12; border-width: 1px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6); }
@media (prefers-reduced-motion: reduce) { .hb-pop, .hb-jam .hb-slot { animation: none; } }
