/* Shared progress component: fixed glass track, theme-controlled level colors. */
.game-progress {
  display: block;
  margin-top: 9px;
  padding-inline: 2px;
  contain: layout paint style;
}

.game-progress-track {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 20px;
  padding: 3px 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(8, 12, 20, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 6px 18px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(10px) saturate(135%);
  -webkit-backdrop-filter: blur(10px) saturate(135%);
  isolation: isolate;
}

.game-progress-track::before,
.game-progress-track::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

.game-progress-track::before {
  inset: 1px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.game-progress-track::after {
  inset: 0;
  z-index: 3;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 46%);
  opacity: 0.72;
}

.game-progress-fill {
  position: absolute;
  inset: 3px auto 3px 3px;
  z-index: 1;
  width: var(--game-progress, 0%);
  min-width: 0;
  max-width: calc(100% - 6px);
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--rtpx-progress-low, #1d4ed8) 0%,
    var(--rtpx-progress-stable, #2eafff) 52%,
    var(--rtpx-progress-medium, #3b82f6) 76%,
    var(--rtpx-progress-high, #60a5fa) 100%
  );
  background-size: var(--game-progress-bg-size, 100%) 100%;
  background-position: left center;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 0 14px rgba(46, 175, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 0 14px color-mix(in srgb, var(--rtpx-progress-stable, #2eafff) 28%, transparent);
  transition: width 720ms cubic-bezier(0.22, 0.72, 0.22, 1);
}

.game-progress-fill::before,
.game-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.game-progress-fill::before {
  background: repeating-linear-gradient(
    126deg,
    rgba(255, 255, 255, 0.18) 0 4px,
    rgba(255, 255, 255, 0) 4px 10px
  );
  opacity: 0.24;
}

.game-progress-fill::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 52%);
  opacity: 0.62;
}

.game-progress-value {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 14px;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 14, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.58);
}

@media (max-width: 820px), (pointer: coarse) {
  .game-progress-track {
    min-height: 18px;
    padding: 2px 3px;
    backdrop-filter: blur(7px) saturate(125%);
    -webkit-backdrop-filter: blur(7px) saturate(125%);
  }

  .game-progress-fill {
    inset: 2px auto 2px 2px;
    max-width: calc(100% - 4px);
  }

  .game-progress-value {
    min-width: 32px;
    padding-inline: 5px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-progress-fill {
    transition: none;
  }
}
