/*
  Kaflul 2.0 gameplay HUD.

  One stable surface replaces the old row of equally weighted glass cards.
  The layer intentionally avoids backdrop-filter and large per-card shadows so
  score/life updates repaint cheaply on older Android WebViews.
*/

html:not(.start-screen-open) .hud {
  --hud-panel: rgba(4, 11, 25, 0.96);
  --hud-card: rgba(12, 25, 44, 0.94);
  --hud-border: rgba(142, 218, 255, 0.28);
  width: min(1120px, calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))));
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "stats actions"
    "progress progress";
  grid-template-rows: 46px 4px;
  align-items: stretch;
  gap: 3px 8px;
  padding: 4px;
  border: 1px solid var(--hud-border);
  border-radius: 17px 13px 17px 13px;
  background:
    linear-gradient(180deg, rgba(18, 37, 61, 0.98), var(--hud-panel));
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

/*
  The 192 MB Android profile cannot afford separate filter surfaces around the
  live canvas. Keep the same solid gradients/borders, but avoid compositor
  layers whose visual contribution is smaller than a single physical pixel on
  that class of display.
*/
html.android-low-memory-runtime:not(.start-screen-open) .game-shell *,
html.android-low-memory-runtime:not(.start-screen-open) .game-shell *::before,
html.android-low-memory-runtime:not(.start-screen-open) .game-shell *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  animation: none !important;
  transition: none !important;
}

html.android-low-memory-runtime:not(.start-screen-open) .hud,
html.android-low-memory-runtime:not(.start-screen-open) .hud .metric,
html.android-low-memory-runtime:not(.start-screen-open) .hud .arcade-collection-hud,
html.android-low-memory-runtime:not(.start-screen-open) .hud .icon-button {
  box-shadow: none !important;
}

/* The 192 MB path keeps collectibles as tiny DOM sprites. Updating even a
   small full-world canvas after a pickup makes old Mali WebViews re-upload a
   texture and pause for several frames. */
html.android-low-memory-runtime #game-static-collectibles-canvas {
  display: none !important;
  transform: none !important;
}

html:not(.start-screen-open) .hud-group-main {
  grid-area: stats;
  height: 46px;
  display: grid;
  grid-template-columns:
    minmax(86px, 0.78fr)
    minmax(82px, 0.72fr)
    minmax(118px, 0.95fr)
    minmax(102px, 0.85fr)
    minmax(230px, 2fr)
    minmax(164px, 1.25fr);
  grid-template-areas: "score combo lives wave mission collection";
  align-items: stretch;
  gap: 5px;
}

html:not(.start-screen-open) .metric-score { grid-area: score; }
html:not(.start-screen-open) .metric-combo { grid-area: combo; }
html:not(.start-screen-open) .metric-lives { grid-area: lives; }
html:not(.start-screen-open) .metric-progress { grid-area: wave; }
html:not(.start-screen-open) .metric-mission { grid-area: mission; }
html:not(.start-screen-open) .arcade-collection-hud { grid-area: collection; }

html:not(.start-screen-open) .metric,
html:not(.start-screen-open) .arcade-collection-hud {
  box-sizing: border-box;
  min-width: 0;
  width: auto;
  min-height: 46px;
  height: 46px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px 9px 12px 9px;
  background: var(--hud-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html:not(.start-screen-open) .metric {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
}

html:not(.start-screen-open) .metric-copy {
  min-width: 0;
  gap: 2px;
}

html:not(.start-screen-open) .metric-label {
  display: block;
  color: #a9bdd3;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
}

html:not(.start-screen-open) .metric strong {
  color: #ffffff;
  font-family: var(--kf-font-display, "Fredoka", "Assistant", sans-serif);
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 800;
  line-height: 1;
}

html:not(.start-screen-open) .metric-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  box-shadow: none;
}

html:not(.start-screen-open) .metric-score {
  border-color: rgba(255, 216, 74, 0.32);
  box-shadow:
    inset 0 2px 0 rgba(255, 216, 74, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .metric-combo {
  border-color: rgba(157, 124, 255, 0.3);
  box-shadow:
    inset 0 2px 0 rgba(157, 124, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .metric-lives {
  grid-template-columns: minmax(0, 1fr);
  border-color: rgba(255, 95, 159, 0.36);
  background:
    linear-gradient(180deg, rgba(57, 18, 42, 0.92), rgba(25, 14, 33, 0.96));
  box-shadow:
    inset 0 2px 0 rgba(255, 95, 159, 0.82),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .metric-lives > .metric-icon {
  display: none;
}

html:not(.start-screen-open) .metric-lives .metric-label {
  color: #ffc1da;
}

html:not(.start-screen-open) .metric-lives[data-life-state="warning"] {
  border-color: rgba(255, 176, 80, 0.72);
  background: linear-gradient(180deg, rgba(71, 36, 20, 0.94), rgba(31, 17, 25, 0.97));
  box-shadow: inset 0 2px 0 rgba(255, 176, 80, 0.92);
}

html:not(.start-screen-open) .metric-lives[data-life-state="critical"] {
  border-color: rgba(255, 76, 95, 0.88);
  background: linear-gradient(180deg, rgba(82, 20, 31, 0.97), rgba(38, 10, 23, 0.98));
  box-shadow: inset 0 2px 0 rgba(255, 76, 95, 1);
}

html:not(.start-screen-open) .metric-lives #lives.hud-life-icons {
  justify-content: flex-start;
  gap: 5px;
}

html:not(.start-screen-open) .hud-life-icon {
  width: 22px;
  height: 22px;
  color: #ff6fae;
  filter: none;
}

html:not(.start-screen-open) .hud-life-main-icon .ui-icon {
  fill: currentColor;
  stroke: #ffe4ef;
  stroke-width: 1.4;
}

html:not(.start-screen-open) .hud-life-count {
  color: #ffffff;
  direction: ltr;
  font-family: var(--kf-font-display, "Fredoka", "Assistant", sans-serif);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

html:not(.start-screen-open) .metric-lives[data-life-state="warning"] .hud-life-main-icon {
  color: #ffb050;
}

html:not(.start-screen-open) .metric-lives[data-life-state="critical"] .hud-life-main-icon {
  color: #ff4c5f;
}

html:not(.start-screen-open) .metric-lives[data-life-state="warning"] .metric-label,
html:not(.start-screen-open) .metric-lives[data-life-state="warning"] .hud-life-count {
  color: #ffd6a3;
}

html:not(.start-screen-open) .metric-lives[data-life-state="critical"] .metric-label,
html:not(.start-screen-open) .metric-lives[data-life-state="critical"] .hud-life-count {
  color: #fff0f2;
}

html:not(.start-screen-open) .metric-progress {
  border-color: rgba(103, 240, 139, 0.3);
  box-shadow:
    inset 0 2px 0 rgba(103, 240, 139, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .metric-progress .metric-label {
  color: #aef2bf;
}

html:not(.start-screen-open) .progress-goal-value,
html:not(.start-screen-open) .progress-goal-count {
  display: inline-flex;
  align-items: baseline;
}

html:not(.start-screen-open) .progress-goal-value {
  gap: 3px;
}

html:not(.start-screen-open) .progress-goal-count {
  direction: ltr;
}

html:not(.start-screen-open) .progress-goal-prefix {
  display: none;
}

html:not(.start-screen-open) .metric-mission {
  grid-template-columns: 24px minmax(0, 1fr);
  border-color: rgba(104, 231, 255, 0.3);
  box-shadow:
    inset 0 2px 0 rgba(104, 231, 255, 0.74),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .metric-mission .metric-copy {
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
}

html:not(.start-screen-open) .metric-mission .metric-label {
  grid-column: 1 / -1;
  color: #aeeeff;
}

html:not(.start-screen-open) .metric-mission strong {
  font-size: clamp(11px, 1.1vw, 13px);
}

html:not(.start-screen-open) .mission-progress {
  color: #ffd84a;
  font-size: 11px;
}

html:not(.start-screen-open) .arcade-collection-hud {
  min-width: 164px;
  padding: 4px 8px;
  border-color: rgba(255, 216, 74, 0.25);
  background: rgba(17, 24, 40, 0.96);
  box-shadow:
    inset 0 2px 0 rgba(255, 216, 74, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html:not(.start-screen-open) .hud-actions {
  grid-area: actions;
  position: static;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px 9px 12px 9px;
  background: rgba(10, 21, 38, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

html:not(.start-screen-open) .hud-actions .icon-button {
  min-width: 44px;
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
}

html:not(.start-screen-open) .hud-actions .icon-button:hover,
html:not(.start-screen-open) .hud-actions .icon-button:focus-visible {
  border-color: rgba(104, 231, 255, 0.44);
  background: rgba(104, 231, 255, 0.1);
  box-shadow: none;
}

html:not(.start-screen-open) .hud-actions .icon-button .ui-icon {
  width: 19px;
  height: 19px;
}

html:not(.start-screen-open) .hud-control-label {
  color: #dce9f6;
  font-size: 10px;
}

html:not(.start-screen-open) .progress-wrap {
  grid-area: progress;
  width: auto;
  height: 4px;
  min-height: 4px;
  margin: 0 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(101, 133, 160, 0.28);
  box-shadow: none;
}

html:not(.start-screen-open) #progress-fill {
  box-shadow: none;
}

@media (min-width: 601px) and (max-width: 920px) {
  html:not(.start-screen-open) .hud {
    grid-template-rows: 46px 25px 4px;
    grid-template-areas:
      "stats actions"
      "stats actions"
      "progress progress";
  }

  html:not(.start-screen-open) .hud-group-main {
    height: 74px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 46px 25px;
    grid-template-areas:
      "score combo lives wave"
      "mission mission collection collection";
  }

  html:not(.start-screen-open) .metric-mission,
  html:not(.start-screen-open) .arcade-collection-hud {
    height: 25px;
    min-height: 25px;
  }

  html:not(.start-screen-open) .metric-mission {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 2px;
  }

  html:not(.start-screen-open) .metric-mission .metric-icon,
  html:not(.start-screen-open) .metric-mission .metric-label {
    display: none;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  html:not(.start-screen-open) .hud {
    inset-block-start: max(5px, env(safe-area-inset-top));
    inset-inline-start: max(6px, env(safe-area-inset-left));
    inset-inline-end: max(6px, env(safe-area-inset-right));
    width: auto;
    height: 65px;
    min-height: 65px;
    grid-template-columns: minmax(0, 1fr) 88px;
    grid-template-rows: 54px 3px;
    gap: 2px 4px;
    padding: 3px;
    border-radius: 14px 10px 14px 10px;
  }

  html:not(.start-screen-open) .hud-group-main {
    width: auto;
    height: 54px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr);
    grid-template-rows: 32px 20px;
    grid-template-areas:
      "score combo lives wave"
      "mission mission collection collection";
    gap: 2px 3px;
  }

  html:not(.start-screen-open) .metric {
    min-width: 0;
    width: auto;
    height: 32px;
    min-height: 32px;
    grid-template-columns: 15px minmax(0, 1fr);
    gap: 3px;
    padding: 3px 4px;
    border-radius: 9px 7px 9px 7px;
  }

  html:not(.start-screen-open) .hud-group-main > .metric:not(.metric-mission) {
    height: 32px;
    min-height: 32px;
  }

  html:not(.start-screen-open) .metric-label,
  html:not(.start-screen-open) .metric-progress .metric-label {
    display: block;
    font-size: 7.5px;
    line-height: 1;
  }

  html:not(.start-screen-open) .metric-progress .metric-label {
    display: none;
  }

  html:not(.start-screen-open) .metric-progress .progress-goal-value {
    justify-content: center;
    gap: 2px;
    font-size: 10px;
  }

  html:not(.start-screen-open) .metric-progress .progress-goal-prefix {
    display: inline;
    color: #aef2bf;
    font-family: var(--kf-font-body, "Assistant", sans-serif);
    font-size: 7.5px;
    font-weight: 900;
  }

  html:not(.start-screen-open) .metric strong {
    font-size: clamp(10.5px, 2.95vw, 12px);
  }

  html:not(.start-screen-open) .metric-icon {
    width: 15px;
    height: 15px;
    border-radius: 6px;
  }

  html:not(.start-screen-open) .metric-lives {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 4px;
  }

  html:not(.start-screen-open) .metric-lives .metric-copy {
    gap: 0;
  }

  html:not(.start-screen-open) .metric-lives .metric-label {
    text-align: center;
  }

  html:not(.start-screen-open) .metric-lives #lives.hud-life-icons {
    justify-content: center;
    gap: 3px;
  }

  html:not(.start-screen-open) .hud-life-icon {
    width: 16px;
    height: 16px;
  }

  html:not(.start-screen-open) .hud-life-count {
    font-size: 15px;
  }

  html:not(.start-screen-open) .metric-mission,
  html:not(.start-screen-open) .arcade-collection-hud {
    width: auto;
    height: 20px;
    min-height: 20px;
    padding: 1px 5px;
    border-radius: 7px;
  }

  html:not(.start-screen-open) .metric-mission {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  html:not(.start-screen-open) .metric-mission .metric-icon,
  html:not(.start-screen-open) .metric-mission .metric-label {
    display: none;
  }

  html:not(.start-screen-open) .metric-mission .metric-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  html:not(.start-screen-open) .metric-mission strong {
    font-size: 9px;
  }

  html:not(.start-screen-open) .mission-progress {
    font-size: 8.5px;
  }

  html:not(.start-screen-open) .arcade-collection-hud {
    min-width: 0;
    gap: 3px;
    padding-inline: 4px;
  }

  html:not(.start-screen-open) .arcade-key-slot {
    width: 14px;
    height: 16px;
  }

  html:not(.start-screen-open) .arcade-letter-slot {
    width: 13px;
    height: 17px;
    font-size: 12px;
  }

  html:not(.start-screen-open) .hud-actions {
    width: 88px;
    height: 44px;
    min-height: 44px;
    display: grid;
    grid-template-columns: repeat(2, 40px);
    grid-template-rows: 40px;
    gap: 2px;
    padding: 2px;
    align-self: start;
  }

  html:not(.start-screen-open) .hud-actions .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  html:not(.start-screen-open) .hud-actions .icon-button .ui-icon {
    width: 18px;
    height: 18px;
  }

  html:not(.start-screen-open) .hud-control-label,
  html:not(.start-screen-open) .hud-actions .fullscreen-button {
    display: none;
  }

  html:not(.start-screen-open) .progress-wrap {
    width: auto;
    height: 3px;
    min-height: 3px;
    margin: 0 3px;
  }
}

@media (max-width: 360px) and (orientation: portrait) {
  html:not(.start-screen-open) .hud {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  html:not(.start-screen-open) .hud-group-main {
    gap-inline: 2px;
  }

  html:not(.start-screen-open) .metric {
    grid-template-columns: 14px minmax(0, 1fr);
    padding-inline: 3px;
  }

  html:not(.start-screen-open) .metric-label,
  html:not(.start-screen-open) .metric-progress .metric-label {
    font-size: 7px;
  }

  html:not(.start-screen-open) .hud-actions {
    width: 86px;
    grid-template-columns: repeat(2, 40px);
  }

  html:not(.start-screen-open) .hud-actions .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  html:not(.start-screen-open) .hud {
    width: calc(100vw - 14px);
    height: 57px;
    min-height: 57px;
    grid-template-rows: 40px 3px;
    padding: 3px;
  }

  html:not(.start-screen-open) .hud-group-main,
  html:not(.start-screen-open) .metric,
  html:not(.start-screen-open) .arcade-collection-hud,
  html:not(.start-screen-open) .hud-actions {
    height: 40px;
    min-height: 40px;
  }

  html:not(.start-screen-open) .hud-group-main {
    grid-template-columns:
      minmax(58px, 0.6fr)
      minmax(56px, 0.55fr)
      minmax(92px, 0.85fr)
      minmax(72px, 0.7fr)
      minmax(220px, 2.2fr)
      minmax(112px, 1fr);
    grid-template-rows: 40px;
    grid-template-areas: "score combo lives wave mission collection";
  }

  html:not(.start-screen-open) .metric-label {
    font-size: 8px;
  }

  html:not(.start-screen-open) .metric strong {
    font-size: 12px;
  }

  html:not(.start-screen-open) .hud-actions .icon-button {
    height: 34px;
    min-height: 34px;
  }

  html:not(.start-screen-open) .hud-control-label {
    display: none;
  }

  html:not(.start-screen-open) .metric-combo .metric-label {
    display: none;
  }

  html:not(.start-screen-open) .progress-wrap {
    height: 3px;
    min-height: 3px;
  }
}

@media (prefers-contrast: more) {
  html:not(.start-screen-open) .hud,
  html:not(.start-screen-open) .metric,
  html:not(.start-screen-open) .arcade-collection-hud,
  html:not(.start-screen-open) .hud-actions {
    border-color: rgba(255, 255, 255, 0.58);
  }

  html:not(.start-screen-open) .metric-label,
  html:not(.start-screen-open) .hud-control-label {
    color: #ffffff;
  }
}

/*
  HUD clarity v3 — make the exact life count readable at a glance.
  The heart rail has a fixed width so the HUD no longer jumps when a life is
  gained or lost. All effects remain gradient/border based for older Android.
*/
html:not(.start-screen-open) .hud {
  border-color: rgba(142, 218, 255, 0.4);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(104, 231, 255, 0.06), transparent 28%, transparent 72%, rgba(255, 216, 74, 0.05)),
    linear-gradient(180deg, rgba(18, 37, 61, 0.99), rgba(4, 11, 25, 0.98));
}

html:not(.start-screen-open) .hud-group-main {
  grid-template-columns:
    minmax(86px, 0.76fr)
    minmax(82px, 0.68fr)
    minmax(146px, 1.18fr)
    minmax(102px, 0.82fr)
    minmax(220px, 1.9fr)
    minmax(156px, 1.2fr);
}

html:not(.start-screen-open) .metric,
html:not(.start-screen-open) .arcade-collection-hud,
html:not(.start-screen-open) .hud-actions {
  border-radius: 11px;
}

html:not(.start-screen-open) .metric-lives {
  min-width: 146px;
  padding: 4px 9px;
}

html:not(.start-screen-open) .metric-lives .metric-copy {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: center;
  gap: 2px;
}

html:not(.start-screen-open) .metric-lives .metric-label {
  text-align: start;
  white-space: nowrap;
}

html:not(.start-screen-open) .hud-life-icons {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-content: stretch;
  gap: 7px;
  min-width: 0;
  direction: ltr;
  white-space: nowrap;
}

html:not(.start-screen-open) .hud-life-readout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
}

html:not(.start-screen-open) .hud-life-main-icon {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #ff6fae;
}

html:not(.start-screen-open) .hud-life-main-icon .ui-icon {
  width: 100%;
  height: 100%;
}

html:not(.start-screen-open) .hud-life-count {
  min-width: 1ch;
  font-size: 21px;
  text-align: center;
}

html:not(.start-screen-open) .hud-life-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  direction: ltr;
}

html:not(.start-screen-open) .hud-life-pip {
  display: inline-grid;
  width: 12px;
  height: 12px;
  place-items: center;
  color: #ff6fae;
}

html:not(.start-screen-open) .hud-life-pip .ui-icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: rgba(255, 238, 246, 0.8);
  stroke-width: 1.2;
}

html:not(.start-screen-open) .hud-life-pip.is-empty {
  color: rgba(255, 193, 218, 0.16);
}

html:not(.start-screen-open) .hud-life-pip.is-empty .ui-icon {
  stroke: rgba(255, 193, 218, 0.52);
}

html:not(.start-screen-open) .hud-life-bonus {
  min-width: 22px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 216, 74, 0.38);
  border-radius: 999px;
  color: #ffe680;
  background: rgba(255, 216, 74, 0.1);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

html:not(.start-screen-open) .metric-lives[data-life-state="warning"] .hud-life-main-icon,
html:not(.start-screen-open) .metric-lives[data-life-state="warning"] .hud-life-pip.is-filled {
  color: #ffb050;
}

html:not(.start-screen-open) .metric-lives[data-life-state="critical"] .hud-life-main-icon,
html:not(.start-screen-open) .metric-lives[data-life-state="critical"] .hud-life-pip.is-filled {
  color: #ff4c5f;
}

@media (min-width: 601px) and (max-width: 920px) {
  html:not(.start-screen-open) .hud-group-main {
    grid-template-columns: 0.95fr 0.82fr 1.28fr 0.9fr;
  }

  html:not(.start-screen-open) .metric-lives {
    min-width: 0;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  html:not(.start-screen-open) .hud {
    height: 73px;
    min-height: 73px;
    grid-template-columns: minmax(0, 1fr) 90px;
    grid-template-rows: 62px 3px;
    padding: 3px;
  }

  html:not(.start-screen-open) .hud-group-main {
    height: 62px;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.82fr) minmax(0, 1.3fr) minmax(0, 0.9fr);
    grid-template-rows: 39px 21px;
  }

  html:not(.start-screen-open) .hud-group-main > .metric:not(.metric-mission),
  html:not(.start-screen-open) .metric {
    height: 39px;
    min-height: 39px;
  }

  html:not(.start-screen-open) .metric-lives {
    min-width: 0;
    padding: 3px 4px;
  }

  html:not(.start-screen-open) .metric-lives .metric-copy {
    gap: 1px;
  }

  html:not(.start-screen-open) .metric-lives .metric-label {
    font-size: 7px;
    text-align: start;
  }

  html:not(.start-screen-open) .hud-life-icons {
    grid-template-columns: auto 1fr;
    gap: 3px;
  }

  html:not(.start-screen-open) .hud-life-readout {
    gap: 2px;
    min-width: 31px;
  }

  html:not(.start-screen-open) .hud-life-main-icon {
    width: 16px;
    height: 16px;
  }

  html:not(.start-screen-open) .hud-life-count {
    font-size: 16px;
  }

  html:not(.start-screen-open) .hud-life-track {
    gap: 1px;
  }

  html:not(.start-screen-open) .hud-life-pip {
    width: 8px;
    height: 8px;
  }

  html:not(.start-screen-open) .hud-life-bonus {
    display: none;
  }

  html:not(.start-screen-open) .metric-mission,
  html:not(.start-screen-open) .arcade-collection-hud {
    height: 21px;
    min-height: 21px;
  }

  html:not(.start-screen-open) .hud-actions {
    width: 90px;
    height: 48px;
    min-height: 48px;
    grid-template-columns: repeat(2, 42px);
    grid-template-rows: 42px;
  }

  html:not(.start-screen-open) .hud-actions .icon-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}

@media (max-width: 360px) and (orientation: portrait) {
  html:not(.start-screen-open) .hud {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  html:not(.start-screen-open) .hud-actions {
    width: 86px;
    grid-template-columns: repeat(2, 40px);
  }

  html:not(.start-screen-open) .hud-actions .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  html:not(.start-screen-open) .hud-life-main-icon {
    width: 14px;
    height: 14px;
  }

  html:not(.start-screen-open) .hud-life-count {
    font-size: 15px;
  }

  html:not(.start-screen-open) .hud-life-pip {
    width: 7px;
    height: 7px;
  }
}
