/* Moze — Milady brown/cream */

:root {
  --brown: #5c1a2e;
  --brown-dark: #3d0f1e;
  --maroon: #800000;
  --cream: #fff8ee;
  --cream-mid: #f0e6d6;
  --tan: #f0d9c8;
  --tan-hover: #e0c0a8;
  --border: #777;
  --text: #000;
  --muted: #4b4b4b;
  /* Neon — same as section bar (.m_box_bar) */
  --neon: #C6E607;
  --neon-soft: #e8f78a;
  --neon-deep: #9bb505;
  --neon-glow: #d4ff2a;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font: 1.2em;
  font-family: "Hiragino Kaku Gothic Pro", Osaka, Meiryo, "MS PGothic", arial, helvetica, clean, sans-serif;
  margin: 0;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>"),
    linear-gradient(var(--cream-mid), var(--cream), var(--cream), white, white);
  background-attachment: fixed, fixed;
  color: var(--text);
  overflow-x: hidden;
  max-width: 100vw;
}

.banner-top {
  margin: 1em;
  text-align: center;
}

.banner-img {
  border: 2px solid gray;
  max-width: 500px;
  width: 100%;
  height: auto;
  padding: 0;
  transition: opacity 0.35s ease;
}

.page-wrap {
  max-width: 43em;
  margin: auto;
}

a {
  color: blue;
  text-decoration: underline;
}

a:hover {
  color: red;
}

img {
  display: block;
  margin: auto;
  max-width: 20em;
  border: 1px solid var(--border);
}

img:hover {
  border: 1px solid purple;
}

.hero-img {
  max-width: 16em;
  transition: opacity 0.25s ease;
}

.hero-gif {
  image-rendering: auto;
}

.inline-img {
  max-width: 14em;
}

/* Boxes */
.m_box {
  border: 1px solid var(--brown);
  margin: 1em;
  background-color: white;
}

.m_box_red {
  border: 1px solid var(--maroon);
  margin: 1em;
  background-color: #ffffee;
}

.m_box_bar {
  background: #C6E607;
  color: var(--brown-dark);
}

.m_box_bar_red {
  background: #C6E607;
  color: var(--brown-dark);
}

h2 {
  margin: 0.001em 0 0.001em 0.25em;
  font-size: 1.1em;
}

p {
  margin: 0.5em 1em;
  color: var(--text);
}

.centered-text { text-align: center; }
.intro { font-size: 1em; }
.links { font-size: 0.95em; }
.fine { font-size: 0.85em; color: var(--muted); }
.hero-caption { font-size: 0.9em; color: var(--muted); }

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0.8em 1em;
}

ul {
  list-style-type: circle;
  margin: 0.5em 1.5em;
}

li { margin: 0.3em 0; }

/* Trait Parallels */
.parallel-block {
  padding: 0.3em 1em 0.6em;
}

.parallel-title {
  margin: 0.5em 1em 0.4em !important;
}

.compare-wide {
  max-width: 100%;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  margin: 0.4em auto;
}

.compare-wide:hover {
  border: 1px solid purple;
}

.whitelist-img {
  display: block;
  max-width: 70%;
  height: auto;
  border: 1px solid var(--border);
  margin: 0.4em auto 1em;
}

/* Gallery */
.gallery-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  justify-content: center;
  align-items: center;
  margin: 0.5em 1em 0.25em;
}

.gallery-search input {
  flex: 1 1 12em;
  max-width: 16em;
  padding: 0.45em 0.65em;
  font-size: 0.9em;
  border: 1px solid var(--brown);
  font-family: inherit;
}

.gallery-search input:focus {
  outline: none;
  border-color: var(--neon-deep);
  box-shadow: 0 0 0 1px var(--neon);
}

.gallery-search-btn {
  font-size: 0.85em !important;
  padding: 0.45em 0.9em !important;
}

.gallery_container {
  display: grid;
  grid-template-columns: 33.33% 33.33% 33.33%;
  padding: 0.5em;
}

.gallery_item {
  text-align: center;
  cursor: pointer;
  padding: 0.3em;
}

.gallery_item img {
  border: 1px solid var(--border);
  max-width: 80%;
  height: auto;
  object-fit: cover;
}

.gallery_item:hover img { border: 1px solid purple; }

.gallery_item .desc {
  padding: 0.35em 0.2em 0.5em;
  font-size: smaller;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  line-height: 1.25;
}

.gallery_item .desc .nick {
  color: var(--brown-dark);
  font-weight: 700;
  font-size: 0.95em;
}

.gallery_item .desc .tok {
  color: var(--muted);
  font-size: 0.85em;
  opacity: 0.85;
}

/* Lightbox — art left, story right (centered as a pair) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5em;
  z-index: 1000;
  cursor: zoom-out;
  overflow: auto;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.25em;
  max-width: min(1040px, 94vw);
  width: auto;
  margin: auto;
  cursor: default;
}

.lightbox-art {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-art img,
.lightbox #lightbox-img {
  max-width: min(48vw, 520px);
  max-height: min(78vh, 640px);
  width: auto;
  height: auto;
  border: 2px solid var(--cream);
  display: block;
  margin: 0;
  object-fit: contain;
  cursor: default;
}

.lightbox-side {
  flex: 0 1 320px;
  width: min(320px, 36vw);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75em;
  max-height: min(78vh, 640px);
  overflow: hidden;
}

.lightbox-caption {
  color: var(--cream);
  font-size: 0.9em;
  text-align: left;
  margin: 0;
  line-height: 1.4;
  flex: 0 0 auto;
}

.lightbox-story {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85em 1em;
  background: rgba(255, 248, 238, 0.08);
  border: 1px solid rgba(198, 230, 7, 0.5);
  color: var(--cream);
  font-size: 0.88em;
  line-height: 1.5;
  text-align: left;
  cursor: default;
  scrollbar-width: thin;
}

.lightbox-story p {
  margin: 0 0 0.55em;
  color: inherit;
}

.lightbox-story p:last-child {
  margin-bottom: 0;
}

.lightbox-story .story-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neon);
  font-weight: 700;
  margin-bottom: 0.45em;
}

.lightbox-close {
  position: absolute;
  top: 0.75em;
  right: 1em;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 2em;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

@media (max-width: 720px) {
  .lightbox-panel {
    flex-direction: column;
    align-items: center;
  }

  .lightbox-art img,
  .lightbox #lightbox-img {
    max-width: min(92vw, 420px);
    max-height: 48vh;
  }

  .lightbox-side {
    max-width: min(92vw, 420px);
    max-height: 38vh;
  }
}

/* Trait Lab */
.trait-lab {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  padding: 0.8em;
}

.composer-wrap {
  text-align: center;
}

.composer-canvas {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--neon-deep);
  background: white;
  max-width: 18em;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--neon-soft);
}

.composer-canvas img,
.composer-canvas .composer-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  margin: 0;
  max-width: none;
  display: block;
}

.composer-canvas img:hover { border: none; }

.composer-empty {
  font-size: 0.8em;
  color: var(--muted);
  padding: 1em;
}

.composer-caption {
  font-size: 0.85em;
  color: var(--muted);
  margin: 0.4em 0 0 !important;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  justify-content: center;
  margin-top: 0.6em;
}

.composer-actions .connect-button {
  font-size: 0.85em;
  padding: 0.45em 1.2em;
  background: var(--neon);
  color: var(--brown-dark);
  border: 1px solid var(--brown-dark);
  font-weight: 600;
}

.composer-actions .connect-button:hover:not(:disabled) {
  background: var(--neon-glow);
  color: var(--brown-dark);
}

.composer-actions .connect-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.trait-picker {
  border: 1px solid var(--neon-deep);
  background: #fff;
}

.trait-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 6px;
  background: var(--neon);
  border-bottom: 1px solid var(--neon-deep);
}

.trait-tab {
  font-size: 0.65em;
  padding: 4px 8px;
  border: 1px solid var(--brown-dark);
  background: rgba(255, 255, 255, 0.85);
  color: var(--brown-dark);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.trait-tab:hover {
  background: var(--neon-glow);
  border-color: var(--brown-dark);
}

.trait-tab.active {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
  color: var(--neon);
  box-shadow: 0 0 8px rgba(198, 230, 7, 0.55);
}

.trait-tab span { opacity: 0.75; }

.trait-tab.active span {
  opacity: 0.9;
  color: var(--neon-soft);
}

.trait-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.trait-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid transparent;
  background: #fafafa;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.trait-item:hover { border-color: var(--neon-deep); }
.trait-item.active {
  border-color: var(--neon-deep);
  background: var(--neon-soft);
  box-shadow: inset 0 0 0 1px var(--neon);
}

.trait-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid #ccc;
  max-width: none;
  margin: 0;
}

.trait-item img:hover { border-color: #ccc; }

.trait-item span {
  font-size: 0.55em;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Staking */
.stake-panel {
  margin: 0.5em 1em 1.1em;
  padding: 0 0.25em 0.5em;
}

/* display:grid/flex overrides native [hidden] — force hide until connect */
.stake-panel [hidden],
.stake-gated[hidden],
.stake-dashboard[hidden],
.stake-toolbar[hidden],
.stake-coverflow[hidden],
.stake-actions[hidden],
.stake-details[hidden],
.stake-wallet-chip[hidden] {
  display: none !important;
}

.stake-connect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5em;
}

/* Connected → hover shows Disconnect */
#stake-connect.is-connected {
  position: relative;
  min-width: 7.5em;
}

#stake-connect.is-connected .stake-conn-hover {
  display: none;
}

#stake-connect.is-connected:hover,
#stake-connect.is-connected:focus-visible {
  background: #5c1a2e;
  color: #fff;
  border-color: #5c1a2e;
}

#stake-connect.is-connected:hover .stake-conn-idle,
#stake-connect.is-connected:focus-visible .stake-conn-idle {
  display: none;
}

#stake-connect.is-connected:hover .stake-conn-hover,
#stake-connect.is-connected:focus-visible .stake-conn-hover {
  display: inline;
}

/* Touch: no reliable hover — show Disconnect when connected on coarse pointers */
@media (hover: none) {
  #stake-connect.is-connected .stake-conn-idle {
    display: none;
  }
  #stake-connect.is-connected .stake-conn-hover {
    display: inline;
  }
  #stake-connect.is-connected {
    background: #5c1a2e;
    color: #fff;
    border-color: #5c1a2e;
  }
}

.stake-wallet-chip {
  font-size: 0.82em;
}

.stake-status {
  min-height: 1.2em;
  margin: 0.35em 0.5em 0.6em !important;
}

.stake-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0.5em 0 0.75em;
}

@media (max-width: 520px) {
  .stake-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stake-stat {
  border: 1px solid var(--brown);
  background: #fff;
  padding: 0.55em 0.4em;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stake-stat.highlight {
  background: var(--neon-soft);
  border-color: var(--neon-deep);
}

.stake-stat-label {
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.stake-stat strong,
.stake-stat .slot-num {
  font-size: 1.15em;
  color: var(--brown-dark);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Slot / odometer number scroll */
.slot-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 1.25em;
}

.slot-odometer {
  display: inline-flex;
  align-items: stretch;
  height: 1.25em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brown-dark);
  font-size: 1em;
  line-height: 1.25em;
}

.slot-digit {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1.25em;
  overflow: hidden;
}

.slot-digit.slot-sym {
  width: 0.32em;
}

.slot-digit.slot-sym .slot-static {
  display: block;
  height: 1.25em;
  line-height: 1.25em;
  text-align: center;
}

.slot-reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.slot-reel span {
  display: block;
  height: 1.25em;
  line-height: 1.25em;
  text-align: center;
  font-weight: 700;
}

.stake-stat.highlight .slot-odometer {
  color: var(--brown-dark);
}

/* brief blur kick on spin */
.slot-odometer.is-spinning .slot-reel {
  filter: blur(0.35px);
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s ease;
}

.stake-stat-unit {
  font-size: 0.62em;
  color: var(--muted);
}

.stake-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0.4em 0 0.65em;
}

.stake-btn-sm {
  font-size: 0.75em !important;
  padding: 0.4em 0.75em !important;
}

.stake-claim {
  background: var(--neon) !important;
  color: var(--brown-dark) !important;
  border-color: var(--brown-dark) !important;
}

.stake-claim:hover:not(:disabled) {
  background: var(--neon-glow) !important;
}

/* Coverflow (Originkit-style) for staked NFTs */
.stake-coverflow {
  --cf-w: min(410px, 88vw);
  --cf-h: min(412px, 88vw);
  position: relative;
  margin: 0.65em 0 0.4em;
  padding: 0.5em 0 0.25em;
  min-height: calc(var(--cf-h) + 3.5em);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cf-stage {
  position: relative;
  width: var(--cf-w);
  height: var(--cf-h);
  perspective: 1600px;
  transform-style: preserve-3d;
  margin: 0 auto;
}

.cf-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cf-w);
  height: var(--cf-h);
  margin: 0;
  padding: 0;
  border: 2px solid #222;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
  font-family: inherit;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.cf-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  margin: 0;
  max-width: none;
  display: block;
  user-select: none;
  pointer-events: none;
}

.cf-card .stake-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  z-index: 2;
}

.cf-card .stake-badge {
  font-size: 0.72em;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.cf-card.staked .stake-badge {
  background: var(--neon);
  color: var(--brown-dark);
}

.cf-card.selected {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.cf-card.selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 1.6em;
  height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neon);
  color: var(--brown-dark);
  font-size: 0.95em;
  font-weight: 900;
  border: 1px solid var(--brown-dark);
}

.cf-card .cf-dim {
  position: absolute;
  inset: 0;
  background: #000;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.cf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  z-index: 5;
  width: 2.2em;
  height: 2.2em;
  border: 1px solid var(--brown-dark);
  background: var(--neon);
  color: var(--brown-dark);
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 2px;
}

.cf-nav:hover {
  background: var(--neon-glow);
}

.cf-prev { left: 0.15em; }
.cf-next { right: 0.15em; }

.cf-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  justify-content: center;
  margin-top: 0.75em;
  width: 100%;
}

.cf-hint {
  margin: 0.45em 0 0 !important;
  width: 100%;
}

@media (max-width: 480px) {
  .stake-coverflow {
    --cf-w: min(300px, 78vw);
    --cf-h: min(300px, 78vw);
  }
  .cf-nav {
    width: 1.9em;
    height: 1.9em;
    font-size: 1.2em;
  }
}

.stake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  justify-content: center;
  margin: 0.55em 0 0.4em;
}

.stake-details {
  margin-top: 0.75em;
  padding: 0.65em 0.85em;
  border-top: 1px solid #e5e5e5;
  text-align: left;
  font-size: 0.85em;
}

.stake-details p {
  margin: 0.3em 0;
}

.stake-details ul {
  margin: 0.35em 0 0.5em 1.2em;
  padding: 0;
  color: var(--text);
}

.stake-details li {
  margin: 0.25em 0;
}

.addr-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.65em;
}

.addr-chip-label {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.addr-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.35em 0.65em 0.35em 0.75em;
  border: 1px solid var(--brown-dark);
  background: var(--neon);
  color: var(--brown-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

.addr-chip:hover {
  background: var(--neon-glow);
}

.addr-chip.copied {
  background: var(--brown-dark);
  color: var(--neon);
}

.addr-chip-text {
  letter-spacing: 0.01em;
}

.addr-chip-action {
  font-size: 0.72em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2em 0.45em;
  border-left: 1px solid rgba(61, 15, 30, 0.35);
  padding-left: 0.55em;
  opacity: 0.9;
}

.addr-chip.copied .addr-chip-action {
  border-left-color: rgba(198, 230, 7, 0.4);
}

/* Holders Leaderboard — entire #leaderboard is [hidden] until user stakes */
#leaderboard[hidden] {
  display: none !important;
}

.lb-body {
  padding: 0.5em 0.75em 0.85em;
}

.lb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
  margin-bottom: 0.55em;
}

.lb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--brown);
  background: #fff;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}

.lb-table th,
.lb-table td {
  padding: 0.55em 0.65em;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.lb-table th {
  background: var(--neon);
  color: var(--brown-dark);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}

.lb-table tbody tr:last-child td {
  border-bottom: none;
}

.lb-table tbody tr:hover {
  background: #faf8f4;
}

.lb-table tr.lb-you {
  background: var(--neon-soft);
  font-weight: 700;
}

.lb-table tr.lb-you:hover {
  background: var(--neon-soft);
}

.lb-rank {
  width: 2.2em;
  font-weight: 800;
  color: var(--brown-dark);
}

.lb-wallet {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.lb-held,
.lb-staked {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.lb-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.25em 0.5em !important;
}

.lb-footnote {
  margin: 0.55em 0.15em 0 !important;
}

#lb-gate-note {
  margin-top: 0.1em;
}

/* Whitelist / Mint */
.mint-box {
  padding: 1em;
  background: white;
  text-align: center;
}

.wl-form {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  align-items: center;
  max-width: 28em;
  margin: 0 auto;
}

.wl-form input {
  width: 100%;
  padding: 0.5em;
  font-size: 0.9em;
  border: 1px solid var(--border);
  font-family: inherit;
}

.wl-form input:focus {
  outline: none;
  border-color: var(--brown);
}

.connect-button {
  padding: 0.5em 1.5em;
  font-size: 1em;
  background: var(--tan);
  color: var(--brown);
  border: 1px solid var(--brown);
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
}

.connect-button:hover {
  background: var(--tan-hover);
  color: var(--brown-dark);
}

.wl-result {
  margin-top: 1em;
  padding: 0.8em;
  font-size: 0.95em;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}

.wl-result.success { background: #f0fff0; }
.wl-result.fail { background: #fff0f0; }
.wl-result span { font-size: 0.85em; color: var(--muted); }

.amount-minted { font-style: italic; color: var(--muted); }
.current-supply { font-weight: bold; }

.mint-details {
  text-align: left;
  max-width: 20em;
  margin: 0.5em 0;
}

.mint-reserve-button a {
  color: var(--brown);
  font-weight: bold;
  font-size: 1.1em;
}

.mint-reserve-button a:hover { color: red; }

.mint-with-avatar {
  display: flex;
  align-items: stretch;
  gap: 1em;
  padding: 1em;
  background: white;
}

.mint-avatar {
  width: 180px;
  height: auto;
  object-fit: cover;
  border: 2px solid var(--maroon);
  flex-shrink: 0;
  margin: 0;
}

.mint-info { flex: 1; min-width: 0; }

.site-footer {
  margin-top: 2em;
  padding: 2.5em 1.5em 2em;
  background: #C6E607;
  color: var(--brown-dark);
  text-align: center;
  border-top: 1px solid var(--maroon);
}

.footer-about {
  max-width: 32em;
  margin: 0 auto 1em;
  line-height: 1.5;
  color: var(--brown-dark);
}

.footer-links {
  font-size: 1.05em;
  margin: 0 0 1em;
}

.footer-links span {
  margin: 0 0.5em;
  color: var(--brown-dark);
}

.site-footer a {
  color: var(--brown-dark);
  font-weight: bold;
}

.site-footer a:hover { color: var(--maroon); }

.footer-fine {
  font-size: 0.8em;
  margin: 0;
}

.stake-soft { font-size: 0.95em; }

.connect-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Mobile / tablet ── */
@media only screen and (max-width: 720px) {
  body {
    font-size: 1.05em;
    background-attachment: scroll, scroll;
  }

  .banner-top {
    margin: 0.6em 0.5em 0.4em;
  }

  .banner-img {
    max-width: 100%;
    border-width: 1px;
  }

  .page-wrap {
    max-width: 100%;
    padding: 0;
  }

  .m_box,
  .m_box_red {
    margin: 0.65em 0.5em;
  }

  .m_box_bar h2,
  .m_box_bar_red h2 {
    font-size: 1em;
    padding: 0.15em 0;
  }

  p {
    margin: 0.45em 0.75em;
  }

  .intro {
    font-size: 0.98em;
    line-height: 1.45;
  }

  .links {
    font-size: 0.95em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em 0.4em;
    justify-content: center;
    align-items: center;
  }

  .hero-img {
    max-width: min(72vw, 14em);
  }

  img {
    max-width: 100%;
  }

  /* Gallery */
  .gallery-search {
    flex-direction: column;
    align-items: stretch;
    margin: 0.5em 0.75em;
    gap: 0.4em;
  }

  .gallery-search input {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* prevent iOS zoom */
    min-height: 2.6em;
  }

  .gallery-search-btn {
    width: 100%;
    min-height: 2.6em;
    font-size: 0.95em !important;
  }

  .gallery_container {
    grid-template-columns: 1fr 1fr;
    gap: 0.15em;
    padding: 0.35em 0.4em 0.6em;
  }

  .gallery_item {
    padding: 0.2em;
  }

  .gallery_item img {
    max-width: 92%;
  }

  .gallery_item .desc .nick {
    font-size: 0.82em;
    word-break: break-word;
  }

  .gallery_item .desc .tok {
    font-size: 0.78em;
  }

  /* Trait lab */
  .trait-lab {
    padding: 0.55em;
    gap: 0.65em;
  }

  .composer-canvas {
    max-width: min(88vw, 18em);
    border-width: 2px;
  }

  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-actions .connect-button {
    width: 100%;
    min-height: 2.7em;
    box-sizing: border-box;
  }

  .trait-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding: 6px 8px;
  }

  .trait-tabs::-webkit-scrollbar {
    display: none;
  }

  .trait-tab {
    flex: 0 0 auto;
    font-size: 0.62em;
    padding: 0.45em 0.65em;
    min-height: 2.2em;
  }

  .trait-items {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    max-height: 200px;
    gap: 6px;
  }

  .trait-item img {
    width: 52px;
    height: 52px;
  }

  .trait-item span {
    font-size: 0.58em;
  }

  /* Staking */
  .stake-panel {
    margin: 0.4em 0.5em 0.9em;
    padding: 0;
  }

  .stake-soft {
    font-size: 0.9em;
    line-height: 1.4;
  }

  .stake-connect-row {
    flex-direction: column;
    width: 100%;
    gap: 0.5em;
  }

  .stake-connect-row .connect-button,
  .stake-connect-row .addr-chip {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    min-height: 2.75em;
  }

  .stake-dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stake-stat {
    padding: 0.65em 0.35em;
  }

  .stake-stat-label {
    font-size: 0.6em;
  }

  .stake-stat strong,
  .stake-stat .slot-num {
    font-size: 1.05em;
  }

  .stake-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stake-btn-sm {
    width: 100%;
    min-height: 2.6em;
    font-size: 0.8em !important;
    box-sizing: border-box;
  }

  .stake-toolbar .stake-claim {
    grid-column: 1 / -1;
  }

  .stake-coverflow {
    --cf-w: min(78vw, 300px);
    --cf-h: min(78vw, 300px);
    min-height: calc(var(--cf-h) + 5.5em);
    width: 100%;
    overflow: hidden;
  }

  .cf-nav {
    width: 2.4em;
    height: 2.4em;
    font-size: 1.25em;
    top: calc(50% - 1.6em);
    transform: none;
  }

  .cf-prev { left: 0.1em; }
  .cf-next { right: 0.1em; }

  .cf-share-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 0.25em;
  }

  .cf-share-bar .connect-button {
    width: 100%;
    min-height: 2.6em;
    box-sizing: border-box;
  }

  .cf-share-bar .stake-claim {
    grid-column: 1 / -1;
  }

  .cf-hint {
    font-size: 0.8em;
    padding: 0 0.5em;
  }

  .stake-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 0 0.15em;
  }

  .stake-actions .connect-button {
    width: 100%;
    min-height: 2.7em;
    box-sizing: border-box;
  }

  .stake-details {
    font-size: 0.82em;
    padding: 0.55em 0.65em;
  }

  .addr-chip-row {
    flex-direction: column;
    align-items: stretch;
  }

  .addr-chip {
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    min-height: 2.6em;
  }

  /* Mint */
  .mint-with-avatar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.85em 0.75em;
    gap: 0.75em;
  }

  .mint-avatar {
    width: min(70vw, 200px);
    max-width: 100%;
  }

  .mint-info {
    text-align: left;
    width: 100%;
  }

  .mint-details {
    max-width: none;
    margin: 0.4em 0;
    padding-left: 1.1em;
  }

  .amount-minted {
    text-align: center;
  }

  .mint-reserve-button {
    text-align: center;
  }

  .wl-form {
    max-width: none;
    padding: 0 0.25em;
  }

  .wl-form input {
    font-size: 16px;
    min-height: 2.6em;
    box-sizing: border-box;
  }

  .wl-form .connect-button {
    width: 100%;
    min-height: 2.7em;
  }

  .whitelist-img {
    max-width: 92%;
  }

  .lb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .lb-toolbar .connect-button {
    width: 100%;
    min-height: 2.6em;
  }

  .lb-table {
    font-size: 0.8em;
  }

  .lb-table th,
  .lb-table td {
    padding: 0.5em 0.4em;
  }

  .compare-wide {
    margin: 0.3em auto;
  }

  .site-footer {
    padding: 1.75em 1em 2em;
    padding-bottom: max(2em, env(safe-area-inset-bottom));
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35em 0.5em;
    font-size: 0.98em;
  }

  .footer-links span {
    margin: 0 0.15em;
  }

  /* Lightbox mobile */
  .lightbox {
    padding: 0.75em 0.6em;
    align-items: flex-start;
    padding-top: max(0.75em, env(safe-area-inset-top));
  }

  .lightbox-panel {
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
    max-width: 100%;
  }

  .lightbox-art img,
  .lightbox #lightbox-img {
    max-width: min(92vw, 400px);
    max-height: 46vh;
  }

  .lightbox-side {
    width: min(92vw, 400px);
    max-width: min(92vw, 400px);
    max-height: 40vh;
    min-width: 0;
  }

  .lightbox-caption {
    font-size: 0.82em;
  }

  .lightbox-story {
    font-size: 0.84em;
    padding: 0.7em 0.8em;
  }

  .lightbox-close {
    top: 0.4em;
    right: 0.55em;
    font-size: 1.85em;
    min-width: 2.2em;
    min-height: 2.2em;
  }
}

@media only screen and (max-width: 380px) {
  body {
    font-size: 1em;
  }

  .gallery_item .desc .nick {
    font-size: 0.75em;
  }

  .stake-coverflow {
    --cf-w: min(84vw, 280px);
    --cf-h: min(84vw, 280px);
  }

  .stake-toolbar {
    grid-template-columns: 1fr;
  }

  .stake-toolbar .stake-claim {
    grid-column: auto;
  }
}

/* Prefer larger touch targets on coarse pointers */
@media (hover: none) and (pointer: coarse) {
  .connect-button,
  .trait-tab,
  .gallery-search-btn,
  .cf-nav,
  .addr-chip {
    min-height: 2.75em;
  }

  .gallery_item:hover img {
    border-color: var(--border);
  }

  a:hover {
    color: blue;
  }
}