:root {
  color-scheme: dark;
  --bg: #071018;
  --surface: #101b26;
  --surface-2: #142231;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f2f8ff;
  --muted: #91a6b8;
  --blue: #35a8ff;
  --green: #35df9b;
  --gold: #ffd166;
  --pink: #ff6fae;
  --purple: #9c7cff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.is-busy button {
  pointer-events: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

p,
small,
.rules span {
  color: var(--muted);
  line-height: 1.45;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: 64px 1fr 74px;
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(53, 168, 255, 0.24), transparent 30%),
    radial-gradient(circle at 92% 16%, rgba(53, 223, 155, 0.16), transparent 28%),
    linear-gradient(180deg, #071018 0%, #0b121b 100%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
}

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

.logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #ff8f70);
  color: #111;
  font-weight: 950;
}

.identity strong,
.identity small {
  display: block;
}

.identity small {
  font-size: 12px;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 20px;
}

.app-view {
  display: none;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px 18px;
}

.app-view.active {
  display: block;
}

.home-hero,
.claim-card,
.machine,
.season-card,
.invite-card,
.quest-peek,
.asset-panel,
.balance-row article,
.quick-action,
.mission-list article,
.shop-stack article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 27, 38, 0.88);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.2);
}

.home-hero,
.claim-card {
  display: grid;
  gap: 16px;
  min-height: 430px;
  padding: 20px;
  align-content: space-between;
  background:
    linear-gradient(145deg, rgba(53, 168, 255, 0.18), transparent 44%),
    linear-gradient(325deg, rgba(255, 209, 102, 0.14), transparent 40%),
    rgba(16, 27, 38, 0.9);
}

.home-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.season-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
}

.reactor-wrap {
  position: relative;
  display: grid;
  min-height: 178px;
  place-items: center;
}

.reactor-halo {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.halo-one {
  width: 178px;
  height: 178px;
  animation: spin 12s linear infinite;
}

.halo-two {
  width: 118px;
  height: 118px;
  border-color: rgba(53, 223, 155, 0.28);
  animation: spin 8s linear infinite reverse;
}

.reactor-core {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 34px;
  background:
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.58), transparent 22%),
    linear-gradient(145deg, #35a8ff, #35df9b 58%, #ffd166);
  color: #071018;
  box-shadow: 0 30px 90px rgba(53, 168, 255, 0.34);
}

.reactor-core span {
  font-size: 32px;
  font-weight: 950;
}

.hero-copy h1 {
  margin-bottom: 7px;
}

.level-line,
.pity-box {
  display: grid;
  gap: 8px;
  text-align: left;
}

.level-line > div:first-child,
.pity-box > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.level-line span,
.pity-box strong {
  font-weight: 950;
}

.thin-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.thin-track > div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
  transition: width 260ms ease;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.primary,
.secondary,
.mini-btn {
  border-radius: 12px;
  font-weight: 900;
}

.primary {
  min-height: 50px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #061119;
}

.pulse {
  animation: pulse 2.2s ease-in-out infinite;
}

.secondary {
  min-height: 50px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.big-cta {
  width: 100%;
}

.balance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.balance-row article {
  min-width: 0;
  padding: 13px 11px;
}

.balance-row span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.balance-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.season-card,
.invite-card,
.collection-card,
.asset-panel {
  margin-top: 10px;
  padding: 14px;
}

.quest-peek {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
}

.quest-peek span,
.quest-peek strong {
  display: block;
}

.quest-peek span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.quest-peek strong {
  font-size: 18px;
}

.home-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.home-stack article,
.collection-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 27, 38, 0.88);
}

.home-stack article {
  min-height: 118px;
  padding: 14px;
}

.home-stack span,
.home-stack small {
  display: block;
}

.home-stack span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.home-stack strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.card-title,
.asset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title span,
.asset-header > span {
  flex: none;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--pink));
  transition: width 240ms ease;
}

.milestones {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.quick-action {
  min-height: 92px;
  padding: 14px;
  text-align: left;
  transition: transform 160ms ease;
}

.quick-action:active,
.reactor-core:active,
.primary:active,
.secondary:active,
.mini-btn:active {
  transform: scale(0.98);
}

.draw-core:active {
  transform: rotate(4deg) scale(0.98);
}

.quick-action span,
.quick-action small {
  display: block;
}

.quick-action span {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 950;
}

.machine {
  min-height: 410px;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(53, 168, 255, 0.24), transparent 32%),
    rgba(16, 27, 38, 0.9);
}

.machine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.machine-top strong {
  color: var(--text);
}

.draw-stage {
  position: relative;
  display: grid;
  min-height: 282px;
  place-items: center;
}

.ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.ring-a {
  width: 210px;
  height: 210px;
  animation: spin 12s linear infinite;
}

.ring-b {
  width: 146px;
  height: 146px;
  border-color: rgba(53, 223, 155, 0.28);
  animation: spin 8s linear infinite reverse;
}

.draw-core {
  position: relative;
  display: grid;
  width: 148px;
  height: 196px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, #1b90ff, #1ed6a5 54%, #ffd166);
  color: #071018;
  box-shadow: 0 28px 80px rgba(35, 166, 255, 0.3);
  transform: rotate(4deg);
}

.draw-core span {
  font-size: 30px;
  font-weight: 950;
}

.draw-core.shake {
  animation: shake 480ms ease;
}

.rarity-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pity-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.rarity-strip span {
  min-height: 42px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.action-stack,
.shop-stack,
.mission-list,
.rank-list,
.rules {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.action-button {
  display: grid;
  gap: 4px;
  place-items: center;
}

.shop-stack article {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
}

.shop-stack strong,
.shop-stack small {
  display: block;
}

.mini-btn {
  min-width: 70px;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.08);
}

.mission-list article {
  display: grid;
  grid-template-columns: 42px 1fr 76px;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 12px;
}

.mission-list #missionList {
  display: grid;
  gap: 10px;
}

.mission-list article.complete {
  border-color: rgba(53, 223, 155, 0.3);
  background: rgba(53, 223, 155, 0.08);
}

.mission-claim {
  min-height: 38px;
  border-radius: 10px;
  background: rgba(53, 223, 155, 0.15);
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.mission-claim:disabled {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  cursor: default;
}

.mission-list article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(53, 223, 155, 0.12);
  color: var(--green);
  font-weight: 950;
}

.invite-card {
  display: grid;
  gap: 12px;
}

.invite-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.invite-progress span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.invite-progress span.done {
  border-color: rgba(53, 223, 155, 0.48);
  background: rgba(53, 223, 155, 0.12);
  color: var(--green);
}

.asset-header {
  margin-bottom: 12px;
}

.collection-card {
  margin-bottom: 10px;
}

.rarity-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.rarity-counts span {
  padding: 7px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.segment-btn {
  min-height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

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

.nft-card {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.34), transparent 18%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.045)),
    var(--card-color, #35a8ff);
}

.nft-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
}

.rarity {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  font-weight: 950;
}

.nft-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 160px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.nft-body strong {
  font-size: 20px;
  line-height: 1.1;
}

.nft-body footer,
.nft-body small {
  color: rgba(255, 255, 255, 0.82);
}

.nft-body footer {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.empty {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.rank-item,
.rules article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.rank-item {
  grid-template-columns: 36px 1fr auto;
  align-items: center;
}

.hidden {
  display: none !important;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.94);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  min-height: 54px;
  place-items: center;
  gap: 2px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.nav-item span {
  font-size: 19px;
}

.nav-item small {
  font-size: 11px;
}

.nav-item.active {
  background: rgba(53, 168, 255, 0.13);
  color: var(--text);
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 9, 14, 0.72);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  width: min(100%, 360px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #101b26;
}

.modal-card .nft-card {
  margin-bottom: 14px;
}

.result-impact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 14px;
}

.result-impact span {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted);
  font-size: 13px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 22px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 86px;
  left: 16px;
  z-index: 30;
  display: none;
  max-width: 488px;
  margin: 0 auto;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 17, 24, 0.96);
  color: var(--text);
}

.toast.show {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  20% {
    transform: rotate(-6deg) scale(1.02);
  }
  45% {
    transform: rotate(7deg) scale(1.04);
  }
  70% {
    transform: rotate(-2deg) scale(1.01);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(53, 223, 155, 0.28);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(53, 223, 155, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(53, 223, 155, 0);
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 27px;
  }

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

  .rarity-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-stack,
  .rarity-counts {
    grid-template-columns: 1fr 1fr;
  }

  .mission-list article {
    grid-template-columns: 38px 1fr;
  }

  .mission-claim {
    grid-column: 2;
  }
}
