/* ─── Splash ──────────────────────────────────────────────────────────────── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  cursor: pointer;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100vh;
  padding-bottom: 48px;
}

.splash-hint {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.25em;
  color: rgba(255, 216, 77, 0.9);
  text-transform: uppercase;
  animation: splash-pulse 1.8s ease-in-out infinite;
  margin: 0;
}

@keyframes splash-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

.splash-exit {
  animation: splash-fade-out 0.7s ease forwards;
}

@keyframes splash-fade-out {
  to { opacity: 0; pointer-events: none; }
}

.app-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.app-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── End Splash ──────────────────────────────────────────────────────────── */

:root {
  --bg-sky: #0f0f10;
  --bg-cloud: #1a1a1d;
  --ink: #f6f3e8;
  --ink-soft: #d9cfa6;
  --lilac: #d7262e;
  --sage: #f2b705;
  --peach: #8f0d12;
  --gold: #ffd84d;
  --danger: #ff6f61;
  --success: #f2b705;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, #000000 0%, #1a1000 35%, #c47a00 70%, #f2b705 100%);
  min-height: 100vh;
}

body.faction-red {
  background: linear-gradient(135deg, #000000 0%, #1a1000 35%, #c47a00 70%, #f2b705 100%);
}

body.faction-yellow {
  background: linear-gradient(135deg, #000000 0%, #1a1000 35%, #c47a00 70%, #f2b705 100%);
}

.bg-glow {
  display: none;
}

.glass {
  backdrop-filter: blur(6px);
  background: rgba(20, 20, 23, 0.55);
  border: 1px solid rgba(255, 216, 77, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.topbar {
  position: relative;
  z-index: 2;
  margin: 10px auto;
  width: min(1200px, calc(100% - 80px));
  border-radius: 18px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand h1 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-badge {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  background: linear-gradient(145deg, #ffe27a, var(--gold));
  color: #2b2200;
}

nav a {
  text-decoration: none;
  color: #ffe27a;
  font-weight: 700;
  margin-left: 10px;
}

main {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto 16px;
}

.route {
  display: none;
  animation: fadeIn 220ms ease;
}

.route.active {
  display: block;
}

.hero {
  border-radius: 20px;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.hero h2 {
  margin: 2px 0;
  font-size: clamp(1.6rem, 2.4vw, 2.8rem);
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 2px 0 0;
  max-width: 900px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.card {
  border-radius: 20px;
  padding: 14px 18px;
}

form label {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

input {
  border: 1px solid #6d5a1a;
  background: #111215;
  color: #fff4cf;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  width: 100%;
  max-width: 420px;
}

select {
  border: 1px solid #6d5a1a;
  background: #111215;
  color: #fff4cf;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  width: 100%;
  max-width: 420px;
}

input:focus,
select:focus,
button:focus,
a:focus {
  outline: 2px solid #ffd84d;
  outline-offset: 2px;
}

.cta,
button,
.cta-link {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button,
.cta-link.soft {
  background: linear-gradient(145deg, #2b2b31, #151519);
  color: #fff0b5;
  text-decoration: none;
}

.cta,
.cta-link {
  background: linear-gradient(145deg, var(--lilac), #8f1015);
  color: #fff7d8;
  box-shadow: 0 10px 18px rgba(128, 8, 13, 0.45);
}

button:hover,
.cta-link:hover {
  transform: translateY(-1px);
}

.status {
  min-height: 20px;
  margin: 4px 0 0;
  color: #f3d46f;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: start;
  height: 100%;
}

.preview img,
#success-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #6d5a1a;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.success-card {
  border-radius: 26px;
  padding: 22px;
  max-width: 760px;
  margin: 8px auto;
}

.tx {
  background: #18191d;
  border: 1px solid #6d5a1a;
  border-radius: 12px;
  padding: 10px;
  font-size: 0.9rem;
  word-break: break-all;
}

.gallery-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gallery-item {
  border-radius: 18px;
  background: #151519;
  border: 1px solid #6d5a1a;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.gallery-meta {
  padding: 10px;
  display: grid;
  gap: 4px;
  font-size: 0.88rem;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ipfs-links {
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(255, 216, 77, 0.06);
  border: 1px solid rgba(255, 216, 77, 0.2);
  border-radius: 12px;
  text-align: center;
}

.ipfs-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

.ipfs-links a {
  display: block;
  font-size: 0.78rem;
  color: #ffd84dcc;
  text-decoration: none;
  word-break: break-all;
  transition: color 0.15s;
}

.ipfs-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ─── Xaman modal ─────────────────────────────────────────────────────────── */

.xaman-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.xaman-overlay[hidden] {
  display: none;
}

.xaman-card {
  width: min(420px, 92vw);
  padding: 32px 28px 28px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.xaman-step-indicator {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.xaman-title {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
}

.xaman-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.xaman-qr-wrap {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.xaman-qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* CSS spinner */
.xaman-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 216, 77, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: xaman-spin 0.8s linear infinite;
}

@keyframes xaman-spin {
  to { transform: rotate(360deg); }
}

.xaman-status-msg {
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.xaman-status-msg.success {
  color: var(--success);
}

.xaman-status-msg.error {
  color: var(--danger);
}

.xaman-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.xaman-open-btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.xaman-cancel-btn {
  background: transparent;
  border: 1px solid rgba(255, 216, 77, 0.25);
  color: var(--ink-soft);
  padding: 9px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.2s, color 0.2s;
}

.xaman-cancel-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.demo-mint {
  background: transparent;
  border: 1px dashed rgba(255, 216, 77, 0.35);
  color: var(--ink-soft);
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.demo-mint:hover {
  border-color: var(--gold);
  color: var(--ink);
  transform: none;
}

.tx-link {
  color: var(--gold);
  text-decoration: underline;
}
