/* Pokedex GameBoy Theme - 8-bit Pastel Edition */

/* Touch-friendly global styles */
button,
a,
input[type="button"],
input[type="submit"],
input[type="reset"],
select {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
}

.wapuu-gallery-container {
  min-height: 100vh;
  background: #e8d5e8;
  padding: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Courier New', monospace;
  position: relative;
}

.wapuu-gallery-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

/* Animated background pattern */
@keyframes backgroundMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

.wapuu-gallery-container::before {
  animation: backgroundMove 20s linear infinite;
  background-size: 20px 20px;
}

/* Parallax background layer */
.wapuu-gallery-container::after {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 179, 193, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(184, 230, 184, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(168, 216, 234, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
  transform: translateY(var(--parallax-y, 0));
  transition: transform 0.1s ease-out;
}

.wapuu-gallery-frame {
  width: 100%;
  max-width: 90%;
  background: #ffb3c1;
  border-radius: 0;
  padding: 2rem;
  box-shadow: 
    8px 0 0 #d89ba8,
    -8px 0 0 #d89ba8,
    0 8px 0 #d89ba8,
    0 -8px 0 #d89ba8,
    8px 8px 0 #d89ba8,
    -8px -8px 0 #d89ba8,
    8px -8px 0 #d89ba8,
    -8px 8px 0 #d89ba8,
    16px 16px 0 rgba(0, 0, 0, 0.1);
  position: relative;
}

.wapuu-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
}

.wapuu-gallery-header .about-button {
  margin-left: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-light {
  width: 60px;
  height: 60px;
  border-radius: 0;
  background: #a8d8ea;
  box-shadow: 
    4px 0 0 #85b8d4,
    -4px 0 0 #85b8d4,
    0 4px 0 #85b8d4,
    0 -4px 0 #85b8d4,
    inset 4px 4px 0 #c5e8f5,
    inset -4px -4px 0 #85b8d4;
}

.header-light.red {
  background: #a8d8ea;
}

.header-lights {
  display: flex;
  gap: 0.5rem;
}

.header-light.yellow,
.header-light.green {
  width: 24px;
  height: 24px;
}

.header-light.yellow {
  background: #fff4a3;
  box-shadow: 
    3px 0 0 #e6d88a,
    -3px 0 0 #e6d88a,
    0 3px 0 #e6d88a,
    0 -3px 0 #e6d88a,
    inset 3px 3px 0 #fffcdb,
    inset -3px -3px 0 #e6d88a;
}

.header-light.green {
  background: #b8e6b8;
  box-shadow: 
    3px 0 0 #9fcc9f,
    -3px 0 0 #9fcc9f,
    0 3px 0 #9fcc9f,
    0 -3px 0 #9fcc9f,
    inset 3px 3px 0 #d8f5d8,
    inset -3px -3px 0 #9fcc9f;
}

.wapuu-logo-text {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 32px;
  font-weight: normal;
  letter-spacing: 2px;
  color: #6b5b7a;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.4;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.wapuu-logo-text a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.wapuu-logo-text a:hover {
  opacity: 0.8;
}

.wapuu-logo-text a:active {
  opacity: 0.6;
}

/* Dance Mode Button - Hidden by default, only shows after Konami code */
.dance-mode-button {
  background: #7aa87a;
  border: 0;
  border-radius: 0;
  padding: 0.5rem 1rem;
  display: none; /* Hidden by default */
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: white;
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 8px;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  box-shadow: 
    3px 0 0 #5a8a5a,
    -3px 0 0 #5a8a5a,
    0 3px 0 #5a8a5a,
    0 -3px 0 #5a8a5a,
    inset 2px 2px 0 rgba(255, 255, 255, 0.3);
  -webkit-tap-highlight-color: rgba(122, 168, 122, 0.3);
  touch-action: manipulation;
  min-height: 44px;
}

/* Show button when dance mode is active */
.dance-mode .dance-mode-button,
.konami-mode .dance-mode-button {
  display: flex;
}

.dance-mode-button:hover {
  background: #8ab88a;
  transform: translateY(-1px);
  box-shadow: 
    4px 0 0 #5a8a5a,
    -4px 0 0 #5a8a5a,
    0 4px 0 #5a8a5a,
    0 -4px 0 #5a8a5a,
    inset 2px 2px 0 rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.dance-mode-button:active {
  transform: translateY(1px);
  box-shadow: 
    2px 0 0 #5a8a5a,
    -2px 0 0 #5a8a5a,
    0 2px 0 #5a8a5a,
    0 -2px 0 #5a8a5a,
    inset 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.dance-mode-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dance-mode-button.active {
  background: #ff6b6b;
  box-shadow: 
    3px 0 0 #cc5555,
    -3px 0 0 #cc5555,
    0 3px 0 #cc5555,
    0 -3px 0 #cc5555,
    inset 2px 2px 0 rgba(255, 255, 255, 0.3),
    0 0 8px rgba(255, 107, 107, 0.5);
  animation: danceButtonPulse 1s ease-in-out infinite;
}

.dance-mode-button.active:hover {
  background: #ff8080;
}

@keyframes danceButtonPulse {
  0%, 100% {
    box-shadow: 
      3px 0 0 #cc5555,
      -3px 0 0 #cc5555,
      0 3px 0 #cc5555,
      0 -3px 0 #cc5555,
      inset 2px 2px 0 rgba(255, 255, 255, 0.3),
      0 0 8px rgba(255, 107, 107, 0.5);
  }
  50% {
    box-shadow: 
      3px 0 0 #cc5555,
      -3px 0 0 #cc5555,
      0 3px 0 #cc5555,
      0 -3px 0 #cc5555,
      inset 2px 2px 0 rgba(255, 255, 255, 0.3),
      0 0 16px rgba(255, 107, 107, 0.8);
  }
}

.wapuu-logo-footer {
  height: 60px;
  width: auto;
  margin-left: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.wapuu-gallery-screen {
  background: #c8f0c8;
  border-radius: 0;
  padding: 1.5rem;
  min-height: 500px;
  box-shadow: 
    inset 6px 6px 0 #a8d0a8,
    inset -6px -6px 0 #e0ffe0;
  border: 8px solid #7aa87a;
  position: relative;
}

.wapuu-gallery-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.03) 3px,
    rgba(0, 0, 0, 0.03) 6px
  );
  pointer-events: none;
}

.wapuu-gallery-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.search-box,
.filter-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.search-box:focus-within,
.filter-box:focus-within {
  box-shadow: 
    5px 0 0 #7aa87a,
    -5px 0 0 #7aa87a,
    0 5px 0 #7aa87a,
    0 -5px 0 #7aa87a,
    inset 2px 2px 0 #f0f0f0,
    inset -2px -2px 0 #d0d0d0;
  transform: translateY(-1px);
}

.search-icon,
.filter-icon {
  color: #7aa87a;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Search icon pulse on focus */
@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.search-box:focus-within .search-icon {
  animation: iconPulse 1.5s ease-in-out infinite;
}

/* Filter icon rotation */
.filter-icon {
  transition: transform 0.3s ease;
}

.filter-box.active .filter-icon,
.filter-select:focus + .filter-icon,
.filter-box:focus-within .filter-icon {
  transform: rotate(180deg);
}

.search-input,
.filter-select {
  flex: 1;
  background: transparent;
  border: none;
  color: #5a7a5a;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  outline: none;
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(90, 122, 90, 0.2);
  touch-action: manipulation;
}

.search-input::placeholder {
  color: #90a090;
  opacity: 1;
}

/* Typing indicator - blinking cursor */
@keyframes blinkCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.search-input:focus {
  caret-color: #7aa87a;
}

.search-box:focus-within::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: #7aa87a;
  animation: blinkCursor 1s step-end infinite;
  pointer-events: none;
  opacity: 0;
}

.search-box:focus-within:has(.search-input:not(:placeholder-shown))::after {
  opacity: 1;
}

.filter-select {
  cursor: pointer;
}

.filter-select option {
  background: #ffffff;
  color: #5a7a5a;
}

.wapuu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

/* Force 1 column on screens smaller than desktop */
@media screen and (max-width: 991px) {
  .wapuu-gallery-container .wapuu-gallery-screen .wapuu-grid {
    grid-template-columns: 1fr !important;
    -ms-grid-columns: 1fr !important;
  }
}

.wapuu-gallery-card {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, transform 0.3s ease;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: fadeInScale 0.3s ease-out forwards;
  opacity: 0;
  -webkit-tap-highlight-color: rgba(122, 168, 122, 0.3);
  touch-action: manipulation;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wapuu-gallery-card:hover {
  transform: scale(1.05);
  box-shadow: 
    5px 0 0 #7aa87a,
    -5px 0 0 #7aa87a,
    0 5px 0 #7aa87a,
    0 -5px 0 #7aa87a,
    0 8px 0 rgba(122, 168, 122, 0.4),
    0 12px 16px rgba(90, 122, 90, 0.2);
}

.wapuu-gallery-card:active {
  transform: translateY(-1px);
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    0 2px 0 rgba(122, 168, 122, 0.3);
}

.card-header {
  padding: 1.0rem;
  text-align: center;
  border-bottom: 0;
  box-shadow: 0 4px 0 rgba(122, 168, 122, 0.2);
}

.wapuu-number {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  color: #6b5b7a;
  font-size: 10px;
  letter-spacing: 0.5px;
  font-weight: normal;
  line-height: 1.6;
  padding: 0.5rem 0.75rem;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.wapuu-sprite {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 rgba(255, 255, 255, 0.5);
}

.wapuu-sprite img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-sizing: border-box;
}

.sprite-placeholder {
  font-size: 72px;
  color: #5a7a5a;
  opacity: 0.3;
}

.wapuu-name {
  color: #5a7a5a;
  letter-spacing: 2px;
  font-size: 14px;
}

.no-results {
  text-align: center;
  color: #7aa87a;
  padding: 3rem;
  font-size: 18px;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

.wapuu-gallery-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer-button {
  width: 80px;
  height: 30px;
  background: #d5b3e0;
  border: 0;
  border-radius: 0;
  box-shadow: 
    4px 0 0 #b89bc5,
    -4px 0 0 #b89bc5,
    0 4px 0 #b89bc5,
    0 -4px 0 #b89bc5,
    inset 3px 3px 0 #e8d5f0,
    inset -3px -3px 0 #b89bc5;
}

.footer-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 16px;
  height: 16px;
  background: #ffb3c1;
  border-radius: 0;
  border: 0;
  box-shadow: 
    3px 0 0 #d89ba8,
    -3px 0 0 #d89ba8,
    0 3px 0 #d89ba8,
    0 -3px 0 #d89ba8,
    inset 2px 2px 0 #ffd5de;
}

.footer-screen-small {
  flex: 1;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 0.5rem 1rem;
  color: #7aa87a;
  text-align: center;
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  line-height: 1.6;
  transition: all 0.3s ease;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.footer-screen-small.updating {
  animation: pulseUpdate 0.4s ease;
}

@keyframes pulseUpdate {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      5px 0 0 #7aa87a,
      -5px 0 0 #7aa87a,
      0 5px 0 #7aa87a,
      0 -5px 0 #7aa87a,
      inset 2px 2px 0 #f0f0f0,
      inset -2px -2px 0 #d0d0d0;
  }
}

/* Pokemon Detail Modal */
.wapuu-detail-modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: backdrop-filter 0.3s ease, background 0.3s ease;
}

.wapuu-gallery-detail-modal {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 0;
  max-width: 600px;
  width: 90%;
  position: relative;
  box-shadow: 
    8px 0 0 #7aa87a,
    -8px 0 0 #7aa87a,
    0 8px 0 #7aa87a,
    0 -8px 0 #7aa87a,
    12px 12px 0 rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.detail-close {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 0;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5a5a5a;
  transition: all 0.2s ease;
  z-index: 10;
  margin-left: auto;
  -webkit-tap-highlight-color: rgba(90, 90, 90, 0.3);
  touch-action: manipulation;
  box-shadow: 
    4px 0 0 #d0d0d0,
    -4px 0 0 #d0d0d0,
    0 4px 0 #d0d0d0,
    0 -4px 0 #d0d0d0,
    inset 2px 2px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(10px);
}

.detail-close:hover {
  transform: translate(-1px, -1px);
  background: rgba(255, 255, 255, 1);
  box-shadow: 
    5px 0 0 #d0d0d0,
    -5px 0 0 #d0d0d0,
    0 5px 0 #d0d0d0,
    0 -5px 0 #d0d0d0,
    inset 2px 2px 0 rgba(255, 255, 255, 1),
    6px 6px 0 rgba(0, 0, 0, 0.1);
}

.detail-modal-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  position: relative;
  box-shadow: 0 6px 0 rgba(122, 168, 122, 0.2);
}

.detail-modal-number {
  color: #6b5b7a;
  font-size: 16px;
  letter-spacing: 2px;
}

.detail-modal-name {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  color: #6b5b7a;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: normal;
  line-height: 1.6;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.detail-modal-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fafafa;
  box-shadow: inset 4px 4px 0 rgba(122, 168, 122, 0.1);
  overflow: hidden;
  cursor: zoom-in;
}

.detail-modal-image img {
  transition: transform 0.3s ease, cursor 0.3s ease;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: pinch-zoom;
}

/* Click zoom (persistent) */
.detail-modal-image.zoomed img {
  transform: scale(2.5);
  cursor: zoom-out;
}

.sprite-placeholder-xlarge {
  font-size: 300px;
  color: #5a7a5a;
  opacity: 0.2;
  font-family: 'Courier New', monospace;
}

.detail-header {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.detail-number,
.detail-name {
  color: #5a7a5a;
  letter-spacing: 2px;
}

.detail-sprite {
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 4px 4px 0 rgba(255, 255, 255, 0.5);
}

.sprite-placeholder-large {
  font-size: 120px;
  color: #5a7a5a;
  opacity: 0.2;
}

.detail-type {
  display: inline-block;
  color: #6b5b7a;
  padding: 0.5rem 1.5rem;
  border-radius: 0;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  box-shadow: 
    4px 0 0 rgba(122, 168, 122, 0.3),
    -4px 0 0 rgba(122, 168, 122, 0.3),
    0 4px 0 rgba(122, 168, 122, 0.3),
    0 -4px 0 rgba(122, 168, 122, 0.3);
}

.detail-info {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  color: #5a7a5a;
  padding: 0.5rem 0;
  border-bottom: 3px solid #e0f0e0;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  letter-spacing: 1px;
}

.detail-description {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  color: #5a7a5a;
  line-height: 1.6;
  margin-bottom: 1rem;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.detail-stats {
  background: #ffffff;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.stat-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: #5a7a5a;
  letter-spacing: 1px;
  font-size: 12px;
}

.stat-bar {
  height: 20px;
  background: #e0f0e0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 
    3px 0 0 #b8d8b8,
    -3px 0 0 #b8d8b8,
    0 3px 0 #b8d8b8,
    0 -3px 0 #b8d8b8,
    inset 2px 2px 0 rgba(0, 0, 0, 0.05);
}

.stat-fill {
  height: 100%;
  transition: width 0.3s ease;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.3);
}

.stat-value {
  color: #5a7a5a;
  text-align: right;
  font-size: 12px;
}

/* Pagination */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  position: relative;
  z-index: 1;
}

.pagination-button {
  background: #ffffff;
  border: 0;
  padding: 0.5rem 1rem;
  color: #5a7a5a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  font-size: 12px;
  transition: all 0.1s ease;
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(122, 168, 122, 0.3);
  touch-action: manipulation;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.pagination-button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 
    5px 0 0 #7aa87a,
    -5px 0 0 #7aa87a,
    0 5px 0 #7aa87a,
    0 -5px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

.pagination-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  background: #ffffff;
  padding: 0.5rem 1.5rem;
  color: #5a7a5a;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  font-size: 12px;
  box-shadow: 
    4px 0 0 #7aa87a,
    -4px 0 0 #7aa87a,
    0 4px 0 #7aa87a,
    0 -4px 0 #7aa87a,
    inset 3px 3px 0 #f0f0f0,
    inset -3px -3px 0 #d0d0d0;
}

/* Tablet and smaller - Force 1 column */
@media (max-width: 768px) {
  .wapuu-gallery-container {
    padding: 1rem 0;
  }
  
  .wapuu-gallery-frame {
    padding: 1rem;
  }
  
  .wapuu-gallery-screen {
    padding: 1rem;
    min-height: 400px;
  }
  
  .wapuu-gallery-controls {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .wapuu-gallery-container .wapuu-gallery-screen .wapuu-grid {
    grid-template-columns: 1fr !important;
    -ms-grid-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .wapuu-logo-text {
    font-size: 24px;
    letter-spacing: 1px;
  }
  
  .wapuu-logo-footer {
    height: 50px;
  }

  .pagination-button {
    padding: 0.5rem;
    font-size: 10px;
  }

  .pagination-info {
    padding: 0.5rem 1rem;
    font-size: 10px;
  }
  
  .header-light.red {
    width: 36px;
    height: 36px;
  }
  
  .header-light.yellow,
  .header-light.green {
    width: 20px;
    height: 20px;
  }
  
  .wapuu-gallery-detail-modal {
    max-width: 90%;
    margin: 1rem;
  }
  
  .detail-modal-name {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  
  .sprite-placeholder-xlarge {
    font-size: 200px;
  }
  
  .footer-screen-small {
    font-size: 8px;
    padding: 0.5rem;
    letter-spacing: 0.5px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .wapuu-gallery-container {
    padding: 0.5rem 0;
  }
  
  .wapuu-gallery-frame {
    padding: 0.75rem;
  }
  
  .wapuu-gallery-screen {
    padding: 0.75rem;
    min-height: 350px;
  }
  
  .wapuu-gallery-container .wapuu-gallery-screen .wapuu-grid {
    grid-template-columns: 1fr !important;
    -ms-grid-columns: 1fr !important;
    gap: 0.5rem;
  }
  
  .wapuu-logo-text {
    font-size: 18px;
    letter-spacing: 1px;
  }
  
  .wapuu-logo-footer {
    height: 40px;
  }
  
  .wapuu-gallery-header {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .header-light.red {
    width: 32px;
    height: 32px;
  }
  
  .header-light.yellow,
  .header-light.green {
    width: 16px;
    height: 16px;
  }
  
  .card-header {
    padding: 0.5rem;
  }
  
  .wapuu-number {
    font-size: 8px;
    letter-spacing: 0.25px;
    padding: 0.25rem 0.4rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .card-body {
    padding: 0.5rem;
  }
  
  .wapuu-sprite {
    width: 100%;
    min-height: 0;
  }
  
  .wapuu-sprite img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  .sprite-placeholder {
    font-size: 48px;
  }
  
  .pagination-controls {
    gap: 0.5rem;
  }
  
  .pagination-button {
    padding: 0.4rem;
    font-size: 9px;
    gap: 0.25rem;
  }
  
  .pagination-info {
    padding: 0.4rem 0.75rem;
    font-size: 9px;
  }
  
  .wapuu-gallery-detail-modal {
    max-width: 95%;
    margin: 0.5rem;
  }
  
  .detail-modal-header {
    padding: 1rem;
  }
  
  .detail-modal-name {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  
  .sprite-placeholder-xlarge {
    font-size: 150px;
  }
  
  .detail-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
  }
  
  .pagination-button {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  
  .footer-button {
    width: 60px;
    height: 40px;
  }
  
  .footer-screen-small {
    padding: 0.4rem 0.6rem;
    font-size: 7px;
    letter-spacing: 0.5px;
  }
  
  .search-box,
  .filter-box {
    padding: 0.6rem;
  }
  
  .search-input,
  .filter-select {
    font-size: 11px;
  }
}

/* About Modal Styles */
.about-button {
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  background: #d5b3e0;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b5b7a;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: rgba(213, 179, 224, 0.3);
  touch-action: manipulation;
  box-shadow: 
    4px 0 0 #b89bc5,
    -4px 0 0 #b89bc5,
    0 4px 0 #b89bc5,
    0 -4px 0 #b89bc5,
    inset 3px 3px 0 #e8d5f0,
    inset -3px -3px 0 #b89bc5;
}

.about-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 
    5px 0 0 #b89bc5,
    -5px 0 0 #b89bc5,
    0 5px 0 #b89bc5,
    0 -5px 0 #b89bc5,
    inset 3px 3px 0 #e8d5f0,
    inset -3px -3px 0 #b89bc5,
    6px 6px 0 rgba(0, 0, 0, 0.1);
}

.about-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.about-modal-content {
  background: #ffffff;
  border-radius: 0;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  position: relative;
  box-shadow: 
    8px 0 0 #7aa87a,
    -8px 0 0 #7aa87a,
    0 8px 0 #7aa87a,
    0 -8px 0 #7aa87a,
    12px 12px 0 rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.about-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5a5a5a;
  transition: all 0.2s ease;
  z-index: 10;
  -webkit-tap-highlight-color: rgba(90, 90, 90, 0.3);
  touch-action: manipulation;
  box-shadow: 
    3px 0 0 #d0d0d0,
    -3px 0 0 #d0d0d0,
    0 3px 0 #d0d0d0,
    0 -3px 0 #d0d0d0;
}

.about-modal-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: translate(-1px, -1px);
}

.about-modal-header {
  background: #d5b3e0;
  padding: 2rem;
  padding-right: 4rem;
  text-align: center;
  border-bottom: 0;
  box-shadow: 0 4px 0 rgba(184, 155, 197, 0.3);
  position: relative;
}

.about-modal-title {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #6b5b7a;
  margin: 0;
  letter-spacing: 1px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.about-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.about-section {
  margin-bottom: 2rem;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h3 {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 10px;
  color: #6b5b7a;
  margin: 0 0 1rem 0;
  letter-spacing: 1px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.about-section p {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  margin: 0 0 1rem 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.info-item {
  background: #f5f5f5;
  padding: 0.75rem;
  border-radius: 0;
  border: 0;
  box-shadow: 
    2px 0 0 #e0e0e0,
    -2px 0 0 #e0e0e0,
    0 2px 0 #e0e0e0,
    0 -2px 0 #e0e0e0;
}

.info-label {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 8px;
  color: #6b5b7a;
  display: block;
  margin-bottom: 0.25rem;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.info-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #333;
  font-weight: 600;
}

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

.feature-list li {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-badge {
  background: #b8e6b8;
  color: #5a7a5a;
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  border: 0;
  box-shadow: 
    2px 0 0 #9fcc9f,
    -2px 0 0 #9fcc9f,
    0 2px 0 #9fcc9f,
    0 -2px 0 #9fcc9f,
    inset 2px 2px 0 #d8f5d8;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.about-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e0e0e0;
  text-align: center;
}

.gameboy-stamp {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 10px;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

.stamp-year {
  font-size: 8px;
  opacity: 0.7;
}

.about-modal-editor-preview {
  padding: 1.5rem;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 0;
  text-align: center;
}

.about-modal-editor-preview h3 {
  font-family: 'Press Start 2P', 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #6b5b7a;
  margin: 0 0 1rem 0;
}

.about-modal-editor-preview p {
  margin: 0.5rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #666;
}

/* Responsive About Modal */
@media (max-width: 768px) {
  .about-button {
    width: 40px;
    height: 40px;
  }
  
  .about-modal-content {
    max-width: 95%;
    margin: 1rem;
  }
  
  .about-modal-header {
    padding: 1rem;
    padding-right: 3.5rem;
  }
  
  .about-modal-title {
    font-size: 12px;
  }
  
  .about-content {
    padding: 1rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .about-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  
  .about-modal-content {
    max-width: 98%;
    margin: 0.5rem;
  }
  
  .about-modal-title {
    font-size: 10px;
  }
  
  .about-section h3 {
    font-size: 9px;
  }
  
  .about-section p,
  .feature-list li {
    font-size: 11px;
  }
  
  .tech-grid {
    flex-direction: column;
  }
  
  .tech-badge {
    width: 100%;
    text-align: center;
  }
}
