* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  background: #0b0b0f;
  color: #e0e0ff;
  background-image: repeating-linear-gradient(
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 2px
  );
}

.site-header {
  text-align: center;
  padding: 30px 10px;
  border-bottom: 3px solid #6c63ff;
}

.site-header h1 {
  margin: 0;
  font-size: 32px;
  color: #9d9dff;
}

.subtitle {
  font-size: 10px;
  color: #aaa;
}

.menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: #111;
  border-bottom: 2px solid #444;
}

.menu a {
  padding: 10px 15px;
  color: #7fffd4;
  text-decoration: none;
  font-size: 10px;
}

.menu a:hover {
  background: #222;
  color: #fff;
}

.content {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 15px;
}

.box {
  background: #14141f;
  border: 2px solid #6c63ff;
  padding: 20px;
  margin-bottom: 20px;
}

.box h2 {
  margin-top: 0;
  font-size: 14px;
  color: #7fffd4;
}

.retro-list {
  list-style: none;
  padding: 0;
}

.retro-list li {
  margin-bottom: 10px;
  font-size: 10px;
}

.site-footer {
  text-align: center;
  font-size: 9px;
  padding: 20px;
  border-top: 2px solid #444;
  color: #777;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.thumb {
  background: #0f0f1a;
  border: 2px solid #6c63ff;
  padding: 5px;
  cursor: pointer;
  text-align: center;
}

.thumb img {
  width: 100%;
  /*image-rendering: pixelated;*/
}

.thumb span {
  display: block;
  font-size: 8px;
  margin-top: 5px;
  color: #7fffd4;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border: 3px solid #6c63ff;
}

.arcade-player {
  background: #0b0b12;
  border: 4px solid #6c63ff;
  padding: 10px;
  margin-top: 20px;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}

.arcade-top,
.arcade-bottom {
  text-align: center;
  font-size: 9px;
  padding: 5px 0;
  color: #7fffd4;
  background: #111;
  border: 2px solid #444;
}

.arcade-screen {
  background: #000;
  border: 3px inset #222;
  padding: 5px;
  margin: 10px 0;
}

.arcade-screen iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

/* Spotify ajuste */
.arcade-screen iframe[src*="spotify"] {
  aspect-ratio: auto;
  height: 152px;
}

/* ===== CRT EFFECT ===== */

#crt-overlay,
#crt-overlay-vignette,
#crt-overlay-scanlines,
#crt-overlay-sub,
#crt-overlay-noise {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.crt-on #crt-overlay,
body.crt-on #crt-overlay-vignette,
body.crt-on #crt-overlay-scanlines,
body.crt-on #crt-overlay-sub,
body.crt-on #crt-overlay-noise {
  opacity: 1;
}

#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  backdrop-filter: blur(.5px);
}

/* vignette */
#crt-overlay-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255,255,255,0.2) 0%,
      rgba(0,0,0,0.2) 70%,
      rgba(0,0,0,0.4) 100%
    );
  mix-blend-mode: overlay;
}

/* scanlines */
#crt-overlay-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.5),
    rgba(255,255,255,0) 2px
  );  
}

/* RGB subpixel */
#crt-overlay-sub {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background-image:
    linear-gradient(
      90deg,
      rgba(255,0,0,0.1),
      rgba(0,255,0,0.1),
      rgba(0,0,255,0.1)
    );
  background-size: 3px 100%;
  mix-blend-mode: overlay;
}

/* noise */
#crt-overlay-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: noiseMove 0.2s steps(8) infinite;
  filter: contrast(2);
  mix-blend-mode: overlay;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

@keyframes noiseMove {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* bloom + chroma */
body.crt-on .crt-content {
  text-shadow: 
    0 0 10px rgba(200,200,255,0.3),
    1px 0 1px rgba(255,0,0,0.75),
    -1px 0 1px rgba(0,255,255,0.75);
}