* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0f0f1e;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(123, 94, 167, 0.03) 20px,
      rgba(123, 94, 167, 0.03) 40px
    );
}

/* Scanline overlay */
.scanlines::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* CRT effect on cover */
.crt-frame {
  border-radius: 8px;
  box-shadow:
    0 0 40px rgba(123, 94, 167, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.crt-frame::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.15) 80%
  );
  pointer-events: none;
  z-index: 5;
}

/* Magazine cover tilt effect */
.magazine-tilt {
  transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
  transition: transform 0.4s ease;
}

.magazine-tilt:hover {
  transform: perspective(1200px) rotateY(0deg) rotateX(0deg) scale(1.02);
}

/* SNES button style */
.snes-btn {
  background: linear-gradient(180deg, #9B7FC7 0%, #7B5EA7 40%, #6B4E97 100%);
  border: 3px solid #5A3D86;
  border-radius: 50px;
  box-shadow:
    0 4px 0 #4A2D76,
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 2px;
  padding: 16px 40px;
  text-transform: uppercase;
  transition: all 0.1s ease;
  position: relative;
  overflow: hidden;
}

.snes-btn:active {
  box-shadow:
    0 1px 0 #4A2D76,
    0 2px 4px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(3px);
}

.snes-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading star spin */
@keyframes starSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.star-spin {
  animation: starSpin 1s ease-in-out infinite;
  display: inline-block;
}

/* Flicker text */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.flicker-text {
  animation: flicker 0.8s ease-in-out infinite;
}

/* Magazine overlay text styles */
.mag-logo {
  font-family: 'Archivo Black', sans-serif;
  color: white;
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
  letter-spacing: -1px;
}

.mag-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: #FFD700;
  text-shadow: 2px 2px 0 #000, 1px 1px 0 #000;
}

.mag-blurb {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  text-shadow: 1px 1px 0 #000;
}

/* Header stripe */
.header-stripe {
  background: linear-gradient(180deg, #FF1A1A 0%, #E60012 50%, #CC0010 100%);
  box-shadow: 0 4px 20px rgba(230, 0, 18, 0.4);
  position: relative;
}

.header-stripe::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700, #FFA500, #FFD700);
}

/* Gallery thumbnail */
.gallery-thumb {
  transition: all 0.2s ease;
  cursor: pointer;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Checkbox custom */
.issue-check {
  width: 18px;
  height: 18px;
  border: 2px solid #7B5EA7;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.issue-check.checked {
  background: #7B5EA7;
  color: #FFD700;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #7B5EA7;
  border-radius: 4px;
}

/* Pixel sprite using box-shadow (Mario mushroom) */
.pixel-mushroom {
  width: 4px;
  height: 4px;
  background: transparent;
  box-shadow:
    /* Top of cap */
    8px 0 #E60012, 12px 0 #E60012, 16px 0 #E60012,
    4px 4px #E60012, 8px 4px #fff, 12px 4px #E60012, 16px 4px #fff, 20px 4px #E60012,
    0px 8px #E60012, 4px 8px #fff, 8px 8px #E60012, 12px 8px #E60012, 16px 8px #E60012, 20px 8px #fff, 24px 8px #E60012,
    0px 12px #E60012, 4px 12px #E60012, 8px 12px #E60012, 12px 12px #E60012, 16px 12px #E60012, 20px 12px #E60012, 24px 12px #E60012,
    /* Face */
    4px 16px #F5D6A8, 8px 16px #F5D6A8, 12px 16px #F5D6A8, 16px 16px #F5D6A8, 20px 16px #F5D6A8,
    8px 20px #F5D6A8, 12px 20px #000, 16px 20px #F5D6A8;
  transform: scale(1.5);
}

/* Pulse glow for random button */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Cover subscriber banner */
.subscriber-banner {
  background: linear-gradient(90deg, #FFD700, #FFA500);
  transform: rotate(-35deg);
  position: absolute;
  top: 20px;
  left: -40px;
  width: 180px;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.6rem;
  padding: 4px 0;
  color: #000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 20;
}

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

.fade-slide-up {
  animation: fadeSlideUp 0.5s ease-out forwards;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}