:root {
  color-scheme: dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #030305;
  color: #888888;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #030305;
}

button,
input,
output {
  font: inherit;
}

button,
input {
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  color: #888888;
}

button {
  padding: 10px 12px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #cc2222;
  color: #cccccc;
}

button:disabled {
  color: #222222;
  cursor: not-allowed;
}

input {
  min-width: 340px;
  padding: 10px 12px;
}

a {
  color: #888888;
}

.app {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.site-header,
.module-head,
.status-row,
.mint-controls,
.price-line,
.burn-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-header {
  border-bottom: 1px solid #1a1a20;
  padding-bottom: 14px;
}

.wallet-wrap {
  position: relative;
}

.wallet-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: grid;
  gap: 6px;
  min-width: 210px;
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  padding: 8px;
}

.wallet-menu button {
  width: 100%;
  text-align: left;
}

.wallet-menu-note,
.wallet-menu a {
  color: #444444;
  font-size: 12px;
  padding: 6px 4px;
}

.wallet-menu a {
  color: #888888;
}

.wallet-menu[hidden] {
  display: none;
}

h1,
h2,
p {
  margin: 0;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  color: #cccccc;
  font-size: clamp(34px, 8vw, 72px);
  line-height: 1;
}

h2,
summary {
  color: #888888;
  font-size: 16px;
}

.hero {
  padding: 48px 0 30px;
  text-align: center;
}

.hero-canvases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 0 auto 20px;
}

.hero-card {
  opacity: 1;
  transition: opacity 420ms ease;
}

.hero-card.fading {
  opacity: 0.16;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 172 / 374;
  background: #030305;
}

.hero p {
  color: #444444;
}

.module {
  border-top: 1px solid #1a1a20;
  padding: 22px 0;
}

.module-head {
  margin-bottom: 14px;
}

.countdown {
  color: #cccccc;
  font-size: clamp(24px, 6vw, 46px);
  margin-bottom: 16px;
}

.mint-open {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
}

.mint-controls {
  justify-content: flex-start;
}

.mint-controls output {
  min-width: 34px;
  text-align: center;
  color: #cccccc;
}

.price-line {
  justify-content: flex-start;
  color: #444444;
  flex-wrap: wrap;
}

.free-mint-status {
  color: #1a8c3a;
  font-size: 12px;
  min-width: 120px;
}

#mintButton {
  border-color: #1a8c3a;
}

.mint-closed {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #cc2222;
}

.minted-reveal,
.feed,
.owned-grid,
.legend-grid {
  display: grid;
  gap: 12px;
}

.minted-reveal {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  margin-top: 16px;
}

.reveal-card {
  border: 1px solid #1a8c3a;
  background: #0a0a0e;
  padding: 8px;
  animation: reveal 520ms ease;
}

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

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

.feed-card {
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.feed-card.burn {
  border-color: #cc2222;
  padding: 14px;
}

.feed-head,
.token-meta,
.feed-meta,
.stat-grid {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #444444;
  font-size: 12px;
}

.feed-art {
  display: grid;
  grid-template-columns: 96px 20px 96px 20px 112px;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.feed-art.mint-art {
  grid-template-columns: 96px 1fr;
}

.feed-art canvas {
  max-height: 206px;
  object-fit: contain;
}

.feed-arrow {
  color: #cc2222;
  text-align: center;
  font-size: 14px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.how-card {
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  padding: 14px;
}

.how-card h3 {
  margin: 0 0 10px;
  color: #cc2222;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.how-card p {
  color: #444444;
  font-size: 12px;
  line-height: 1.55;
}

.burn-state {
  color: #444444;
  margin-bottom: 12px;
}

.burn-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.owned-grid {
  max-height: 620px;
  overflow: auto;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
}

.token-card {
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  padding: 8px;
  text-align: left;
}

.token-card.selected-a {
  border-color: #cc2222;
}

.token-card.selected-b {
  border-color: #1a8c3a;
}

.token-card canvas {
  max-height: 220px;
  object-fit: contain;
}

.badge {
  color: #cccccc;
}

.burn-preview {
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  min-height: 300px;
  padding: 14px;
}

.preview-title {
  color: #cc2222;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.preview-title span:last-child {
  color: #444444;
}

.preview-stack {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(120px, 0.85fr) minmax(170px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.preview-panel {
  min-width: 0;
  border: 1px solid #1a1a20;
  background: #030305;
  padding: 10px;
}

.preview-panel.projected {
  border-color: #cc2222;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #888888;
  font-size: 12px;
  margin-bottom: 8px;
}

.preview-head span:last-child {
  color: #cccccc;
}

.preview-panel canvas {
  width: min(100%, 180px);
  max-height: 338px;
  object-fit: contain;
  margin: 0 auto;
}

.preview-panel.projected canvas {
  width: min(100%, 220px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-top: 10px;
  color: #444444;
  font-size: 11px;
}

.stat-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid #1a1a20;
  padding-top: 4px;
}

.stat-grid b,
.stat-grid em {
  font-style: normal;
  font-weight: 400;
}

.stat-grid b {
  color: #444444;
}

.stat-grid em {
  color: #888888;
  text-align: right;
}

.burn-actions {
  justify-content: flex-start;
  margin-top: 14px;
  color: #444444;
}

#burnButton {
  border-color: #cc2222;
}

details summary {
  cursor: pointer;
}

.legend-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-top: 18px;
  gap: 14px;
}

.legend-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid #1a1a20;
  background: #0a0a0e;
  padding: 12px;
}

.legend-sample {
  display: grid;
  place-items: center;
  border-right: 1px solid #1a1a20;
  padding-right: 12px;
}

.legend-item canvas {
  width: 80px;
  height: 122px;
  aspect-ratio: auto;
}

.legend-item strong {
  display: block;
  color: #cccccc;
  font-weight: 400;
  margin-bottom: 8px;
}

.legend-copy span {
  display: block;
  color: #888888;
  line-height: 1.45;
}

.status-row {
  position: sticky;
  bottom: 0;
  border-top: 1px solid #1a1a20;
  background: #030305;
  padding: 10px 0;
  color: #444444;
  font-size: 12px;
}

.error {
  color: #cc2222;
}

.empty-text {
  color: #222222;
  border: 1px dashed #1a1a20;
  padding: 18px;
}

@media (max-width: 820px) {
  .app {
    width: min(100% - 20px, 720px);
  }

  .site-header {
    align-items: flex-end;
  }

  .mint-open,
  .how-grid,
  .burn-layout,
  .preview-stack {
    grid-template-columns: 1fr;
    display: grid;
  }

  input {
    min-width: 0;
    width: 100%;
  }

  .hero-canvases {
    grid-template-columns: 1fr;
    max-width: 220px;
  }

  .hero-card:nth-child(n + 2) {
    display: none;
  }

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

  .feed-art,
  .feed-art.mint-art {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .feed-art canvas {
    width: min(100%, 150px);
  }

  .feed-arrow {
    text-align: left;
  }

  .preview-panel canvas,
  .preview-panel.projected canvas {
    width: min(100%, 190px);
  }
}