:root {
  --ink: #1f2450;
  --night: #24305e;
  --sky: #72c7ff;
  --grass: #47bf68;
  --leaf: #218a47;
  --coin: #ffd447;
  --berry: #ff5b7f;
  --paper: #fff7d6;
  --white: #ffffff;
  --shadow: #151936;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(#75cdfd 0 55%, #8be079 55% 75%, #43a94f 75% 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 58px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(#328541, #328541);
  border-top: 6px solid #226b36;
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
}

.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -2;
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  width: 74px;
  height: 28px;
  background: var(--white);
  box-shadow: 0 6px 0 rgba(31, 36, 80, .16);
}

.cloud::before,
.cloud::after {
  content: "";
  top: -18px;
}

.cloud::before {
  left: 12px;
  width: 32px;
  height: 32px;
}

.cloud::after {
  right: 14px;
  width: 38px;
  height: 38px;
}

.cloud-one {
  left: 7%;
  top: 120px;
}

.cloud-two {
  right: 8%;
  top: 190px;
  transform: scale(.78);
}

.star {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--coin);
  box-shadow: 0 0 0 4px rgba(255, 212, 71, .22);
  clip-path: polygon(50% 0, 63% 36%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 36%);
}

.star-one {
  top: 92px;
  right: 28%;
}

.star-two {
  top: 250px;
  left: 20%;
}

.star-three {
  top: 310px;
  right: 15%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 12px;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
}

.brand,
.nav a,
.pixel-button,
.level,
.section-title p,
.player-card p,
.stats label {
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-weight: 900;
  text-transform: uppercase;
}

.brand {
  text-decoration: none;
  font-size: 12px;
  color: var(--berry);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a {
  padding: 10px 12px;
  font-size: 9px;
  text-decoration: none;
  background: #dff7ff;
  border: 3px solid var(--ink);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 54px 16px 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  align-items: center;
  gap: 32px;
  min-height: 520px;
}

.eyebrow,
.section-title p {
  margin: 0 0 12px;
  color: var(--berry);
  font-size: 10px;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 76px;
  line-height: 1.06;
  text-shadow: 4px 4px 0 var(--coin);
}

h2 {
  margin-bottom: 0;
  font-size: 42px;
}

.intro,
.plain-text {
  max-width: 650px;
  font-size: 20px;
  line-height: 1.8;
  font-weight: 700;
}

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

.pixel-button,
.quest-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--coin);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.pixel-button:hover,
.quest-card a:hover,
.treasure:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.pixel-button.ghost {
  background: #b8f7ff;
}

.player-card,
.quest-card,
.inventory {
  background: var(--paper);
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--shadow);
}

.player-card {
  padding: 22px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto 22px;
  overflow: hidden;
  background: transparent;
  border: 5px solid var(--ink);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.stats p,
.stats label {
  display: block;
  margin: 0 0 14px;
  font-size: 9px;
}

.bar {
  display: block;
  height: 18px;
  margin-top: 8px;
  background: #ffffff;
  border: 3px solid var(--ink);
}

.bar span {
  display: block;
  height: 100%;
  background: var(--berry);
}

.bar.green span {
  background: var(--grass);
}

.section {
  margin-top: 72px;
}

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

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

.quest-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 22px;
}

.level {
  display: inline-block;
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 10px;
  color: var(--white);
  background: var(--night);
  border: 3px solid var(--ink);
  font-size: 8px;
}

.quest-card h3,
.inventory h3 {
  font-size: 22px;
}

.quest-card p,
.inventory li {
  font-size: 17px;
  line-height: 1.65;
}

.quest-card a {
  margin-top: auto;
  align-self: flex-start;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.inventory {
  padding: 24px;
  background: #dff7ff;
}

.inventory ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.treasure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.treasure {
  width: 92px;
  height: 92px;
  color: var(--ink);
  background: var(--coin);
  border: 5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow);
  font: 900 28px "Courier New", monospace;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.toast {
  display: inline-block;
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--paper);
  border: 4px solid var(--ink);
  font-weight: 800;
}

footer {
  padding: 28px 16px 36px;
  text-align: center;
  color: var(--white);
  background: var(--night);
  border-top: 5px solid var(--ink);
}

footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    margin: 12px 12px 0;
  }

  .nav {
    justify-content: flex-start;
  }

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

  .hero {
    min-height: 0;
    padding-top: 20px;
  }

  .player-card,
  .inventory {
    max-width: 430px;
  }

  h1 {
    font-size: 52px;
  }

  h2 {
    font-size: 34px;
  }
}

@media (max-width: 520px) {
  main {
    padding-inline: 12px;
  }

  .nav a {
    font-size: 8px;
  }

  .intro,
  .plain-text {
    font-size: 17px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 28px;
  }

  .player-card,
  .quest-card,
  .inventory {
    box-shadow: 5px 5px 0 var(--shadow);
  }

  .treasure {
    width: 76px;
    height: 76px;
    font-size: 20px;
  }
}
