/* ==========================================================================
   ui-hud.css — Akofena-style slim fight HUD (override sheet, loaded after the
   inline <style> in index.html).

   Slim glass health bars with square portrait chips, a compact dark-glass
   timer, icon-weight utility chips, gold rally meters and Bebas Neue display
   type. JS hooks preserved: .combo-badge.active, #banner.show, .pip.won and
   the width transitions on .hp-trail / .hp-fill / .meter-fill.
   ========================================================================== */

#hud {
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
           max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

/* ---------- TOP BAR ---------- */

.top-bar {
  align-items: flex-start;
  gap: 12px;
}

.fighter-hud {
  gap: 3px;
  padding-top: 1px;
}

/* name row — 26px portrait chip + condensed name, pips hug the timer side */
.name-row {
  align-items: center;
  gap: 6px;
  min-height: 26px;
}

.char-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-weight: 400;
  font-size: clamp(13px, 1.9vw, 16px);
  letter-spacing: 2.2px;
  line-height: 1;
  color: #ffd98e;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.75);
  padding-top: 1px;
}

.char-name::before {
  content: '';
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 4px;
  border: 1px solid rgba(216, 168, 78, 0.75);
  background: rgba(10, 6, 4, 0.6) url('../assets/portrait-sango.webp') center/cover no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

#name-p2::before { background-image: url('../assets/portrait-idia.webp'); }
.p2 .char-name { flex-direction: row-reverse; }   /* chip on the outer edge */

.pips { gap: 3px; }
.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(216, 168, 78, 0.85);
  background: rgba(8, 5, 10, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.pip.won {
  background: radial-gradient(circle, #fff4c8 5%, #f6b93b 55%, #b33c00 100%);
  border-color: #ffe9ad;
  box-shadow: 0 0 7px rgba(255, 170, 40, 0.85);
}

/* health — 10px slim bar, thin gold frame on dark glass */
.hp-outer {
  height: 10px;
  border: 1px solid rgba(216, 168, 78, 0.6);
  border-radius: 3px;
  background: rgba(10, 6, 10, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), inset 0 1px 3px rgba(0, 0, 0, 0.8);
  transform: skewX(-8deg);
}
.p2 .hp-outer { transform: skewX(8deg); }

.hp-trail {
  background: rgba(255, 244, 214, 0.9);          /* white damage trail */
  transition: width 0.35s ease-out;
}
.hp-fill {
  background: linear-gradient(180deg, #ffe066 0%, #ff8800 55%, #b82e00 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 7px rgba(255, 140, 0, 0.55);
  transition: width 0.06s linear;
}
.p2 .hp-fill {
  background: linear-gradient(180deg, #70ff94 0%, #17b857 55%, #06632c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 7px rgba(60, 220, 110, 0.45);
}

/* rally meter — 5px amber thread under the health bar */
.meter-outer {
  width: 78%;
  height: 5px;
  border: 1px solid rgba(216, 168, 78, 0.45);
  border-radius: 3px;
  background: rgba(8, 5, 8, 0.7);
  overflow: hidden;
}
.meter-fill {
  background: linear-gradient(90deg, #a35c08 0%, #f6b93b 55%, #ffe9a8 100%);
  box-shadow: 0 0 6px rgba(246, 185, 59, 0.7);
  transition: width 0.1s;
}
.p2 .meter-fill {
  background: linear-gradient(90deg, #a35c08 0%, #f6b93b 55%, #ffe9a8 100%);
  box-shadow: 0 0 6px rgba(246, 185, 59, 0.7);
}

/* ---------- CENTER: wordmark + compact timer + glass chips ---------- */

.center-hud {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 4px;
}

.wordmark-mini {
  font-family: 'Oswald', ui-sans-serif, sans-serif;
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(230, 184, 106, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  margin-bottom: 2px;
}

.timer-box {
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-weight: 400;
  font-size: clamp(26px, 4.2vw, 34px);
  line-height: 0.95;
  min-width: 54px;
  text-align: center;
  color: #ffeec2;
  background: rgba(12, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(216, 168, 78, 0.6);
  border-radius: 6px;
  padding: 1px 10px 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 170, 0.12);
}

/* pause / moves — small glass chips tucked under the timer, out of flow so
   they don't inflate the top-bar height */
.hud-utility-row {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  gap: 5px;
  pointer-events: auto;
}

.hud-mini-btn {
  pointer-events: auto;
  height: 26px;
  min-height: 0;
  padding: 0 9px;
  border-radius: 5px;
  border: 1px solid rgba(216, 168, 78, 0.55);
  background: rgba(12, 7, 10, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #f0d9a8;
  font-family: 'Oswald', ui-sans-serif, sans-serif;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.hud-mini-btn:active { transform: scale(0.94); }

/* pause = bare ⏸ icon (text kept in DOM for a11y, visually suppressed) */
#hud-pause-btn {
  width: 30px;
  padding: 0;
  font-size: 0;
}
#hud-pause-btn::before {
  content: '\23F8';
  font-family: sans-serif;
  font-size: 13px;
  line-height: 24px;
  color: #f0d9a8;
}

/* ---------- MID-LAYER: combo badges, counter tags, banner ---------- */

.combo-badge {
  top: 10%;
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 4vw, 30px);
  letter-spacing: 2px;
  color: #ffd98e;
  text-shadow: 0 2px 0 rgba(60, 15, 0, 0.9), 0 3px 10px rgba(0, 0, 0, 0.85),
               0 0 14px rgba(255, 140, 0, 0.35);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.12s, transform 0.12s;
}
.combo-badge.active { opacity: 1; transform: scale(1); }

.combo-badge.counter-tag {
  top: 24%;
  color: #ffce8a;
  text-shadow: 0 2px 0 rgba(70, 0, 10, 0.9), 0 3px 10px rgba(0, 0, 0, 0.85),
               0 0 14px rgba(255, 60, 60, 0.4);
}
#combo-p1, #counter-p1 { left: 2%; }
#combo-p2, #counter-p2 { right: 2%; text-align: right; }

.callout-sub {
  display: block;
  font-family: 'Oswald', ui-sans-serif, sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 238, 194, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  margin-top: 1px;
}

/* ROUND / FIGHT banner — giant gold-gradient Bebas */
#banner {
  position: absolute;
  top: 38%;
  left: 50%;
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  font-weight: 400;
  font-size: clamp(44px, 9vw, 80px);
  letter-spacing: 8px;
  line-height: 0.9;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff7d6 0%, #ffbb33 48%, #c83e00 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 rgba(61, 14, 0, 0.95))
          drop-shadow(0 0 22px rgba(255, 120, 0, 0.5));
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: transform 0.22s cubic-bezier(0.18, 1.4, 0.4, 1), opacity 0.18s;
  pointer-events: none;
}
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

#banner-sub {
  display: block;
  font-size: clamp(14px, 3vw, 24px);
  letter-spacing: 6px;
  margin-top: 6px;
  color: #ffd166;
  -webkit-text-fill-color: #ffd166;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
