:root {
  --ink: #1d1830;
  --ink-2: #302744;
  --panel: #463353;
  --cream: #fff0d1;
  --paper: #fff7e7;
  --pink: #ff7fbc;
  --hot: #ed4f9b;
  --rose: #ffc4dc;
  --gold: #ffd36e;
  --blue: #7ea6bb;
  --line: #2a213b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffdeeb;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-nav,
.game-nav {
  position: fixed;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
  padding: 10px 12px 10px 18px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 247, 231, 0.9);
  box-shadow: 0 8px 0 rgba(29, 24, 48, 0.22);
  backdrop-filter: blur(10px);
}

.game-nav {
  background: rgba(30, 24, 48, 0.88);
  color: var(--paper);
}

.play-minimal-header {
  position: fixed;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 20;
  min-height: 64px;
  pointer-events: none;
}

.back-logo {
  position: absolute;
  top: 0;
  left: 0;
  min-height: 64px;
  padding: 8px 14px 8px 10px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(30, 24, 48, 0.88);
  color: var(--paper);
  box-shadow: 0 8px 0 rgba(29, 24, 48, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.back-logo:hover {
  transform: translateY(-2px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
}

.logo-brand img {
  width: 46px;
  height: 46px;
  border: 3px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.18);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--hot);
  border: 3px solid var(--line);
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.18);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font-size: 15px;
}

.nav-links a {
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 3px;
  content: "";
  background: var(--hot);
  transition: right 160ms ease;
}

.nav-links a:hover::after {
  right: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  box-shadow: 4px 4px 0 rgba(29, 24, 48, 0.18);
}

.icon-link.dark {
  background: #382b4d;
  color: var(--paper);
}

.pixel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: var(--hot);
  color: #fff;
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.16), 5px 5px 0 rgba(29, 24, 48, 0.25);
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.pixel-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.16), 7px 7px 0 rgba(29, 24, 48, 0.25);
}

.pixel-button.small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 11px;
}

.pixel-button.secondary {
  background: var(--paper);
  color: var(--ink);
}

.hero-scene,
.play-scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg,
.play-bg {
  position: absolute;
  inset: 0;
  z-index: -5;
  background-position: center bottom;
  background-size: cover;
  image-rendering: pixelated;
  transform: scale(1.02);
}

.hero-bg {
  background-image: url("assets/hero-bg.png");
}

.play-bg {
  background-image: url("assets/play-bg.png");
  animation: slow-pan 18s ease-in-out infinite alternate;
}

.hero-shade,
.play-glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(255, 218, 235, 0.94) 0%, rgba(255, 218, 235, 0.66) 34%, rgba(255, 218, 235, 0.16) 70%),
    linear-gradient(180deg, rgba(29, 24, 48, 0.1), rgba(29, 24, 48, 0.58));
}

.play-glow {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 127, 188, 0.24), transparent 32%),
    linear-gradient(180deg, rgba(19, 15, 33, 0.12), rgba(19, 15, 33, 0.68));
}

.parallax,
.play-clouds,
.play-stars {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.layer-stars,
.play-stars {
  background-image:
    radial-gradient(#fff7d7 2px, transparent 3px),
    radial-gradient(#fff 1px, transparent 2px);
  background-position: 10% 22%, 68% 18%;
  background-size: 170px 130px, 230px 170px;
  opacity: 0.82;
  animation: twinkle 5s steps(2, end) infinite;
}

.layer-sparkles,
.play-clouds {
  background:
    linear-gradient(var(--cream), var(--cream)) 18% 28% / 90px 18px no-repeat,
    linear-gradient(var(--cream), var(--cream)) 22% 25% / 46px 18px no-repeat,
    linear-gradient(var(--cream), var(--cream)) 77% 30% / 110px 20px no-repeat,
    linear-gradient(var(--cream), var(--cream)) 72% 27% / 55px 20px no-repeat;
  opacity: 0.78;
  animation: drift 22s linear infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(680px, calc(100% - 40px));
  min-height: 100vh;
  padding: 130px 0 86px;
  margin-left: clamp(22px, 7vw, 110px);
}

.kicker {
  margin: 0 0 16px;
  color: var(--hot);
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  line-height: 1.6;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-content h1,
.connect-panel h1 {
  margin-bottom: 22px;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  text-shadow: 0 5px 0 #b13976, 5px 5px 0 var(--line);
  text-transform: uppercase;
}

.lead {
  width: min(560px, 100%);
  margin-bottom: 30px;
  color: #302744;
  font-size: clamp(19px, 2.1vw, 27px);
  line-height: 1.3;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hud-card,
.mini-hud,
.stats-row,
.connect-panel,
.bottom-dock {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(58, 42, 75, 0.9);
  color: var(--paper);
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.15), 6px 6px 0 rgba(29, 24, 48, 0.24);
}

.hero-hud {
  position: absolute;
  right: clamp(20px, 5vw, 78px);
  bottom: 44px;
  z-index: 3;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.hud-card div,
.stats-row div {
  min-width: 126px;
  padding: 12px 14px;
  background: rgba(29, 24, 48, 0.38);
}

.hud-card span,
.stats-row span,
.mini-hud span {
  display: block;
  margin-bottom: 6px;
  color: var(--rose);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.hud-card strong,
.stats-row strong,
.mini-hud strong {
  color: var(--cream);
  font-size: 20px;
}

.section-band {
  padding: clamp(66px, 9vw, 110px) clamp(22px, 6vw, 88px);
  background: var(--paper);
}

.section-copy {
  max-width: 760px;
}

.section-copy h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.12;
}

.section-copy p {
  max-width: 650px;
  color: #594a65;
  font-size: 21px;
  line-height: 1.45;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 36px;
}

.feature-grid article {
  min-height: 190px;
  padding: 24px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #ffe2ef;
  box-shadow: 7px 7px 0 rgba(29, 24, 48, 0.14);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 38px;
  margin-bottom: 18px;
  color: #fff;
  background: var(--hot);
  border: 3px solid var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}

.feature-grid h3 {
  margin-bottom: 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 20px;
}

.feature-grid p {
  margin-bottom: 0;
  color: #594a65;
  font-size: 18px;
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
  background: #2a213b;
  color: var(--paper);
}

.split .section-copy p {
  color: #ffd9ea;
}

.split h2 {
  color: #fff;
}

.pixel-frame {
  overflow: hidden;
  border: 4px solid #120f1d;
  border-radius: 8px;
  background: #ffc2dc;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.3);
}

.pixel-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  image-rendering: pixelated;
}

.text-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--gold);
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.docs-section {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(42, 33, 59, 0.94), rgba(42, 33, 59, 0.94)),
    url("assets/banner.png") center / cover;
  color: var(--paper);
}

.docs-section::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    radial-gradient(#fff7d7 2px, transparent 3px),
    radial-gradient(#ff7fbc 2px, transparent 3px);
  background-size: 180px 140px, 260px 190px;
  opacity: 0.18;
  pointer-events: none;
}

.docs-section > * {
  position: relative;
  z-index: 1;
}

.docs-section .section-copy p {
  color: #ffe1ef;
}

.docs-section h2 {
  color: #fff;
}

.book-shell {
  position: relative;
  max-width: 100%;
  min-height: 560px;
  margin-top: 38px;
  padding: 34px 34px 92px;
  overflow: hidden;
  border: 4px solid #140f20;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 15, 32, 0.36), transparent 16%, transparent 84%, rgba(20, 15, 32, 0.36)),
    #5a405f;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.22), 10px 10px 0 rgba(0, 0, 0, 0.28);
}

.book-page {
  position: absolute;
  top: 34px;
  left: 50%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(620px, calc(100% - 68px));
  min-height: 430px;
  padding: clamp(24px, 4vw, 46px);
  border: 4px solid #140f20;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(237, 79, 155, 0.12), transparent 24%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(48, 39, 68, 0.08) 31px 34px),
    #fff7e7;
  color: var(--ink);
  opacity: 0;
  box-shadow: inset -8px -8px 0 rgba(237, 79, 155, 0.11), 6px 6px 0 rgba(0, 0, 0, 0.24);
  transform: translateX(-50%) translateY(18px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.book-page.is-active {
  z-index: 2;
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.book-page::after {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 34px;
  height: 28px;
  content: "";
  border-right: 4px solid rgba(237, 79, 155, 0.28);
  border-bottom: 4px solid rgba(237, 79, 155, 0.28);
}

.book-page h3 {
  margin-bottom: 16px;
  color: var(--hot);
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  line-height: 1.3;
  text-transform: uppercase;
}

.book-page p,
.book-page li {
  color: #4d4158;
  font-size: 18px;
  line-height: 1.45;
}

.book-page ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  margin: 18px 0 0;
}

.page-number {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 34px;
  margin-bottom: 20px;
  border: 3px solid var(--line);
  background: var(--hot);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}

.cover-page,
.final-page,
.token-page {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.5), transparent 16%),
    linear-gradient(135deg, #ffe2ef, #fff7e7 54%, #ffd3e7);
}

.cover-page img {
  width: 150px;
  height: 150px;
  margin-top: 26px;
  border: 4px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
}

.book-controls {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 14px;
}

.book-arrow {
  display: grid;
  place-items: center;
  width: 72px;
  height: 54px;
  border: 3px solid #140f20;
  border-radius: 6px;
  background: var(--hot);
  color: #fff;
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.16), 5px 5px 0 rgba(0, 0, 0, 0.22);
  font-family: "Press Start 2P", monospace;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.book-arrow:disabled {
  opacity: 0.42;
  cursor: default;
  filter: grayscale(0.6);
}

.book-count {
  justify-self: center;
  padding: 14px 18px;
  border: 3px solid #140f20;
  border-radius: 6px;
  background: #241b33;
  color: var(--cream);
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.3;
  text-transform: uppercase;
}

.rewards {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  min-height: 430px;
  background:
    linear-gradient(rgba(255, 226, 239, 0.9), rgba(255, 226, 239, 0.9)),
    url("assets/banner.png") center / cover;
}

.play-page {
  min-height: 100vh;
  overflow: hidden;
  background: #161126;
}

.play-scene {
  display: grid;
  place-items: center;
  padding: 120px 24px 110px;
}

.mini-hud {
  position: absolute;
  top: 112px;
  left: 28px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
  padding: 10px 14px;
}

.mini-hud img {
  width: 62px;
  height: 62px;
  border: 3px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  image-rendering: pixelated;
}

.stats-row {
  position: absolute;
  top: 112px;
  right: 28px;
  z-index: 3;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.connect-panel {
  position: relative;
  z-index: 4;
  width: min(610px, 100%);
  padding: clamp(24px, 4vw, 42px);
  text-align: center;
  background: rgba(42, 33, 59, 0.84);
  backdrop-filter: blur(8px);
}

.connect-panel h1 {
  margin-bottom: 18px;
  font-size: clamp(30px, 5vw, 58px);
}

.panel-x-button {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 50px;
  margin: 0 auto 22px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--hot);
  box-shadow: inset -5px -5px 0 rgba(237, 79, 155, 0.14), 5px 5px 0 rgba(0, 0, 0, 0.22);
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  text-transform: uppercase;
}

.panel-x-button:hover {
  transform: translate(-2px, -2px);
}

.connect-panel p:not(.kicker) {
  max-width: 420px;
  margin: 0 auto 26px;
  color: #ffe1ef;
  font-size: 19px;
  line-height: 1.4;
}

.connect {
  width: min(330px, 100%);
}

.connect:disabled {
  cursor: wait;
  opacity: 0.72;
}

.connect.is-connected {
  background: #44b88d;
}

.wallet-status {
  min-height: 24px;
  margin: 16px auto 0;
  color: var(--cream);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.6;
}

.bottom-dock {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 5;
  display: flex;
  gap: 10px;
  width: min(760px, calc(100% - 36px));
  padding: 10px;
  transform: translateX(-50%);
}

.bottom-dock span {
  flex: 1;
  min-width: 0;
  padding: 16px 10px;
  border: 2px solid rgba(255, 240, 209, 0.28);
  background: rgba(29, 24, 48, 0.52);
  color: var(--rose);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}

@keyframes drift {
  from {
    transform: translateX(-7%);
  }
  to {
    transform: translateX(7%);
  }
}

@keyframes twinkle {
  50% {
    opacity: 0.44;
  }
}

@keyframes slow-pan {
  from {
    transform: scale(1.03) translateX(-1.5%);
  }
  to {
    transform: scale(1.03) translateX(1.5%);
  }
}

@media (max-width: 920px) {
  .site-nav,
  .game-nav {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .play-minimal-header {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .nav-links {
    display: none;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(255, 218, 235, 0.94) 0%, rgba(255, 218, 235, 0.6) 52%, rgba(29, 24, 48, 0.62) 100%);
  }

  .hero-content {
    width: calc(100% - 36px);
    margin: 0 auto;
    padding-top: 118px;
  }

  .hero-hud {
    left: 18px;
    right: 18px;
    bottom: 18px;
    overflow-x: auto;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .book-shell {
    min-height: 590px;
    padding: 20px 18px 94px;
  }

  .book-page {
    top: 20px;
    width: calc(100% - 36px);
    min-height: 462px;
  }

  .book-page p,
  .book-page li {
    font-size: 16px;
  }

  .book-controls {
    left: 14px;
    right: 14px;
    grid-template-columns: 58px 1fr 58px;
    gap: 8px;
  }

  .book-arrow {
    width: 58px;
    height: 50px;
  }

  .book-count {
    padding: 12px 8px;
    font-size: 9px;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .rewards {
    align-items: start;
    flex-direction: column;
  }

  .mini-hud,
  .stats-row {
    display: none;
  }

  .bottom-dock {
    overflow-x: auto;
  }

  .bottom-dock span {
    flex: 0 0 138px;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 12px;
  }

  .logo-brand img {
    width: 38px;
    height: 38px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .icon-link {
    width: 38px;
    height: 38px;
  }

  .pixel-button.small {
    padding: 0 12px;
  }

  .back-logo span {
    display: none;
  }

  .hero-content h1 {
    font-size: 46px;
  }

  .lead,
  .section-copy p {
    font-size: 18px;
  }

  .section-copy h2 {
    font-size: 28px;
  }

  .play-scene {
    padding-inline: 16px;
  }

  .connect-panel {
    margin-top: 42px;
  }
}
