.mint-page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  color: var(--text);
}

/* Per-project background image rendered behind the content. Set via JS. */
.mint-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.mint-bg.active { opacity: 0.35; }
.mint-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,26,0.4) 0%, rgba(10,10,26,0.85) 60%, rgba(10,10,26,0.95) 100%);
}

.mint-loading,
.mint-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 24px;
  color: var(--text-muted);
  text-align: center;
}

.mint-error h2 { color: var(--text); margin: 0; }

.mint-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(124,58,237,0.2);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mint-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 880px) {
  .mint-layout { grid-template-columns: 1fr; }
  .mint-art-col { max-width: 480px; margin: 0 auto; }
}

.mint-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}

.mint-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mint-art-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 6px; letter-spacing: 0.05em; text-transform: uppercase;
}

.mint-art-links { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.mint-art-links a {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); text-decoration: none;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  transition: all 0.15s;
}
.mint-art-links a:hover { color: #fff; background: rgba(124,58,237,0.12); border-color: rgba(124,58,237,0.4); }
.mint-art-links a svg { width: 18px; height: 18px; }
.mint-art-links a img { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }

/* Labelled link (View Collection) — same pill, sized to its text. */
.mint-art-links a.with-text {
  width: auto; padding: 0 12px; gap: 8px;
  font-size: 0.8rem; font-weight: 600; color: #e9d5ff;
}

.mint-eyebrow {
  color: #c4b5fd; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}

.mint-eyebrow .dot {
  width: 8px; height: 8px; background: #7c3aed; border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.mint-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 8px 0 4px;
  line-height: 1.1;
  color: #fff;
}

.mint-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; }
.mint-symbol {
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  font-weight: 600;
}
.mint-status { color: var(--text-muted); font-weight: 500; }
.mint-status.live { color: #c4b5fd; font-weight: 700; }
.mint-status.sold-out { color: #f59e0b; font-weight: 700; }

.mint-progress-wrap { margin-top: 24px; }
.mint-progress-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; }
.mint-progress-label span:first-child { color: #fff; font-weight: 700; }
.mint-progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.mint-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.mint-phase-card {
  margin-top: 24px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(168,85,247,0.04));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
}
.mint-phase-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mint-phase-label { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.mint-phase-type { font-size: 0.75rem; padding: 2px 8px; background: rgba(124,58,237,0.25); border-radius: 4px; color: #c4b5fd; font-weight: 600; }
.mint-phase-price { font-size: 1.5rem; font-weight: 800; color: #fff; }
.mint-phase-price small { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; margin-left: 6px; }
.mint-phase-meta { margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 14px; flex-wrap: wrap; }
.mint-phase-meta span strong { color: #fff; }

.mint-action-row { margin-top: 20px; display: flex; gap: 12px; align-items: stretch; }

.mint-qty {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.mint-qty-btn {
  width: 40px; height: 48px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
}
.mint-qty-btn:hover { background: rgba(255,255,255,0.06); }
.mint-qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.mint-qty input {
  width: 56px; height: 48px;
  background: transparent;
  border: none;
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  -moz-appearance: textfield;
}
.mint-qty input::-webkit-outer-spin-button,
.mint-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.mint-cta {
  flex: 1;
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mint-cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124,58,237,0.35); }
.mint-cta:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.mint-cta .spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.mint-qty-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}

.mint-feedback {
  margin-top: 14px;
  font-size: 0.85rem;
  min-height: 1.4em;
}
.mint-feedback.error { color: #f87171; }
.mint-feedback.success { color: #6ee7b7; }
.mint-feedback.info { color: var(--text-muted); }

.mint-phases-list-wrap { margin-top: 28px; }
.mint-phases-list-label {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; margin-bottom: 10px;
}
.mint-phases-list { display: flex; flex-direction: column; gap: 8px; }
.mint-phase-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.mint-phase-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mint-phase-row-name { font-weight: 700; color: #fff; font-size: 0.9rem; }
.mint-phase-row-type { color: rgba(255,255,255,0.5); font-weight: 500; font-size: 0.7rem; }
.mint-phase-row-supply { color: rgba(255,255,255,0.55); font-size: 0.72rem; }
.mint-phase-row-price { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: 0.85rem; }
.mint-phase-row-meta { display: flex; gap: 12px; align-items: center; }

.mint-phase-row-pill {
  padding: 3px 9px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}

/* Active (mintable now) — purple tint, brighter border */
.mint-phase-row.active {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.45);
}
.mint-phase-row.active:hover { background: rgba(124,58,237,0.18); border-color: rgba(168,85,247,0.6); }
.mint-phase-row.active .mint-phase-row-pill {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  display: inline-flex; align-items: center; gap: 4px;
}
.mint-phase-row.active .mint-phase-row-pill::before {
  content: ''; width: 6px; height: 6px; background: #fff; border-radius: 50%; animation: livePulse 1.5s infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Upcoming — amber tint, semi-bright */
.mint-phase-row.upcoming {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.25);
  opacity: 0.85;
}
.mint-phase-row.upcoming:hover { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.5); }
.mint-phase-row.upcoming .mint-phase-row-pill { background: rgba(245,158,11,0.2); color: #fcd34d; }

/* Ended — strongly faded */
.mint-phase-row.ended {
  background: rgba(255,255,255,0.015);
  border-color: rgba(255,255,255,0.06);
  opacity: 0.4;
}
.mint-phase-row.ended .mint-phase-row-pill { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
.mint-phase-row.ended .mint-phase-row-name { color: rgba(255,255,255,0.7); }

/* Sold out — red pill, faded */
.mint-phase-row.sold-out {
  background: rgba(239,68,68,0.04);
  border-color: rgba(239,68,68,0.18);
  opacity: 0.55;
}
.mint-phase-row.sold-out .mint-phase-row-pill { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* Selected — bright glow, even on top of active */
.mint-phase-row.selected {
  border-color: #a855f7;
  background: rgba(124,58,237,0.22);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.5), 0 6px 18px rgba(124,58,237,0.3);
  opacity: 1;
}
.mint-phase-row.selected .mint-phase-row-name { color: #fff; }

/* Not selectable — disabled cursor + hover suppressed */
.mint-phase-row.nopick { cursor: not-allowed; }
.mint-phase-row.nopick:hover { background: rgba(255,255,255,0.015); border-color: rgba(255,255,255,0.06); }
.mint-phase-row.nopick.sold-out:hover { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.18); }

.mint-description {
  margin-top: 20px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.btn-link {
  display: inline-block;
  color: #c4b5fd;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 8px;
  transition: all 0.15s;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-link:hover { border-color: rgba(124,58,237,0.6); background: rgba(124,58,237,0.08); }

.mint-success-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 24px;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mint-success-card {
  position: relative;
  background: #0c0a14; border: 1px solid rgba(124,58,237,0.35);
  border-radius: 18px; padding: 28px 28px 24px;
  max-width: 540px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(168,85,247,0.08);
  animation: cardPop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.mint-success-card.wide { max-width: 720px; }
@keyframes cardPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.mint-success-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 8px; }
.mint-success-icon { line-height: 0; filter: drop-shadow(0 0 14px rgba(168,85,247,0.5)); }
.mint-success-card h2 { margin: 0; color: #fff; font-size: 1.4rem; }
.mint-success-list { margin: 18px 0 4px; font-size: 0.8rem; color: var(--text-muted); }
.mint-success-list a { color: #c4b5fd; text-decoration: none; }
.mint-success-list a:hover { text-decoration: underline; }
.mint-success-actions { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.mint-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.mint-modal-close:hover { color: #fff; background: rgba(124,58,237,0.18); border-color: rgba(124,58,237,0.45); }

/* Single asset viewer, reused by the success card and the nft modal */
.ms-viewer { text-align: left; }
.ms-art {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 14px; overflow: hidden; background: #111;
  border: 1px solid var(--border); margin: 0 auto;
}
.ms-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-art-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mint-spin {
  width: 28px; height: 28px;
  border: 3px solid rgba(124,58,237,0.2); border-top-color: #a855f7;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.ms-name { margin: 14px 0 10px; font-size: 1.05rem; font-weight: 800; color: #fff; text-align: center; }
.ms-traits {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; margin-top: 4px;
}
.ms-trait {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 9px;
  background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.18);
}
.ms-trait-k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: #c4b5fd; font-weight: 700; }
.ms-trait-v { font-size: 0.82rem; color: #fff; font-weight: 600; word-break: break-word; }
.ms-no-traits { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: 8px 0; }
.ms-loading-cap { margin-top: 14px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* Multi-mint gallery */
.ms-gallery-stage { position: relative; }
.ms-gallery-counter {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.ms-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15); color: #fff;
  font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.ms-nav:hover { background: rgba(124,58,237,0.6); border-color: rgba(168,85,247,0.7); }
.ms-nav.prev { left: 8px; }
.ms-nav.next { right: 8px; }
.ms-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: thin; }
.ms-thumb {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 9px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: #111; transition: border-color 0.15s, transform 0.15s;
}
.ms-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-thumb:hover { transform: translateY(-2px); }
.ms-thumb.active { border-color: #a855f7; box-shadow: 0 0 0 1px rgba(168,85,247,0.4); }

/* Discover: recently minted + my mints */
.mint-discover {
  position: relative; z-index: 1;
  margin: 48px auto 0; max-width: 1200px;
  border-top: 1px solid var(--border); padding-top: 28px;
}
.mint-discover-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.mint-discover-tab {
  padding: 9px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.mint-discover-tab:hover { color: #fff; background: rgba(124,58,237,0.1); }
.mint-discover-tab.active {
  color: #fff; background: rgba(124,58,237,0.18); border-color: rgba(168,85,247,0.5);
}
.mint-discover-empty { color: var(--text-muted); font-size: 0.85rem; padding: 28px 4px; text-align: center; }

/* Auto-scrolling recently-minted marquee */
.mint-marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.mint-marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee var(--marquee-dur, 60s) linear infinite; }
.mint-marquee:hover .mint-marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mint-tile {
  flex: 0 0 auto; width: 150px; cursor: pointer;
  border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mint-tile:hover { transform: translateY(-3px); border-color: rgba(168,85,247,0.5); box-shadow: 0 10px 24px rgba(0,0,0,0.4); }
.mint-tile-art { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #111; }
.mint-tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mint-tile-name { padding: 8px 10px; font-size: 0.74rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* My-mints grid */
.mint-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.mint-mine-connect { text-align: center; padding: 12px 4px 4px; }
.mint-mine-connect p { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 14px; }

/* Generic NFT modal */
.mint-nft-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001; padding: 24px; animation: fadeIn 0.2s;
}
.mint-nft-modal-card {
  position: relative; background: #0c0a14; border: 1px solid rgba(124,58,237,0.35);
  border-radius: 18px; padding: 28px; max-width: 460px; width: 100%;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  animation: cardPop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@media (max-width: 560px) {
  .mint-mine-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .mint-tile { width: 130px; }
}
