:root {
  --bg: #000000;
  --cursor-x: -100px;
  --cursor-y: -100px;
  --panel: #020202;
  --panel-2: #090909;
  --panel-3: #111111;
  --line: rgba(71, 85, 105, 0.82);
  --line-soft: rgba(31, 41, 55, 0.7);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #93c5fd;
  --gold: #facc15;
  --red: #f87171;
  --green: #86efac;
  --violet: #c084fc;
  --cyan: #7dd3fc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(147, 197, 253, 0.07), transparent 28%),
    radial-gradient(circle at 80% 18%, rgba(248, 113, 113, 0.05), transparent 22%),
    linear-gradient(180deg, #030303 0%, #000 38%, #020202 100%);
  color: var(--text);
  font-family: monospace;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  cursor: none;
}

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

button {
  cursor: none;
}

strong {
  color: var(--text);
}

.site-shell {
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}

.site-cursor,
.site-cursor-shadow {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 5000;
  opacity: 0;
  transform-origin: 2px 2px;
  background-image: url("../monochrome_packed.png");
  background-repeat: no-repeat;
  background-size: 784px auto;
  background-position: -576px -96px;
  image-rendering: pixelated;
}

.site-cursor {
  transform: translate(var(--cursor-x), var(--cursor-y)) rotate(-22deg) scale(2.7);
  filter: brightness(1.3);
}

.site-cursor-shadow {
  transform: translate(calc(var(--cursor-x) + 8px), calc(var(--cursor-y) + 6px)) rotate(-22deg) scale(2.86);
  filter: brightness(0);
  opacity: 0;
}

.site-cursor.is-active {
  opacity: 1;
}

.site-cursor-shadow.is-active {
  opacity: 0.55;
}

.cursor-pressed .site-cursor {
  transform: translate(var(--cursor-x), var(--cursor-y)) rotate(-22deg) scale(2.45);
}

.cursor-pressed .site-cursor-shadow {
  transform: translate(calc(var(--cursor-x) + 8px), calc(var(--cursor-y) + 6px)) rotate(-22deg) scale(2.62);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 24px;
  background: rgba(2, 2, 2, 0.94);
  border: 2px solid rgba(71, 85, 105, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--blue);
}

main {
  display: grid;
  gap: 28px;
}

.hero,
.manual-section,
.cta-strip,
.play-section,
.feature-card {
  background: rgba(2, 2, 2, 0.94);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.9fr);
  gap: 22px;
  padding: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.16em;
}

.hero h1,
.section-head h2,
.cta-strip h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0.03em;
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.4rem, 4.8vw, 5rem);
}

.hero-text,
.manual-card p,
.feature-card p,
.play-subtitle {
  color: var(--muted);
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  letter-spacing: 0.08em;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: var(--panel-3);
}

.button-primary {
  border-color: rgba(250, 204, 21, 0.7);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.18), rgba(250, 204, 21, 0.08));
  color: var(--gold);
}

.button-primary:hover,
.button-primary:focus-visible {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.1));
}

.button-secondary {
  color: var(--blue);
}

.button-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.token-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.08), rgba(9, 9, 9, 1));
  border: 2px solid rgba(250, 204, 21, 0.35);
}

.token-card-icon {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 28px rgba(250, 204, 21, 0.18));
}

.token-card-copy {
  display: grid;
  gap: 6px;
}

.stat-card {
  padding: 18px;
  background: var(--panel-2);
  border: 2px solid var(--line-soft);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.stat-value {
  display: block;
  color: var(--text);
  line-height: 1.35;
}

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

.feature-card {
  padding: 22px;
}

.feature-card h2,
.manual-card h3 {
  margin: 0 0 12px;
  color: var(--text);
}

.manual-section,
.play-section,
.sprite-section {
  padding: 28px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

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

.manual-card {
  padding: 20px;
  background: var(--panel-2);
  border: 2px solid var(--line-soft);
}

.sprite-section {
  background: rgba(2, 2, 2, 0.94);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.sprite-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.sprite-card {
  padding: 18px;
  background: var(--panel-2);
  border: 2px solid var(--line-soft);
  text-align: center;
}

.sprite-card h3 {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.sprite {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  image-rendering: pixelated;
  background-image: url("../monochrome_packed.png");
  background-repeat: no-repeat;
  background-size: 3136px auto;
}

.sprite-militia { background-position: -1664px 0; }
.sprite-archer { background-position: -1792px -64px; }
.sprite-cleric { background-position: -1984px -64px; }
.sprite-necromancer { background-position: -1536px -384px; }
.sprite-paladin { background-position: -1984px 0; }
.sprite-boss { background-position: -1792px -320px; }

.cta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
}

.cta-strip h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
}

.game-frame {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 18px;
  background: linear-gradient(180deg, rgba(9, 9, 9, 0.98), rgba(2, 2, 2, 1));
  border: 2px solid var(--line);
  overflow: hidden;
}

.game-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.game-frame-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.is-hidden {
  display: none;
}

#game-root {
  width: 100%;
  max-width: 1360px;
  height: min(76vh, 820px);
  min-height: 360px;
  max-height: 820px;
  margin: 0 auto;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.72),
    inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 22px 28px;
  background: rgba(2, 2, 2, 0.94);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.site-footer h2 {
  margin: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
}

.footer-copy {
  max-width: 420px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.footer-ca {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 2px solid var(--line-soft);
  background: var(--panel-2);
  color: var(--muted);
  letter-spacing: 0.06em;
}

.game-frame.is-fullscreen {
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 18px;
  box-sizing: border-box;
  border: 0;
  background:
    linear-gradient(180deg, rgba(9, 9, 9, 0.98), rgba(2, 2, 2, 1));
}

.game-frame.is-fullscreen #game-root {
  width: 100%;
  max-width: none;
  height: calc(100vh - 92px);
  max-height: none;
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
}

@media (max-width: 1280px) {
  .hero,
  .feature-grid,
  .manual-grid,
  .sprite-grid {
    grid-template-columns: 1fr;
  }

  .cta-strip,
  .game-frame-head,
  .topbar,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-frame-actions {
    width: 100%;
  }

  .footer-links {
    justify-content: flex-start;
  }

  #game-root {
    height: min(62vh, 620px);
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 14px;
  }

  .hero,
  .manual-section,
  .play-section,
  .cta-strip,
  .sprite-section,
  .site-footer {
    padding: 18px;
  }

  .hero h1 {
    max-width: none;
  }

  #game-root {
    height: min(54vh, 420px);
    min-height: 260px;
  }
}

@media (hover: none), (pointer: coarse) {
  body,
  a,
  button,
  canvas {
    cursor: auto;
  }

  .site-cursor,
  .site-cursor-shadow {
    display: none;
  }
}
