.gallery-header {
  border-bottom: 1px solid #0f0;
  margin: 10px 0 30px;
  padding-bottom: 5px;
  text-align: center;
}
.glitch-text {
  color: #0f0;
  font-size: 24px;
  text-decoration: none;
  position: relative;
  animation: textGlitch 3s infinite;
}
@keyframes textGlitch {
  0% { text-shadow: -2px 0 #f00, 2px 0 #0ff; }
  20% { text-shadow: 2px 0 #f00, -2px 0 #0ff; }
  40% { text-shadow: -2px 0 #0ff, 2px 0 #f00; }
  60% { text-shadow: 2px 0 #0ff, -2px 0 #f00; }
  80% { text-shadow: -2px 0 #f00, 2px 0 #0ff; }
  100% { text-shadow: none; }
}

.gallery-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 860px;
  margin: 20px auto;
  position: relative;
  z-index: 5;
}

.gallery-item {
  width: 200px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  border: 1px solid #1f4f1f;
  padding: 5px;
  background: #0a0a0a;
  transition: border 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}
.gallery-item:hover {
  border-color: #f00;
}
.gallery-item img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  display: block;
}
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,0,0,0.1) 0px,
    rgba(255,0,0,0.1) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover::after {
  opacity: 0.3;
}

.gallery-caption {
  font-family: 'Home Bargains Calculator', monospace;
  font-size: 12px;
  color: #888;
  text-align: center;
  margin-top: 5px;
}

.hotspot {
  position: absolute;
  width: 200px;
  height: 0;
  background: transparent;
  z-index: 10;
  cursor: default;
  display: none;
}

.kitty-absolute {
  position: absolute;
  width: 200px;
  z-index: 15;
  display: none;
  border: 1px solid #1f4f1f;
  padding: 5px;
  background: #0a0a0a;
  box-sizing: border-box;
  cursor: pointer;
}
.kitty-absolute img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  display: block;
}
.kitty-absolute .gallery-caption {
  font-family: 'Home Bargains Calculator', monospace;
  font-size: 12px;
  color: #f00;
  text-align: center;
  margin-top: 5px;
}

.nav a[href="/gallery.html"] {
  color: #f00 !important;
  position: relative;
}
.nav a[href="/gallery.html"]::after {
  content: "•";
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  color: #f00;
  font-size: 12px;
}
.nav a[href="/"] {
  color: #888;
}
.nav a[href="/"]::after {
  content: none;
}

.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
}
.modal-content {
  position: relative;
  margin: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 90%;
  max-width: 800px;
  border: 2px solid #0f0;
  background: #000;
  padding: 10px;
}
.modal-image-container {
  text-align: center;
}
.modal-image-container img {
  max-width: 100%;
  max-height: 80vh;
  image-rendering: pixelated;
}
.close {
  position: absolute;
  top: 5px;
  right: 15px;
  color: #f00;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}
.close:hover {
  color: #fff;
}
.modal-prev, .modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #0f0;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  padding: 10px;
  user-select: none;
}
.modal-prev {
  left: 10px;
}
.modal-next {
  right: 10px;
}
.modal-prev:hover, .modal-next:hover {
  color: #f00;
}

@media screen and (max-width: 600px) {
  .gallery-item, .hotspot, .kitty-absolute {
    width: 150px;
  }
  .gallery-container {
    max-width: 660px;
    gap: 10px;
  }
  .modal-prev, .modal-next {
    font-size: 30px;
  }
}