/* Graveyard page */

html:has(body.graveyard-shell),
body.graveyard-shell {
  background: #0a0c12;
  color: #d8dce8;
}

body.graveyard-shell {
  position: relative;
  overflow-x: hidden;
}

.graveyard-sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 110%, rgba(24, 32, 28, 0.95) 0%, transparent 55%),
    linear-gradient(180deg, #12131f 0%, #0a0c12 45%, #07080d 100%);
  z-index: 0;
}


.graveyard-fog {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 220px;
  background: linear-gradient(90deg, transparent, rgba(180, 190, 200, 0.08), transparent);
  filter: blur(18px);
  animation: graveyard-fog-drift 24s linear infinite;
}
.graveyard-fog--back {
  bottom: 18%;
  opacity: 0.5;
  animation-duration: 32s;
}
.graveyard-fog--front {
  bottom: 8%;
  opacity: 0.35;
  animation-duration: 20s;
  animation-direction: reverse;
}

@keyframes graveyard-fog-drift {
  from { transform: translateX(-8%); }
  to { transform: translateX(8%); }
}

.graveyard-ghosts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.graveyard-ghost-emote {
  position: absolute;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: opacity, transform;
  transition: opacity 1.8s ease-in-out;
  user-select: none;
}

.graveyard-ghost-emote-move {
  display: block;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(180, 200, 255, 0.25));
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.graveyard-ghost-emote.is-active {
  animation: graveyard-ghost-rise var(--float-duration, 14s) ease-in-out infinite alternate;
}

.graveyard-ghost-emote.is-active .graveyard-ghost-emote-move {
  animation: graveyard-ghost-drift var(--orbit-duration, 10s) linear infinite;
}

@keyframes graveyard-ghost-drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12.5% {
    transform: translate3d(calc(var(--orbit-x, 26px) * 0.7), calc(var(--orbit-y, 16px) * -0.7), 0) rotate(6deg);
  }
  25% {
    transform: translate3d(var(--orbit-x, 26px), 0, 0) rotate(10deg);
  }
  37.5% {
    transform: translate3d(calc(var(--orbit-x, 26px) * 0.7), calc(var(--orbit-y, 16px) * 0.7), 0) rotate(4deg);
  }
  50% {
    transform: translate3d(0, var(--orbit-y, 16px), 0) rotate(-8deg);
  }
  62.5% {
    transform: translate3d(calc(var(--orbit-x, 26px) * -0.7), calc(var(--orbit-y, 16px) * 0.7), 0) rotate(-5deg);
  }
  75% {
    transform: translate3d(calc(var(--orbit-x, 26px) * -1), 0, 0) rotate(-10deg);
  }
  87.5% {
    transform: translate3d(calc(var(--orbit-x, 26px) * -0.7), calc(var(--orbit-y, 16px) * -0.7), 0) rotate(-3deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

@keyframes graveyard-ghost-rise {
  from {
    transform: translate(-50%, -50%) translate3d(0, 0, 0);
  }
  to {
    transform: translate(-50%, -50%) translate3d(var(--drift-side, 0px), calc(var(--drift-up, 48px) * -1), 0);
  }
}
.site-bar--graveyard {
  position: relative;
  z-index: 10;
  background: rgba(8, 10, 16, 0.82);
  border-bottom: 1px solid rgba(120, 130, 150, 0.18);
  backdrop-filter: blur(8px);
}
.site-bar--graveyard .site-bar-nav a {
  color: #e8ebf2;
}

.graveyard-page {
  position: relative;
  z-index: 3;
  padding: 88px 0 64px;
  min-height: 70vh;
}

.graveyard-moon {
  position: absolute;
  top: 72px;
  right: 12%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d8 0%, #d8cfaa 45%, #8a8470 100%);
  box-shadow: 0 0 40px rgba(255, 246, 216, 0.25);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.graveyard-header {
  text-align: center;
  margin-bottom: 36px;
}

.graveyard-kicker {
  color: #9a7bd8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.graveyard-page h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: #f0f2f8;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  margin-bottom: 10px;
}

.graveyard-lede {
  color: #9aa3b8;
  max-width: 52ch;
  margin: 0 auto;
}

.graveyard-empty {
  text-align: center;
  color: #8a93a8;
  font-style: italic;
  padding: 48px 20px;
  border: 1px dashed rgba(120, 130, 150, 0.25);
  border-radius: 16px;
  background: rgba(12, 14, 20, 0.55);
}

.graveyard-ground {
  margin-top: 8px;
}

.graveyard-ground-title {
  text-align: center;
  font-size: 1.1rem;
  color: #b8c0d0;
  margin-bottom: 20px;
  font-weight: 700;
}

.graveyard-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 64px 56px;
  padding: 20px 12px 56px;
  min-height: 180px;
}

.grave {
  flex: 0 1 122px;
  align-self: flex-start;
  display: flex;
  justify-content: center;
  position: relative;
  overflow: visible;
  padding: 12px 8px 16px;
  margin-top: var(--row-nudge, 0px);
  transform: rotate(var(--tilt, 0deg)) translate(var(--shift-x, 0px), var(--shift-y, 0px));
  animation: graveyard-rise 0.7s ease both;
  animation-delay: var(--delay, 0ms);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.grave:hover {
  filter: brightness(1.08);
  transform: rotate(var(--tilt, 0deg)) translate(var(--shift-x, 0px), calc(var(--shift-y, 0px) - 3px));
}

.grave:focus-visible {
  outline: 2px solid rgba(154, 123, 216, 0.85);
  outline-offset: 4px;
  border-radius: 8px;
}

.grave-stone-wrap {
  position: relative;
  overflow: visible;
}

.grave::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 118%;
  height: 12px;
  background: linear-gradient(180deg, #3a4038 0%, #2a3028 100%);
  border-radius: 2px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

@keyframes graveyard-rise {
  from {
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) translate(var(--shift-x, 0px), calc(var(--shift-y, 0px) + 24px));
  }
  to {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg)) translate(var(--shift-x, 0px), var(--shift-y, 0px));
  }
}

.grave-stone {
  position: relative;
  overflow: hidden;
  width: 122px;
  min-height: 168px;
  padding: 14px 11px 16px;
  text-align: center;
  color: #2a2e36;
  background:
    linear-gradient(165deg, #8f959f 0%, #6f757f 38%, #565c66 100%);
  border: 2px solid #4a5058;
  border-radius: 48% 48% 8px 8px / 28% 28% 8px 8px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -8px 16px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.grave-cobweb {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  color: rgba(214, 222, 234, 0.82);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.grave-cobweb--overlay {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grave-stone-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.grave-cross {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: -4px;
  font-size: 22px;
  color: rgba(30, 34, 42, 0.55);
  line-height: 1;
  pointer-events: none;
}

.grave-rip,
.grave-name,
.grave-deaths,
.grave-head {
  position: relative;
  z-index: 2;
}

.grave-spider {
  position: absolute;
  bottom: var(--spider-bottom, 24%);
  left: var(--spider-left, 18%);
  font-size: var(--spider-size, 12px);
  line-height: 1;
  opacity: var(--spider-opacity, 0.88);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  animation: grave-spider-crawl var(--spider-duration, 3.8s) ease-in-out infinite alternate;
  animation-delay: var(--spider-delay, 0s);
}

@keyframes grave-spider-crawl {
  0% {
    transform: translateX(0) scaleX(var(--spider-dir, 1));
  }
  100% {
    transform: translateX(calc(var(--spider-travel, 12px) * var(--spider-dir, 1))) scaleX(var(--spider-dir, 1));
  }
}

.grave-crack {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, rgba(18, 22, 28, 0.15), rgba(18, 22, 28, 0.65), rgba(18, 22, 28, 0.2));
  border-radius: 2px;
  pointer-events: none;
  transform: rotate(var(--crack-tilt, 20deg));
}

.grave-crack--one {
  top: 42%;
  left: 30%;
  height: 28px;
}

.grave-crack--two {
  top: 56%;
  left: 58%;
  height: 20px;
}

.grave-rip {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(26, 30, 38, 0.75);
}

.grave-name {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
  color: #1a1e26;
}

.grave-deaths {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 11px;
  font-weight: 700;
  color: #3a2838;
}

.grave-head {
  display: block;
  margin: 12px auto 2px;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border: 1px solid rgba(26, 30, 38, 0.35);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
}

.footer--graveyard {
  position: relative;
  z-index: 3;
  background: rgba(8, 10, 16, 0.9);
  border-top: 1px solid rgba(120, 130, 150, 0.15);
}

@media (max-width: 640px) {
  .graveyard-moon {
    top: 64px;
    right: 8%;
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .graveyard-fog,
  .grave {
    animation: none;
  }
  .graveyard-ghosts {
    display: none;
  }

  .grave-spider {
    animation: none;
  }
}
