/* ══════════════════════════════════════════════════════════════
   Component — VP Bar (top score bar)
   Extracted from shoot/v0.4/style.css
══════════════════════════════════════════════════════════════ */

/* Hoisted as a CSS var so other chrome (battlefield #stage, transition.js
   chrome reservation calc) can anchor itself relative to the vp-bar
   without hard-coding 48px. */
:root { --vp-bar-height: 48px; }

#vp-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vp-bar-height);
  background:
    linear-gradient(180deg, rgba(8,12,16,0.97), rgba(8,12,16,0.88)),
    linear-gradient(90deg, color-mix(in srgb, var(--faction-a) 6%, transparent), transparent 30%, transparent 70%, color-mix(in srgb, var(--faction-b) 6%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--faction-a) 10%, transparent);
  display: flex;
  align-items: center;
  /* Don't use justify-content:center on the bar itself — the ancillary
     elements (auth, menu btn) on the right would shift the center.
     Instead the core score group (.vp-center-group) is absolutely
     centered, and ancillary elements are pushed to the right edge. */
  justify-content: flex-end;
  gap: 8px;
  padding-right: 8px;
  z-index: 50;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
/* Core score group (faction + round pill + faction) — absolutely
   centered within the VP bar so ancillary elements like auth/menu on
   the right don't shift the visual center. Aligns with the phase pill
   + decision banner below. */
/* Grid layout so the round pill (`.vp-status`) lands on the BAR's true
   center, independent of faction-label widths. `1fr auto 1fr` gives
   equal side columns → pill is exact center. Factions justify toward
   the pill so the whole block stays visually tight. */
.vp-center-group {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  max-width: 720px;
  width: min(68vw, 720px);
}
.vp-center-group .vp-faction:first-child { justify-self: end; }
.vp-center-group .vp-faction:last-child  { justify-self: start; }
.vp-center-group .vp-status               { justify-self: center; }

.vp-faction {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font: 600 10px/1 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.side-a .vp-name { color: var(--faction-a); font-family: 'Rajdhani', sans-serif; }
.side-b .vp-name { color: var(--faction-b); font-family: 'Rajdhani', sans-serif; }
.vp-score { font: 700 24px/1 'Anton', sans-serif; }
.side-a .vp-score { color: var(--faction-a); text-shadow: 0 0 12px color-mix(in srgb, var(--faction-a) 35%, transparent); }
.side-b .vp-score { color: var(--faction-b); text-shadow: 0 0 12px color-mix(in srgb, var(--faction-b) 40%, transparent); }
.vp-vs {
  font: 700 9px/1 'Rajdhani', sans-serif;
  color: var(--text-dis);
  letter-spacing: 3px;
  opacity: .75;
}

.vp-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  max-width: 160px;
  padding: 5px 12px 6px;
  /* active-faction: VP status pill border tracks the active turn */
  border: 1px solid color-mix(in srgb, var(--active-faction) 14%, transparent);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(12,18,24,.92), rgba(9,13,18,.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 18px rgba(0,0,0,.2);
}
.vp-status-label {
  font: 700 8px/1 'Rajdhani', sans-serif;
  letter-spacing: 2.6px;
  color: var(--text-dis);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.vp-active-faction {
  font: 700 14px/1 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
}
/* Round number: zero letter-spacing so "1/5" gaps are even */
#vp-round-center {
  letter-spacing: 0;
}

.vp-round-wrap {
  display: none;
}
.vp-round-label {
  font: 700 8px/1 'Rajdhani', sans-serif;
  letter-spacing: 2.4px;
  color: rgba(201,163,82,.8);
  text-transform: uppercase;
}
.vp-round {
  font: 700 16px/1 'Anton', sans-serif;
  letter-spacing: 1px;
  color: #f0d49b;
}

.vp-cp {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 12px;
  font: 600 10px/1 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  color: var(--text-dis);
}
/* Per-side CP indicator. Both sides render simultaneously so reactive
   stratagems (e.g. command-reroll on a save during the opponent's shoot
   phase) visibly debit the using faction — not the active faction.
   Both sides stay at full opacity; the per-side faction-color tint on
   `.vp-cp-num` is enough to distinguish them. */
.vp-cp .vp-cp-side {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vp-cp .vp-cp-label {
  font: 600 10px/1 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  color: var(--text-dis);
}
.vp-cp .vp-cp-num {
  font: 700 16px/1 'Anton', sans-serif;
}
.vp-cp .side-a .vp-cp-num {
  color: var(--faction-a);
  text-shadow: 0 0 8px color-mix(in srgb, var(--faction-a) 30%, transparent);
}
.vp-cp .side-b .vp-cp-num {
  color: var(--faction-b);
  text-shadow: 0 0 8px color-mix(in srgb, var(--faction-b) 30%, transparent);
}
.vp-cp .vp-cp-sep {
  color: var(--text-dis);
  opacity: 0.4;
  font: 700 12px/1 'Anton', sans-serif;
}

#reset-btn {
  display: none;
}
/* active-faction: reset button hover themes to active turn */
#reset-btn:hover { border-color: color-mix(in srgb, var(--active-faction) 30%, transparent); color: var(--active-faction); }
