:root {
  --bg: #050508;
  --bg-elevated: #101018;
  --accent: #ff0033;
  --accent-soft: rgba(255, 0, 51, 0.12);
  --accent-strong: rgba(255, 0, 51, 0.35);
  --text-main: #f7f7f8;
  --text-muted: #8b8c96;
  --border-subtle: #262635;
  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.85);
  --transition-fast: 160ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #181826 0, var(--bg) 56%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeInPage 0.6s ease-out both;
}

/* NAVBAR */

.nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: 1120px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 14px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 0, #ff4b6a 0, var(--accent) 40%, #7f001e 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(255, 0, 51, 0.55);
  animation: pulseLogo 2.4s ease-in-out infinite;
}

.logo-mark svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.nav-title-main {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-main);
}

.nav-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-strong);
  background: rgba(255, 0, 51, 0.06);
  font-size: 11px;
}

/* MAIN LAYOUT */

.main {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding: 20px;
}

.main-inner {
  margin: 0 auto;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: stretch; /* make columns same height */
  animation: floatUp 0.7s ease-out 0.05s both;
}

/* make hero and side fill the grid row height */
.hero,
.side {
  height: 100%;
}

@media (max-width: 900px) {
  .main-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 8px;
  }

  .hero,
  .side {
    height: auto;
  }
}

/* HERO */

.hero {
  text-align: center;
  padding: 34px 26px 30px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 10% -20%, rgba(255,0,51,0.45) 0, transparent 48%),
    radial-gradient(circle at 90% 120%, rgba(85,0,255,0.45) 0, transparent 55%),
    rgba(11, 11, 18, 0.96);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  animation: heroBreath 6s ease-in-out infinite;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(5, 5, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #05ff9a 0, #00884d 55%, transparent 100%);
  box-shadow: 0 0 10px rgba(5,255,154,0.8);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-title span {
  color: var(--accent);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 480px;
  margin: 0 auto 26px;
  line-height: 1.5;
}

.hero-button-wrap {
  margin-bottom: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 42px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ff0033, #ff4b6a, #ff7b9a);
  background-size: 220% 220%;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 18px 38px rgba(255, 0, 51, 0.55);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    opacity var(--transition-fast);
  animation: gradientShift 7s ease-in-out infinite;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(255, 0, 51, 0.7);
  filter: brightness(1.02);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 22px rgba(255, 0, 51, 0.55);
}

.btn-primary-icon {
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.btn-primary--small {
  padding: 10px 22px;
  font-size: 13px;
  box-shadow: none;
  animation: none;
}

.hero-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.hero-status--connected {
  color: #05ff9a;
}

.hero-divider {
  margin: 22px auto 18px;
  width: 56%;
  max-width: 280px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.hero-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.hero-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.hero-step-index {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SIDE PANEL */

.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: rgba(9, 9, 15, 0.9);
  border-radius: 24px;
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* QUESTS */

.quests-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .quests-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.quest {
  position: relative;
  padding: 12px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 0 0, rgba(255,0,51,0.18) 0, transparent 40%),
    rgba(6, 6, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.quest::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.04),
    transparent,
    rgba(255, 255, 255, 0.02)
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.quest:hover::before {
  opacity: 1;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quest-title {
  font-size: 13px;
  font-weight: 500;
}

.quest-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--accent);
  background: rgba(255, 0, 51, 0.06);
}

.quest-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.quest-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quest-reward {
  font-size: 12px;
  color: #f9f9fb;
}

.quest-reward span {
  color: var(--accent);
  font-weight: 600;
}

.btn-quest {
  position: relative;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  overflow: hidden;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.btn-quest:hover {
  transform: translateY(-0.5px);
}

/* Iridescent animation when wallet connected */
.wallet-connected .btn-quest {
  background: linear-gradient(120deg,
    rgba(255, 0, 51, 0.24),
    rgba(255, 120, 150, 0.26),
    rgba(255, 0, 51, 0.24)
  );
  background-size: 220% 220%;
  border-color: rgba(255, 0, 51, 0.65);
  box-shadow: 0 0 18px rgba(255, 0, 51, 0.3);
  animation: buttonGlow 3.6s ease-in-out infinite;
}

.wallet-connected .btn-quest::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.45),
    transparent,
    rgba(255, 255, 255, 0.18)
  );
  mix-blend-mode: screen;
  opacity: 0.0;
  animation: shimmer 3.6s linear infinite;
}

/* REWARDS SUMMARY */

.panel--summary {
  position: relative;
}

.summary-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.summary-stat {
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-stat--row {
  grid-column: 1 / -1;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.summary-value {
  font-size: 13px;
  font-weight: 500;
}

.summary-value span {
  color: var(--accent);
}

.summary-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

.summary-footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-footnote {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 220px;
}

@media (max-width: 720px) {
  .summary-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-stat--row {
    grid-column: auto;
  }

  .summary-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* REWARD OPTIONS */

.reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.reward-pill {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reward-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle, #ff0033 0, #89001e 60%);
}

.reward-dot.usdt {
  background: radial-gradient(circle, #26a17b 0, #0a6044 60%);
}

/* FOOTER */

.footer {
  max-width: 1120px;
  margin: 16px auto 24px;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.footer-text {
  max-width: 380px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links a {
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal--open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, 0.85);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  background: #11111a;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
  padding: 18px 18px 16px;
  max-width: 420px;
  width: calc(100% - 32px);
  z-index: 41;
  animation: floatUp 0.35s ease-out both;
}

.modal-header {
  margin-bottom: 10px;
}

.modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--accent);
  background: rgba(255, 0, 51, 0.08);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.modal-steps {
  margin: 10px 0 8px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-main);
}

.modal-steps li {
  margin-bottom: 6px;
}

.modal-reward {
  font-size: 12px;
  color: #f9f9fb;
}

.modal-reward span {
  color: var(--accent);
  font-weight: 600;
}

.modal-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  border: none;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* ANIMATIONS */

@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroBreath {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.85);
  }
  50% {
    transform: translateY(-3px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.7;
  }
}

@keyframes pulseLogo {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 22px rgba(255, 0, 51, 0.55);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.85);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes buttonGlow {
  0%,
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 18px rgba(255, 0, 51, 0.3);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 26px rgba(255, 75, 115, 0.45);
  }
}

@keyframes shimmer {
  0% {
    opacity: 0;
    transform: translateX(-80%);
  }
  20% {
    opacity: 0.8;
  }
  60% {
    opacity: 0;
  }
  100% {
    transform: translateX(80%);
  }
}

/* Respect reduced motion */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
