/* The game's "Pixel Dungeon" palette (Sweetie-16 based). */
:root {
  --ink: #0d0e17;
  --bg: #1a1c2c;
  --panel: #333c57;
  --panel-hi: #566c86;
  --muted: #94b0c2;
  --text: #f4f4f4;
  --gold: #ffcd75;
  --orange: #ef7d57;
  --red: #b13e53;
  --green: #38b764;
  --lime: #a7f070;
  --pixel: "Press Start 2P", monospace;
  --body: "M PLUS 1p", system-ui, sans-serif;
}

@font-face {
  font-family: "Press Start 2P";
  src: url(fonts/PressStart2P-Regular.ttf) format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
  overflow-x: hidden;
}

img { image-rendering: pixelated; }

/* ---- night sky backdrop: stars, a pixel moon, the keep's silhouette and ground fog */
/* Behind the first screen only; the page below sits on the plain night colour. */
.sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: max(100vh, 640px);
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(#0d0e17 0%, #1a1c2c 45%, #29366f 100%);
  overflow: hidden;
}

.sky::after { /* fade into the page */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20vh;
  background: linear-gradient(transparent, var(--bg));
}

.stars {
  position: absolute;
  inset: 0 0 40% 0;
  background-image:
    radial-gradient(2px 2px at 8% 12%, #f4f4f4 50%, transparent 51%),
    radial-gradient(2px 2px at 23% 30%, #94b0c2 50%, transparent 51%),
    radial-gradient(2px 2px at 37% 8%, #f4f4f4 50%, transparent 51%),
    radial-gradient(2px 2px at 52% 22%, #94b0c2 50%, transparent 51%),
    radial-gradient(2px 2px at 64% 6%, #f4f4f4 50%, transparent 51%),
    radial-gradient(2px 2px at 81% 18%, #94b0c2 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 34%, #f4f4f4 50%, transparent 51%),
    radial-gradient(2px 2px at 14% 46%, #94b0c2 50%, transparent 51%),
    radial-gradient(2px 2px at 72% 42%, #f4f4f4 50%, transparent 51%);
  animation: twinkle 4s steps(2) infinite;
}

@keyframes twinkle { 50% { opacity: .6; } }

/* A blocky moon: a disc drawn with hard steps and two craters. */
.moon {
  position: absolute;
  top: 9vh;
  right: 12vw;
  width: 96px;
  height: 96px;
  background:
    radial-gradient(circle at 34% 40%, #b7c3cf 0 10px, transparent 11px),
    radial-gradient(circle at 62% 66%, #c4cfd9 0 7px, transparent 8px),
    #e4e9ee;
  clip-path: polygon(30% 0, 70% 0, 70% 6%, 82% 6%, 82% 12%, 88% 12%, 88% 18%, 94% 18%, 94% 30%, 100% 30%, 100% 70%,
    94% 70%, 94% 82%, 88% 82%, 88% 88%, 82% 88%, 82% 94%, 70% 94%, 70% 100%, 30% 100%, 30% 94%, 18% 94%, 18% 88%,
    12% 88%, 12% 82%, 6% 82%, 6% 70%, 0 70%, 0 30%, 6% 30%, 6% 18%, 12% 18%, 12% 12%, 18% 12%, 18% 6%, 30% 6%);
  filter: drop-shadow(0 0 24px rgba(228, 233, 238, .35));
}

.keep {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 46vh;
}

.fog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12vh;
  height: 14vh;
  background: linear-gradient(transparent, rgba(148, 176, 194, .08), transparent);
}

/* ---- content */
main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.hero {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

h1 { margin: 0; line-height: 0; }

.logo {
  width: min(560px, 88vw);
  height: auto;
}

.tagline {
  margin: 0 0 12px;
  font: 11px/1.8 var(--pixel);
  color: var(--muted);
  letter-spacing: .04em;
}

/* Buttons in the game's style: a flat fill, ink border, a light top edge and a dark bottom edge. Green = take the
   action (the game's ui.Primary). */
.btn {
  display: inline-block;
  min-width: 240px;
  padding: 20px 40px 18px;
  font: 22px/1 var(--pixel);
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--green);
  border: 4px solid var(--ink);
  box-shadow: inset 0 4px 0 var(--lime), inset 0 -6px 0 #257145, 0 6px 0 var(--ink), 0 0 32px rgba(56, 183, 100, .35);
  transition: transform .06s;
}

.btn:hover, .btn:focus-visible { filter: brightness(1.08); outline: none; }

.btn:focus-visible { box-shadow: inset 0 4px 0 var(--lime), inset 0 -6px 0 #257145, 0 6px 0 var(--ink), 0 0 0 4px var(--gold); }

.btn:active { transform: translateY(4px); box-shadow: inset 0 4px 0 var(--lime), inset 0 -6px 0 #257145, 0 2px 0 var(--ink); }



/* ---- champions: each idles through its 4-frame sheet (96 px frames shown at 2x) */
.party { margin: 8px 0 40px; }

.lineup {
  display: flex;
  justify-content: center;
  gap: 0;
}

.lineup i {
  --f: 96px;
  width: var(--f);
  height: var(--f);
  margin: 0 -14px;
  background: var(--s) 0 0 / calc(var(--f) * 4) var(--f) no-repeat;
  image-rendering: pixelated;
  animation: idle .9s steps(4) infinite;
  filter: drop-shadow(0 4px 0 rgba(13, 14, 23, .6));
}

.lineup i:nth-child(2n) { animation-delay: -.3s; }
.lineup i:nth-child(3n) { animation-delay: -.6s; }

@keyframes idle { to { background-position: calc(var(--f) * -4) 0; } }

/* ---- panels: stone with an ink outline and a gold trim, like the game's frames */
.panel {
  position: relative;
  padding: 24px 22px;
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 6px var(--panel), inset 0 0 0 8px rgba(13, 14, 23, .5), 0 8px 0 var(--ink);
}

.panel h2 {
  margin: 0 0 14px;
  font: 14px/1.4 var(--pixel);
  color: var(--gold);
  text-transform: uppercase;
}

.panel p { margin: 0; color: var(--text); }

.about { max-width: 720px; margin: 0 auto 48px; }

.shots + .about { margin-top: 8px; }

/* ---- screenshots: swipe on phones, a row on wide screens */
.shots {
  display: flex;
  gap: 16px;
  margin: 0 -16px 40px;
  padding: 8px 16px 8px; /* room above for the gold trim and the hover lift, which the scroller would clip */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.shots::-webkit-scrollbar { display: none; }

.shots figure {
  flex: 0 0 82%;
  margin: 0;
  scroll-snap-align: center;
}

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 2px var(--gold), 0 8px 0 var(--ink);
}

.shots figcaption {
  margin-top: 14px;
  font: 10px/1.6 var(--pixel);
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
}
.shots img { cursor: zoom-in; transition: transform .12s; }

.shots img:hover, .shots img:focus-visible { transform: translateY(-4px); outline: none; }

/* ---- a screenshot shown full size */
#zoom {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 16px;
  border: 0;
  background: rgba(13, 14, 23, .92);
  cursor: zoom-out;
}

#zoom[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

#zoom::backdrop { background: transparent; }

#zoom img {
  max-width: 100%;
  max-height: calc(100dvh - 72px);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 2px var(--gold);
}

#zoom p {
  margin: 0;
  font: 11px/1.6 var(--pixel);
  color: var(--gold);
  text-transform: uppercase;
}

@media (min-width: 760px) {
  .tagline { font-size: 13px; }
  .lineup i { --f: 128px; margin: 0 -18px; }
  .shots { margin: 0 0 56px; padding: 0; overflow: visible; }
  .shots figure { flex: 1; }
  .moon { width: 128px; height: 128px; }
}

/* Phones in landscape: little height, so a shorter hero. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 92vh; gap: 8px; }
  .logo { width: min(380px, 60vw); }
  .tagline { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .stars, .lineup i { animation: none; }
}
