/* One centered clock, with two equal columns for the information below it. */
.match-hud {
  position: absolute; z-index: 4; top: 16px; left: 50%; transform: translateX(-50%);
  width: clamp(260px, 17vw, 328px); overflow: hidden; pointer-events: none;
  border: 2px solid #102c25; border-bottom: 4px solid #d9aa58; border-radius: 5px;
  background: #183e34f5; color: #f5ebd5; text-align: center;
  box-shadow: 3px 4px 0 #10292140; font-variant-numeric: tabular-nums;
}
.match-hud[hidden], .match-hud [hidden] { display: none !important; }
.match-results .match-hud, .game-card.replaying .match-hud { visibility: hidden; }
.match-hud-clock { position: relative; display: grid; place-items: center; height: 64px; padding: 0; }
.match-hud #round-label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; line-height: 1.3; font-weight: 750; color: #d4d8c3; }
.match-hud #timer-label { display: block; margin: 0; font-size: clamp(38px, 2.5vw, 48px); line-height: 1; font-weight: 900; letter-spacing: 0; color: #fff8e8; }
.match-hud #timer-label.urgent { color: #ffad8c; }
.match-hud.survival #round-label { display: none; }
/* Center the count and its caption together as one label. */
.match-hud.survival #timer-label {
  display: flex; align-items: baseline; justify-content: center;
  gap: 9px; white-space: nowrap;
}
.match-hud .survival-count-caption { font-size: 26px; line-height: 1; font-weight: 750; color: #f5ebd5; }
.match-hud .survival-count-number {
  display: inline-flex; align-items: baseline; transform-origin: center;
  color: #ff827a; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: inherit; line-height: 1; font-weight: 900; font-variant-numeric: lining-nums tabular-nums;
}
.match-hud .survival-count-number > span { font: inherit; }
/* Hangul fills more of the em than lining digits. Keep one font size and
   optically match the unit's ink height to the number beside it. */
.match-hud .survival-count-unit { transform: scale(.88); transform-origin: center 80%; margin-inline: -.05em; }
.match-hud.survival[data-survivor-pulse="0"] .survival-count-number { animation: survivor-pop-a 320ms ease-out; }
.match-hud.survival[data-survivor-pulse="1"] .survival-count-number { animation: survivor-pop-b 320ms ease-out; }
@keyframes survivor-pop-a { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.14); } }
@keyframes survivor-pop-b { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.14); } }
.match-hud-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid #85957a7a; }
.match-hud-population, .match-hud-score {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; padding: 6px 8px;
}
.match-hud-score { border-left: 1px solid #85957a7a; }
.match-hud .match-hud-label { font-size: 11px; line-height: 1.3; color: #d4d8c3; font-weight: 650; }
.match-hud :is(#alive-label, #zone-points) { font-size: 24px; line-height: 1.1; font-weight: 850; color: #fff8e8; }
.match-hud.survival #alive-label { font-size: 20px; }
.match-hud-stats small { display: block; font-size: 10px; line-height: 1.3; color: #c8d1bc; white-space: nowrap; }
.match-hud-score.inside { background: #f5ebd5; }
.match-hud-score.inside :is(.match-hud-label, #zone-points) { color: #203b32; }
.match-hud-score.inside small { color: #59674f; }
.match-hud-cue { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 24px; padding: 4px 8px; border-top: 1px solid #85957a7a; }
.match-hud #zone-label { font-size: 11px; font-weight: 650; line-height: 1.35; word-break: keep-all; }
.match-hud .zone-arrow { display: inline-block; flex: 0 0 14px; font-size: 16px; line-height: 1; }
/* Keep one's banked score visible after elimination, beside the live count. */
.game-card.spectating .match-hud #zone-status:not([hidden]) { display: flex !important; }
.match-hud.settling { border-bottom-color: #e3ba64; }
.match-hud.settling #timer-label { color: #e3ba64; }
.match-hud.settling #alive-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; color: #9acaf2; }
.match-hud.settling .match-hud-score { background: #f5ebd5; }
.match-hud.settling .match-hud-score :is(.match-hud-label, #zone-points) { color: #203b32; }
.match-hud.settling .match-hud-score small { color: #59674f; }
.match-hud.settling .match-hud-cue { color: #e3ba64; }
.match-hud.settling[data-cash-pulse="0"] #zone-points { animation: cash-tick-a 150ms ease-out; }
.match-hud.settling[data-cash-pulse="1"] #zone-points { animation: cash-tick-b 150ms ease-out; }
@keyframes cash-tick-a { from { transform: translateY(2px); } to { transform: translateY(0); } }
@keyframes cash-tick-b { from { transform: translateY(2px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .match-hud.settling[data-cash-pulse] #zone-points { animation: none; }
  .match-hud.survival[data-survivor-pulse] .survival-count-number { animation: none; }
}
@media (max-width: 850px), (pointer: coarse) {
  .match-hud {
    top: calc(8px + env(safe-area-inset-top, 0px));
    width: min(220px, calc(100% - 408px)); min-width: 160px;
    border-width: 1px; border-bottom-width: 3px; border-radius: 3px; box-shadow: none;
  }
  .match-hud-clock { height: 42px; }
  .match-hud #round-label { left: 6px; font-size: 9px; }
  .match-hud #timer-label { font-size: 28px; }
  .match-hud.survival #timer-label { gap: 7px; }
  .match-hud .survival-count-caption { font-size: 20px; }
  .match-hud-population, .match-hud-score { gap: 1px; padding: 3px; }
  .match-hud .match-hud-label { font-size: 10px; }
  .match-hud :is(#alive-label, #zone-points) { font-size: 18px; }
  .match-hud.survival #alive-label { font-size: 16px; }
  .match-hud.settling #alive-label { font-size: 14px; }
  .match-hud-stats small { display: none; }
  .match-hud-cue { gap: 4px; min-height: 21px; padding: 3px 5px; }
  .match-hud #zone-label { font-size: 9px; line-height: 1.3; }
  .match-hud .zone-arrow { flex-basis: 12px; font-size: 14px; }
}
