/* In-game HUD: the question card (round, round markers, score, question, hint) and the zoom buttons.
   Placement is in layout.css. */

/* three columns, the round markers in the true centre of the card whatever the widths of the label and the score */
.hud-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-4); }
.score-card { grid-column: 3; justify-self: end; margin: 0; white-space: nowrap; font-weight: 800; font-size: var(--text-lg); }
.score-card .score-unit { font-weight: 600; font-size: var(--text-sm); color: var(--muted); }
#hud .question {
  font-size: var(--text-question); font-weight: var(--weight-strong); line-height: 1.12; letter-spacing: -0.01em;
  text-align: center;
}
.hint {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-md); color: var(--muted); text-align: center;
}
.hint::before {
  content: ''; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icon-pin) center / contain no-repeat; mask: var(--icon-pin) center / contain no-repeat;
}
.hint.off { display: none; }
/* after the guess the card shrinks: smaller question, the markers and score stay */
#hud.revealed { padding-block: var(--space-3) 14px; }
#hud.revealed .question { font-size: var(--text-lg); }

@media (max-width: 640px), (orientation: landscape) and (max-height: 500px) {
  #hud .question, .hint { text-align: left; justify-content: flex-start; }
  .hud-row { gap: var(--space-3); }
  .hud-row .rounds li { width: 20px; }
  .hint { font-size: var(--text-sm); }
}
@media (max-width: 380px) {
  .hud-row .rounds { display: none; }   /* the round label says the same on very narrow phones */
}

/* the round's time limit: a quiet shrinking bar, prominent with the seconds for the last 15 s (js/game/round-timer.js) */
.round-timer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); min-height: 18px; }
.round-timer:not([data-active]) { visibility: hidden; }   /* keeps its row, so the card does not jump when the countdown starts */
.round-timer-bar { position: relative; height: 3px; border-radius: 2px; background: var(--tier-empty); overflow: hidden; }
.round-timer-bar::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--left, 1) * 100%); border-radius: inherit;
  background: var(--muted); opacity: .5; transition: width .25s linear;
}
.round-timer-sec { display: none; min-width: 2ch; text-align: right; font-size: var(--text-sm); font-weight: 800; color: var(--warn); }
.round-timer[data-warn="true"] .round-timer-bar { height: 4px; }
.round-timer[data-warn="true"] .round-timer-bar::after { background: var(--warn); opacity: 1; animation: timer-pulse 1s ease-in-out infinite; }
.round-timer:not([data-warn="true"]) { grid-template-columns: minmax(0, 1fr); }   /* until then the bar takes the whole row */
.round-timer[data-warn="true"] .round-timer-sec { display: block; }
@keyframes timer-pulse { 50% { opacity: .55; } }
#hud.revealed .round-timer { display: none; }
@media (prefers-reduced-motion: reduce) {
  .round-timer-bar::after { transition: none; }
  .round-timer[data-warn="true"] .round-timer-bar::after { animation: none; }
}
