/* HUD da corrida: painel único de acumulado, encostado no topo da pista e centralizado. */
.mr-demo .mr-demo__hud {
  top: 0;
  justify-content: center;
}

.mr-demo .mr-demo__earnings-panel {
  --hud-gold-1: #fff6b0;
  --hud-gold-2: #ffd43b;
  --hud-gold-3: #f59f0b;
  --hud-cyan: #7fe3ff;
  position: relative;
  box-sizing: border-box;
  width: clamp(230px, 54cqw, 320px);
  flex: none;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 13px;
  overflow: hidden;
  border: 1px solid #9fe9ff8c;
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background:
    radial-gradient(120% 90% at 50% -20%, #1ec2ff47, transparent 60%),
    radial-gradient(80% 70% at 50% 60%, #ffd43b1f, transparent 70%),
    linear-gradient(160deg, #0a3d66e6, #04203ceb 55%, #021428f0);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    inset 0 1px 0 #e6faff80,
    inset 0 -10px 24px #00101e7a,
    0 0 0 1px #00b7ff2e,
    0 12px 30px #000c1acc,
    0 0 34px #12b6ff40;
  text-align: center;
  transition: border-color .35s ease, box-shadow .35s ease;
}

/* Reflexo diagonal sutil no vidro. */
.mr-demo .mr-demo__earnings-panel::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, #ffffff1f 0%, #ffffff00 38%);
  content: "";
  pointer-events: none;
}

.mr-demo .mr-demo__earnings-panel > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border: 1px solid #7fe3ff52;
  border-radius: 999px;
  background: #021a31b3;
  color: #d4f4ff;
  font-size: clamp(10px, 2.3cqw, 12px);
  font-weight: 800;
  letter-spacing: 1.6px;
  line-height: 1.4;
  text-shadow: 0 0 8px #40c8ff70;
}

.mr-demo .mr-demo__earnings-panel > span::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hud-gold-2);
  box-shadow: 0 0 0 3px #ffd43b2e, 0 0 10px #ffd43bd9;
  content: "";
  animation: mr-hud-live 1.6s ease-in-out infinite;
}

.mr-demo .mr-demo__earnings-panel > strong {
  position: relative;
  display: block;
  margin: 6px -6px 9px;
  background: linear-gradient(180deg, var(--hud-gold-1) 8%, var(--hud-gold-2) 52%, var(--hud-gold-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(28px, 7.4cqw, 44px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 1px 0 #7a5410) drop-shadow(0 0 14px #ffd43b73);
  overflow-wrap: anywhere;
}

/* Barra de progresso até a meta. */
.mr-demo .mr-hud-meter {
  position: relative;
  height: 9px;
  margin: 0 2px 10px;
  overflow: hidden;
  border: 1px solid #7fe3ff3d;
  border-radius: 999px;
  background: linear-gradient(180deg, #011224, #03223f);
  box-shadow: inset 0 1px 3px #000a16b3;
}

.mr-demo .mr-hud-meter > i {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 9px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb703, #ffd43b 55%, #fff3a3);
  box-shadow: 0 0 10px #ffd43b99;
  transition: width .35s cubic-bezier(.22, 1, .36, 1);
}

/* Brilho que percorre a barra. */
.mr-demo .mr-hud-meter > i::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, #ffffffb3 50%, transparent 80%);
  background-size: 200% 100%;
  content: "";
  animation: mr-hud-shine 2.2s linear infinite;
}

.mr-demo .mr-hud-meter > em {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 0 4px;
  border-radius: 999px;
  background: #021428d9;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  line-height: 9px;
  font-variant-numeric: tabular-nums;
}

.mr-demo .mr-demo__earnings-panel > small {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid #7fe3ff33;
  border-radius: 11px;
  background: #021a3199;
  color: #a5e7ff;
  font-size: clamp(11px, 2.5cqw, 13px);
  line-height: 1.1;
}

.mr-demo .mr-demo__earnings-panel > small > span {
  color: #8fdcff;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.mr-demo .mr-demo__earnings-panel > small > b {
  color: #fff;
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Meta atingida: verde-dourado pulsando. */
.mr-demo .mr-demo__earnings-panel--goal {
  border-color: #8dffb3b3;
  animation: mr-hud-goal 1.8s ease-in-out infinite;
}

.mr-demo .mr-demo__earnings-panel--goal > span {
  border-color: #8dffb380;
  color: #d9ffe6;
  text-shadow: 0 0 8px #3dff8a80;
}

.mr-demo .mr-demo__earnings-panel--goal > span::before {
  background: #4dff95;
  box-shadow: 0 0 0 3px #4dff952e, 0 0 10px #4dff95d9;
}

.mr-demo .mr-demo__earnings-panel--goal .mr-hud-meter > i {
  background: linear-gradient(90deg, #22c55e, #4dff95 55%, #d9ffe6);
  box-shadow: 0 0 12px #4dff95a6;
}

@keyframes mr-hud-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.8); }
}

@keyframes mr-hud-shine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes mr-hud-goal {
  0%, 100% {
    box-shadow: inset 0 1px 0 #e6faff80, inset 0 -10px 24px #00101e7a, 0 0 0 1px #4dff9540, 0 12px 30px #000c1acc, 0 0 26px #4dff9540;
  }
  50% {
    box-shadow: inset 0 1px 0 #e6faff80, inset 0 -10px 24px #00101e7a, 0 0 0 2px #4dff9570, 0 12px 30px #000c1acc, 0 0 44px #4dff9580;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mr-demo .mr-demo__earnings-panel > span::before,
  .mr-demo .mr-hud-meter > i::after,
  .mr-demo .mr-demo__earnings-panel--goal {
    animation: none;
  }
}

@media (max-width: 420px) {
  .mr-demo .mr-demo__earnings-panel {
    width: min(300px, calc(100cqw - 24px));
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 11px;
  }
}

@media (max-width: 360px), (max-height: 600px) {
  .mr-demo .mr-demo__earnings-panel {
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 9px;
    border-radius: 0 0 16px 16px;
  }

  .mr-demo .mr-demo__earnings-panel > strong {
    margin: 4px -4px 7px;
    font-size: clamp(24px, 7cqw, 34px);
  }

  .mr-demo .mr-hud-meter {
    height: 8px;
    margin-bottom: 7px;
  }

  .mr-demo .mr-demo__earnings-panel > small {
    padding: 6px 9px;
    font-size: 11px;
  }
}
