@font-face {
  font-family: 'ArcadeFont';
  src: url('arcade-font.woff2') format('woff2');
  font-display: swap;
}

.logos{
  width:50px;
}

#matrix-background {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -100;
  width: 100vw;
  height: 100vh;
  background: black;
  pointer-events: none;
}


/*

#background-effects {
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/8/85/Smiley.svg");
  background-repeat: repeat;
  background-size: contain;
  opacity: 1;
}*/



body {
  margin: 0;
  font-family: 'ArcadeFont', monospace;
  background: radial-gradient(circle at top, #111 0%, #000 100%);
  color: #0ff;
  text-align: center;
}


#background-effects {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
}

/* Tron grid: líneas brillantes cian que se mueven */
.glow-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 255, 0.03) 0px,
    rgba(0, 255, 255, 0.06) 2px,
    transparent 4px
  );
  animation: glow-grid 3s linear infinite;
  opacity: 0.5;
}

/* Matrix overlay: efecto visual animado encima */
.matrix-overlay {
  position: absolute;
  width: 200%;
  height: auto;
  opacity: 0.08;
  animation: matrix-fall 30s linear infinite;
  pointer-events: none;
  user-select: none;
}

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

@keyframes matrix-fall {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}



header {
  padding: 1em;
  background-color: #222;
  border-bottom: 2px solid #0ff;
}

h1 {
  font-size: 3vw;
  margin: 0.2em 0;
  color: #0ff;
}

p {
  font-size: 1.2em;
  color: #ccc;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1em;
  padding: 2em;
}

.game-card {
  position: relative;
  border: 2px solid #0ff;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-color: #000;
  aspect-ratio: 1/1;
  transition: transform 0.3s, border-color 0.3s;
}

.cover {
  flex: 1;
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
}

.game-card:hover {
  transform: scale(1.05);
  border-color: #f0f;
}

.game-title {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.8);
  color: #0ff;
  padding: 0.5em;
  font-size: 1em;
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
}
/*
.game-title {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.7);
  color: #0ff;
  padding: 0.5em 0;
  font-size: 1em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}*/

footer {
  font-size: 0.9em;
  padding: 1em;
  color: #666;
}


#intro-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, #000, #111 70%, #000);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #0ff;
  font-family: 'ArcadeFont', monospace;
  text-align: center;
  animation: flicker-bg 1s infinite alternate;
  overflow: hidden;
}

.intro-content {
  z-index: 2;
}

.intro-title {
  font-size: 4vw;
  text-shadow: 0 0 10px #0ff, 0 0 20px #f0f, 0 0 30px #0ff;
  margin-bottom: 0.5em;
  animation: pulse 1.2s infinite ease-in-out;
}

.intro-sub {
  font-size: 1.5em;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes flicker-bg {
  0% { background-color: #000; }
  100% { background-color: #111; }
}

.scan-line {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 5%;
  background: rgba(0,255,255,0.2);
  filter: blur(5px);
  animation: scan 4s infinite linear;
}

@keyframes scan {
  0% { top: -5%; }
  100% { top: 105%; }
}



/* CRT overlay */
#crt {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0px,
    rgba(0,0,0,0.05) 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  animation: crt-flicker 0.2s infinite;
  opacity: 0.6;
}

@keyframes crt-flicker {
  0%, 100% { opacity: 0.6; transform: scaleX(1.003) scaleY(1.001); }
  50% { opacity: 0.7; transform: scaleX(1.001) scaleY(1.003); }
}


.arcade-logo {
  animation: bounceIn 1s ease-out, pulse 1.5s infinite;
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3) translateY(-100%); }
  60% { opacity: 1; transform: scale(1.05) translateY(20%); }
  80% { transform: scale(0.95) translateY(-10%); }
  100% { transform: scale(1) translateY(0); }
}


body.teleporting::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #0ff 0%, #000 80%);
  animation: teleport-flash 0.6s ease-out forwards;
  z-index: 99999;
  pointer-events: none;
}

@keyframes teleport-flash {
  0% { opacity: 0; transform: scale(0.1); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(5); }
}


@keyframes glitch {
  0% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
  10% { clip-path: inset(20% 0 65% 0); transform: translate(-2px, -1px); }
  20% { clip-path: inset(60% 0 15% 0); transform: translate(2px, 1px); }
  30% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 0); }
  40% { clip-path: inset(10% 0 80% 0); transform: translate(2px, 2px); }
  50% { clip-path: inset(85% 0 5% 0); transform: translate(-1px, -2px); }
  60%, 100% { clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

.glitch-logo {
  position: relative;
  color: #0ff;
  text-shadow: 0 0 5px #0ff, 0 0 10px #f0f, 0 0 20px #0ff;
  animation: glitch 2.5s infinite;
}




.glitch-hover {
  position: relative;
  color: #0ff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.glitch-hover::before,
.glitch-hover::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  color: #f0f;
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  transform: translate(-2px, -2px);
  opacity: 0;
}

.glitch-hover::after {
  color: #0ff;
  clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
  transform: translate(2px, 2px);
}

.glitch-hover:hover::before,
.glitch-hover:hover::after {
  opacity: 1;
  animation: glitch-flicker 0.3s steps(2, end) infinite;
}

@keyframes glitch-flicker {
  0% { transform: translate(0px, 0px); }
  20% { transform: translate(-2px, -2px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0px, 0px); }
}





.glitch-noise {
  position: relative;
  color: #0ff;
  animation: noise-glitch 1.8s infinite ease-in-out;
  text-shadow:
    0 0 1px #0ff,
    0 0 2px #0ff,
    0 0 4px #0ff,
    0 0 8px #f0f;
}

@keyframes noise-glitch {
  0% { transform: translate(0, 0); opacity: 1; }
  10% { transform: translate(-1px, 1px); }
  20% { transform: translate(1px, -1px); }
  30% { transform: translate(-2px, 0); }
  40% { transform: translate(2px, 1px); opacity: 0.95; }
  50% { transform: translate(0, 0); }
  60% { transform: translate(-1px, -2px); }
  70% { transform: translate(1px, 2px); }
  80% { transform: translate(-1px, 1px); opacity: 0.9; }
  90% { transform: translate(1px, -1px); }
  100% { transform: translate(0, 0); opacity: 1; }
}


.external-links {
  margin-top: 2em;
  display: flex;
  justify-content: center;
  gap: 2em;
  flex-wrap: wrap;
}

.external-links a {
  color: #0ff;
  text-decoration: none;
  font-size: 1.1em;
  transition: text-shadow 0.3s;
}

.external-links a:hover {
  text-shadow: 0 0 5px #f0f, 0 0 10px #0ff;
}





#arcade-footer {
  position: relative;
  text-align: center;
  padding: 2em 1em;
  color: #0ff;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.7);
  overflow: hidden;
  z-index: 10;
}

#arcade-footer p {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
}

.wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #0ff, transparent);
  opacity: 0.15;
  animation: wave-glow 4s linear infinite;
}

@keyframes wave-glow {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}




#mascota {
  position: fixed;
  bottom: 80px;
  left: 0;
  z-index: 20;
  padding: 0.5em;
  animation: mascota-saludo 4s ease-in-out infinite;
  cursor: pointer;
}

#mascota img {
  width: 64px;
  height: auto;
  image-rendering: pixelated;
}

@keyframes mascota-saludo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}




#mascota-dialogo {
  position: fixed;
  bottom: 160px;
  left: 70px;
  background: rgba(0, 0, 0, 0.8);
  color: #0ff;
  padding: 0.5em 1em;
  border: 1px solid #0ff;
  border-radius: 8px;
  font-size: 0.85em;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 30;
}





#offline-overlay {
  position: fixed;
  inset: 0;
  background: black;
  color: #0ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
  text-align: center;
  padding: 2em;
  font-family: 'Courier New', monospace;
}

.offline-content h1 {
  font-size: 2em;
  margin-bottom: 1em;
}

.offline-content p {
  font-size: 1em;
  margin-bottom: 2em;
  opacity: 0.7;
}

.offline-content button {
  background: transparent;
  border: 1px solid #0ff;
  padding: 0.6em 1.2em;
  color: #0ff;
  font-family: inherit;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.offline-content button:hover {
  background: #0ff;
  color: black;
}

.glitch-text {
  animation: glitch 1.5s infinite;
  position: relative;
}

@keyframes glitch {
  0% { text-shadow: 2px 0 red, -2px 0 blue; }
  20% { text-shadow: -2px 0 red, 2px 0 blue; }
  40% { text-shadow: 2px 0 red, -2px 0 blue; }
  60% { text-shadow: -1px 0 red, 1px 0 blue; }
  80% { text-shadow: 1px 0 red, -1px 0 blue; }
  100% { text-shadow: 0 0 red, 0 0 blue; }
}