:root {
  --bg: #07020a;
  --panel: #14040a;
  --panel-hover: #2a0712;
  --crimson: #c1121f;
  --crimson-bright: #e0263a;
  --crimson-dark: #6e0a1a;
  --bone: #eadfcb;
  --bone-dim: #a8998a;
  --gold: #e9b949;
  --gold-dark: #9a6b12;
  --shadow: #000;

  --px: 4px; /* size of one "pixel" in borders and shadows */

  --font-display: "Pixelify Sans", "Courier New", monospace;
  --font-body: "VT323", "Courier New", monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #2a0510 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, #1a0309 0%, transparent 70%),
    var(--bg);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.25;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  z-index: 0;
  pointer-events: none;
  animation: twinkle 4s steps(2) infinite;
}

.moon {
  position: fixed;
  top: 28px;
  right: 28px;
  width: 128px;
  height: 128px;
  z-index: 0;
  pointer-events: none;
  background: center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 28px rgba(193, 18, 31, 0.55));
}

.bat-layer {
  position: fixed;
  inset: 0;
  z-index: 65;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

.crypt {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 64px 16px 180px;
}

.crypt-footer {
  text-align: center;
  color: var(--bone-dim);
  opacity: 0.6;
  font-size: 1rem;
}

.pixel-frame {
  --edge: var(--crimson-dark);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--edge),
    0 var(--px) 0 0 var(--edge),
    calc(var(--px) * -1) 0 0 0 var(--edge),
    var(--px) 0 0 0 var(--edge),
    var(--px) calc(var(--px) * 2) 0 0 var(--shadow),
    calc(var(--px) * 2) var(--px) 0 0 var(--shadow);
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.avatar {
  --edge: var(--crimson);
  width: 112px;
  height: 112px;
  margin-bottom: 10px;
  background: var(--panel);
}

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

.avatar img.is-placeholder {
  object-fit: contain;
  padding: 16px;
}

.profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--crimson-bright);
  text-shadow: 3px 3px 0 var(--shadow), 0 0 20px rgba(193, 18, 31, 0.45);
}

.profile-tagline {
  margin: 0;
  color: var(--bone-dim);
}

.link-list,
.links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px 10px 12px;
  border: 0;
  background: var(--panel);
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.08s steps(2), background-color 0.08s;
}

.link-btn::after {
  content: "»";
  font-size: 1.4rem;
  color: var(--crimson);
}

.link-btn:hover {
  --edge: var(--crimson);
  background: var(--panel-hover);
}

.link-btn:not(.is-floating):hover { transform: translate(-2px, -2px); }
.link-btn:not(.is-floating):active { transform: translate(2px, 2px); }

.link-btn:focus-visible {
  outline: 2px dashed var(--gold);
  outline-offset: 8px;
}

.link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--crimson-dark);
  color: var(--bone);
  font-size: 1.1rem;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.35), inset 4px 4px 0 rgba(255, 255, 255, 0.08);
}

.link-label {
  flex: 1;
  min-width: 0;
}

.throne-slot { position: relative; }

.throne-slot.is-empty::before {
  content: attr(data-ghost);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bone-dim);
  opacity: 0.55;
  letter-spacing: 0.08em;
}

.throne-btn {
  --edge: var(--gold-dark);
  background: linear-gradient(180deg, #4a0812, #22030a);
  color: var(--gold);
}

.throne-btn:hover {
  --edge: var(--gold);
  background: linear-gradient(180deg, #5c0a17, #2a040d);
}

.throne-btn::after { color: var(--gold); }

.throne-icon { background: #22030a; }

.throne-icon img {
  width: 27px;
  image-rendering: pixelated;
}

.throne-btn .link-label {
  background: linear-gradient(100deg, var(--gold) 40%, #fff6d5 50%, var(--gold) 60%) 100% 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 3.2s linear infinite;
}

.throne-btn.is-floating {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: min(300px, calc(100vw - 32px));
  /* `translate` (not `transform`) so the pop-in `scale` grows in place */
  translate: var(--x, 0px) var(--y, 0px);
  transition: translate 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

.throne-btn.is-vanished {
  visibility: hidden;
  pointer-events: none;
}

.throne-btn.is-vanished,
.throne-btn.no-transition { transition: none; }

.throne-btn.is-appearing { animation: materialize 0.35s steps(5) both; }

.throne-taunt {
  position: absolute;
  bottom: calc(100% + 18px);
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 2px 10px;
  background: var(--bone);
  color: #1a0509;
  font-family: var(--font-body);
  font-size: 1.1rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow:
    0 -4px 0 0 var(--bone),
    0 4px 0 0 var(--bone),
    -4px 0 0 0 var(--bone),
    4px 0 0 0 var(--bone);
}

.throne-taunt::after {
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  translate: -50% 0;
  width: 8px;
  height: 8px;
  background: var(--bone);
}

.throne-taunt.is-shown { opacity: 1; }

.decree {
  --edge: var(--gold-dark);
  position: fixed;
  bottom: 20px;
  left: 50%;
  translate: -50% 0;
  z-index: 55;
  width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  background: #0e0206;
  text-align: center;
  animation: decree-in 0.4s steps(4) both;
}

.decree[hidden] { display: none; }

.decree-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.decree-text { margin: 6px 0 4px; }

.decree-count {
  margin: 0;
  font-size: 1rem;
  color: var(--bone-dim);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes twinkle { 50% { opacity: 0.55; } }
@keyframes shimmer { to { background-position: 0 0; } }
@keyframes materialize {
  from { scale: 0.2; opacity: 0; filter: brightness(3); }
  to   { scale: 1;   opacity: 1; filter: none; }
}
@keyframes decree-in { from { translate: -50% 140%; } }

@media (max-width: 560px) {
  .moon {
    top: 14px;
    right: 14px;
    width: 72px;
    height: 72px;
    opacity: 0.75;
  }
  .crypt { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
