/* F5: action bar (BG3 style), aiming panel and action lines in the log. */

.action-bar {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: end; width: 100%;
  background: linear-gradient(180deg, rgba(30, 24, 18, 0.96), rgba(18, 16, 14, 0.98)); border: 1px solid #5a4630;
  border-radius: 14px; padding: 8px 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}
.hb-float { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; width: min(100%, 640px); pointer-events: none; }
.hb-float > * { pointer-events: auto; }
.act-tip {
  background: rgba(20, 18, 16, 0.97); border: 1px solid #6b5436; border-radius: 10px; padding: 8px 12px; font-size: 0.85rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.act-tip p { margin: 4px 0 0; color: var(--text); }
.act-tip .tip-error { color: var(--danger); }
.act-tip .tip-cost { color: var(--muted); }
.hb-portrait { display: grid; justify-items: center; gap: 3px; width: 96px; }
.face-xl { width: 76px; height: 76px; border-radius: 50%; font-size: 1.4rem; border-width: 3px; border-color: #8a6a3c; }
.hb-name { font-size: 0.82rem; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-portrait small { font-size: 0.78rem; color: var(--text); }
.hb-center { display: grid; gap: 6px; min-width: 0; }
.hb-res { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hb-grid { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hb-tabs { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.hb-tab {
  background: rgba(40, 32, 24, 0.9); color: var(--muted); border: 1px solid #4a3a28; border-radius: 999px; padding: 2px 12px; font-size: 0.75rem;
}
.hb-tab.active { color: var(--accent); border-color: var(--accent); }
.hb-end { display: grid; place-items: center; }
.end-turn {
  width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 10px;
  background: radial-gradient(circle at 50% 35%, #2f6f8f, #123447 70%); color: #e8f6ff; font-weight: 700; font-size: 0.82rem;
  border: 3px solid #5bc0eb; box-shadow: 0 0 16px rgba(91, 192, 235, 0.45);
}
.end-turn:disabled { filter: grayscale(1) brightness(0.55); box-shadow: none; cursor: default; }
.economy { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pip {
  display: inline-flex; align-items: center; gap: 4px; background: rgba(40, 32, 24, 0.9); color: var(--text);
  border: 1px solid #4a3a28; border-radius: 999px; padding: 2px 9px; font-size: 0.8rem;
}
.pip-action { color: #7bd389; }
.pip-bonus { color: #f2c14e; }
.pip-reaction { color: #c792ff; }
.pip span { color: var(--text); }
.pip.used { opacity: 0.38; text-decoration: line-through; }
.movement { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.move-meter { display: inline-block; width: 70px; height: 6px; background: rgba(0, 0, 0, 0.6); border-radius: 3px; overflow: hidden; }
.move-meter > span { display: block; height: 100%; background: #f2c14e; }
.slots { display: inline-flex; align-items: center; gap: 4px 10px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.slot-level { display: inline-flex; align-items: center; gap: 3px; }
.slot-level small { font-family: var(--font-title); color: #9ad8f2; margin-right: 1px; }
.slot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #5bc0eb; }
.slot.full { background: #5bc0eb; }
.marks { display: flex; gap: 4px; }
.light-badge { font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.light-badge.light-2 { color: #1b1606; background: #f2d27a; border-color: #f2d27a; }
.light-badge.light-1 { color: #e8e4da; background: #3a3f55; border-color: #59607d; }
.light-badge.light-0 { color: #b9bdd0; background: #10121c; border-color: #2a2e40; }
.act-group { display: flex; gap: 4px; flex-wrap: wrap; padding-right: 10px; border-right: 1px solid #4a3a28; }
.act-group:last-of-type { border-right: none; padding-right: 0; }
.act {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 7px;
  background: linear-gradient(180deg, #2b241c, #17130f); color: var(--text); border: 1px solid #5a4630; border-radius: 6px;
}
.act:hover { border-color: var(--accent); box-shadow: 0 0 8px rgba(212, 162, 76, 0.45); }
.act-attack { border-bottom: 3px solid #b5523b; }
.act-spell { border-bottom: 3px solid #3b7bb5; }
.act-feature { border-bottom: 3px solid #c79a3a; }
.act.unavailable { opacity: 0.38; cursor: not-allowed; }
.act.aiming { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.act kbd {
  position: absolute; top: -6px; left: -5px; font-size: 0.62rem; background: var(--bg); color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 3px;
}
.act-cost { position: absolute; top: 1px; right: 3px; font-size: 0.6rem; }
.cost-action { color: #7bd389; }
.cost-bonus { color: #f2c14e; }
.cost-reaction { color: #c792ff; }
.cost-movement { color: #f2c14e; }
.act-uses { position: absolute; bottom: 1px; right: 3px; font-size: 0.65rem; color: var(--text); text-shadow: 0 1px 2px #000; }
.aim-panel {
  display: grid; gap: 4px; font-size: 0.85rem; background: rgba(20, 18, 16, 0.97); border: 1px solid #6b5436; border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.aim-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.aim-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aim-line .chip { font-size: 0.72rem; padding: 1px 7px; }
.aim-actions { display: flex; gap: 6px; justify-content: flex-end; }

.roll-action .action-result { font-size: 0.85rem; }
.roll-action .target { color: var(--accent); }
.roll-action .roll-detail { font-size: 0.75rem; color: var(--muted); }
.rests { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.rests small { flex-basis: 100%; }

.effect-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.effect-chips .chip { font-size: 0.75rem; padding: 2px 8px; display: inline-flex; align-items: center; gap: 2px; }
.effect-chips .effect-buff { border-color: #5bc0eb; color: #bfe6f7; }
.effect-chips .effect-debuff { border-color: #e55934; color: #f6c3b5; }
.effect-chips .chip-conc { border-color: var(--accent); color: var(--accent); }
.effect-chips .chip-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 0.9rem; }

/* Right-click menu on doors and objects (F19b). */
.object-menu {
  position: absolute; z-index: 40; min-width: 210px; max-width: 280px; padding: 6px;
  background: rgba(22, 24, 30, 0.97); border: 1px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55); transform: translate(8px, 8px);
}
.object-menu-head { display: flex; flex-direction: column; padding: 4px 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.object-menu-head strong { font-family: var(--font-title); color: var(--accent); }
.object-menu-item {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.object-menu-item:hover:not([disabled]) { background: var(--panel-2); }
.object-menu-item[disabled] { opacity: 0.5; cursor: default; }
.object-menu p { margin: 6px 8px; }

/* F17: the trip banner, above the action bar. */
.travel-banner {
  display: flex; align-items: center; gap: 10px; justify-content: center; margin: 0 auto 8px; padding: 8px 14px; width: fit-content;
  background: rgba(22, 24, 30, 0.95); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* F7: talking, narration and the pause. */
.chat-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.chat-to { display: flex; gap: 6px; }
.roll-chat .chat-text { margin: 4px 0 0; white-space: pre-wrap; }
.roll-narration { border-color: var(--accent); }
.roll-narration p { margin: 4px 0 0; font-family: var(--font-title); font-style: italic; }
.narration-layer { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; z-index: 30; }
.narration-box { pointer-events: auto; max-width: min(620px, 90vw); }
.narration-card {
  padding: 22px 26px; background: rgba(20, 18, 14, 0.96); border: 1px solid var(--accent); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 14px; align-items: flex-end;
}
.narration-text { margin: 0; align-self: stretch; font-family: var(--font-title); font-size: 1.15rem; line-height: 1.5; white-space: pre-wrap; }
.paused-banner {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px;
  background: rgba(14, 16, 20, 0.92); border: 1px solid var(--accent); color: var(--accent); font-weight: 700;
}
/* F11b: the slot a spell is cast with. */
.slot-picker { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.slot-picker .chip { font-family: var(--font-title); min-width: 34px; }
/* F11f: a sorcerer's metamagic while aiming, and its sorcery points. */
.meta-picker { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.meta-picker .chip { font-size: 0.78rem; }
.meta-picker .chip small { opacity: 0.75; margin-left: 2px; }
.meta-picker .chip:disabled { opacity: 0.45; cursor: not-allowed; }
.slots.sorcery .slot-level small { color: #d3b1ff; }
.slot.sp { border-color: #c792ff; }
.slot.sp.full { background: #c792ff; }
/* F11c: BG3's buttons next to the end of turn. */
.hb-end { display: flex; align-items: center; gap: 8px; }
.hud-buttons { display: grid; grid-template-columns: repeat(3, 32px); gap: 4px; }
.hud-btn {
  width: 32px; height: 32px; padding: 5px; display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: rgba(14, 15, 19, 0.9); color: var(--muted); border: 1px solid var(--border);
}
.hud-btn:hover:not([disabled]) { color: var(--text); border-color: var(--accent); }
.hud-btn.on { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 162, 76, 0.3); }
.hud-btn[disabled] { opacity: 0.4; cursor: default; }
.hud-btn .icon { width: 18px; height: 18px; }
.spellbook .spell-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.spellbook .spell-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.02); }
.spellbook .spell-row.on { background: rgba(212, 162, 76, 0.08); }
.spellbook h3 { color: var(--accent); font-family: var(--font-title); margin: 6px 0; }
.spellbook h4 { margin: 8px 0 4px; font-size: 0.85rem; color: var(--muted); }
.spellbook-slots { margin-bottom: 6px; }
/* F11f: Wild Shape's list of forms. */
.beast-picker {
  display: grid; gap: 6px; font-size: 0.85rem; background: rgba(20, 18, 16, 0.97); border: 1px solid #6b5436; border-radius: 10px;
  padding: 8px 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); max-height: 46vh; overflow-y: auto;
}
.beast-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.beast-head .btn { margin-left: auto; }
.beast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.beast-card {
  display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  background: rgba(40, 32, 24, 0.9); color: var(--text); border: 1px solid #4a3a28;
}
.beast-card:hover:not(.unavailable) { border-color: var(--accent); }
.beast-card.unavailable { opacity: 0.55; cursor: default; }
.beast-face { flex: none; width: 36px; height: 36px; font-size: 0.8rem; }
.beast-info { display: grid; gap: 1px; min-width: 0; }
.beast-info small { display: block; }
.beast-why { color: var(--danger); }
