body {
  background: linear-gradient(135deg, orange, gold);
  color: #111;
  font-family: 'Press Start 2P', cursive;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1 {
  font-size: 14px;
  margin: 0 0 12px;
  text-shadow: 1px 1px #fff;
}

h2 {
  font-size: 12px;
  margin: 0 0 16px;
  text-shadow: 1px 1px #fff;
}

.title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 24px;
  margin: 20px 0;
  padding: 0 10px;
  text-align: center;
  text-shadow: 2px 2px #fff;
}

.title img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  border-bottom: 4px solid #444;
  background: rgba(255, 102, 0, 0.9);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  cursor: pointer;
  border-right: 2px solid #444;
  user-select: none;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.tab img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.tab:hover {
  background: #ff9900;
  color: #fff;
  transition: transform 0.2s, background 0.2s;
}

.tab.active {
  background: #fff;
  color: #ff6600;
  position: relative;
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: #ff6600;
}

.content {
  padding: 20px;
  text-align: center;
  min-height: 300px;
}

.zoom-container {
  display: inline-block;
  overflow: hidden;
  border: 4px solid #444;
  background: #fff;
  box-shadow: 4px 4px #444;
}

img.pixel-art {
  image-rendering: pixelated;
  width: 150px;
  height: auto;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.zoom-container:hover img.pixel-art {
  transform: scale(2);
  cursor: zoom-out;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.gallery-grid img {
  width: 100px;
  height: auto;
  max-width: 150px;
  image-rendering: pixelated;
  border: 2px solid #444;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-grid img:hover {
  transform: scale(1.5);
  z-index: 2;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  image-rendering: pixelated;
  border: 4px solid #fff;
}

.modal .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  color: #fff;
  background: #ff6600;
  padding: 10px;
  cursor: pointer;
  border: 2px solid #fff;
}

/* Tablet */
@media (max-width: 768px) {
  .title {
    font-size: 18px;
  }

  .tab {
    padding: 8px 14px;
    gap: 6px;
  }

  .tab img {
    width: 28px;
    height: 28px;
  }

  img.pixel-art {
    width: 100px;
  }

  .gallery-grid img:hover,
  .zoom-container:hover img.pixel-art {
    transform: scale(1.2);
  }
}

/* Mobile: icon-only tabs to fit all 7 in one row */
@media (max-width: 600px) {
  .title {
    font-size: 15px;
    margin: 14px 0;
  }

  .tab {
    font-size: 0; /* hides the text label, keeps the icon */
    padding: 10px 12px;
    gap: 0;
    justify-content: center;
    flex: 1;
    border-right: 1px solid #444;
  }

  .tab img {
    width: 28px;
    height: 28px;
  }

  .content {
    padding: 16px 12px;
  }

  h1 {
    font-size: 12px;
  }

  h2 {
    font-size: 11px;
  }

  .gallery-grid {
    gap: 12px;
  }
}

/* Small phones */
@media (max-width: 400px) {
  body {
    font-size: 10px;
  }

  .title {
    font-size: 13px;
  }

  .tab {
    padding: 8px;
  }

  .tab img {
    width: 24px;
    height: 24px;
  }

  .content {
    padding: 12px 8px;
  }

  .gallery-grid {
    gap: 8px;
  }

  .gallery-grid img {
    width: 80px;
  }

  img.pixel-art {
    width: 80px;
  }

  .modal img {
    max-width: 95%;
    max-height: 95%;
  }

  .modal .close {
    font-size: 14px;
    padding: 8px;
    top: 10px;
    right: 10px;
  }
}

/* No hover effects on touch screens */
@media (hover: none) {
  .gallery-grid img:hover,
  .zoom-container:hover img.pixel-art {
    transform: none;
  }
}
