* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  cursor: default;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:
    radial-gradient(600px 300px at 10% 8%, rgba(92, 66, 255, 0.06), transparent 8%),
    radial-gradient(500px 240px at 88% 92%, rgba(95, 213, 255, 0.04), transparent 6%),
    linear-gradient(180deg, var(--m-bg-1), var(--m-bg-2));
  color: #e6eef8;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

header nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  justify-content: space-between;
}

header nav .left-block {
  display: flex;
}

.vk-paly.main-logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--m-accent-1);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(124, 255, 203, 0.04), rgba(90, 161, 255, 0.03));
  box-shadow: 0 6px 18px rgba(12, 18, 40, 0.4);
}

header nav a {
  color: var(--m-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .18s;
}

header nav a:hover {
  color: #fff;
  transform: translateY(-2px);
}

main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ========== Карточка прогресса ========== */
.marathon-card {
  background: var(--m-card-bg);
  border-radius: var(--m-radius);
  padding: 18px;
  box-shadow: var(--m-shadow);
  backdrop-filter: blur(6px) saturate(120%);
  overflow: visible;
  position: relative;
  margin-bottom: 20px;
}

/* декоративный заголовок */
.marathon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.marathon-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.marathon-title h1 {
  font-size: 16px;
  margin: 0;
  color: #fff;
  letter-spacing: 0.2px;
}

.marathon-sub {
  font-size: 13px;
  color: var(--m-muted);
  margin-top: 2px;
}

/* кнопки */
.marathon-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--m-accent-1);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all .18s;
  box-shadow: 0 4px 14px rgba(12, 18, 40, 0.35);
}

.btn.primary {
  background: linear-gradient(90deg, var(--m-accent-1), var(--m-accent-2));
  color: #061223;
  border: 0;
  transform: translateZ(0);
  position: relative;
  padding-left: 32px;

  &::before {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 0;
    top: 50%;
    transform: translate(5px, -50%);
    background-image: url(../../assets/img/coin.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }
}

.btn.stream {
  position: relative;

  &::before {
    content: "";
    width: 24px;
    height: 24px;
    background-color: #80109f;
  }
}

body[data-stream-online="false"] {
  .btn.stream {
    position: relative;

    &::before {
      background-color: #8e8e8e;
      mask: url(../../assets/img/live.step-nAllowed.svg) center / cover no-repeat;
    }

    &:hover {
      transform: translateY(0);
      cursor: not-allowed;
    }
  }
}

body[data-stream-online="true"] {
  .btn {
    &.stream {
      position: relative;

      &::before {
        content: "";
        background-color: #8811b3;

        -webkit-mask-position: center;
        mask-position: center;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: cover;
        mask-size: cover;

        -webkit-mask-image: url("../../assets/img/live.step-static.svg");
        mask-image: url("../../assets/img/live.step-static.svg");

        animation: live-animate 2s steps(1) infinite;
      }
    }
  }
}

@keyframes live-animate {
  0% {
    -webkit-mask-image: url("../../assets/img/live.step-static.svg");
    mask-image: url("../../assets/img/live.step-static.svg");
  }

  15% {
    -webkit-mask-image: url("../../assets/img/live.step-middle.svg");
    mask-image: url("../../assets/img/live.step-middle.svg");
  }

  30% {
    -webkit-mask-image: url("../../assets/img/live.step-final.svg");
    mask-image: url("../../assets/img/live.step-final.svg");
  }

  85% {
    -webkit-mask-image: url("../../assets/img/live.step-middle.svg");
    mask-image: url("../../assets/img/live.step-middle.svg");
  }

  100% {
    -webkit-mask-image: url("../../assets/img/live.step-static.svg");
    mask-image: url("../../assets/img/live.step-static.svg");
  }
}

.btn:hover {
  transform: translateY(-3px);
}

/* прогресс бар */
.marathon-track {
  background: rgba(255, 255, 255, 0.04);
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.marathon-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(124, 255, 203, 0.12), rgba(90, 161, 255, 0.16));
  position: relative;
  transition: width 900ms cubic-bezier(.2, .9, .2, 1);
  box-shadow: inset 0 0 28px rgba(124, 255, 203, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

/* анимированные диагональные полоски внутри заполнения */
.marathon-fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.03) 10%, rgba(0, 0, 0, 0.02) 10%);
  background-size: 24px 24px;
  opacity: 0.6;
  transform: translateX(0);
  animation: stripes 2.4s linear infinite;
  mix-blend-mode: overlay;
}

@keyframes stripes {
  from {
    transform: translateX(0)
  }

  to {
    transform: translateX(24px)
  }
}

.marathon-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

.marathon-numbers {
  display: flex;
  gap: 12px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.marathon-numbers .current {
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}

.marathon-numbers .goal {
  color: var(--m-muted);
  font-size: 13px;
}

.marathon-percent {
  font-weight: 800;
  font-size: 14px;
  background: linear-gradient(90deg, var(--m-neon), var(--m-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* прогресс плашка поверх */
.marathon-fill-badge {
  position: absolute;
  left: calc(var(--pos, 0%) - 30px);
  top: 26px;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .18s;
}

.marathon-fill-badge.visible {
  opacity: 1;
}

.marathon-fill-badge .bubble {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.marathon-fill-badge .mini {
  font-size: 11px;
  color: var(--m-muted);
}

/* конфетти/поздравление */
.celebrate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity .22s;
}

.celebrate.show {
  opacity: 1;
  pointer-events: none;
}

.celebrate .banner {
  background: linear-gradient(90deg, #FFEE99, #FFB3C6);
  color: #091028;
  padding: 16px 22px;
  border-radius: 16px;
  font-weight: 800;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.5);
  transform: translateY(-8px);
  animation: floatUp 900ms ease;
}

@keyframes floatUp {
  from {
    transform: translateY(0)
  }

  to {
    transform: translateY(-8px)
  }
}

/* Маршрут-список/месяцы */
.month {
  margin-top: 18px;
  margin-bottom: 18px;
  color: var(--m-muted);
  font-size: 14px;

  & span {
    position: relative;

    &::after {
      content: attr(data-month-sum);
      font-weight: 700;
    }
  }
}

.list-day {
  margin: 12px 0;
  padding: 0px 12px 12px 12px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  min-width: 200px;
  width: 100%;
  max-width: 300px;

  & h3 {
    position: relative;

    &::before {
      content: attr(data-day);
      margin-right: 5px;
    }

    &::after {
      content: attr(data-day-sum);
    }
  }
}

.list-day li {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  padding: 8px 10px 8px 10px;
  border-radius: 10px;
  color: #dff6ee;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 6px 18px rgba(3, 8, 20, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.02);
  position: relative;

  &::after {
    content: attr(data-plus);
    font-weight: 700;
  }
}

/* ========== Модальное окно (legal) ========== */
.list-law {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.96);
  min-width: 280px;
  max-width: 92vw;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.95), rgba(6, 8, 14, 0.95));
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.7);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, transform 260ms ease, visibility 260ms;
  list-style: none;
  color: #dbe9ff;
}

.list-law li {
  padding: 8px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--m-muted);
}

.list-law.marathon-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

body.marathon-modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 14, 26, 0.55), rgba(3, 5, 10, 0.85));
  z-index: 1100;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: 0;
  color: var(--m-muted);
  font-weight: 700;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.list-law .legal-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* кнопка владельца */
.list-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #111827, rgba(255, 255, 255, 0.02));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Footer */
footer section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
  color: var(--m-muted);
}

/* адаптив */
@media (max-width:740px) {
  .marathon-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .marathon-actions {
    width: 100%;
    justify-content: space-between;
  }

  .marathon-fill-badge {
    display: none;
  }
}