:root {
  color-scheme: dark;
}

body.wallfacer-page {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(0, 40, 60, 0.65), transparent 60%),
    #050608;
  font-family: "Courier New", monospace;
  color: #d7f6ff;
}

.wallfacer-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  background: radial-gradient(circle at 20% 20%, rgba(0, 200, 255, 0.08), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(0, 120, 150, 0.08), transparent 55%);
  cursor: grab;
}

.wallfacer-screen.is-dragging {
  cursor: grabbing;
}

.wallfacer-screen::before,
.wallfacer-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.wallfacer-screen::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0px,
    rgba(0, 0, 0, 0.35) 1px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.35;
  mix-blend-mode: screen;
}

.wallfacer-screen::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.2'/></svg>");
  opacity: 0.3;
  mix-blend-mode: soft-light;
  animation: noiseShift 0.5s steps(2) infinite;
}

@keyframes noiseShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-8px, 4px, 0);
  }
  100% {
    transform: translate3d(6px, -6px, 0);
  }
}

#wallfacer-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
}

.wallfacer-connections {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.wallfacer-connection {
  stroke: rgba(80, 220, 240, 0.28);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 12;
  filter: drop-shadow(0 0 6px rgba(120, 240, 255, 0.25));
  animation: connectionFlicker 2.2s steps(2) infinite;
}

.wallfacer-connection:nth-child(3n) {
  stroke-dasharray: 4 10;
  animation-duration: 1.6s;
}

.wallfacer-connection:nth-child(4n) {
  stroke-dasharray: 1 8;
  animation-duration: 2.8s;
}

@keyframes connectionFlicker {
  0% {
    stroke-opacity: 0.15;
    filter: drop-shadow(0 0 4px rgba(120, 240, 255, 0.2));
  }
  50% {
    stroke-opacity: 0.35;
    filter: drop-shadow(0 0 10px rgba(120, 240, 255, 0.35));
  }
  100% {
    stroke-opacity: 0.22;
    filter: drop-shadow(0 0 6px rgba(120, 240, 255, 0.25));
  }
}

.wallfacer-tile {
  position: absolute;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  pointer-events: auto;
  z-index: 1;
  --float-offset: 0px;
  --tile-size: clamp(220px, 34vw, 280px);
  transform: translate(-50%, -50%) var(--tile-transform) translateY(var(--float-offset));
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.wallfacer-image {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  border: 1px solid rgba(20, 120, 140, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(0, 200, 255, 0.15);
  background: #050608;
  overflow: hidden;
}

.wallfacer-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

.wallfacer-tile.is-wide img {
  width: var(--tile-size);
  height: auto;
  max-height: 70vh;
}

.wallfacer-tile.is-tall img {
  height: var(--tile-size);
  width: auto;
  max-width: 70vw;
}

.wallfacer-caption {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 255, 255, 0.8);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.35);
}

.wallfacer-tile.is-center {
  filter: brightness(1.08);
  --float-offset: -12px;
}

.wallfacer-tile.is-center .wallfacer-image {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(0, 255, 255, 0.25);
}

.wallfacer-tile.is-dim .wallfacer-image img {
  filter: saturate(0.7) brightness(0.85) contrast(1.05);
  opacity: var(--dim-opacity, 0.75);
}

.wallfacer-tile.is-dim .wallfacer-text-block {
  opacity: 0.85;
}

.wallfacer-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><filter id='n'><feTurbulence type='turbulence' baseFrequency='0.18' numOctaves='1' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='80' height='80' filter='url(%23n)' opacity='0.6'/></svg>");
  background-size: var(--static-size, 96px) var(--static-size, 96px);
  image-rendering: pixelated;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  filter: contrast(1.35) brightness(1);
  animation: wallfacerStatic var(--static-speed, 0.24s) steps(1, end) infinite;
  animation-delay: var(--static-delay, 0s);
}

.wallfacer-tile.is-dim .wallfacer-image::after {
  opacity: var(--static-opacity, 0.75);
}

.wallfacer-tile.is-far .wallfacer-image::after {
  opacity: 0.95;
  filter: contrast(1.6) brightness(1.05);
}

.wallfacer-tile.is-far .wallfacer-image img {
  opacity: 0.22;
  filter: saturate(0.4) brightness(0.7) contrast(1.1) blur(2.6px);
}

.wallfacer-tile.is-far .wallfacer-text-block {
  opacity: 0.2;
  filter: blur(2px);
}

@keyframes wallfacerStatic {
  0% {
    background-position: 0 0;
    opacity: calc(var(--static-opacity, 0.75) * 0.8);
  }
  25% {
    background-position: 16px -24px;
    opacity: calc(var(--static-opacity, 0.75) * 1.05);
  }
  50% {
    background-position: -22px 18px;
    opacity: calc(var(--static-opacity, 0.75) * 0.9);
  }
  75% {
    background-position: 28px 10px;
    opacity: calc(var(--static-opacity, 0.75) * 1.1);
  }
  100% {
    background-position: -10px -30px;
    opacity: calc(var(--static-opacity, 0.75) * 0.95);
  }
}

.wallfacer-text-block {
  max-width: min(320px, 70vw);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 200, 255, 0.35);
  background: rgba(4, 12, 18, 0.85);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55),
    0 0 16px rgba(0, 200, 255, 0.15);
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(210, 255, 255, 0.92);
  text-transform: none;
  letter-spacing: 0.02em;
}

#wallfacer-hud {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 320px;
}

#wallfacer-hud h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7f7ff;
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
}

#wallfacer-hud p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(180, 230, 240, 0.8);
}

#wallfacer-hud a {
  color: rgba(180, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.8rem;
}

#wallfacer-message {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(5, 12, 18, 0.7);
  border: 1px solid rgba(0, 200, 255, 0.2);
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  max-width: 90vw;
}

.wallfacer-hidden {
  display: none;
}

@media (max-width: 700px) {
  .wallfacer-tile {
    --tile-size: clamp(170px, 55vw, 230px);
  }

  #wallfacer-hud {
    max-width: 240px;
  }
}
