/* ===================== VARIABLES GLOBALES ===================== */
:root {
  --fg: #00ff00;
  --bg: #000; /* Fondo negro para estilo hacker */
  --accent: #00ff00;
  --danger: #ff0033;
  font-family: 'Share Tech Mono', monospace;
}

/* ===================== RESET GLOBAL ===================== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--bg); /* Mantenerlo por si el canvas no carga */
  color: var(--fg);
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden; /* Para que no haya scroll innecesario */
  position: relative;
}

/* ===================== CANVAS MATRIX ===================== */
.main-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -999; /* Muy por detrás */
  display: block;
  background: transparent;
  pointer-events: none; /* Para que no bloquee clics */
}

/* ===================== PÁGINA PRINCIPAL ===================== */
.main-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  position: relative;
  z-index: 10; /* Para que el contenido esté por encima del canvas */
}

.main-container {
  animation: fadeIn 2s ease-in-out;
}

.main-title {
  font-size: 3em;
  text-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent);
}

.main-buttons a {
  display: inline-block;
  margin: 10px;
  padding: 10px 20px;
  border: 2px solid var(--accent);
  color: var(--fg);
  text-decoration: none;
  transition: 0.3s;
}

.main-buttons a:hover {
  background: var(--accent);
  color: var(--bg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===================== MODAL DEL MINIJUEGO ===================== */
.modal-game {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1); /* más transparente */
  backdrop-filter: blur(5px); /* efecto desenfoque */
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-game.active {
  display: flex; /* se activa con JS */
}


.modal-game.active {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-game iframe {
  width: 90%;
  height: 90%;
  border: 2px solid var(--accent);
  background: transparent; /* ya no bloquea la vista */

}


.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--fg);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 0 8px var(--accent);
}


/* ===================== MINIJUEGO ===================== */

.game-body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;  background: none transparent;

}

.game-wrap {
  width: min(900px, 92vw);
  padding: 28px 22px;
  background: #0a0a0a;
  border: 3px solid var(--accent);
  box-shadow: 0 0 18px var(--accent);
  text-align: center;
}

.game-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.game-chip {
  border: 1px solid var(--accent);
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 140px;
}

.game-word {
  margin: 16px auto;
  letter-spacing: 12px;
  display: flex;
  justify-content: center;
  font-weight: 700;
  font-size: 40px;
  overflow: hidden;
}

.game-input {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-letter {
  width: 70px;
  text-align: center;
  font-size: 28px;
  background: #000;
  border: 2px solid var(--accent);
  color: var(--fg);
  padding: 6px 8px;
}

.game-btn {
  padding: 10px 16px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.game-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ===================== SCOREBOARD ======================*/
#scoreboard {
  margin-top: 30px;
  padding: 20px;
  background: #0a0a0a;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent);
  border-radius: 8px;
  color: var(--fg);
  text-align: center;
}

#scoreboard h3 {
  margin-bottom: 16px;
  font-size: 24px;
  color: var(--accent);
}

#scoreboard table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
}

#scoreboard th,
#scoreboard td {
  padding: 10px;
  border: 1px solid var(--accent);
  color: var(--fg);
}

#scoreboard th {
  background: #111;
  color: var(--accent);
}

#scoreboard tr:nth-child(even) {
  background: #1a1a1a;
}

#scoreboard tr:hover {
  background: #222;
}

/* ===================== ERROR PAGES ===================== */
.error-body {
  flex-direction: column;
  text-align: center;
}

.error-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.error-title {
  font-size: 4em;
  text-transform: uppercase;
  text-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent);
  margin-bottom: 20px;
}

.error-message {
  font-size: 1.5em;
  margin-bottom: 30px;
}

.error-button {
  display: inline-block;
  padding: 12px 25px;
  border: 2px solid var(--accent);
  color: var(--fg);
  text-decoration: none;
  font-size: 1.2em;
  transition: 0.3s;
}

.error-button:hover {
  background: var(--accent);
  color: var(--bg);
}
