:root {
  --bg: #07111f;
  --panel: #10243f;
  --ink: #f4f7fb;
  --muted: #9bb0ce;
  --gold: #e7b23c;
  --line: rgba(255, 255, 255, 0.12);
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.preview-banner {
  margin: 0; background: var(--gold); color: #14284b; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; padding: 6px 12px;
}
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: rgba(7, 17, 31, 0.92);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.brand { text-decoration: none; letter-spacing: 0.16em; font-size: 12px; }
.brand span { color: var(--gold); letter-spacing: 0; font-size: 16px; font-weight: 700; margin-left: 8px; }
.top-link { color: var(--muted); text-decoration: none; font-size: 14px; }

.hero {
  display: grid; gap: 28px; align-items: center;
  padding: 36px 18px 12px; max-width: 1080px; margin: 0 auto;
}
.kicker { color: var(--gold); letter-spacing: 0.2em; font-size: 12px; margin: 0 0 8px; }
h1 { font-size: 56px; line-height: 0.95; margin: 0 0 14px; letter-spacing: -0.03em; }
.story { color: #d5e2f5; font-size: 18px; line-height: 1.5; max-width: 38rem; margin: 0 0 12px; }
.story.note { color: var(--muted); font-size: 14px; }
.cta {
  display: inline-block; margin-top: 8px; background: var(--gold); color: #14284b;
  text-decoration: none; font-weight: 700; padding: 12px 18px; border-radius: 999px;
}
.hero-card {
  width: min(280px, 70vw); justify-self: center;
  border: 4px solid var(--gold); border-radius: 18px; image-rendering: pixelated;
  background: #0c1c33; padding: 8px;
}
.hero-caption { margin: 8px 0 0; text-align: center; color: #d5e2f5; font-size: 13px; line-height: 1.4; }
.hero-caption strong { color: #fff; font-size: 15px; }

.gallery { max-width: 1100px; margin: 0 auto; padding: 28px 18px 48px; }
.gallery-head h2 { margin: 0 0 8px; font-size: 28px; }
.demo-banner {
  margin: 0; padding: 10px 12px; border: 1px solid rgba(231, 178, 60, 0.45);
  background: rgba(231, 178, 60, 0.1); border-radius: 12px; color: #f4e2b0; font-size: 14px;
}
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 8px; }
.filters button {
  border: 0; background: rgba(255,255,255,0.06); color: #c5d4ea;
  border-radius: 999px; padding: 8px 12px; white-space: nowrap; cursor: pointer;
}
.filters button[aria-selected="true"] { background: var(--gold); color: #14284b; font-weight: 700; }
.count { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--panel); border: 2px solid #8b93a7; border-radius: 16px;
  padding: 8px; text-align: left; cursor: pointer; color: inherit; width: 100%;
}
.card.super_rare { border-color: #e7b23c; }
.card.ultra_rare { border-color: #d7fff6; }
.card.rare { border-color: #4c8dff; }
.card.less_common { border-color: #3dce86; }
.card img, .idle { width: 100%; aspect-ratio: 120/156; object-fit: cover; image-rendering: pixelated; border-radius: 10px; background: #0c1c33; }
.idle { position: relative; display: block; overflow: hidden; }
.idle-bg, .idle-char { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.idle-bg { object-fit: cover; }
.idle-char {
  background-repeat: no-repeat;
  background-size: 100% 400%;
  background-position: 0 0;
}
.idle-bg-anim {
  background-repeat: no-repeat;
  background-size: 100% 800%;
  background-position: 0 0;
}
.idle-char.jump, .idle-char.celebrate { background-size: 100% 800%; }
.idle.is-on .idle-char { animation: idle-frames 1.6s steps(1, end) infinite; }
.idle.is-on .idle-char.jump { animation: idle-bg 0.9s steps(1, end) infinite; }
.idle.is-on .idle-char.celebrate { animation: idle-bg 1.55s steps(1, end) infinite; }
.idle.is-on .idle-bg-anim { animation: idle-bg 1.1s steps(1, end) infinite; }
.idle.is-on .idle-bg-anim.cosmos { animation-duration: 2.8s; }
.idle.is-on .idle-bg-anim.ultra { animation-duration: 1.8s; }
@keyframes idle-frames {
  0% { background-position: 0 0%; }
  25% { background-position: 0 33.333%; }
  50% { background-position: 0 66.666%; }
  75% { background-position: 0 100%; }
}
@keyframes idle-bg {
  0% { background-position: 0 0%; }
  12.5% { background-position: 0 14.286%; }
  25% { background-position: 0 28.571%; }
  37.5% { background-position: 0 42.857%; }
  50% { background-position: 0 57.143%; }
  62.5% { background-position: 0 71.429%; }
  75% { background-position: 0 85.714%; }
  87.5% { background-position: 0 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .idle.is-on .idle-char,
  .idle.is-on .idle-char.jump,
  .idle.is-on .idle-char.celebrate,
  .idle.is-on .idle-bg-anim,
  .idle.is-on .idle-bg-anim.cosmos,
  .idle.is-on .idle-bg-anim.ultra { animation: none; }
}
.sheet-art.idle { width: min(240px, 60vw); margin: 8px auto 12px; border-radius: 12px; }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin: 6px 2px; }
.tag { display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.tag-one { background: #14110c; color: #e7b23c; box-shadow: inset 0 0 0 1px #e7b23c; }
.tag-ultra { background: #24143f; color: #d8c4ff; }
.tag-super { background: #3a2a08; color: #e7b23c; }
.tag-rare { background: #102848; color: #8eb6ff; }
.tag-less { background: #0d2a1c; color: #5ee0a0; }
.card h3 { margin: 0 6px 4px; font-size: 15px; }
.status {
  margin: 8px 2px 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  border-radius: 999px;
  padding: 8px 10px;
  -webkit-text-fill-color: currentColor;
}
.status.buy {
  background: var(--gold);
  color: #14284b;
  -webkit-text-fill-color: #14284b;
}
.status.owned {
  background: rgba(143, 208, 255, 0.16);
  color: #d7ecff;
  -webkit-text-fill-color: #d7ecff;
}
.status.reserve {
  background: transparent;
  color: #e7b23c;
  -webkit-text-fill-color: #e7b23c;
  border: 1px solid rgba(231, 178, 60, 0.7);
}
.card.feature { grid-column: 1 / -1; justify-self: center; width: min(280px, 100%); }

.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  display: flex; align-items: flex-end; justify-content: center; z-index: 20; padding: 12px;
}
.sheet[hidden] { display: none; }
.sheet-card {
  background: #10243f; width: min(520px, 100%); max-height: min(92vh, 820px);
  overflow: auto; border-radius: 20px 20px 16px 16px; padding: 16px 16px 22px;
  border: 1px solid var(--line);
}
.close { float: right; background: transparent; border: 0; color: var(--muted); cursor: pointer; }
.sheet-art { width: min(240px, 60vw); display: block; margin: 8px auto 12px; image-rendering: pixelated; border-radius: 12px; }
.tier { color: var(--gold); letter-spacing: 0.12em; font-size: 12px; margin: 0; }
#sheet-title { margin: 4px 0; font-size: 28px; }
.price { margin: 0 0 8px; }
.guide { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.flavour { color: #d5e2f5; line-height: 1.45; }
.action { margin-top: 14px; display: grid; gap: 8px; }
.action button,
button.buy {
  background: var(--gold);
  color: #14284b;
  -webkit-text-fill-color: #14284b;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
}
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input {
  background: #07111f; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.warn { color: #ffb4a8; font-size: 13px; margin: 0; }
.owner-line { font-size: 14px; color: #c5d4ea; }
.demo-pay { margin: 0; color: #14284b; background: var(--gold); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.demo-done { margin: 0; color: #d5e2f5; font-size: 14px; }

footer { border-top: 1px solid var(--line); padding: 22px 18px 40px; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 800px; margin: 0 auto; }

@media (min-width: 800px) {
  .hero { grid-template-columns: 1.3fr 0.7fr; padding-top: 64px; }
  h1 { font-size: 76px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
