:root {
  --background: #010201;
  --screen: #030603;
  --panel: #060a06;

  --green: #8eff57;
  --green-bright: #b4ff78;
  --green-dark: #31552b;

  --text: #e4eadf;
  --muted: #788173;
  --disabled: #4c514a;

  --red: #ff3f5f;
  --blue: #28a8ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  width: 100%;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at center,
      #10180d 0%,
      #060906 40%,
      #010201 100%
    );

  color: var(--text);

  font-family:
    "Courier New",
    Courier,
    monospace;

  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 4px
    );

  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;

  opacity: 0.3;

  background:
    radial-gradient(
      ellipse at center,
      transparent 45%,
      rgba(0, 0, 0, 0.45) 100%
    );
}

button,
a {
  font: inherit;
}

#app {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* =========================
   LOADING
========================= */

#loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 1;

  transition:
    opacity 500ms steps(6, end);
}

.screen-frame {
  position: relative;

  width: min(96vw, 1120px);
  min-height: min(92vh, 780px);

  display: flex;
  flex-direction: column;

  border: 2px solid rgba(142, 255, 87, 0.42);

  background:
    linear-gradient(
      rgba(3, 6, 3, 0.95),
      rgba(1, 3, 1, 0.98)
    );

  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(142, 255, 87, 0.08),
    inset 0 0 70px rgba(142, 255, 87, 0.035);

  overflow: hidden;
}

.screen-frame::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 0;
  z-index: 20;

  width: 100%;
  height: 18%;

  pointer-events: none;

  background:
    linear-gradient(
      to bottom,
      transparent,
      rgba(142, 255, 87, 0.035),
      rgba(255, 255, 255, 0.045),
      transparent
    );

  animation:
    screenScan 6s linear infinite;
}

.boot-message,
.loading-footer,
.window-header,
.main-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;

  padding: 14px 18px;

  color: var(--green);

  font-size: 0.72rem;
  letter-spacing: 0.12em;

  border-color:
    rgba(142, 255, 87, 0.25);
}

.boot-message {
  border-bottom:
    1px solid rgba(142, 255, 87, 0.25);
}

.loading-footer {
  border-top:
    1px solid rgba(142, 255, 87, 0.25);
}

.boot-status {
  animation:
    statusBlink 1s steps(2, end) infinite;
}

.loading-content {
  position: relative;
  z-index: 5;

  flex: 1;

  width: min(90%, 760px);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;

  text-align: center;

  padding: 30px 0;
}

/* =========================
   YUCA
========================= */

#yuca-loader {
  position: relative;

  width: min(100%, 720px);
  height: clamp(210px, 32vw, 320px);

  margin: 0 auto 18px;

  overflow: hidden;
}

#yuca-loader img {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center 67%;

  transform:
    translate(-50%, -50%)
    scale(1.04);

  image-rendering: pixelated;
  image-rendering: crisp-edges;

  mix-blend-mode: multiply;

  filter:
    brightness(0.95)
    contrast(1.35)
    saturate(0.92)
    drop-shadow(
      0 10px 5px
      rgba(0, 0, 0, 0.8)
    );
}

.loading-text {
  margin-bottom: 18px;

  color: var(--green-bright);

  font-size:
    clamp(
      0.9rem,
      2.5vw,
      1.15rem
    );

  font-weight: bold;

  letter-spacing: 0.14em;

  text-shadow:
    0 0 8px rgba(142, 255, 87, 0.55);
}

.loading-dots::after {
  content: "";

  animation:
    loadingDots 1.2s steps(4, end) infinite;
}

.loading-bar {
  width: 100%;
  height: 28px;

  padding: 4px;

  border:
    2px solid var(--green);

  background: #010301;

  box-shadow:
    0 0 14px rgba(142, 255, 87, 0.16),
    inset 0 0 12px rgba(142, 255, 87, 0.06);
}

.loading-progress {
  width: 0%;
  height: 100%;

  background:
    repeating-linear-gradient(
      90deg,
      var(--green) 0,
      var(--green) 12px,
      transparent 12px,
      transparent 17px
    );

  box-shadow:
    0 0 10px rgba(142, 255, 87, 0.55);

  transition:
    width 100ms steps(2, end);
}

#loading-percentage {
  margin-top: 12px;

  color: var(--green);

  font-size: 1rem;

  text-shadow:
    0 0 7px rgba(142, 255, 87, 0.45);
}

#loading-status {
  min-height: 1.2rem;

  margin-top: 8px;

  color: var(--muted);

  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

/* =========================
   GLITCH
========================= */

#glitch-transition {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: grid;
  place-items: center;

  background: #000;

  color: var(--green-bright);

  font-size:
    clamp(
      1.3rem,
      5vw,
      3.2rem
    );

  font-weight: bold;

  letter-spacing: 0.14em;

  text-align: center;

  animation:
    glitchScreen 650ms steps(7, end);
}

#glitch-transition::before,
#glitch-transition::after {
  content: "ACCESO CONCEDIDO";
  position: absolute;
}

#glitch-transition::before {
  color: var(--red);

  clip-path:
    inset(12% 0 58% 0);

  animation:
    glitchLayerOne 120ms steps(2, end) infinite;
}

#glitch-transition::after {
  color: var(--blue);

  clip-path:
    inset(60% 0 12% 0);

  animation:
    glitchLayerTwo 140ms steps(2, end) infinite;
}

/* =========================
   MENÚ + PANTALLAS
========================= */

#main-menu,
#characters-screen,
#arcade-screen {
  min-height: 100vh;

  display: grid;
  place-items: center;

  padding: 18px;
}

.menu-window,
.characters-window {
  position: relative;

  width: min(96vw, 1180px);

  border:
    2px solid rgba(142, 255, 87, 0.45);

  background:
    linear-gradient(
      rgba(4, 8, 4, 0.97),
      rgba(1, 3, 1, 0.99)
    );

  box-shadow:
    0 0 24px rgba(142, 255, 87, 0.08),
    inset 0 0 60px rgba(142, 255, 87, 0.025);

  overflow: hidden;
}

.window-header {
  border-bottom:
    1px solid rgba(142, 255, 87, 0.25);
}

.main-footer {
  border-top:
    1px solid rgba(142, 255, 87, 0.25);
}

.menu-content {
  display: grid;

  grid-template-columns:
    minmax(280px, 0.85fr)
    minmax(420px, 1.35fr);

  gap: 44px;

  padding: 42px 28px;
}

.brand-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.system-label {
  margin-bottom: 18px;

  color: var(--green);

  font-size: 0.75rem;
  letter-spacing: 0.13em;
}

h1 {
  margin-bottom: 18px;

  color: var(--green);

  font-size:
    clamp(
      3.2rem,
      8vw,
      6.8rem
    );

  line-height: 0.82;

  letter-spacing: -0.08em;

  text-shadow:
    4px 0 rgba(255, 63, 95, 0.48),
    -4px 0 rgba(40, 168, 255, 0.48),
    0 0 18px rgba(142, 255, 87, 0.18);
}

.intro-text {
  color: var(--muted);

  font-size:
    clamp(
      0.95rem,
      2vw,
      1.15rem
    );
}

/* =========================
   ARCHIVOS
========================= */

.project-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;

  gap: 12px;
}

.project-link {
  display: grid;

  grid-template-columns:
    auto minmax(0, 1fr) auto;

  align-items: center;

  gap: 14px;

  min-height: 66px;

  padding: 14px 18px;

  border:
    2px solid rgba(142, 255, 87, 0.38);

  background:
    rgba(3, 7, 3, 0.85);

  color: var(--green);

  text-decoration: none;

  font-size:
    clamp(
      0.78rem,
      1.7vw,
      1.05rem
    );

  letter-spacing: 0.04em;

  text-align: left;

  transition:
    transform 120ms steps(2, end),
    border-color 120ms linear,
    background 120ms linear,
    box-shadow 120ms linear;
}

.project-button {
  width: 100%;
  cursor: pointer;
}

.project-link:hover,
.project-link:focus-visible {
  transform:
    translateX(8px);

  border-color:
    var(--green-bright);

  background:
    rgba(17, 30, 13, 0.95);

  box-shadow:
    0 0 15px rgba(142, 255, 87, 0.15);

  outline: none;
}

.project-icon {
  animation:
    projectCursor 900ms steps(2, end) infinite;
}

.project-name {
  overflow-wrap: anywhere;
}

.project-action {
  color: var(--green-bright);
  font-size: 0.74em;
}

.unavailable {
  color: var(--disabled);

  border-color:
    rgba(110, 118, 105, 0.25);

  cursor: not-allowed;
}

.unavailable .project-icon,
.unavailable .project-action {
  color: var(--disabled);
  animation: none;
}

.unavailable:hover {
  transform: none;

  border-color:
    rgba(110, 118, 105, 0.25);

  background:
    rgba(3, 7, 3, 0.85);

  box-shadow: none;
}

/* =========================
   INTEGRANTES
========================= */

.characters-content {
  position: relative;
  padding: 30px;
}

.character-status {
  margin-bottom: 24px;

  color: var(--green-bright);

  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.character-images {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 24px;
}

.character-card {
  border:
    1px solid rgba(142, 255, 87, 0.28);

  background:
    rgba(0, 0, 0, 0.45);

  padding: 12px;

  overflow: hidden;
}

.character-label {
  margin-bottom: 10px;

  color: var(--green);

  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.character-card img {
  display: block;

  width: 100%;
  height: auto;

  border:
    1px solid rgba(142, 255, 87, 0.2);

  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* =========================
   ARCADE
========================= */

#arcade-screen .characters-window {
  border-color:
    rgba(255, 70, 70, 0.45);

  box-shadow:
    0 0 28px rgba(255, 40, 40, 0.08),
    inset 0 0 70px rgba(255, 40, 40, 0.025);
}

#arcade-screen .window-header {
  color: #ff5c5c;

  border-bottom:
    1px solid rgba(255, 70, 70, 0.25);
}

#arcade-screen .character-status {
  color: #ff6b6b;

  text-shadow:
    0 0 8px rgba(255, 60, 60, 0.4);
}

#arcade-screen .character-images {
  position: relative;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

#arcade-screen .character-card {
  position: relative;

  aspect-ratio: 4 / 3;

  padding: 10px;

  border:
    2px solid rgba(255, 70, 70, 0.25);

  background:
    #020202;

  overflow: hidden;
}

/* CAMBIO CLAVE:
   ahora se ve TODA la imagen */

#arcade-screen .character-card img {
  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  border: none;

  background: #000;

  image-rendering: pixelated;
  image-rendering: crisp-edges;

  animation:
    arcadeIdle 1.1s steps(2, end) infinite;
}

#arcade-screen .character-card:nth-child(1) {
  animation:
    playerOneEnter 620ms cubic-bezier(.2,.8,.2,1) both;
}

#arcade-screen .character-card:nth-child(2) {
  animation:
    playerTwoEnter 620ms cubic-bezier(.2,.8,.2,1) both;
}

#arcade-screen .character-card::after {
  content: "";

  position: absolute;
  inset: 0;

  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 4px,
      rgba(255, 255, 255, 0.03) 5px
    );

  mix-blend-mode: screen;
}

#arcade-screen .characters-content::before {
  content: "FIGHT!";

  position: absolute;

  left: 50%;
  top: 50%;

  z-index: 50;

  transform:
    translate(-50%, -50%)
    scale(0.2);

  color: #ffb300;

  font-size:
    clamp(
      2.4rem,
      8vw,
      7rem
    );

  font-weight: 900;

  letter-spacing: 0.06em;

  text-shadow:
    4px 4px 0 #8b1c00,
    -2px -2px 0 #ffe36b,
    0 0 18px rgba(255, 70, 0, 0.75);

  opacity: 0;

  pointer-events: none;
}

#arcade-screen.arcade-active .characters-content::before {
  animation:
    fightText 1.1s steps(6, end) forwards;
}

#arcade-screen.arcade-active .characters-window {
  animation:
    arcadeShake 420ms steps(6, end);
}

#arcade-screen.arcade-active::before {
  content: "";

  position: fixed;
  inset: 0;

  z-index: 200;

  pointer-events: none;

  background:
    rgba(255, 0, 0, 0.28);

  animation:
    arcadeFlash 380ms steps(3, end) forwards;
}

#arcade-screen .main-footer {
  color: #ff7b4d;

  border-top:
    1px solid rgba(255, 80, 40, 0.25);
}

#arcade-screen .main-footer span:last-child {
  animation:
    insertCoinBlink 700ms steps(2, end) infinite;
}

.back-button {
  margin-top: 26px;

  padding: 13px 18px;

  border:
    2px solid rgba(142, 255, 87, 0.4);

  background: #030703;

  color: var(--green-bright);

  cursor: pointer;

  letter-spacing: 0.08em;
}

.back-button:hover,
.back-button:focus-visible {
  border-color: var(--green-bright);

  background:
    rgba(17, 30, 13, 0.95);

  outline: none;
}

/* =========================
   ANIMACIONES
========================= */

@keyframes screenScan {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(680%);
  }
}

@keyframes statusBlink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0.3;
  }
}

@keyframes loadingDots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75%,
  100% {
    content: "...";
  }
}

@keyframes glitchScreen {
  0% {
    opacity: 0;
    transform: scaleY(0.02);
  }

  20% {
    opacity: 1;
    transform: scaleY(1);
  }

  45% {
    transform: translateX(-8px);
  }

  65% {
    transform: translateX(9px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glitchLayerOne {
  0% {
    transform: translate(-7px, -2px);
  }

  100% {
    transform: translate(5px, 2px);
  }
}

@keyframes glitchLayerTwo {
  0% {
    transform: translate(6px, 2px);
  }

  100% {
    transform: translate(-5px, -2px);
  }
}

@keyframes projectCursor {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0.25;
  }
}

@keyframes playerOneEnter {
  0% {
    opacity: 0;

    transform:
      translateX(-120%)
      scale(0.92);
  }

  100% {
    opacity: 1;

    transform:
      translateX(0)
      scale(1);
  }
}

@keyframes playerTwoEnter {
  0% {
    opacity: 0;

    transform:
      translateX(120%)
      scale(0.92);
  }

  100% {
    opacity: 1;

    transform:
      translateX(0)
      scale(1);
  }
}

@keyframes arcadeIdle {
  0%,
  100% {
    transform:
      translateY(0)
      scale(1);
  }

  50% {
    transform:
      translateY(-2px)
      scale(1.002);
  }
}

@keyframes fightText {
  0% {
    opacity: 0;

    transform:
      translate(-50%, -50%)
      scale(0.15);
  }

  25% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      scale(1.3);
  }

  48% {
    transform:
      translate(-50%, -50%)
      scale(0.95);
  }

  68% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      scale(1);
  }

  100% {
    opacity: 0;

    transform:
      translate(-50%, -50%)
      scale(1.15);
  }
}

@keyframes arcadeShake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-7px, 2px);
  }

  40% {
    transform: translate(7px, -2px);
  }

  60% {
    transform: translate(-4px, 3px);
  }

  80% {
    transform: translate(4px, -2px);
  }
}

@keyframes arcadeFlash {
  0% {
    opacity: 1;
  }

  40% {
    opacity: 0.25;
  }

  100% {
    opacity: 0;
  }
}

@keyframes insertCoinBlink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0.25;
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 780px) {
  .boot-message,
  .loading-footer,
  .window-header,
  .main-footer {
    flex-direction: column;
    gap: 5px;
    font-size: 0.62rem;
  }

  .menu-content {
    grid-template-columns: 1fr;

    gap: 36px;

    padding: 34px 18px;
  }

  .character-images {
    grid-template-columns: 1fr;
  }

  #arcade-screen .character-images {
    grid-template-columns: 1fr;
  }

  #arcade-screen .character-card {
    aspect-ratio: 4 / 3;
  }

  h1 {
    font-size:
      clamp(
        3rem,
        18vw,
        5rem
      );
  }

  .project-link {
    grid-template-columns:
      auto minmax(0, 1fr);

    padding: 14px;
  }

  .project-action {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  #loading-screen,
  #main-menu,
  #characters-screen,
  #arcade-screen {
    padding: 8px;
  }

  .loading-content {
    width: 92%;
  }

  #yuca-loader {
    height: 210px;
    margin-bottom: 10px;
  }

  #yuca-loader img {
    transform:
      translate(-50%, -50%)
      scale(1.18);
  }

  .loading-bar {
    height: 23px;
  }

  .menu-window,
  .characters-window {
    width: 100%;
  }

  .characters-content {
    padding: 18px;
  }
}