.ax-challenge-fab,
.ax-challenge-modal,
.ax-challenge-modal * {
  box-sizing: border-box;
}

.ax-challenge-fab {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 2147482000;
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  margin: 0;
  padding: 7px 13px 7px 7px;
  border: 1px solid rgba(89, 210, 228, .52);
  border-radius: 17px;
  color: #d8f2f5;
  background: linear-gradient(145deg, #123f50, #0a2f3d);
  box-shadow: 0 10px 28px rgba(3, 37, 49, .28), inset 0 1px rgba(194, 241, 246, .16);
  font: 800 12px/1.05 Inter, system-ui, sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ax-challenge-fab.is-visible { display: flex; }
.ax-challenge-fab:active { transform: scale(.97); }

.ax-challenge-fab__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  color: #12333f;
  background: linear-gradient(145deg, #aaf865, #71d42b);
  box-shadow: 0 0 0 4px rgba(127, 226, 58, .12);
  font-size: 18px;
  font-weight: 950;
}

.ax-challenge-fab__mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(127, 226, 58, .42);
  border-radius: 16px;
  animation: axChallengePulse 2.2s ease-out infinite;
}

.ax-challenge-fab__copy { display: grid; gap: 4px; text-align: left; }
.ax-challenge-fab__copy small { color: #8fd5df; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.ax-challenge-fab__score { color: #98ec55; }

@keyframes axChallengePulse {
  0% { opacity: .75; transform: scale(.82); }
  72%, 100% { opacity: 0; transform: scale(1.28); }
}

.ax-challenge-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  place-items: end center;
  padding: 18px 14px max(14px, env(safe-area-inset-bottom));
  color: #163843;
  background: rgba(7, 40, 51, .58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: Inter, system-ui, sans-serif;
}

.ax-challenge-modal.is-open { display: grid; }

.ax-challenge-sheet {
  position: relative;
  width: min(100%, 470px);
  max-height: min(82dvh, 650px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(68, 142, 158, .32);
  border-radius: 29px;
  background:
    radial-gradient(circle at 90% 4%, rgba(132, 232, 57, .24), transparent 29%),
    linear-gradient(160deg, #d4ebef 0%, #afd4dc 100%);
  box-shadow: 0 28px 72px rgba(3, 34, 45, .42), inset 0 1px rgba(225, 250, 251, .72);
}

.ax-challenge-sheet__hero {
  position: relative;
  padding: 22px 22px 18px;
  overflow: hidden;
  border-radius: 28px 28px 21px 21px;
  color: #d8f2f5;
  background: linear-gradient(145deg, #164f61, #0a3544);
}

.ax-challenge-sheet__hero::after {
  content: "A";
  position: absolute;
  right: -6px;
  bottom: -44px;
  color: rgba(145, 226, 83, .10);
  font: 950 174px/1 Inter, system-ui, sans-serif;
  transform: rotate(-8deg);
}

.ax-challenge-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  color: #9be85b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.ax-challenge-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #86df3e;
  box-shadow: 0 0 0 5px rgba(134, 223, 62, .13);
}

.ax-challenge-title {
  position: relative;
  z-index: 1;
  max-width: 330px;
  margin: 0;
  font-size: clamp(28px, 7vw, 38px);
  line-height: .98;
  letter-spacing: -.055em;
}

.ax-challenge-lead {
  position: relative;
  z-index: 1;
  max-width: 345px;
  margin: 14px 0 0;
  color: #a9d2db;
  font-size: 13px;
  line-height: 1.55;
}

.ax-challenge-prize {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(151, 236, 83, .34);
  border-radius: 16px;
  background: rgba(8, 43, 54, .48);
}

.ax-challenge-prize small { display: block; color: #8fc4cf; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ax-challenge-prize strong { display: block; margin-top: 2px; color: #b0f477; font-size: 23px; letter-spacing: -.03em; }
.ax-challenge-prize__badge { color: #d4edf1; font-size: 11px; font-weight: 800; text-align: right; }

.ax-challenge-close {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(184, 231, 237, .2);
  border-radius: 13px;
  color: #b9dce2;
  background: rgba(5, 37, 47, .72);
  font: 500 24px/1 system-ui, sans-serif;
  cursor: pointer;
}

.ax-challenge-body { padding: 15px; }
.ax-challenge-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.ax-challenge-progress-head strong { color: #16485a; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.ax-challenge-progress-head span { color: #276678; font-size: 12px; font-weight: 900; }

.ax-challenge-missions { display: grid; gap: 9px; }
.ax-challenge-mission {
  display: grid;
  grid-template-columns: 41px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(54, 116, 130, .2);
  border-radius: 17px;
  background: rgba(208, 235, 239, .54);
}

.ax-challenge-mission.is-done {
  border-color: rgba(89, 176, 37, .42);
  background: linear-gradient(100deg, rgba(171, 231, 133, .42), rgba(203, 235, 235, .6));
}

.ax-challenge-mission__num {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 13px;
  color: #b9dfe5;
  background: #174f61;
  font-size: 13px;
  font-weight: 950;
}

.ax-challenge-mission.is-done .ax-challenge-mission__num { color: #143b45; background: #8be145; }
.ax-challenge-mission__copy { min-width: 0; }
.ax-challenge-mission__copy strong { display: block; color: #153e4a; font-size: 13px; }
.ax-challenge-mission__copy small { display: block; margin-top: 4px; color: #52747c; font-size: 10px; line-height: 1.35; }
.ax-challenge-mission__copy .ax-challenge-mission__winner { color: #286c31; font-weight: 750; }
.ax-challenge-mission__copy .ax-challenge-mission__winner b { color: #174b25; }
.ax-challenge-mission__state { color: #66838a; font-size: 9px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.ax-challenge-mission.is-done .ax-challenge-mission__state { color: #398b19; }

.ax-challenge-footer {
  margin-top: 13px;
  padding: 13px 14px;
  border-radius: 16px;
  color: #365e68;
  background: rgba(150, 196, 205, .34);
}
.ax-challenge-timer { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.ax-challenge-timer strong { color: #145064; }
.ax-challenge-rules { margin: 10px 0 0; padding-left: 17px; font-size: 9px; line-height: 1.55; }
.ax-challenge-rules li + li { margin-top: 3px; }

.ax-challenge-winner {
  margin-top: 13px;
  padding: 15px;
  border: 1px solid rgba(79, 169, 34, .34);
  border-radius: 16px;
  color: #234c2b;
  background: rgba(166, 228, 124, .42);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.ax-challenge-toast {
  position: fixed;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  z-index: 2147483600;
  display: none;
  width: min(calc(100% - 30px), 360px);
  padding: 12px 15px;
  border: 1px solid rgba(121, 224, 64, .42);
  border-radius: 15px;
  color: #d7f1f4;
  background: #103c4b;
  box-shadow: 0 14px 35px rgba(4, 37, 48, .35);
  transform: translateX(-50%);
  text-align: center;
  font: 800 12px/1.35 Inter, system-ui, sans-serif;
}
.ax-challenge-toast.is-visible { display: block; animation: axChallengeToast 3.2s both; }
@keyframes axChallengeToast { 0% { opacity: 0; transform: translate(-50%, 12px); } 10%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }

.ax-challenge-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(102, 181, 51, .38);
  border-radius: 12px;
  color: #1e5940;
  background: rgba(170, 229, 133, .38);
  font: 850 10px/1 Inter, system-ui, sans-serif;
}
.ax-challenge-profile-badge[hidden] { display: none; }
.ax-challenge-profile-badge span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  color: #143942;
  background: #8de24a;
  font-size: 13px;
  font-weight: 950;
}

@media (min-width: 720px) {
  .ax-challenge-modal { place-items: center; }
  .ax-challenge-fab { bottom: 22px; left: 22px; }
}

@media (max-width: 370px) {
  .ax-challenge-fab__copy small { display: none; }
  .ax-challenge-fab { padding-right: 10px; }
  .ax-challenge-sheet__hero { padding-inline: 19px; }
  .ax-challenge-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ax-challenge-fab__mark::after,
  .ax-challenge-toast.is-visible { animation: none; }
}
