/* CubeYo shared HUD chrome — pairs with hud-bar.js (CubeyoHud) */
/* Layout: actions 左 · stats 居中 · trailing（私有配置）右 */

.cy-hud {
  position: relative;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-start;
  align-items: center;
  --cy-hud-divider: color-mix(in srgb, var(--cy-text-on-dark) 10%, transparent);
  border-bottom: 1px solid var(--cy-hud-divider);
}

.cy-hud-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  z-index: 1;
}

.cy-hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  padding: 2px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cy-text-on-dark) 6%, transparent);
  font-size: 12px;
  line-height: 1.35;
}

.cy-hud-slot[hidden] {
  display: none !important;
}

.cy-hud-slot {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  white-space: nowrap;
}

.cy-hud-stat-label {
  font-weight: 400;
  opacity: 0.72;
}

.cy-hud-stat-label.cy-hud-stat-label--colon::after {
  content: ':';
}

.cy-hud-stat-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cy-hud-stat-plain {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cy-hud-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 1;
}

.cy-hud-trailing {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* actions 与 trailing 统一：compact ghost chip（覆盖 shell.css .hud button） */
.cy-hud .cy-hud-btn,
.cy-hud-trailing button {
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--cy-hud-chip-border, #9a9488);
  color: var(--cy-hud-chip-text, inherit);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  min-width: auto;
  min-height: auto;
  opacity: 0.85;
  cursor: pointer;
}

.cy-hud .cy-hud-btn:hover,
.cy-hud-trailing button:hover {
  opacity: 1;
}

.cy-hud-trailing button.active,
.cy-hud .cy-hud-btn.cy-hud-btn--active {
  opacity: 1;
  font-weight: 700;
  background: var(--cy-hud-chip-active-bg, #7a756c);
  border-color: var(--cy-hud-chip-active-border, #7a756c);
  color: var(--cy-hud-chip-active-text, #ffffff);
}

/* trailing 内多钮横排（主题、盘数等） */
.cy-hud-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.cy-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* 无 actions / trailing：仅成绩，整条居中 */
.cy-hud:not(:has(.cy-hud-start)):not(:has(.cy-hud-end)) {
  justify-content: center;
}

.cy-hud:not(:has(.cy-hud-start)):not(:has(.cy-hud-end)) .cy-hud-stats {
  position: static;
  transform: none;
  pointer-events: auto;
}
