body, canvas, #canvas {
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-webkit-text-size-adjust: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
ter, #ter {
font-size: 25px
}
:root {
  /* фиксированные размеры */
  --w: 230px;
  --h: 35px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: #111;
}

/* центрируем блок и фиксируем ширину */
.loader-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--w);
  transform: translate(-50%, -50%);
  pointer-events: none; /* чтобы клики не блокировала */
}

/* рамка/контейнер */
.bar {
  position: relative;
  width: 100%;
  height: var(--h);
  border-radius: 8px;
  background: #1b1b1b;
  padding: 4px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06),
    inset 0 0 18px rgba(0,0,0,.65);
  overflow: hidden;
}

/* зелёная заливка */
#fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(180deg, #96e76a 0%, #5bb81c 70%);
  box-shadow:
    inset 0 8px 12px rgba(255,255,255,.18),
    inset 0 -10px 12px rgba(0,0,0,.30),
    0 2px 10px rgba(79,210,42,.35);
  transition: width .2s ease;
  animation: trewev-pulse 2.2s ease-in-out infinite;
}

/* проценты по центру */
#pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(0,0,0,.8);
  pointer-events: none;
}

/* бегущий диагональный блик */
#fill::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -160px;
  width: 140px;
  transform: skewX(-20deg);
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.42) 50%,
    rgba(255,255,255,0) 100%
  );
  mix-blend-mode: screen;
  animation: trewev-shine 1.6s linear infinite;
  pointer-events: none;
}

/* анимации */
@keyframes trewev-shine {
  from { left: -160px; }
  to { left: calc(100% + 160px); }
}

@keyframes trewev-pulse {
  0% {
    box-shadow: inset 0 8px 12px rgba(255,255,255,.18),
                inset 0 -10px 12px rgba(0,0,0,.30),
                0 2px 8px rgba(79,210,42,.30);
  }
  50% {
    box-shadow: inset 0 8px 12px rgba(255,255,255,.22),
                inset 0 -10px 12px rgba(0,0,0,.34),
                0 2px 16px rgba(79,210,42,.70);
  }
  100% {
    box-shadow: inset 0 8px 12px rgba(255,255,255,.18),
                inset 0 -10px 12px rgba(0,0,0,.30),
                0 2px 8px rgba(79,210,42,.30);
  }
}

/* отключаем эффекты при завершении */
.bar.complete #fill { animation: none; }
.bar.complete #fill::after { display: none; }

/* для слабых устройств */
@media (prefers-reduced-motion: reduce) {
  #fill { animation: none; }
  #fill::after { animation: none; }
}

