:root {
  --ink: #08141c;
  --foam: #f4efe4;
  --paper: #fffaf1;
  --teal: #1aa6b8;
  --teal-2: #0e7c8a;
  --mint: #7de2c3;
  --gold: #e4b44c;
  --alert: #e25b4c;
  --line: rgba(8, 20, 28, 0.12);
  --shadow: 0 24px 60px rgba(8, 20, 28, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Outfit, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(26, 166, 184, 0.22), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(228, 180, 76, 0.16), transparent 50%),
    linear-gradient(180deg, #d7eef2 0%, var(--foam) 38%, #efe7d6 100%);
  min-height: 100vh;
}
a { color: inherit; }
button, input { font: inherit; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 8px;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.04em; }
.mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal);
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.12);
}
.nav-links { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.nav-links a { text-decoration: none; opacity: 0.72; }
.nav-links a:hover { opacity: 1; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.big {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #1fc0d4, var(--teal-2));
  color: #062026;
  box-shadow: 0 10px 0 #0a5560;
}
.btn.big:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 8px 0 #0a5560; }
.btn.big[disabled] {
  background: #d5dde0;
  color: #66767c;
  box-shadow: none;
  opacity: 1;
}
.btn.warn { background: var(--alert); color: #fff; }
.btn.tiny { padding: 8px 10px; font-size: 12px; border-radius: 10px; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 18px;
}
h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.92;
  margin: 0 0 16px;
}
.lede { font-size: 18px; max-width: 46ch; opacity: 0.82; margin: 0 0 22px; }

.mint-card, .card {
  background: var(--paper);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.7);
}
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty b { min-width: 24px; text-align: center; font-size: 22px; }
.muted { opacity: 0.62; font-size: 13px; }
.status {
  margin-top: 12px;
  min-height: 1.3em;
  font-size: 13px;
  color: var(--teal-2);
}

.art-stack { position: relative; height: 520px; }
.art-stack img {
  position: absolute;
  width: 58%;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: #fff;
  object-fit: cover;
  aspect-ratio: 1;
}
.art-stack img:nth-child(1) { left: 6%; top: 18%; transform: rotate(-9deg); z-index: 1; }
.art-stack img:nth-child(2) { right: 4%; top: 0; transform: rotate(8deg); width: 62%; z-index: 2; }
.art-stack img:nth-child(3) { left: 18%; bottom: 8%; transform: rotate(3deg); width: 64%; z-index: 3; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 36px;
}
.stat {
  background: rgba(255,250,241,.7);
  border-radius: 18px;
  padding: 14px 16px;
}
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; opacity: 0.65; }

.section { padding: 10px 0 46px; }
h2 { font-family: Fraunces, Georgia, serif; font-size: 36px; margin: 0 0 8px; }
.grid-3, .grid-2 { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1.2fr 0.8fr; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.odds { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.odds i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.nft img, .ph {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: #e9f4f6;
}
.ph { display: grid; place-items: center; font-size: 42px; }
.nft { padding: 12px; }
.nft .meta { display: flex; justify-content: space-between; margin: 8px 0; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #d9f3f6;
  font-size: 11px;
  font-weight: 700;
}
.pill.rare { background: #dce8ff; }
.pill.epic { background: #ead9ff; }
.pill.legendary { background: #ffe6b0; }
.pill.one { background: #ffd0c8; }

.swap label { display: block; }
.swap input {
  width: 100%;
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.bag-tools {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.bag-actions {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.bag-tools input {
  width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
#bag-status { margin: 4px 0 0; min-height: 1.2em; }
.swap .btn { width: 100%; }
.tab {
  display: flex;
  width: max-content;
  background: #efe7d6;
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 10px;
}
.tab button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.tab button.on { background: var(--ink); color: #fff; }

footer {
  padding: 28px 0 60px;
  font-size: 13px;
  opacity: 0.75;
}
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; word-break: break-all; }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 14px;
  max-width: min(420px, calc(100% - 24px));
  z-index: 20;
  display: none;
}
.toast.show { display: block; }

@media (max-width: 900px) {
  .hero, .grid-3, .grid-2, .stats { grid-template-columns: 1fr; }
  .art-stack { height: 360px; margin-top: 10px; }
  .nav-links { display: none; }
}
