:root {
  color-scheme: dark;
  --black: #080808;
  --ink: #11100e;
  --line: #5d4f31;
  --gold: #ad9154;
  --ivory: #efe8d6;
  --muted: #b9ad8c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, #1b1711 0, var(--black) 42rem);
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.viewer {
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(173, 145, 84, 0.36);
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(10px);
}

h1 {
  margin: 0;
  font-size: clamp(1rem, 2.3vw, 1.45rem);
  letter-spacing: 0;
  color: var(--ivory);
}

.topbar p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.counter {
  flex: 0 0 auto;
  min-width: 4.8rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.95rem;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.4rem) clamp(3.4rem, 7vw, 6rem);
  min-height: 0;
  overflow: hidden;
}

.page-frame {
  margin: 0;
  height: min(calc(100svh - 9.5rem), 82rem);
  max-height: 100%;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
}

.page-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-shadow: 0 1.4rem 4rem rgba(0, 0, 0, 0.62);
  user-select: none;
  -webkit-user-drag: none;
}

.support-page {
  height: min(calc(100svh - 9.5rem), 82rem);
  max-height: 100%;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  padding: clamp(1.7rem, 4.2vw, 3.8rem);
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.3)),
    url("./pages/25-support-background.png") center / cover no-repeat,
    #060606;
  border: 1px solid rgba(173, 145, 84, 0.62);
  box-shadow:
    inset 0 0 0 0.45rem rgba(173, 145, 84, 0.3),
    inset 0 0 0 0.72rem rgba(0, 0, 0, 0.82),
    0 1.4rem 4rem rgba(0, 0, 0, 0.62);
  user-select: none;
}

.support-copy {
  max-width: 28rem;
  text-align: center;
  text-shadow: 0 0.18rem 0.7rem rgba(0, 0, 0, 0.9);
}

.support-kicker {
  margin: 0 0 0.55rem;
  color: rgba(239, 232, 214, 0.72);
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  text-transform: uppercase;
}

.support-copy h2 {
  margin: 0 0 0.95rem;
  color: var(--ivory);
  font-size: clamp(1.85rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
}

.support-copy p {
  color: rgba(239, 232, 214, 0.88);
  font-size: clamp(0.94rem, 1.75vw, 1.14rem);
  line-height: 1.48;
}

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.05rem;
}

.wallet-display {
  max-width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid rgba(239, 232, 214, 0.22);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(239, 232, 214, 0.9);
  font-family: "Courier New", monospace;
  font-size: clamp(0.88rem, 1.8vw, 1rem);
}

.copy-wallet {
  min-height: 2.55rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(173, 145, 84, 0.62);
  background: rgba(10, 9, 8, 0.72);
  color: var(--ivory);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.copy-wallet:hover,
.copy-wallet:focus-visible {
  background: rgba(36, 30, 20, 0.9);
  border-color: rgba(239, 232, 214, 0.7);
  outline: none;
}

.wallet-status {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  color: rgba(239, 232, 214, 0.76);
  font-size: 0.92rem;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(2.55rem, 5vw, 3.4rem);
  height: clamp(2.55rem, 5vw, 3.4rem);
  display: grid;
  place-items: center;
  border: 1px solid rgba(173, 145, 84, 0.52);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.72);
  color: var(--ivory);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.nav:hover,
.nav:focus-visible {
  background: rgba(32, 27, 19, 0.9);
  border-color: rgba(239, 232, 214, 0.72);
  outline: none;
}

.nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.nav span {
  display: block;
  margin-top: -0.12em;
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  line-height: 1;
}

.nav-prev {
  left: clamp(0.65rem, 2vw, 1.55rem);
}

.nav-next {
  right: clamp(0.65rem, 2vw, 1.55rem);
}

.rail {
  border-top: 1px solid rgba(173, 145, 84, 0.28);
  background: rgba(8, 8, 8, 0.82);
  padding: 0.65rem clamp(0.75rem, 2vw, 1.25rem);
}

.thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 3.2rem;
  gap: 0.45rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: rgba(173, 145, 84, 0.65) rgba(255, 255, 255, 0.06);
  padding-bottom: 0.2rem;
}

.thumb {
  width: 3.2rem;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 1px solid rgba(173, 145, 84, 0.32);
  background: var(--ink);
  cursor: pointer;
}

.thumb[aria-current="true"] {
  border-color: var(--ivory);
  box-shadow: 0 0 0 2px rgba(173, 145, 84, 0.5);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-support {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0.25rem;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.28)),
    url("./pages/25-support-background.png") center / cover no-repeat,
    #060606;
  color: rgba(239, 232, 214, 0.9);
  font-size: 0.54rem;
  line-height: 1;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .stage {
    padding-inline: 0.65rem;
  }

  .page-frame,
  .support-page {
    width: min(100%, calc((100svh - 10rem) * 2 / 3));
    height: auto;
    max-height: calc(100svh - 10rem);
  }

  .support-page {
    padding: clamp(1.6rem, 8vw, 2.4rem);
  }

  .nav {
    top: auto;
    bottom: 1rem;
    transform: none;
    z-index: 2;
  }
}
