/* hud.css - thanh streak/XP/muc tieu/giao dien, toast, nut nghe. Chi dung token kem gia tri du phong. */
.hud {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 10px;
}
.hud-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--hd-ink, inherit);
}
.hud-xp { flex: 1 1 180px; min-width: 160px; }
.hud-meter {
  flex: 1 1 60px; min-width: 60px; height: 10px;
  background: var(--line, #d9dee7); border-radius: 999px; overflow: hidden;
}
.hud-meter .bar-fill {
  height: 100%; background: var(--accent, var(--ok, #1f9d55));
  border-radius: 999px; transition: width .4s ease;
}
.hud-goalbox { flex-wrap: wrap; gap: 6px 8px; }
.hud-goal-lbl { font-weight: 600; font-size: .95em; color: var(--muted, inherit); }
.site-header .hud-goal-lbl { color: var(--hd-ink, #fff); font-weight: 500; }
.hud-goals { display: inline-flex; gap: 6px; }
.hud-btn {
  min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line, #d9dee7); border-radius: var(--radius-sm, 12px);
  background: var(--card, #fff); color: var(--ink, #1d2433);
  font: inherit; font-weight: 600; cursor: pointer;
}
.hud-btn[aria-pressed="true"] {
  background: var(--pri, #2563eb); color: var(--pri-ink, #fff); border-color: var(--pri, #2563eb);
}
.hud-btn:focus-visible { outline: 3px solid var(--focus, #f59e0b); outline-offset: 2px; }

.hud-mascot { display: inline-flex; align-items: center; gap: 4px; }
.hud-mascot-face, .hud-mascot-face .mascot { width: 28px; height: 28px; }
.hud-mascot-face { display: inline-flex; }
.hud-btn[aria-pressed="true"] .hud-mascot-face { --m-scarf: var(--hd-focus, #ffd24a); }

.btn-speak {
  min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line, #d9dee7); border-radius: var(--radius-sm, 12px);
  background: var(--card, #fff); color: var(--ink, #1d2433);
  font: inherit; cursor: pointer; vertical-align: middle;
}
.btn-speak:focus-visible { outline: 3px solid var(--focus, #f59e0b); outline-offset: 2px; }

.fold { margin: 10px 0; }
.fold > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }

.hud-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bs-toast:empty { display: none; }
.bs-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; z-index: 1000;
  background: var(--ink, #1d2433); color: var(--card, #fff);
  border-radius: var(--radius, 20px); box-shadow: var(--shadow, 0 6px 20px rgba(0, 0, 0, .25));
  font-weight: 600; text-align: center;
  animation: bs-toast-in .25s ease;
}
@keyframes bs-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .hud-meter .bar-fill { transition: none; }
  .bs-toast { animation: none; }
}
