:root {
  color-scheme: dark;
  --pointer-x: 50%;
  --pointer-y: 34%;
  --bg: #07130b;
  --surface: #0d1b11;
  --surface-2: #122718;
  --paper: #f4fff5;
  --muted: #b6c8b9;
  --green: #00c805;
  --green-2: #57f287;
  --purple: #8b4cf6;
  --red: #ff4d5a;
  --border: rgba(244, 255, 245, 0.16);
  --shadow: rgba(0, 0, 0, 0.36);
  --glass: rgba(6, 13, 9, 0.72);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at var(--pointer-x) var(--pointer-y), rgba(0, 200, 5, 0.16), transparent 24rem),
    radial-gradient(circle at 78% 14%, rgba(139, 76, 246, 0.22), transparent 30rem),
    linear-gradient(145deg, #050906 0%, #0a140d 34%, #210039 72%, #5b0872 100%);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(rgba(244, 255, 245, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 255, 245, 0.022) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 255, 245, 0.045), transparent 36rem),
    linear-gradient(180deg, rgba(7, 19, 11, 0.1), rgba(7, 19, 11, 0.82));
}

#effectCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mascot-confetti {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mascot-confetti img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: calc(var(--s) * 1.45);
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 12%;
  opacity: 0.18;
  filter: saturate(1.12) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.48));
  transform: translate(-50%, -50%) rotate(var(--r));
}

button,
input {
  font: inherit;
}

button,
a,
input {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--green-2);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--bg);
  background: var(--green);
  font-weight: 900;
  letter-spacing: 0;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0.75rem auto 0;
  border: 1px solid rgba(244, 255, 245, 0.12);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: rgba(5, 9, 6, 0.68);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.75rem;
}

.brand-lockup img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 20%;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 1.08rem;
  line-height: 1;
}

.brand-lockup small {
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 0.85rem;
  color: rgba(244, 255, 245, 0.72);
  font-size: 0.9rem;
  font-weight: 700;
}

.nav-actions a:hover {
  color: var(--paper);
  background: rgba(244, 255, 245, 0.08);
}

.hero-band,
.mission-band,
.ruler-band,
.tweet-band,
.game-band {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.74fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 3rem 0 4.5rem;
}

.hero-copy {
  min-width: 0;
  max-width: 44rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

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

h1 {
  max-width: 100%;
  margin-bottom: 1.1rem;
  font-size: clamp(3.4rem, 7.1vw, 5.65rem);
  line-height: 0.88;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-lede {
  max-width: 39rem;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.hero-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.hero-stat-row span {
  border: 1px solid rgba(87, 242, 135, 0.24);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  background: rgba(0, 200, 5, 0.085);
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.contract-box {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr) auto;
  align-items: center;
  min-height: 48px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(244, 255, 245, 0.06);
  overflow: hidden;
}

.contract-box span {
  padding: 0 0.8rem;
  color: var(--green-2);
  font-size: 0.76rem;
  font-weight: 950;
}

.contract-box code {
  min-width: 0;
  color: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 46px;
  min-height: 46px;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 1rem;
  background: rgba(244, 255, 245, 0.065);
  color: var(--paper);
  font-weight: 900;
  transition: transform 150ms ease-out, background-color 100ms ease-out;
}

.primary-link {
  border-color: transparent;
  background: var(--green);
  color: var(--bg);
}

@media (hover: hover) {
  .action-link:hover {
    transform: translateY(-1px);
    background: rgba(244, 255, 245, 0.14);
  }

  .primary-link:hover {
    background: var(--green-2);
  }
}

.wallet-form {
  width: min(100%, 43rem);
  margin-top: 1.35rem;
  padding: 1.15rem;
  border: 1px solid rgba(87, 242, 135, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 255, 245, 0.05), transparent),
    var(--glass);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.wallet-form label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.input-row input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 1rem;
  background: rgba(244, 255, 245, 0.08);
  color: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.input-row input::placeholder {
  color: rgba(244, 255, 245, 0.52);
}

.input-row button,
.share-actions button,
.error-state button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.1rem;
  transition: transform 150ms ease-out, background-color 100ms ease-out;
}

@media (hover: hover) {
  .input-row button:hover,
  .share-actions button:hover,
  .error-state button:hover {
    transform: translateY(-1px);
    background: var(--green-2);
  }
}

.button-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.helper,
.field-error,
.warning-note {
  min-height: 1.1rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.field-error,
.warning-note:not(:empty) {
  color: #ffb8be;
}

.mascot-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 25rem;
  overflow: hidden;
  border: 1px solid rgba(244, 255, 245, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 22%, rgba(87, 242, 135, 0.14), transparent 18rem),
    linear-gradient(160deg, rgba(21, 0, 45, 0.78), rgba(120, 0, 150, 0.38)),
    rgba(244, 255, 245, 0.04);
  transform-style: preserve-3d;
}

.mascot-stage > img {
  position: relative;
  z-index: 1;
  width: min(78%, 21rem);
  max-height: 25rem;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.55));
  transform: translateZ(24px) rotate(-2deg);
}

.mascot-stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(0, 200, 5, 0.18) 28px 31px, transparent 31px 44px),
    linear-gradient(120deg, transparent 0%, rgba(244, 255, 245, 0.12) 48%, transparent 56%);
  opacity: 0.35;
  transform: rotate(-14deg);
}

.mascot-stage::after {
  content: "ONCHAIN RULER";
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  border: 1px solid rgba(244, 255, 245, 0.18);
  border-radius: 8px;
  padding: 0.42rem 0.6rem;
  background: rgba(7, 19, 11, 0.72);
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 950;
}

.ticker-strip {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.ticker-strip span {
  border: 1px solid rgba(244, 255, 245, 0.18);
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
  background: rgba(7, 19, 11, 0.76);
  color: var(--green-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.mission-band,
.ruler-band,
.tweet-band {
  display: grid;
  grid-template-columns: minmax(0, 0.56fr) minmax(17rem, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: 4.5rem 0;
  border-top: 1px solid rgba(244, 255, 245, 0.1);
}

.mission-copy {
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  line-height: 1.55;
}

.mission-copy p:last-child {
  margin-bottom: 0;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.rank-grid article {
  min-height: 9rem;
  border: 1px solid rgba(244, 255, 245, 0.12);
  border-radius: 8px;
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(244, 255, 245, 0.055), rgba(244, 255, 245, 0.025)),
    rgba(7, 19, 11, 0.48);
}

.rank-grid h3 {
  margin: 0.85rem 0 0.5rem;
  font-size: 1rem;
}

.rank-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.rank-dot {
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
}

.rank-dot.red {
  background: var(--red);
}

.rank-dot.purple {
  background: var(--purple);
}

.rank-dot.green {
  background: var(--green);
}

.rank-dot.gold {
  background: #ffcf5c;
}

.section-heading h2,
.result-panel h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 3.45vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

.section-heading,
.mission-copy {
  min-width: 0;
}

.section-subcopy {
  max-width: 25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.tweet-stack {
  display: grid;
  gap: 0.75rem;
}

.ozzy-shot {
  margin: 0;
  border: 1px solid rgba(244, 255, 245, 0.11);
  border-radius: 8px;
  padding: 0.55rem;
  background:
    linear-gradient(180deg, rgba(244, 255, 245, 0.075), rgba(244, 255, 245, 0.025)),
    rgba(4, 6, 5, 0.58);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.ozzy-shot > a {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(244, 255, 245, 0.14);
  border-radius: 8px;
  background: #000;
}

.ozzy-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.ozzy-shot figcaption {
  margin-top: 0.85rem;
}

.tweet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0;
  border: 1px solid rgba(244, 255, 245, 0.2);
  border-radius: 8px;
  padding: 0 1rem;
  background: rgba(0, 200, 5, 0.1);
  color: var(--green-2);
  font-weight: 900;
}

.tweet-link:hover {
  background: rgba(244, 255, 245, 0.14);
}

.game-band {
  padding: 4rem 0 5rem;
}

.result-panel {
  min-height: 26rem;
  border: 1px solid rgba(87, 242, 135, 0.18);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(180deg, rgba(244, 255, 245, 0.05), rgba(244, 255, 245, 0.02)),
    rgba(8, 17, 11, 0.88);
}

.hidden {
  display: none !important;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  place-items: center;
  min-height: 22rem;
  text-align: center;
}

.empty-state img {
  width: 88px;
  height: 132px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
}

.empty-state p,
.loading-state p,
.error-state p,
#resultLine {
  max-width: 39rem;
  color: var(--muted);
  line-height: 1.5;
}

.skeleton {
  width: min(100%, 36rem);
  height: 1.25rem;
  margin-bottom: 0.8rem;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(244, 255, 245, 0.08), rgba(244, 255, 245, 0.18), rgba(244, 255, 245, 0.08));
  background-size: 200% 100%;
}

.skeleton.wide {
  height: 3rem;
}

.skeleton.short {
  width: min(100%, 22rem);
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.size-readout {
  min-width: 12rem;
  border: 1px solid rgba(0, 200, 5, 0.38);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(0, 200, 5, 0.1);
  text-align: right;
}

.size-readout strong,
.size-readout span {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.size-readout strong {
  color: var(--green-2);
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 0.95;
}

.size-readout span {
  color: var(--muted);
  font-weight: 800;
}

.pnl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.8rem 0;
}

.pnl-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(244, 255, 245, 0.055);
}

.pnl-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pnl-grid dd {
  margin: 0.35rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.positive {
  color: var(--green-2);
}

.negative {
  color: #ff9aa3;
}

.receipt-preview {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #07130b;
}

.receipt-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2rem);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  border-radius: 0;
  background: rgba(2, 5, 3, 0.78);
  cursor: default;
}

.receipt-dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  border: 1px solid rgba(244, 255, 245, 0.22);
  border-radius: 8px;
  padding: clamp(0.85rem, 2vw, 1.15rem);
  background:
    linear-gradient(160deg, rgba(7, 19, 11, 0.98), rgba(30, 0, 64, 0.98)),
    var(--surface);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.58);
}

.receipt-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.receipt-dialog-header .eyebrow {
  margin-bottom: 0.25rem;
}

.receipt-dialog-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1;
}

.close-button {
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  background: rgba(244, 255, 245, 0.08);
  color: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
}

.receipt-dialog .receipt-preview img {
  max-height: min(66vh, 620px);
  object-fit: contain;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.share-actions .secondary-button {
  border: 1px solid var(--border);
  color: var(--paper);
  background: rgba(244, 255, 245, 0.08);
}

@media (prefers-reduced-motion: no-preference) {
  .mascot-stage > img {
    animation: floaty 4s ease-in-out infinite;
  }

  .mascot-confetti img {
    animation: stickerFloat 5.5s ease-in-out infinite;
    animation-delay: var(--d);
  }

  .skeleton {
    animation: shimmer 1.2s ease-in-out infinite;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes stickerFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(var(--r));
  }
  50% {
    transform: translate(-50%, calc(-50% - 9px)) rotate(calc(var(--r) + 3deg));
  }
}

@media (max-width: 820px) {
  .hero-band,
  .mission-band,
  .ruler-band,
  .tweet-band,
  .score-layout {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: auto;
    padding-top: 1.25rem;
  }

  .mascot-stage {
    min-height: 23rem;
  }

  .score-layout,
  .size-readout {
    text-align: left;
  }

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

@media (max-width: 560px) {
  .topbar,
  .hero-band,
  .mission-band,
  .ruler-band,
  .tweet-band,
  .game-band {
    width: auto;
    margin-right: 1rem;
    margin-left: 1rem;
  }

  .topbar {
    align-items: flex-start;
  }

  .nav-actions {
    display: none;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row button,
  .share-actions button,
  .share-actions a,
  .action-link {
    width: 100%;
  }

  .ticker-strip,
  .pnl-grid,
  .rank-grid {
    grid-template-columns: 1fr;
  }

  .contract-box {
    width: 100%;
  }

  h1 {
    font-size: clamp(2.45rem, 11.4vw, 2.65rem);
    line-height: 0.93;
  }

  .hero-lede {
    max-width: calc(100vw - 2rem);
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  .hero-copy,
  .eyebrow {
    max-width: calc(100vw - 2rem);
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .mascot-stage {
    min-height: 20rem;
  }

  .mascot-stage > img {
    width: min(82%, 17rem);
    max-height: 21rem;
  }

  .mascot-stage::after {
    top: 0.75rem;
    right: auto;
    left: 0.75rem;
    font-size: 0.66rem;
  }

  .mascot-confetti img {
    opacity: 0.13;
  }

  .receipt-modal {
    align-items: start;
  }

  .receipt-dialog {
    max-height: calc(100vh - 1.5rem);
  }
}
