:root {
  color-scheme: dark;
  --bg: #11111f;
  --panel: #1f1e31;
  --panel-2: #242339;
  --panel-3: #313049;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: #aaa7cf;
  --green: #00d981;
  --green-dark: #004b2f;
  --purple: #7b6cff;
  --shadow: rgba(0, 0, 0, 0.42);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button {
  font: inherit;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 217, 129, 0.16), transparent 21%),
    radial-gradient(circle at 84% 5%, rgba(123, 108, 255, 0.17), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 38%),
    #121120;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 64px 0 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.2)),
    radial-gradient(circle at 50% 38%, rgba(0, 217, 129, 0.08), transparent 34%);
}

.nav {
  height: 64px;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #151426;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.08em;
  color: #fff;
  font-size: 20px;
  font-style: italic;
}

.logo strong::first-letter {
  color: var(--green);
}

.logo-mark {
  width: 22px;
  height: 22px;
  border: 4px solid var(--green);
  border-right-color: transparent;
  border-radius: 7px;
  position: relative;
}

.logo-mark::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 4px;
  left: -6px;
  top: 5px;
  border-radius: 99px;
  background: var(--green);
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--muted);
  font-weight: 700;
}

.nav nav span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav nav .active {
  color: #fff;
}

.nav b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #061b13;
  background: var(--green);
  font-size: 11px;
}

.wallet {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wallet span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #1b1a2d;
  font-weight: 800;
}

.wallet .profile {
  width: 38px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: #5d38c9;
}

.content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 22px 0 80px;
}

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.filters button {
  min-width: 156px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  color: var(--green);
  background: rgba(0, 217, 129, 0.14);
  font-weight: 800;
}

.filters span {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border-radius: 6px;
  background: var(--green);
  vertical-align: middle;
}

.offer-title {
  position: absolute;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  text-align: center;
}

.offer-title h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.offer-title p {
  margin: 0;
  color: #e8e7fb;
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}

.offer-card {
  min-height: 334px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #171626;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.art {
  position: relative;
  height: 206px;
  background-size: cover;
  background-position: center;
}

.art::before,
.art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.art::before {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.64)),
    radial-gradient(circle at 72% 32%, rgba(255, 255, 255, 0.28), transparent 15%);
}

.art::after {
  right: 16px;
  top: 16px;
  width: 86px;
  height: 30px;
  border-radius: 999px;
  background: rgba(8, 8, 18, 0.54);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.forest .art {
  background:
    radial-gradient(circle at 48% 50%, #ffc878 0 7%, transparent 8%),
    radial-gradient(ellipse at 52% 68%, #97592f 0 22%, transparent 23%),
    linear-gradient(55deg, transparent 0 42%, rgba(255, 225, 119, 0.28) 43% 46%, transparent 47%),
    repeating-linear-gradient(112deg, rgba(96, 55, 26, 0.55) 0 9px, transparent 9px 64px),
    linear-gradient(135deg, #153e44, #275d39 46%, #0a1826);
}

.valley .art {
  background:
    radial-gradient(circle at 50% 28%, #ffe9a8 0 13%, transparent 14%),
    radial-gradient(ellipse at 38% 76%, #79bd56 0 26%, transparent 27%),
    radial-gradient(ellipse at 72% 76%, #ab754b 0 23%, transparent 24%),
    linear-gradient(135deg, #86d8fb, #b1d56d 50%, #a26443);
}

.farm .art {
  background:
    radial-gradient(circle at 72% 30%, #ffffff 0 8%, transparent 9%),
    repeating-linear-gradient(22deg, rgba(255, 222, 57, 0.9) 0 13px, rgba(238, 175, 24, 0.9) 13px 25px, transparent 25px 42px),
    radial-gradient(ellipse at 48% 82%, #74b85a 0 28%, transparent 29%),
    linear-gradient(135deg, #86cff6, #7cc067 52%, #ad6330);
}

.card-body {
  padding: 0 12px 16px;
}

.card-body h2 {
  margin: -34px 0 14px;
  font-size: 17px;
  position: relative;
  z-index: 1;
}

.card-body button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  color: #04160f;
  background: var(--green);
  font-weight: 900;
}

.card-body p {
  margin: 16px 0 0;
  color: #f3f2ff;
  text-align: center;
  font-weight: 800;
}

.chat {
  position: fixed;
  right: 26px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 10px 28px rgba(0, 217, 129, 0.24);
}

.chat::before {
  content: "";
  position: absolute;
  inset: 13px 11px 15px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
}

.survey-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 5, 13, 0.48);
  backdrop-filter: blur(8px) saturate(1.08);
}

.survey-modal {
  width: min(536px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px var(--shadow), 0 0 0 1px rgba(0, 217, 129, 0.035);
  animation: modalIn 260ms ease-out both;
}

.modal-head {
  padding: 28px 16px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
}

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.modal-head p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
}

.modal-progress {
  height: 6px;
  border-radius: 99px;
  background: #62617f;
  overflow: hidden;
}

.modal-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #9f9cc8;
  transition: width 220ms ease;
}

.question-panel {
  padding: 26px 16px 24px;
  border-top: 1px solid var(--line);
}

.question-panel h3 {
  margin: 0 0 28px;
  text-align: center;
  font-size: 16px;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel);
  text-align: left;
  font-size: 16px;
}

.answer:not(.selected):hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: #25243a;
}

.answer i {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid #aaa7cf;
  border-radius: 50%;
}

.answer.selected {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  color: #fff;
}

.answer.selected i {
  border: 6px solid var(--green);
}

.skip {
  display: block;
  margin: 26px auto 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 16px;
}

.skip:hover {
  color: #fff;
}

.reward-note {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  margin: 0 14px 0;
  padding: 18px 20px;
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 25%, rgba(0, 217, 129, 0.16), transparent 22%),
    linear-gradient(135deg, #00462d, #005838);
  overflow: hidden;
}

.reward-note p {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.reward-note strong {
  display: block;
  color: #ccecdf;
  font-weight: 500;
}

.sparkles {
  position: relative;
  width: 70px;
  height: 74px;
}

.sparkles span {
  position: absolute;
  width: 28px;
  height: 28px;
  opacity: 0;
  animation: sparkleFloat 2.4s ease-in-out infinite;
}

.sparkles span::before,
.sparkles span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #0df29b;
  transform: translate(-50%, -50%);
}

.sparkles span::after {
  width: 8px;
  height: 100%;
}

.sparkles span:nth-child(1) {
  left: 10px;
  top: 2px;
  width: 34px;
  height: 34px;
}

.sparkles span:nth-child(2) {
  left: 42px;
  top: 18px;
  width: 18px;
  height: 18px;
  animation-delay: 0.3s;
}

.sparkles span:nth-child(3) {
  left: 8px;
  top: 52px;
  width: 14px;
  height: 14px;
  animation-delay: 0.65s;
}

.sparkles span:nth-child(4) {
  left: 26px;
  top: 42px;
  width: 30px;
  height: 30px;
  animation-delay: 1s;
}

.next {
  width: calc(100% - 28px);
  min-height: 48px;
  margin: 10px 14px 22px;
  border: 0;
  border-radius: 7px;
  color: #04160f;
  background: var(--green);
  box-shadow: 0 5px 0 #00b96e;
  font-weight: 900;
}

.next:disabled {
  color: rgba(255, 255, 255, 0.22);
  background: var(--panel-3);
  box-shadow: none;
}

.next:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 0 #00b96e;
}

.next.download-ready {
  color: rgba(255, 255, 255, 0.45);
  background: var(--panel-3);
}

.final-card {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid rgba(0, 217, 129, 0.35);
  border-radius: 12px;
  background: rgba(0, 217, 129, 0.08);
  text-align: center;
}

.final-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.final-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .nav {
    grid-template-columns: 1fr;
    height: auto;
    padding: 18px;
  }

  .nav nav,
  .wallet {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .offer-title {
    position: static;
    transform: none;
    margin-bottom: 16px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .filters {
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .filters button {
    min-width: 128px;
  }

  .survey-overlay {
    align-items: center;
    justify-items: center;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .survey-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 14px;
  }

  .modal-head {
    padding: 16px 12px 12px;
  }

  .modal-head h2 {
    font-size: 17px;
  }

  .modal-head p {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .question-panel {
    padding: 14px 10px 10px;
  }

  .question-panel h3 {
    margin-bottom: 14px;
    font-size: 15px;
  }

  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .answer {
    min-height: 50px;
    gap: 8px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.15;
  }

  .answer i {
    width: 16px;
    height: 16px;
  }

  .answer.selected i {
    border-width: 5px;
  }

  .skip {
    margin-top: 12px;
    font-size: 13px;
  }

  .reward-note {
    grid-template-columns: 54px 1fr;
    gap: 12px;
    min-height: 64px;
    margin: 0 10px;
    padding: 10px 14px;
    text-align: left;
  }

  .reward-note p {
    font-size: 13px;
    line-height: 1.25;
  }

  .sparkles {
    width: 46px;
    height: 44px;
  }

  .sparkles span:nth-child(2) {
    left: 30px;
  }

  .next {
    position: sticky;
    bottom: 8px;
    z-index: 2;
    width: calc(100% - 20px);
    min-height: 44px;
    margin: 8px 10px 12px;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sparkleFloat {
  0%,
  100% {
    opacity: 0.2;
    transform: translateY(5px) scale(0.78) rotate(0deg);
  }
  38% {
    opacity: 1;
    transform: translateY(-3px) scale(1) rotate(45deg);
  }
  70% {
    opacity: 0.55;
    transform: translateY(0) scale(0.86) rotate(90deg);
  }
}
