.hud,
.hud-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hud {
  justify-content: flex-end;
}

.hud-metrics {
  justify-content: flex-end;
}

.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0b0b0b;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.hud-item .value {
  color: var(--fg);
  font-weight: 600;
}

.hud-item.score {
  gap: 4px;
}

.hud-item.score .label::after {
  content: ':';
  margin-left: 2px;
}

.hud-item.score.is-hidden {
  display: none;
}

.hud-item.timer {
  font-size: 1.1rem;
}

.hud-item.timer .value {
  min-width: 4ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

@keyframes timerFlashWarn {
  from { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.8); }
  to   { box-shadow: 0 0 0 24px rgba(255, 209, 102, 0); }
}

@keyframes timerFlashDanger {
  from { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.85); }
  to   { box-shadow: 0 0 0 24px rgba(255, 77, 77, 0); }
}

.hud-item.timer.flash-warning {
  animation: timerFlashWarn 0.6s ease-out;
}

.hud-item.timer.flash-danger {
  animation: timerFlashDanger 0.6s ease-out;
}

.hud-item.timer.timer-danger-pulse {
  animation: timerFlashWarn 0.5s ease-out infinite;
}

#promptText {
  flex: 1;
  text-align: center;
}

#promptText .prompt-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#promptText .value {
  font-weight: 700;
  color: var(--accent);
  transition: color 0.3s ease;
}

@keyframes promptFlash {
  from { background-color: rgba(255, 209, 102, 0.3); }
  to   { background-color: transparent; }
}

.prompt-highlight {
  animation: promptFlash 0.8s ease-out;
  border-radius: 8px;
}

.daily-progress {
  display: none;
  gap: 0;
  align-items: center;
  margin-left: auto;
  min-height: 26px;
  flex-wrap: nowrap;
  align-self: center;
}

.daily-progress.is-active {
  display: flex;
}

.daily-progress .progress-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #2a2a2a;
  background: #101010;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

.daily-progress .progress-node.is-current {
  border-color: var(--accent);
  border-style: dotted;
  color: var(--fg);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.18);
  transform: translateY(-1px);
}

.daily-progress .progress-node.is-correct,
.daily-progress .progress-node.is-incorrect {
  border-color: var(--accent);
}

.daily-progress .progress-node.is-correct {
  background: var(--accent);
  color: #000;
}

.daily-progress .progress-node.is-incorrect {
  background: #101010;
  color: var(--accent);
}

.daily-progress .progress-label {
  line-height: 1;
  font-size: 0.7rem;
}

.daily-progress .progress-connector {
  flex: 0 0 22px;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #141414;
  transition: background 0.2s ease;
  margin-inline: -2px;
}

.daily-progress .progress-connector.is-active {
  background: var(--accent);
}

@media (max-width: 640px) {
  .hud {
    display: contents;
  }

  .hud-metrics {
    display: contents;
  }

  #timer {
    grid-area: timer;
    justify-self: center;
  }

  #score {
    grid-area: score;
    justify-self: end;
  }

  #promptText {
    grid-area: prompt;
    justify-self: start;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .daily-progress {
    grid-area: progress;
    justify-content: flex-end;
  }

  .hud-item {
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .hud-item.score {
    gap: 3px;
  }

  .daily-progress .progress-node {
    width: 16px;
    height: 16px;
  }

  .daily-progress .progress-node.is-current {
    box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.24);
  }

  .daily-progress .progress-label {
    font-size: 0.55rem;
  }

  .daily-progress .progress-connector {
    flex: 0 0 12px;
    width: 12px;
    height: 2px;
    margin-inline: -2px;
  }
}
