:root {
  --green: #b8ff00;
  --green-deep: #79c900;
  --ink: #101208;
  --clay: #d98942;
  --clay-dark: #8d4f25;
  --cream: #fff2d0;
  --panel: rgba(255, 236, 190, 0.76);
  --panel-strong: rgba(255, 247, 219, 0.92);
  --line: rgba(16, 18, 8, 0.16);
  --shadow: rgba(70, 62, 24, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", Arial, sans-serif;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.36) 0 9%, transparent 22%),
    radial-gradient(circle at 78% 8%, rgba(255, 255, 255, 0.22) 0 7%, transparent 24%),
    linear-gradient(135deg, #c9ff00 0%, var(--green) 43%, #a9f400 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(rgba(16, 18, 8, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-position: 0 0, 12px 10px;
  background-size: 28px 28px, 34px 34px;
  mix-blend-mode: multiply;
  opacity: 0.44;
}

button,
a {
  font: inherit;
}

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

.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
}

.brand,
.topbar-actions,
.hero-actions,
.panel-heading,
.burn-math {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.brand-mark {
  width: 34px;
  height: 30px;
  border-radius: 48% 52% 45% 55%;
  background: var(--clay);
  box-shadow:
    inset -5px -7px 0 rgba(92, 45, 19, 0.2),
    inset 5px 5px 0 rgba(255, 227, 157, 0.42),
    0 5px 0 var(--clay-dark);
  transform: rotate(-8deg);
}

.topbar-actions {
  gap: 12px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 700;
}

.wallet-button,
.primary-action,
.burn-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 7px 0 rgba(16, 18, 8, 0.34);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.wallet-button {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
}

.wallet-button:disabled {
  cursor: progress;
  opacity: 0.62;
  transform: none;
}

.network-badge-wrong {
  border-color: rgba(141, 29, 20, 0.55);
  background: rgba(141, 29, 20, 0.14);
  color: #8d1d14;
}

.wallet-button:not(:disabled):hover,
.primary-action:hover,
.burn-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 0 rgba(16, 18, 8, 0.28);
}

.wallet-button:focus-visible,
.primary-action:focus-visible,
.burn-button:focus-visible,
.refresh-nfts:focus-visible,
.nft-token:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 4px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 34px;
  align-items: center;
  min-height: 560px;
  padding: 36px 0 26px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: clamp(3.3rem, 8.2vw, 7.8rem);
  line-height: 0.88;
  font-weight: 400;
}

.hero-text {
  max-width: 620px;
  margin-bottom: 30px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
  font-weight: 600;
}

.hero-actions {
  gap: 14px;
  flex-wrap: wrap;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
}

.contract-pill,
.network-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 2px solid rgba(16, 18, 8, 0.18);
  border-radius: 999px;
  background: rgba(255, 242, 208, 0.54);
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.clay-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 480px;
  isolation: isolate;
  overflow: visible;
}

.clay-stage::before {
  position: absolute;
  bottom: 44px;
  width: min(82%, 390px);
  height: min(66%, 330px);
  content: "";
  border-radius: 48% 52% 43% 57%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 246, 202, 0.62), transparent 24%),
    linear-gradient(145deg, #f0b46b, #b86730 72%);
  box-shadow:
    inset -22px -25px 0 rgba(94, 45, 18, 0.16),
    inset 22px 22px 0 rgba(255, 239, 189, 0.28),
    0 28px 50px rgba(16, 18, 8, 0.22);
  transform: rotate(2deg);
  z-index: -2;
}

.slot-counter {
  position: absolute;
  top: 42px;
  right: 8px;
  z-index: 1;
  display: grid;
  gap: 2px;
  min-width: 158px;
  padding: 15px 18px;
  border: 2px solid rgba(16, 18, 8, 0.15);
  border-radius: 22px 18px 24px 16px;
  background: var(--panel-strong);
  box-shadow: 0 12px 0 rgba(94, 74, 33, 0.18);
  transform: rotate(3deg);
}

.slot-counter span {
  font-family: "Space Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
}

.slot-counter small {
  font-weight: 700;
}

.clay-stage img {
  width: min(88%, 440px);
  filter: drop-shadow(0 34px 24px rgba(69, 54, 17, 0.22));
  transform: translateY(18px) rotate(-3deg);
}

.clay-shadow {
  position: absolute;
  bottom: 70px;
  width: min(72%, 380px);
  height: 38px;
  border-radius: 999px;
  background: rgba(58, 46, 15, 0.18);
  filter: blur(10px);
  z-index: -1;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}

.clay-panel {
  border: 2px solid rgba(16, 18, 8, 0.18);
  border-radius: 24px 20px 28px 18px;
  background: var(--panel);
  box-shadow:
    inset 8px 8px 0 rgba(255, 255, 255, 0.28),
    inset -10px -12px 0 rgba(112, 74, 28, 0.12),
    0 18px 0 rgba(78, 67, 28, 0.14);
  backdrop-filter: blur(18px);
}

.burn-panel {
  padding: clamp(22px, 4vw, 34px);
}

.panel-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

h2 {
  margin-bottom: 0;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 400;
  line-height: 0.92;
}

.status-stack {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin-bottom: 24px;
  border: 2px solid rgba(16, 18, 8, 0.1);
  border-radius: 16px;
  background: rgba(255, 246, 220, 0.5);
}

.burn-confirm {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
  border: 3px solid rgba(141, 29, 20, 0.5);
  border-radius: 20px 16px 22px 14px;
  background: rgba(255, 240, 214, 0.94);
  box-shadow: 0 8px 0 rgba(141, 29, 20, 0.16);
}

.burn-confirm[hidden] {
  display: none;
}

.burn-confirm h3 {
  margin-bottom: 0;
  color: #8d1d14;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.05;
}

.burn-confirm p {
  margin-bottom: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

.burn-confirm code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(141, 29, 20, 0.12);
  font-family: "Space Mono", monospace;
  font-size: 0.85em;
}

.confirm-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirm-tokens li {
  padding: 6px 12px;
  border: 2px solid rgba(141, 29, 20, 0.28);
  border-radius: 999px;
  background: rgba(255, 250, 230, 0.9);
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.confirm-math strong {
  font-weight: 800;
}

.confirm-ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 250, 230, 0.72);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.confirm-ack input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  accent-color: #8d1d14;
  cursor: pointer;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-cancel {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid rgba(16, 18, 8, 0.2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 242, 208, 0.8);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.confirm-burn {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #8d1d14;
  box-shadow: 0 6px 0 rgba(141, 29, 20, 0.32);
}

.ghost-cancel:focus-visible,
.confirm-ack input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.burn-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.burn-connect {
  min-height: 48px;
  padding: 0 24px;
  font-size: 0.95rem;
}

.opensea-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid rgba(16, 18, 8, 0.16);
  border-radius: 999px;
  background: rgba(255, 242, 208, 0.72);
  box-shadow: 0 5px 0 rgba(91, 60, 23, 0.12);
  font-size: 0.88rem;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.opensea-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(91, 60, 23, 0.1);
}

.opensea-link:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.opensea-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.66), transparent 34%),
    linear-gradient(150deg, #2081e2, #1868b7);
}

.empty-nfts-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--cream);
  background: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.owned-nfts {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 16px;
  border: 2px solid rgba(16, 18, 8, 0.1);
  border-radius: 18px 16px 20px 14px;
  background: rgba(255, 246, 220, 0.42);
}

.owned-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.owned-heading h3 {
  margin-bottom: 3px;
  font-size: 1rem;
  line-height: 1.1;
}

.owned-heading p {
  margin-bottom: 0;
  color: rgba(16, 18, 8, 0.66);
  font-size: 0.9rem;
  font-weight: 650;
}

.refresh-nfts {
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid rgba(16, 18, 8, 0.18);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 242, 208, 0.72);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.refresh-nfts:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.nft-token,
.empty-nfts {
  min-height: 74px;
  border: 2px solid rgba(16, 18, 8, 0.14);
  border-radius: 18px 14px 20px 13px;
}

.nft-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  margin-bottom: 8px;
  border-radius: 14px 11px 15px 10px;
  background:
    linear-gradient(115deg, rgba(255, 250, 230, 0.35) 8%, rgba(255, 250, 230, 0.65) 18%, rgba(255, 250, 230, 0.35) 33%)
      0 0 / 300% 100%,
    rgba(92, 45, 19, 0.18);
  animation: thumb-shimmer 1.4s ease-in-out infinite;
}

.nft-thumb.is-loaded {
  background: rgba(92, 45, 19, 0.12);
  animation: none;
}

.nft-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
}

.nft-thumb.is-loaded img {
  opacity: 1;
}

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

@media (prefers-reduced-motion: reduce) {
  .nft-thumb {
    animation: none;
  }
}

.nft-token {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 239, 184, 0.7), transparent 30%),
    linear-gradient(145deg, #e5a15a, #c97335);
  box-shadow:
    inset -5px -7px 0 rgba(92, 45, 19, 0.15),
    0 5px 0 rgba(91, 60, 23, 0.16);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.nft-token:hover {
  transform: translateY(-2px);
  box-shadow:
    inset -5px -7px 0 rgba(92, 45, 19, 0.15),
    0 7px 0 rgba(91, 60, 23, 0.14);
}

.nft-token[aria-pressed="true"] {
  color: var(--cream);
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 239, 184, 0.22), transparent 30%),
    linear-gradient(145deg, #382012, #101208);
}

.nft-token strong {
  font-family: "Space Mono", monospace;
  font-size: 1rem;
}

.nft-token .nft-state {
  font-size: 0.74rem;
  font-weight: 800;
}

.empty-nfts {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  padding: 18px;
  color: rgba(16, 18, 8, 0.62);
  gap: 10px;
  background: rgba(255, 250, 230, 0.52);
  font-weight: 700;
  text-align: center;
}

.status-row,
.forge-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px dashed rgba(16, 18, 8, 0.18);
}

.status-row:last-child,
.forge-details div:last-child {
  border-bottom: 0;
}

.status-row span,
.forge-details span,
.token-input-label span,
.portal-note {
  color: rgba(16, 18, 8, 0.68);
}

.status-row strong,
.forge-details strong {
  font-family: "Space Mono", monospace;
  text-align: right;
}

.token-input-label {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-weight: 800;
}

.token-input-label span {
  font-size: 0.9rem;
  font-weight: 600;
}

.burn-math {
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 16px 0;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(16, 18, 8, 0.08);
  font-size: 0.92rem;
  font-weight: 800;
}

.burn-button {
  width: 100%;
  min-height: 58px;
  border-radius: 18px 16px 20px 14px;
  font-size: 1rem;
}

.burn-button:disabled {
  cursor: not-allowed;
  color: rgba(16, 18, 8, 0.45);
  background: rgba(16, 18, 8, 0.16);
  box-shadow: none;
}

.portal-note {
  min-height: 20px;
  margin: 18px 0 0;
  font-weight: 700;
}

.forge-panel {
  padding: clamp(22px, 3vw, 30px);
}

.forge-number {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.forge-number span {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: clamp(4.6rem, 8vw, 7rem);
  line-height: 0.84;
}

.forge-number small {
  font-family: "Space Mono", monospace;
  font-weight: 700;
}

.progress-shell {
  height: 20px;
  padding: 4px;
  margin-bottom: 22px;
  border: 2px solid rgba(16, 18, 8, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 230, 0.68);
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay-dark), var(--clay), #ffe69a);
  transition: width 300ms ease;
}

.forge-details {
  display: grid;
  overflow: hidden;
  border: 2px solid rgba(16, 18, 8, 0.1);
  border-radius: 16px;
  background: rgba(255, 246, 220, 0.5);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.steps article {
  min-height: 180px;
  padding: 22px;
  border: 2px solid rgba(16, 18, 8, 0.16);
  border-radius: 20px 16px 22px 14px;
  background: rgba(255, 242, 208, 0.58);
  box-shadow: 0 12px 0 rgba(78, 67, 28, 0.12);
}

.steps span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 45% 55% 50% 50%;
  color: var(--cream);
  background: var(--clay-dark);
  font-family: "Space Mono", monospace;
  font-weight: 700;
}

.steps h3 {
  margin-bottom: 10px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 400;
}

.steps p {
  margin-bottom: 0;
  color: rgba(16, 18, 8, 0.72);
  font-weight: 650;
  line-height: 1.45;
}

@media (max-width: 840px) {
  .page-shell {
    width: min(100% - 24px, 620px);
  }

  .topbar,
  .topbar-actions,
  .panel-heading {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .hero,
  .portal-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 32px;
  }

  .clay-stage {
    min-height: 390px;
  }

  .clay-stage::before {
    bottom: 36px;
    width: min(76%, 320px);
    height: 260px;
  }

  .slot-counter {
    top: 16px;
    right: 2px;
  }

  .burn-math {
    display: grid;
    min-height: auto;
    padding: 12px 14px;
  }
}

@media (max-width: 520px) {
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .nav-link {
    display: none;
  }

  .wallet-button {
    width: 100%;
  }

  .panel-heading {
    flex-direction: column;
  }

  .owned-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-nfts {
    width: 100%;
  }

  .status-row,
  .forge-details div {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 12px 14px;
  }

  .status-row strong,
  .forge-details strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
