:root {
  color-scheme: dark;
  --bg: #080807;
  --ink: #0f0d0a;
  --black: #12100d;
  --panel: rgba(23, 19, 15, 0.86);
  --panel-solid: #19140f;
  --line: rgba(225, 190, 112, 0.32);
  --line-strong: rgba(225, 190, 112, 0.62);
  --gold: #e5bd63;
  --gold-soft: #f4dfaa;
  --cream: #fff0c6;
  --muted: #bcae8b;
  --red: #7c241f;
  --red-soft: #b04a35;
  --green: #75b6a3;
  --blue: #8ca8d8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.78), rgba(8, 8, 7, 0.94)),
    url("assets/official/site-bg.png") center top / cover,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 74px 100%,
    linear-gradient(180deg, rgba(124, 36, 31, 0.28) 0%, transparent 34rem),
    var(--bg);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.08), #080807 84%),
    linear-gradient(120deg, rgba(124, 36, 31, 0.3), transparent 28rem);
}

.site-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(229, 189, 99, 0.045) 1px, transparent 1px) 0 0 / 88px 88px,
    linear-gradient(0deg, rgba(229, 189, 99, 0.032) 1px, transparent 1px) 0 0 / 88px 88px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

.site-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(114deg, transparent 0 47%, rgba(229, 189, 99, 0.16) 47.1%, transparent 47.4%),
    linear-gradient(91deg, transparent 0 17%, rgba(255, 240, 198, 0.08) 17.05%, transparent 17.2%),
    linear-gradient(88deg, transparent 0 73%, rgba(176, 74, 53, 0.18) 73.05%, transparent 73.25%);
  opacity: 0.8;
}

.linework {
  position: absolute;
  inset: -8vh -12vw;
  opacity: 0.78;
}

.curve,
.slash,
.rail {
  position: absolute;
  pointer-events: none;
}

.curve {
  border: 1px solid rgba(244, 223, 170, 0.2);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(229, 189, 99, 0.06);
}

.curve-a {
  top: 5vh;
  right: -11vw;
  width: min(72vw, 980px);
  height: min(34vw, 470px);
  border-left-color: transparent;
  border-bottom-color: rgba(176, 74, 53, 0.2);
  transform: rotate(-18deg);
}

.curve-b {
  top: 31vh;
  left: -18vw;
  width: min(92vw, 1250px);
  height: min(42vw, 560px);
  border-right-color: rgba(229, 189, 99, 0.32);
  border-top-color: transparent;
  transform: rotate(10deg);
}

.curve-c {
  right: 15vw;
  bottom: 4vh;
  width: min(58vw, 720px);
  height: min(21vw, 270px);
  border-color: rgba(140, 168, 216, 0.16);
  transform: rotate(23deg);
}

.slash {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 223, 170, 0.56), rgba(176, 74, 53, 0.36), transparent);
  transform-origin: left center;
}

.slash-a {
  top: 18vh;
  left: 4vw;
  width: 68vw;
  transform: rotate(-7deg);
}

.slash-b {
  top: 52vh;
  right: -3vw;
  width: 54vw;
  transform: rotate(14deg);
}

.slash-c {
  bottom: 18vh;
  left: 18vw;
  width: 45vw;
  opacity: 0.75;
  transform: rotate(-18deg);
}

.rail {
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(229, 189, 99, 0.34), transparent);
}

.rail-a {
  top: -3vh;
  left: 10vw;
  height: 112vh;
  transform: rotate(1.5deg);
}

.rail-b {
  top: 8vh;
  right: 26vw;
  height: 86vh;
  background: linear-gradient(180deg, transparent, rgba(255, 240, 198, 0.2), rgba(176, 74, 53, 0.22), transparent);
  transform: rotate(-2deg);
}

.backdrop-sigil {
  position: absolute;
  top: 74px;
  right: -34px;
  width: min(46vw, 620px);
  opacity: 0.2;
  filter: sepia(0.2) saturate(0.85);
}

.backdrop-role {
  position: absolute;
  bottom: -34px;
  max-height: 70vh;
  opacity: 0.18;
  filter: saturate(0.86) contrast(0.98);
}

.role-a {
  right: 3vw;
}

.role-b {
  left: -30px;
  opacity: 0.12;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(229, 189, 99, 0.24);
  background:
    linear-gradient(100deg, rgba(176, 74, 53, 0.12), transparent 38%),
    rgba(8, 8, 7, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(255, 240, 198, 0.6);
  color: #171008;
  background: var(--gold);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

.official-logo {
  width: 96px;
  max-height: 46px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a,
.bulk-link {
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.site-nav a:hover,
.bulk-link:hover {
  border-color: var(--line);
  color: var(--cream);
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 64px);
}

.catalog-shell {
  position: relative;
  min-height: calc(100vh - 70px);
}

.catalog-shell::before {
  content: "";
  position: absolute;
  top: 32px;
  right: 4%;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 189, 99, 0.54), transparent);
  transform: rotate(-2.2deg);
  pointer-events: none;
}

.catalog-shell::after {
  content: "";
  position: absolute;
  top: 116px;
  left: -8%;
  width: 58%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 74, 53, 0.5), transparent);
  transform: rotate(7deg);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.72fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: stretch;
  padding: 32px 0 26px;
}

.hero-layout::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 86px;
  width: min(54vw, 760px);
  height: min(18vw, 230px);
  border-top: 1px solid rgba(244, 223, 170, 0.24);
  border-radius: 50%;
  transform: rotate(-9deg);
  pointer-events: none;
}

.catalog-head {
  display: grid;
  align-content: end;
  min-height: 420px;
}

h1,
h2,
p {
  margin: 0;
}

.series-line {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  max-width: 780px;
  margin-top: 12px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 8.8vw, 126px);
  line-height: 0.86;
  font-weight: 900;
  text-shadow: 0 12px 38px rgba(0, 0, 0, 0.55);
}

.catalog-head p:not(.series-line) {
  max-width: 670px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.55;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.stats span {
  position: relative;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(229, 189, 99, 0.08), transparent),
    rgba(16, 13, 10, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.stats span::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 9px;
  width: 34px;
  height: 1px;
  background: rgba(229, 189, 99, 0.42);
  transform: rotate(-12deg);
}

.stats strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-soft);
  font-size: 30px;
  line-height: 1;
}

.official-window {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(8, 8, 7, 0.1), rgba(8, 8, 7, 0.78)),
    url("assets/official/first-panel-3.webp") center / cover;
  box-shadow: var(--shadow);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.official-window::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 240, 198, 0.34);
  clip-path: polygon(0 0, 92% 0, 100% 16%, 100% 100%, 8% 100%, 0 84%);
}

.official-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 8, 7, 0.82), transparent 54%, rgba(8, 8, 7, 0.5));
}

.window-copy::before {
  content: "";
  position: absolute;
  left: -16px;
  right: 28px;
  top: -18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 189, 99, 0.72), transparent);
  transform: rotate(-3deg);
}

.window-copy {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 34px;
  z-index: 1;
}

.window-copy span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.window-copy strong {
  display: block;
  max-width: 430px;
  margin-top: 8px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.05;
}

.character-rail {
  position: absolute;
  z-index: 1;
  right: 20px;
  top: 22px;
  display: grid;
  gap: 8px;
  width: 90px;
}

.character-rail img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  border: 1px solid rgba(255, 240, 198, 0.24);
  background: rgba(8, 8, 7, 0.5);
}

.toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 12, 10, 0.92);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.toolbar::before {
  content: "";
  position: absolute;
  left: -10%;
  right: 6%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 189, 99, 0.28), rgba(176, 74, 53, 0.22), transparent);
  transform: rotate(-1.4deg);
  pointer-events: none;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-box svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px 0 42px;
  border: 1px solid rgba(229, 189, 99, 0.24);
  color: var(--cream);
  background: rgba(5, 5, 4, 0.82);
  outline: none;
}

.search-box input:focus {
  border-color: var(--gold);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  min-height: 46px;
  padding: 4px;
  border: 1px solid rgba(229, 189, 99, 0.22);
  background: rgba(5, 5, 4, 0.7);
}

.segmented button {
  min-width: 94px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.segmented button.active {
  color: #15100a;
  background: var(--gold);
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding-bottom: 58px;
}

.pet-card {
  position: relative;
  display: grid;
  grid-template-rows: 134px auto auto;
  min-height: 296px;
  border: 1px solid rgba(229, 189, 99, 0.22);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(124, 36, 31, 0.16), transparent 44%),
    var(--panel);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 296px 232px;
  cursor: pointer;
}

.pet-card:hover,
.pet-card:focus-visible {
  border-color: rgba(229, 189, 99, 0.62);
  outline: none;
}

.pet-card::before {
  content: "";
  position: absolute;
  left: -16px;
  right: 18px;
  top: 41%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 189, 99, 0.25), transparent);
  transform: rotate(-4deg);
  pointer-events: none;
}

.pet-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-top: 1px solid rgba(244, 223, 170, 0.22);
  border-right: 1px solid rgba(244, 223, 170, 0.22);
  transform: skew(-12deg);
  pointer-events: none;
}

.sprite-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 134px;
  border-bottom: 1px solid rgba(229, 189, 99, 0.18);
  background:
    linear-gradient(90deg, rgba(229, 189, 99, 0.055) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(51, 34, 22, 0.85), rgba(11, 10, 9, 0.96));
  overflow: hidden;
}

.sprite-stage::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 76px;
  border: 1px solid rgba(229, 189, 99, 0.16);
  border-radius: 50%;
  transform: rotate(-16deg);
}

.sprite-stage::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 16px;
  bottom: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 74, 53, 0.4), transparent);
  transform: rotate(5deg);
}

.pet-preview {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.48));
}

.pet-copy {
  padding: 16px 16px 12px;
}

.pet-copy h2 {
  min-height: 30px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pet-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(229, 189, 99, 0.34);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.official {
  border-color: rgba(117, 182, 163, 0.56);
  color: #a8d8ca;
}

.badge.cute {
  border-color: rgba(229, 189, 99, 0.62);
  color: var(--gold-soft);
}

.pet-card.cute-variant .sprite-stage {
  background:
    linear-gradient(90deg, rgba(229, 189, 99, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(65, 39, 25, 0.9), rgba(11, 10, 9, 0.96));
}

.details-link,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  color: #15100a;
  background: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.details-link {
  border: 1px solid rgba(229, 189, 99, 0.36);
  color: var(--cream);
  background: rgba(5, 5, 4, 0.68);
}

.details-link:hover {
  border-color: var(--gold);
}

.download {
  border: 0;
}

.download:hover {
  background: var(--gold-soft);
}

.download svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.source-panel {
  margin-top: 12px;
  padding: 30px 0 20px;
  border-top: 1px solid var(--line);
}

.source-panel h2 {
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.source-grid a {
  position: relative;
  min-height: 54px;
  padding: 16px;
  border: 1px solid rgba(229, 189, 99, 0.24);
  color: var(--cream);
  background: rgba(23, 19, 15, 0.74);
  text-decoration: none;
  font-size: 13px;
  font-weight: 820;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.source-grid a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 20px;
  bottom: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 189, 99, 0.38), transparent);
  transform: rotate(-2deg);
}

.source-panel p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.detail-shell {
  position: relative;
  display: grid;
  gap: 28px;
  min-height: calc(100vh - 70px);
}

.detail-shell::before,
.detail-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 189, 99, 0.48), rgba(176, 74, 53, 0.32), transparent);
  pointer-events: none;
}

.detail-shell::before {
  top: 72px;
  left: -7%;
  width: 64%;
  transform: rotate(-5deg);
}

.detail-shell::after {
  top: 176px;
  right: -8%;
  width: 58%;
  transform: rotate(8deg);
}

.back-link {
  width: max-content;
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.back-link:hover {
  color: var(--cream);
  border-color: var(--gold);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 68px);
  align-items: stretch;
}

.detail-stage {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 590px;
  padding: 28px 22px 108px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(90deg, rgba(229, 189, 99, 0.055) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(180deg, rgba(51, 34, 22, 0.88), rgba(8, 8, 7, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
}

.detail-stage::before {
  content: "";
  position: absolute;
  width: min(88%, 520px);
  height: 170px;
  border: 1px solid rgba(244, 223, 170, 0.18);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.detail-stage::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 6%;
  bottom: 78px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 74, 53, 0.58), transparent);
  transform: rotate(4deg);
}

.detail-sprite-frame {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(76vw, 430px);
  max-width: 100%;
  height: min(58vh, 460px);
  min-height: 360px;
  overflow: hidden;
  contain: layout paint;
}

.detail-sprite {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 192px;
  height: 208px;
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  background-position: 0 var(--row-y, 0px);
  transform: translate(-50%, -50%) scale(var(--sprite-scale, 2));
  transform-origin: center;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.52));
  animation: atlas-state var(--duration, 1.1s) steps(var(--frames, 6)) infinite;
  will-change: background-position;
}

@keyframes atlas-state {
  from {
    background-position: 0 var(--row-y, 0px);
  }

  to {
    background-position: var(--end-x, -1152px) var(--row-y, 0px);
  }
}

.state-tabs {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.state-tabs button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(229, 189, 99, 0.28);
  color: var(--muted);
  background: rgba(5, 5, 4, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.state-tabs button.active {
  color: #15100a;
  border-color: var(--gold);
  background: var(--gold);
}

.detail-copy {
  align-self: center;
}

.detail-copy h1 {
  max-width: 900px;
  font-size: clamp(50px, 7.6vw, 110px);
}

.detail-summary {
  max-width: 760px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
}

.variant-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(98px, 1fr));
  gap: 4px;
  min-height: 44px;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid rgba(229, 189, 99, 0.24);
  background: rgba(5, 5, 4, 0.68);
}

.variant-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.variant-link.active {
  color: #15100a;
  background: var(--gold);
}

.variant-link.disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

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

.detail-actions a {
  min-height: 42px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  color: var(--cream);
  background: rgba(10, 8, 7, 0.72);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.detail-actions a.primary {
  color: #15100a;
  background: var(--gold);
}

.detail-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(280px, 0.52fr);
  gap: 18px;
}

.info-panel,
.source-art-panel {
  position: relative;
  border: 1px solid rgba(229, 189, 99, 0.24);
  background: rgba(23, 19, 15, 0.78);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.info-panel {
  padding: 22px;
}

.info-panel h2,
.source-art-panel h2 {
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.info-item {
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(229, 189, 99, 0.16);
  background: rgba(5, 5, 4, 0.46);
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.info-item strong,
.info-item a {
  display: block;
  margin-top: 6px;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-art-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 390px;
  padding: 22px;
  overflow: hidden;
}

.source-art-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  margin-top: 10px;
  border: 1px solid rgba(229, 189, 99, 0.14);
  background:
    linear-gradient(90deg, rgba(229, 189, 99, 0.045) 1px, transparent 1px) 0 0 / 30px 30px,
    rgba(5, 5, 4, 0.42);
}

.source-art-wrap img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.42));
}

.empty {
  grid-column: 1 / -1;
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(229, 189, 99, 0.42);
  color: var(--muted);
  background: rgba(23, 19, 15, 0.56);
}

@media (max-width: 1050px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .detail-hero,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .catalog-head {
    min-height: auto;
  }

  .official-window {
    min-height: 320px;
  }

  .detail-stage {
    min-height: 520px;
    padding-bottom: 104px;
  }

  .backdrop-role {
    opacity: 0.08;
  }
}

@media (max-width: 900px) {
  .site-header,
  .toolbar,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    align-items: stretch;
  }

  .site-nav {
    justify-content: space-between;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px;
  }

  .site-header {
    padding: 14px 18px;
  }

  .official-logo,
  .brand small,
  .backdrop-role,
  .backdrop-sigil {
    display: none;
  }

  .site-nav a {
    padding-inline: 8px;
    font-size: 12px;
  }

  .stats,
  .segmented,
  .result-line,
  .result-actions,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .stats,
  .result-line,
  .result-actions {
    display: grid;
  }

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

  h1 {
    font-size: 58px;
  }

  .official-window {
    min-height: 280px;
  }

  .detail-stage {
    min-height: 430px;
    padding: 18px 14px 96px;
  }

  .detail-sprite-frame {
    width: min(100%, 330px);
    height: min(54vh, 330px);
    min-height: 292px;
  }

  .detail-copy h1 {
    font-size: 54px;
  }

  .detail-sprite {
    transform: translate(-50%, -50%) scale(var(--sprite-mobile-scale, 1.55));
  }

  .state-tabs {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .state-tabs button {
    min-height: 30px;
    padding: 0 7px;
    font-size: 10px;
  }

  .window-copy {
    left: 18px;
    right: 88px;
    bottom: 20px;
  }

  .window-copy strong {
    font-size: 20px;
    line-height: 1.04;
  }

  .character-rail {
    top: 20px;
    right: 14px;
    width: 62px;
  }

  .character-rail img {
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pet-sprite {
    animation: none;
  }
}
