/* The mint page and the reveal walkout. Builds on site.css. */
:root {
  --tier-common: #b8c3d8;
  --tier-rare: #1ee0ff;
  --tier-epic: #c084fc;
  --tier-legendary: #ffc93c;
  --tier-quantum: #ff5fd2;
}

/* ---------- mint page ---------- */
.mint { position: relative; padding: 64px 0 96px; overflow: hidden; min-height: calc(100vh - 64px); }
.mint-grid { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.mint-visual { display: grid; justify-items: center; gap: 14px; }
.mint-card { position: relative; width: min(440px, 100%); aspect-ratio: 1; background: var(--plate);
  box-shadow: 0 0 0 2px var(--line-2), 0 0 60px rgba(30, 224, 255, .18), 0 30px 80px rgba(0, 0, 0, .5);
  animation: float 5s ease-in-out infinite; }
.mint-card img { width: 100%; height: 100%; }
.mint-card-scan { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0 46%, rgba(30, 224, 255, .22) 50%, transparent 54% 100%);
  background-size: 100% 240%; animation: scan 3.2s linear infinite; mix-blend-mode: screen; }
@keyframes scan { from { background-position: 0 -120%; } to { background-position: 0 120%; } }
@keyframes float { 50% { transform: translateY(-10px); } }
.mint-card-note { text-align: center; }
.mint-panel h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.05; margin: 22px 0 18px; }
.mint-panel .lead { font-size: 18px; }
.mint-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 30px 0 12px; }
.mint-stats div { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.mint-stats strong { font: 400 20px/1.2 var(--pixel); overflow-wrap: anywhere; }
.mint-bar { height: 8px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.mint-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .8s ease; }
.mint-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn-mint { min-width: 180px; justify-content: center; font-size: 18px; padding: 18px 28px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }
.wallet-menu { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mint-status { min-height: 1.6em; margin-top: 16px; color: var(--muted); }
.mint-status.is-error { color: #ff7a8a; }
.mint-status.is-ok { color: var(--green); }
.mint-fine { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.linkish { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.recent { position: relative; margin-top: 88px; }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.recent-head h2 { font-size: 28px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.recent-grid a { position: relative; display: block; background: var(--plate); text-decoration: none; }
.recent-grid img { width: 100%; aspect-ratio: 1; }
.recent-grid span { display: block; padding: 6px 8px; font: 500 12px/1.3 var(--mono); color: var(--muted); background: var(--panel); }

/* ---------- admin page ---------- */
.admin-wrap { position: relative; max-width: 1000px; }
.admin h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.05; margin: 22px 0 18px; }
.admin-role { color: var(--muted); align-self: center; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.admin-card { display: grid; gap: 12px; align-content: start; padding: 22px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: opacity .2s ease; }
.admin-card.is-wide { grid-column: 1 / -1; }
.admin-card.is-off { opacity: .5; }
.admin-card h2 { font-size: 20px; }
.admin-card .btn { justify-self: start; }
.admin-card .note { margin: 0; font-size: 14px; color: var(--muted); }
.admin-card .linkish { justify-self: start; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; font: 400 13px/1.5 var(--mono); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { color: var(--cyan); }
.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; background: var(--bg-2); color: var(--text);
  font: 400 14px/1.2 var(--mono); box-shadow: inset 0 0 0 1px var(--line-2); }
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--cyan); }
.field .btn { flex: none; }
.danger { display: grid; gap: 10px; margin-top: 8px; padding: 16px; box-shadow: inset 0 0 0 1px rgba(255, 122, 138, .35); background: rgba(255, 122, 138, .05); }
.btn-danger { --b: #ff7a8a; color: #ff9aa6; background: transparent; }
.mint-status a { color: var(--cyan); }

/* ---------- walkout ---------- */
body.wo-open { overflow: hidden; }
.wo { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto; background: #02050b;
  --stock: #16223a; --tier: var(--cyan); color: var(--text); animation: wo-in .35s ease both; }
.wo[hidden] { display: none; }
@keyframes wo-in { from { opacity: 0; } }
.wo-bg { position: absolute; inset: 0; transition: background .7s ease;
  background: radial-gradient(ellipse 60% 55% at 50% 48%, color-mix(in srgb, var(--stock) 70%, transparent), transparent 70%),
              radial-gradient(ellipse 120% 80% at 50% 110%, rgba(0, 0, 0, .9), transparent 60%); }
.wo[data-phase="sealed"] .wo-bg { background: radial-gradient(ellipse 50% 50% at 50% 48%, rgba(30, 224, 255, .22), transparent 70%); }
.wo-beams { position: absolute; inset: -40%; pointer-events: none; opacity: .55;
  background: conic-gradient(from 180deg at 50% 100%, transparent 0 40deg, rgba(255, 255, 255, .06) 46deg, transparent 52deg 150deg,
    rgba(255, 255, 255, .05) 158deg, transparent 166deg 360deg);
  animation: beams 9s ease-in-out infinite alternate; }
@keyframes beams { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.wo-head { position: relative; text-align: center; padding: 34px 16px 0; display: grid; gap: 8px; }
.wo-title { font: 400 clamp(22px, 3.2vw, 34px)/1.1 var(--pixel); letter-spacing: .02em; }
.wo-sub { font-size: 13px; color: var(--muted); }
.wo-help { justify-self: center; font-size: 13px; }
.wo-center { position: relative; display: flex; align-items: center; justify-content: center; gap: 48px; padding: 16px; }
.wo-card-wrap { perspective: 1200px; }
.wo-card { position: relative; width: min(56vmin, 460px); aspect-ratio: 1; background: var(--plate);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tier) 60%, #26365a), 0 0 90px color-mix(in srgb, var(--stock) 60%, transparent),
    0 40px 120px rgba(0, 0, 0, .7);
  transform-style: preserve-3d; animation: card-float 6s ease-in-out infinite; transition: box-shadow .6s ease; }
@keyframes card-float { 50% { transform: translateY(-8px) rotateX(3deg) rotateY(-3deg); } }
.wo-card.is-flip { animation: flip .76s cubic-bezier(.5, 0, .3, 1) both, card-float 6s ease-in-out .76s infinite; }
@keyframes flip { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(90deg) scale(1.08); } 100% { transform: rotateY(0) scale(1); } }
.wo-canvas { width: 100%; height: 100%; display: block; }
.wo[data-phase="sealed"] .wo-card::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0 46%, rgba(30, 224, 255, .25) 50%, transparent 54% 100%);
  background-size: 100% 240%; animation: scan 1.8s linear infinite; mix-blend-mode: screen; }
.wo[data-phase="sealed"] .wo-card { box-shadow: 0 0 0 3px rgba(30, 224, 255, .6), 0 0 120px rgba(30, 224, 255, .35); animation: pulse-card 1.6s ease-in-out infinite; }
@keyframes pulse-card { 50% { box-shadow: 0 0 0 3px rgba(30, 224, 255, .9), 0 0 160px rgba(30, 224, 255, .55); } }
/* a burst of light around the card when a layer lands; the art itself stays untouched */
.wo-flash { position: absolute; inset: -6px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 4px var(--flash, #fff), 0 0 70px 18px var(--flash, #fff); }
.wo-flash.is-on { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: .95; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1); } }

.wo-side { position: relative; width: 380px; display: grid; }
.wo-side > * { grid-area: 1 / 1; }
.wo-trait { position: relative; min-width: 300px; max-width: 380px; padding: 22px 26px; display: grid; gap: 6px;
  background: linear-gradient(90deg, rgba(14, 22, 38, .96), rgba(14, 22, 38, .82));
  box-shadow: inset 4px 0 0 var(--c, var(--tier-common)), 0 20px 60px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateX(40px) skewX(-4deg); }
.wo-trait.is-in { animation: slide-in .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes slide-in { to { opacity: 1; transform: none; } }
.wo-trait[data-tier="common"] { --c: var(--tier-common); }
.wo-trait[data-tier="rare"] { --c: var(--tier-rare); }
.wo-trait[data-tier="epic"] { --c: var(--tier-epic); }
.wo-trait[data-tier="legendary"] { --c: var(--tier-legendary); }
.wo-trait[data-tier="quantum"] { --c: var(--tier-quantum); }
.wo-trait-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wo-trait-value { font: 400 clamp(20px, 2.6vw, 30px)/1.15 var(--pixel); }
.wo-trait-odds { font-size: 14px; color: var(--c); }
.wo[data-phase="final"] .wo-trait { display: none; }

.wo-tierbadge { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 10px 18px; white-space: nowrap;
  font: 400 22px/1 var(--pixel); color: #04121a; background: var(--tier); opacity: 0; pointer-events: none; }
.wo[data-phase="final"] .wo-tierbadge { animation: slam .6s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes slam { 0% { opacity: 0; transform: translateX(-50%) scale(2.6); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
.wo[data-tier="common"] { --tier: var(--tier-common); }
.wo[data-tier="rare"] { --tier: var(--tier-rare); }
.wo[data-tier="epic"] { --tier: var(--tier-epic); }
.wo[data-tier="legendary"] { --tier: var(--tier-legendary); }
.wo[data-tier="quantum"] { --tier: var(--tier-quantum); }
.wo[data-phase="final"] .wo-card { box-shadow: 0 0 0 4px var(--tier), 0 0 140px color-mix(in srgb, var(--tier) 45%, transparent), 0 40px 120px rgba(0, 0, 0, .7); }
.wo[data-phase="final"][data-tier="legendary"] .wo-card::after,
.wo[data-phase="final"][data-tier="quantum"] .wo-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 45%, transparent 60%); background-size: 250% 100%;
  animation: shine 2.4s ease-in-out infinite; }
@keyframes shine { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.wo[data-tier="quantum"] .wo-tierbadge { background: linear-gradient(90deg, var(--pink), var(--cyan), var(--green), var(--gold), var(--pink)); background-size: 300% 100%; animation: slam .6s cubic-bezier(.2, 1.6, .4, 1) forwards, rainbow 3s linear infinite; }
@keyframes rainbow { to { background-position: 300% 0; } }

.wo-final { position: relative; display: grid; gap: 16px; align-content: center; animation: rise .5s ease .3s both; }
.wo-final[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateX(20px); } }
.wo-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 62vh; overflow: auto; }
.wo[data-phase="final"] .wo-card { width: min(50vmin, 440px); }
.wo-summary div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; background: rgba(14, 22, 38, .85); box-shadow: inset 3px 0 0 var(--c, var(--tier-common)); }
.wo-summary div[data-tier="rare"] { --c: var(--tier-rare); }
.wo-summary div[data-tier="epic"] { --c: var(--tier-epic); }
.wo-summary div[data-tier="legendary"] { --c: var(--tier-legendary); }
.wo-summary div[data-tier="quantum"] { --c: var(--tier-quantum); }
.wo-summary dt { grid-column: 1 / -1; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.wo-summary dd { margin: 0; font-size: 14px; }
.wo-summary span { font-size: 11px; color: var(--c, var(--muted)); align-self: end; }
.wo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wo-skip { position: absolute; top: 18px; right: 18px; z-index: 3; background: rgba(14, 22, 38, .8); color: var(--muted); border: 0;
  box-shadow: inset 0 0 0 1px var(--line-2); padding: 10px 14px; cursor: pointer; }
.wo-skip:hover { color: var(--text); }
.wo[data-phase="final"] .wo-skip { display: none; }
.wo-confetti { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.wo-confetti i { position: absolute; width: 10px; height: 10px; background: var(--c); animation: burst var(--d) cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes burst { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .mint-grid { grid-template-columns: 1fr; gap: 40px; }
  .mint-visual { order: 2; }
  .wo { overflow-y: auto; }
  .wo-center { flex-direction: column; gap: 22px; }
  .wo-card { width: min(78vw, 56vh); }
  .wo[data-phase="final"] .wo-card { width: min(62vw, 36vh); }
  .wo-side { width: min(92vw, 460px); }
  .wo-trait { min-width: 0; max-width: none; }
  .wo-summary { max-height: none; }
  .wo-actions { justify-content: center; }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
  .field { flex-direction: column; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .mint-stats { grid-template-columns: 1fr 1fr; }
  .mint-stats div:last-child { grid-column: 1 / -1; }
  .mint-stats strong { font-size: 16px; overflow-wrap: normal; white-space: nowrap; }
  .mint-actions .btn { flex: 1 1 100%; justify-content: center; }
  .wo-head { padding-top: 62px; }
  .wo-skip { top: 14px; right: 14px; }
  .wo[data-phase="final"] .wo-center { padding-top: 36px; }
  .wo-summary div { grid-template-columns: 1fr; }
  .wo-summary span { align-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .wo-card, .mint-card { animation: none !important; }
}
