@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
  --green: #35f27a;
  --green-dim: #17a352;
  --green-glow: rgba(53, 242, 122, 0.55);
  --red: #ff2b4d;
  --red-glow: rgba(255, 43, 77, 0.65);
  --trans-blue: #5bcefa;
  --trans-pink: #f5a9b8;
  --trans-white: #ffffff;
  --ambient-tint: rgba(53, 242, 122, 0.05);
  --bg: #030a05;
  --yellow: #f0e04f;
}

* {
  box-sizing: border-box;
}

/* Dock de iconos -- alternativa clickeable a escribir comandos */
.bottom-row {
  align-items: center;
}

#mute-btn[aria-pressed="true"]{
  color: var(--red);
}

#c-t::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    color: white;

    background-color: currentColor;

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z'/%3E%3C/svg%3E")
        center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z'/%3E%3C/svg%3E")
        center / contain no-repeat;

        margin-right: 6px;
    vertical-align: middle;
    left: 215px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
}


#icon-dock {
  gap: 6px;
  height: 32px;
  display: none;
  margin-left: auto;
}

#icon-dock.visible {
  display: flex;
}

#icon-dock button {
  line-height: 1;
  border: 1px solid #17a35200;
  background: rgba(2, 8, 4, 0.6);
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.4rem;
  margin-left: 10px;
  margin-right: 10px;
  cursor: pointer;
  padding: 5px;
  display: flex;
  border-radius: 8px;
  align-items: center;
  position: relative;
}

#icon-dock button:hover {
  background: var(--green);
  color: #000;
}

/* Scrollbar tematizado -- reemplaza el gris default del navegador */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--green-dim) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--green-dim);
  box-shadow: 0 0 4px var(--green-glow);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'Share Tech Mono', monospace;
}

.hud {
  position: relative;
  width: min(1200px, 92vw);
  height: min(1000px, 95vh);
  padding: 18px 22px 22px;
  border: 1px solid var(--green-dim);
  background:
    linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.35) 50%),
    radial-gradient(ellipse at center, var(--ambient-tint), rgba(0, 0, 0, 0) 70%),
    #020604;
  background-size: 100% 3px, auto, auto;
  color: var(--green);
  text-shadow: 0 0 4px var(--green-glow), 0 0 1px var(--green-glow);
  letter-spacing: 0.5px;
  overflow: hidden;
  animation: flicker 5s infinite;
  box-shadow: 0px 0px 9px 3px var(--green-glow);
}

/* corner brackets */
.hud::before,
.hud::after,
.hud .row::before,
.hud .row::after {
  content: none;
}

.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--green);
  opacity: 0.9;
}

.corner.tl {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.corner.tr {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.corner.bl {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.corner.br {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--green-dim);
  text-transform: uppercase;
}

.top-left,
.top-right {
  line-height: 1.6;
}

.top-right {
  text-align: right;
}

.top-left .lbl-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  margin-right: 6px;
  box-shadow: 0 0 6px var(--green-glow);
  vertical-align: middle;
}

.dots {
    display: flex;
    gap: 10px;
    height: fit-content;
    text-align: center;
    justify-content: stretch;
    align-items: center;
    flex-direction: row-reverse;
    width: stretch;
}

.dots p{
  margin: 0px;
}

.dots span {
    width: 6px;
    height: 6px;
    background: var(--green);
    box-shadow: 0 0 5px var(--green-glow);
    animation: idleBlink 3s infinite ease-in-out;
}

.dots span:nth-child(2) {
    animation-delay: .3s;
}

.dots span:nth-child(3) {
    animation-delay: .6s;
}

.dots span:nth-child(4) {
    animation-delay: .9s;
}

@keyframes idleBlink {
    0%, 100% {
        opacity: .35;
    }

    50% {
        opacity: .85;
    }
}

.center {
  text-align: center;
  padding: 25px 0px 34px;
  max-height: 700px;
  height: 90%;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.win {
  z-index: 9999;
}

.center>.welcome-screen>h1 {
  margin: 0 0 10px;
  font-size: clamp(14px, 2.4vw, 19px);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.center>.welcome-screen>h2 {
  margin: 0;
  font-size: clamp(14px, 2.4vw, 19px);
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 6px var(--green-glow), 0 0 12px var(--green-glow);
}

.bottom-row {
  font-size: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--green-dim);
  text-transform: uppercase;
  display: flex;
  gap: 24px;
  height: 45px;
}

.bottom-row span:not(:last-child)::after {
  content: '';
}

/* scanline sweep */
.scan {
  position: fixed;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent 0%, var(--ambient-tint) 50%, transparent 100%);
  animation: sweep 6s linear infinite;
  pointer-events: none;
}

@keyframes sweep {
  0% {
    top: -40%;
  }

  100% {
    top: 100%;
  }
}

@keyframes flicker {

  0%,
  96%,
  100% {
    opacity: 1;
  }

  97% {
    opacity: 0.92;
  }

  98% {
    opacity: 1;
  }

  99% {
    opacity: 0.85;
  }
}

@media (max-width:560px) {
  .top-row {
    font-size: 9px;
  }

  .bottom-row {
    font-size: 9px;
    flex-direction: column;
    gap: 4px;
  }
}

.btn-start {
  background: var(--green);
  color: #000;
  border: none;
  padding: 8px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 6px var(--green-glow);
}

.about-me {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--green-dim);
  background: rgba(0, 0, 0, 0.2);
  color: var(--green);
}

.introduction {
  margin-top: 20px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--green);
  display: flex;
  flex-direction: column;
  justify-content: left;
}

.introduction button {
  margin-bottom: 10px;
  font-size: 16px;
  width: fit-content;
  background: var(--green);
  color: #000;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 6px var(--green-glow);
  text-align: left;
  font-family: 'Share Tech Mono', monospace;
}

.console-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.directory {
  color: var(--green);
  font-weight: bold;
}

#console-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font: inherit;
  flex: 1;
  position: relative;
  left: -9px;
}

.cursor {
  width: 10px;
  height: 18px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

#explorer {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 10px;
  height: 100%;
  width: -webkit-fill-available;
  padding-right: 20px;
  overflow: hidden;

}

#bg-ascii {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 4px;
  font-family: monospace;
  font-size: 6px;
  line-height: 6px;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
  color: var(--green);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

#bg-ascii.visible {
  display: block;
}

#terminal-output,
.console-line {
  position: relative;
  z-index: 1;
}

#terminal-output {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  text-align: start;
  width: 100%;
}

#music-player {
  position: relative;
  display: none;
  flex-direction: column;
  width: 200px;
  height: fit-content;
}

.right-container {
  width: 200px;
}

.error-feed {
  position: relative;
  width: 198px;
  height: 170px;
  min-height: 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  margin-top: 20px;
}

.error-feed .feed-line {
  word-break: break-word;
  overflow-wrap: break-word;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: normal;
  animation: feedLineIn 0.25s ease-out;
}

@keyframes feedLineIn {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.con-btn-player {
  display: flex;
  width: 150px;
  margin-top: 5px;
  flex-direction: column;
  align-items: unset;
  justify-content: flex-start;
  position: relative;
}

.container-btns-m{
  display: flex;
  flex-direction: row;
  margin-bottom: 15px;
}

.con-btn-player button {
  margin: 0px 15px 0px 0px;
}

#music-player button {
  border: none;
  /* padding: 10px; */
  color: inherit;
  cursor: pointer;
  background: none;
  font-family: inherit;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3), -2px -2px 6px rgba(89, 195, 195, 0);
  font-size: 0.5rem;
  height: 32px;
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#music-player button:hover {
  background: #2dcb66;
  border-radius: 8px;
  color: black;
}

.container-tname {
    width: 187px;
    text-align: left;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    
    /* Degradado en los bordes para que no se corte feo */
    mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
}

#track-name {
    display: block; /* Cambiamos a block con max-content */
    width: max-content;
    white-space: nowrap;
    color: var(--green, #00ff00);
    will-change: transform;
}

#track-name.marquee {
    animation: marquee-pingpong linear infinite;
}

@keyframes marquee-pingpong {
    0%, 15% {
        transform: translateX(0);
    }
    45%, 65% {
        transform: translateX(var(--marquee-distance));
    }
    95%, 100% {
        transform: translateX(0);
    }
}

#music-wave {
  width: 462px;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1px;
  white-space: pre;
  overflow: hidden;
  color: var(--green);
  text-shadow: 0 0 4px var(--green-glow);
  opacity: 0.85;
  transform: rotate(270deg);
  position: absolute;
  left: -38px;
  top: 168px;
}

#music-wave.beat-flash {
  animation: beatFlash 0.15s ease-out;
}

@keyframes beatFlash {
  0% {
    text-shadow: 0 0 14px var(--green-glow), 0 0 6px var(--green-glow), 0 0 2px var(--green-glow);
    opacity: 1;
  }

  100% {
    text-shadow: 0 0 4px var(--green-glow);
    opacity: 0.85;
  }
}

.hud.beat-flash {
  animation: hudBeatFlash 0.15s ease-out;
}

@keyframes hudBeatFlash {
  0% {
    border-color: var(--green);
    box-shadow: 0 0 30px 7px var(--green-glow), 0 0 12px var(--green-glow);
  }

  100% {
    border-color: var(--green-dim);
    box-shadow: 0px 0px 9px 3px var(--green-glow);
  }
}

#track-time {
  min-width: 42px;
  width: fit-content;
  text-align: right;
  font-size: 11px;
  opacity: 0.7;
  color: var(--green);
}

track-time {
  min-width: 42px;
  width: fit-content;
  text-align: right;
  font-size: 11px;
  opacity: 0.7;
  color: var(--green);
}

/* Control de volumen -- misma estetica CRT verde que el resto del player */
.con-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 150px;
  color: var(--green);
}

.con-volume #mute-btn {
  flex: 0 0 auto;
  margin: 0;
}

.con-volume.muted #mute-btn {
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
}

#volume-value {
  flex: 0 0 auto;
  min-width: 20px;
  text-align: right;
  font-size: 11px;
  opacity: 0.7;
  color: var(--green);
}

/* Slider -- reseteamos la apariencia nativa y lo pintamos a mano */
#volume-slider {
  flex: 1;
  min-width: 0;
  height: 14px;
  margin: 0;
  cursor: pointer;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  /* --fill lo actualiza el JS: porcentaje ya recorrido */
  --fill: 50%;
}

/* Riel: parte recorrida en verde con glow, resto apagado */
#volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--green) 0%,
    var(--green) var(--fill),
    rgba(53, 242, 122, 0.18) var(--fill),
    rgba(53, 242, 122, 0.18) 100%
  );
  box-shadow: 0 0 6px var(--green-glow);
}

#volume-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(53, 242, 122, 0.18);
}

#volume-slider::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}

/* Thumb: bloque cuadrado tipo cursor de terminal, con brillo */
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 12px;
  margin-top: -4px;
  border: none;
  border-radius: 1px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 10px;
  height: 12px;
  border: none;
  border-radius: 1px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  cursor: pointer;
}

#volume-slider:focus-visible {
  outline: none;
}

#volume-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 12px var(--green-glow), 0 0 4px var(--green-glow);
}

div#terminal-output>div {
  max-width: 60vw;
  width: max-content;
  overflow-wrap: break-word;
}

#terminal-output a {
  color: var(--green);
  text-decoration: underline;
}

#terminal-output a:hover {
  color: #fff;
}

.cmd-choice {
  position: relative;
  cursor: pointer;
  /* text-decoration: none; */
  padding-bottom: 2px;
  /* border-bottom: 1px dashed rgba(53, 242, 122, 0.35); */
  animation: cmdPulse 2.4s ease-in-out infinite;
}

.cmd-choice::before {
  content: "»";
  display: inline-block;
  margin-right: 3px;
  color: var(--green);
  animation: cmdArrow 2.4s ease-in-out infinite;
}

.cmd-choice:hover {
  animation: none;
  text-shadow: 0 0 8px var(--green-glow);
  border-bottom-color: var(--green);
}

.cmd-choice:hover::before {
  animation: none;
  opacity: 1;
  transform: translateX(3px);
}

@keyframes cmdPulse {

  0%,
  100% {
    text-shadow: 0 0 2px var(--green-glow);
    border-bottom-color: rgba(53, 242, 122, 0.35);
  }

  50% {
    text-shadow: 0 0 8px var(--green-glow), 0 0 14px var(--green-glow);
    border-bottom-color: var(--green);
  }
}

@keyframes cmdArrow {

  0%,
  100% {
    transform: translateX(0);
    opacity: 0.4;
  }

  50% {
    transform: translateX(3px);
    opacity: 1;
  }
}

.cmd-choice:hover {
  text-shadow: 0 0 6px var(--green-glow);
}

.win-body a {
  color: var(--green);
  text-decoration: underline;
}

.win-body a:visited {
  color: var(--green);
}

.win-body a:hover {
  color: #fff;
}

/* Konami code glitch — "is this real?" */
.hud.glitch-active {
  animation: glitchShake 0.15s infinite, glitchHue 0.3s infinite;
}

.hud.glitch-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      rgba(255, 0, 90, 0.10) 0px,
      rgba(0, 255, 200, 0.10) 2px,
      transparent 4px);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: glitchLines 0.2s steps(2) infinite;
}

.hud.glitch-active #terminal-output,
.hud.glitch-active .top-row,
.hud.glitch-active .bottom-row {
  animation: glitchText 0.25s infinite;
}

@keyframes glitchShake {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-4px, 2px);
  }

  40% {
    transform: translate(4px, -2px) skewX(1deg);
  }

  60% {
    transform: translate(-3px, -3px);
  }

  80% {
    transform: translate(3px, 3px) skewX(-1deg);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes glitchHue {

  0%,
  100% {
    filter: hue-rotate(0deg) contrast(1) saturate(1);
  }

  50% {
    filter: hue-rotate(45deg) contrast(1.4) saturate(1.8);
  }
}

@keyframes glitchLines {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(4px);
  }
}

@keyframes glitchText {

  0%,
  100% {
    text-shadow: 0 0 4px var(--green-glow), 0 0 1px var(--green-glow);
    transform: translateX(0);
  }

  25% {
    text-shadow: -2px 0 rgba(255, 0, 90, 0.8), 2px 0 rgba(0, 255, 200, 0.8);
    transform: translateX(-1px);
  }

  50% {
    text-shadow: 2px 0 rgba(255, 0, 90, 0.8), -2px 0 rgba(0, 255, 200, 0.8);
    transform: translateX(1px);
  }

  75% {
    text-shadow: -1px 0 rgba(255, 0, 90, 0.6), 1px 0 rgba(0, 255, 200, 0.6);
    transform: translateX(0);
  }
}

/* kill lila — CRT power-off */
.hud.dying {
  animation: crtOff 2ms cubic-bezier(0.6, 0, 0.9, 0.4) forwards;
}

@keyframes crtOff {
  0% {
    transform: scale(1, 1);
    filter: brightness(1) saturate(1);
    opacity: 1;
  }

  55% {
    transform: scale(1.03, 0.015);
    filter: brightness(5) saturate(0);
    opacity: 1;
  }

  100% {
    transform: scale(0, 0.001);
    filter: brightness(12) saturate(0);
    opacity: 0;
  }
}

.hud.powering-on {
  animation: crtOn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes crtOn {
  0% {
    transform: scale(0, 0.001);
    filter: brightness(12) saturate(0);
    opacity: 0;
  }

  45% {
    transform: scale(1.03, 0.015);
    filter: brightness(5) saturate(0);
    opacity: 1;
  }

  100% {
    transform: scale(1, 1);
    filter: brightness(1) saturate(1);
    opacity: 1;
  }
}

/* Transición de tema -- variante corta del ciclo crtOff/crtOn de kill lila.
   El HUD "se apaga", cambiamos la piel en el punto más oscuro, y "reenciende"
   ya con el tema nuevo puesto. Así el cambio se siente como un reboot en vez
   de un corte seco de colores. */
.hud.theme-collapse {
  animation: crtOff 480ms cubic-bezier(0.6, 0, 0.9, 0.4) forwards;
}

.hud.theme-expand {
  animation: crtOn 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Ráfaga de estática -- se agrega solo durante el instante "apagado",
   entre el fin del colapso y el arranque del reencendido */
.hud.theme-static::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(115deg,
      rgba(255, 255, 255, 0.09) 0px,
      rgba(255, 255, 255, 0.09) 1px,
      transparent 1px,
      transparent 3px),
    repeating-linear-gradient(3deg,
      rgba(255, 255, 255, 0.05) 0px,
      transparent 2px,
      rgba(255, 255, 255, 0.05) 4px);
  animation: staticNoise 90ms steps(2) infinite;
}

@keyframes staticNoise {
  0% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-2%, 1%);
  }

  100% {
    transform: translate(2%, -1%);
  }
}

/* Accesibilidad -- si el visitante pidió menos movimiento, el reboot de
   tema se resuelve como un fundido simple en vez de todo el show */
@media (prefers-reduced-motion: reduce) {

  .cmd-choice {
    animation: none;
    border-bottom-color: var(--green);
  }

  .cmd-choice::before {
    animation: none;
    opacity: 1;
  }

  .hud.theme-collapse,
  .hud.theme-expand {
    animation: none !important;
    transition: opacity 250ms ease;
  }

  .hud.theme-collapse {
    opacity: 0.15;
  }

  .hud.theme-static::before {
    animation: none;
    opacity: 0;
  }
}

#death-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  color: #ff2b4d;
  text-shadow: 0 0 4px #ff2b4d;
  /* color: var(--green);
  text-shadow: 0 0 4px var(--green-glow); */
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease, visibility 0s linear 0s;
  z-index: 999;
}

#death-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}

#death-overlay .reboot-hint {
  opacity: 0.45;
  font-size: 0.85em;
  animation: blink 1.4s steps(1) infinite;
}

/* Ambient instability — random red errors */
.error-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 15, 59, 0.336);
  pointer-events: none;
  opacity: 0;
  z-index: 40;
}

.error-flash.active {
  animation: errorFlash 0.35s ease-out;
}

@keyframes errorFlash {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.corrupt-line {
  color: var(--red) !important;
  text-shadow: 0 0 5px var(--red-glow) !important;
}

.flag-blue {
  color: var(--trans-blue);
  text-shadow: 0 0 4px var(--trans-blue);
}

.flag-pink {
  color: var(--trans-pink);
  text-shadow: 0 0 4px var(--trans-pink);
}

.flag-white {
  color: var(--trans-white);
  text-shadow: 0 0 4px var(--trans-white);
}

/* dysphoria bug — vuelca toda la paleta verde a rojo */
body.dysphoria-active {
  --green: var(--red);
  --green-dim: #a3172f;
  --green-glow: var(--red-glow);
  --ambient-tint: rgba(255, 43, 77, 0.06);
}

body.dysphoria-active .output-text {
  color: #ff8a8a;
}



/* CRT grain / ruido de estática */
.crt-grain {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grainShift 1s steps(6) infinite;
}

@keyframes grainShift {
  0% {
    transform: translate(0, 0);
  }

  16% {
    transform: translate(-3%, -8%);
  }

  33% {
    transform: translate(-8%, 3%);
  }

  50% {
    transform: translate(6%, -10%);
  }

  66% {
    transform: translate(-4%, 8%);
  }

  83% {
    transform: translate(3%, -3%);
  }

  100% {
    transform: translate(0, 0);
  }
}

.crt-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Sistema de ventanas flotantes -- "CLI dreams" */
#window-layer {
  position: fixed;
  inset: 0;
  z-index: 700;
  pointer-events: none;
}

.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  min-height: 90px;
  max-width: 90vw;
  max-height: 85vh;
  background: rgba(2, 8, 4, 0.95);
  border: 1px solid var(--green-dim);
  box-shadow: 0 0 18px var(--green-glow);
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  pointer-events: auto;
  overflow: hidden;
  animation: winMaterialize 0.35s ease-out;
}

@keyframes winMaterialize {
  0% {
    opacity: 0;
    transform: scale(0.9) skewX(2deg);
    filter: brightness(3) contrast(1.6);
  }

  40% {
    opacity: 1;
    transform: scale(1.02) skewX(-1deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) skewX(0);
    filter: brightness(1) contrast(1);
  }
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--green-dim);
  cursor: move;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  user-select: none;
  flex-shrink: 0;
}

.win-close {
  background: none;
  border: 1px solid var(--green-dim);
  color: var(--green);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  padding: 1px 7px;
  line-height: 1;
}

.win-close:hover {
  background: var(--red);
  border-color: var(--red);
  color: #000;
}

.win-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg,
      transparent 0%, transparent 44%,
      var(--green-dim) 44%, var(--green-dim) 56%,
      transparent 56%, transparent 100%);
  opacity: 0.65;
  z-index: 2;
}

.win-resize-handle:hover {
  opacity: 1;
}

.win-body {
  padding: 12px;
  font-size: 12px;
  flex: 1;
  overflow: auto;
}

.win-body a,
.win-body a:visited {
  color: var(--green);
  text-decoration: underline;
}

.win-body a:hover {
  color: #fff;
}

/* Barras de diagnostico dentro de una ventana */
.diag-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  font-size: 10px;
  text-transform: uppercase;
}

.diag-bar-track {
  height: 8px;
  border: 1px solid var(--green-dim);
  overflow: hidden;
}

.diag-bar-fill {
  height: 100%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  transition: width 0.4s ease;
}

.diag-bar-fill.unstable {
  background: var(--red);
  box-shadow: 0 0 6px var(--red-glow);
}

/* Lista de procesos (task manager) */
.proc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--green-dim);
  font-size: 11px;
}

.proc-kill {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: inherit;
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.proc-kill:hover {
  background: var(--red);
  color: #000;
}

.proc-protected {
  opacity: 0.4;
  font-size: 10px;
  white-space: nowrap;
}

/* Ventanas virus del bug de dysphoria -- sin boton de cerrar */
.virus-win {
  animation: winMaterialize 0.35s ease-out, virusPulse 0.9s ease-in-out infinite;
}

.virus-win .win-titlebar {
  cursor: default;
  color: var(--red);
}

.win.dying {
  animation: crtOff 0.5s cubic-bezier(0.6, 0, 0.9, 0.4) forwards;
}

@keyframes virusPulse {

  0%,
  100% {
    box-shadow: 0 0 14px var(--green-glow);
  }

  50% {
    box-shadow: 0 0 26px var(--green-glow);
  }
}


/* #visual-feed {
    position: absolute;

    top: 30px;
    right: 0px;

    width: 200px;
    height: 200px;

    overflow: hidden;

    z-index: 8999;
    pointer-events: none;
} */

#lila-ascii {
  margin: 0;
  font-family: monospace;
  font-size: 7px;
  line-height: 7px;

  white-space: pre;
}

#visual-feed.hidden {
  display: none;
}

#lila-ascii {
  font-size: 6px;
  line-height: 6px;
  letter-spacing: 0;
}

.error {
  color: var(--red);
  text-shadow: 0 0 6px var(--red-glow);
}

.lila {
  color: #fff;
  text-shadow: 0 0 6px #fff;
}

#visual-container {
  /* position: absolute; */

  top: 30px;
  right: 0;
  z-index: 4;
  width: 200px;
}

#visual-feed {
  /* position: relative; */

  width: 200px;
  height: 200px;

  overflow: hidden;

  z-index: 5;
  pointer-events: none;
}

#lyrics-feed {
  position: relative;

  text-align: left;
  width: 200px;

  margin-top: 5px;

}

.lyrics-header {
  opacity: 0.5;
  font-size: 8px;
}

.lyrics-artist {
  margin-top: 4px;
}

.lyrics-title {
  opacity: 0.7;
}

.lyrics-text {
  margin-top: 3px;
  min-height: 28px;
  font-size: 10px;
}

/* ============================================
   TEMA "SOFT" -- claymorphism, alternativa a la
   terminal CRT. Se activa con .theme-soft en
   <html> Y <body> (el fondo real de la página lo
   determina <html>, por eso hace falta en los dos).
   ============================================ */

html.theme-soft,
body.theme-soft {
  /* background: #8b8b8bf3; */
  background: var(--yellow);
}

body.theme-soft .hud {
  background: #3c3667;
  border: none;
  border-radius: 28px;
  box-shadow: 6px 7px 14px rgb(0 0 0 / 25%), -3px -3px 8px rgb(105 100 100 / 12%), inset 2px 2px 5px rgb(219 219 219 / 8%), inset -3px -3px 6px rgb(0 0 0 / 12%);
  color: #ece9fb;
  text-shadow: none;
}

.command {
  color: var(--green);
  left: -9px;
  position: relative;
}

span.output-text {
  color: var(--trans-white);
}

.running {
  color: var(--green);
}

.warning {
  color: var(--yellow);
}

.wil-t {
  color: var(--green);
}

.unknow {
  color: var(--green);
}

/* :not(.dying) evita pisar la animación de colapso de kill lila */
body.theme-soft .hud:not(.dying):not(.beat-flash):not(.powering-on):not(.theme-collapse):not(.theme-expand) {
  animation: none;
}

body.theme-soft .hud.beat-flash {
  animation: hudBeatFlashSoft 0.15s ease-out;
}

@keyframes hudBeatFlashSoft {
  0% {
    box-shadow:
      12px 12px 30px rgba(0, 0, 0, 0.4),
      -10px -10px 28px rgba(35, 66, 66, 0.35);
  }

  100% {
    box-shadow:
      12px 12px 24px rgba(0, 0, 0, 0.35),
      -8px -8px 20px rgba(30, 56, 56, 0.12);
  }
}

@keyframes mutePulse {
    0%,100% {
        opacity: .35;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

body.theme-soft .unknow {
  color: #59c3c3;
}

/* Asignamos color al texto qué mande como comando el usuario */
/* Color del LILA_ABYSS/ (COMANDO) */
body.theme-soft .command {
  color: #59c3c3;
}

body.theme-soft .warning{
  color: var(--yellow);
}

body.theme-soft .wil-t {
  color: #59c3c3;
}

body.theme-soft #track-name {
  color: #59c3c3;
  font-size: 1rem;
}

body.theme-soft .corner,
body.theme-soft .scan,
body.theme-soft .crt-grain,
body.theme-soft .crt-vignette {
  display: none;
}

body.theme-soft .top-row,
body.theme-soft .bottom-row {
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-soft .top-left .lbl-icon,
body.theme-soft .dots span {
  background: var(--trans-white);
  box-shadow: none;
}

body.theme-soft .directory,
body.theme-soft #console-input,
body.theme-soft .cursor {
  color: #59c3c3;
}

body.theme-soft #console-input::placeholder {
  color: rgba(89, 195, 195, 0.45);
}

body.theme-soft #terminal-output a,
body.theme-soft .win-body a {
  color: #59c3c3;
}

body.theme-soft #terminal-output a:visited,
body.theme-soft .win-body a:visited {
  color: #59c3c3;
}

body.theme-soft #terminal-output a:hover,
body.theme-soft .win-body a:hover {
  color: #59c3c3;
}

body.theme-soft .corrupt-line,
body.theme-soft .error {
  color: #ff8a8a !important;
  text-shadow: none !important;
}

body.theme-soft #music-player button {
  border-radius: 8px;
  padding: 5px;
  font-family: inherit;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3), -2px -2px 6px rgba(89, 195, 195, 0);
  border: none;
}

body.theme-soft #music-player button:hover {
  background: #59c3c3;
  color: #322c58;
  opacity: 1;
}

/* Ventanas flotantes en modo soft */
body.theme-soft .win {
  background: #3c3667b6;
  border: none;
  border-radius: 12px;
  box-shadow: 6px 7px 14px rgb(0 0 0 / 25%), -3px -3px 8px rgb(105 100 100 / 12%), inset 2px 2px 5px rgb(219 219 219 / 8%), inset -3px -3px 6px rgb(0 0 0 / 12%);
  color: #ece9fb;
  backdrop-filter: blur(1px);
}

/* :not(.dying):not(.virus-win) preserva el colapso de kill lila
   y el pulso de las ventanas virus de dysphoria */
body.theme-soft .win:not(.dying):not(.virus-win) {
  animation: none;
}

body.theme-soft #mute-btn[aria-pressed="true"] {
    color: var(--trans-blue);
    text-shadow: 0 0 8px var(--trans-blue);
}

body.theme-soft #volume-slider::-webkit-slider-thumb{
  background-color: var(--trans-white);
}

body.theme-soft .win-titlebar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--trans-white);
}

body.theme-soft .win-close {
  background: var(--trans-white);
  border: none;
  border-radius: 5px;
  color: #322c58;
}

body.theme-soft .win-close:hover {
  background: #322c58;
  color: var(--trans-white);
}

body.theme-soft .win-resize-handle {
  background: linear-gradient(135deg,
      transparent 0%, transparent 44%,
      #59c3c3 44%, #59c3c3 56%,
      transparent 56%, transparent 100%);
}

body.theme-soft .diag-bar-track {
  border-color: rgba(255, 255, 255, 0.18);
}

body.theme-soft .diag-bar-fill {
  background: #59c3c3;
  box-shadow: none;
}

body.theme-soft .diag-bar-fill.unstable {
  background: #ff8a8a;
}

body.theme-soft .proc-kill {
  border-color: #ff8a8a;
  color: #ff8a8a;
  border-radius: 8px;
}

body.theme-soft .proc-kill:hover {
  background: #ff8a8a;
  color: #322c58;
}

/* Dock de iconos en modo soft */
body.theme-soft #icon-dock button {
  background: #3c3667;
  border: none;
  border-radius: 8px;
  color: var(--trans-white);
  box-shadow:
    3px 3px 8px rgba(0, 0, 0, 0.3),
    -2px -2px 6px rgba(89, 195, 195, 0.1);
  font-size: 1.4rem;
  margin-left: 10px;
  margin-right: 10px;
  padding: 5px;
  position: relative;
}

body.theme-soft #icon-dock button:hover {
  background: #59c3c3;
  color: #322c58;
}

body.theme-soft #death-overlay {
  background: #373066;
  color: var(--trans-white);
  text-shadow: none;
}

body.theme-soft #track-name,
body.theme-soft #music-wave,
body.theme-soft #track-time,
body.theme-soft .con-volume,
body.theme-soft #volume-value {
  color: var(--trans-white);
  text-shadow: none;
}

body.theme-soft #volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--trans-blue) 0%,
    var(--trans-blue) var(--fill),
    rgba(91, 206, 250, 0.18) var(--fill),
    rgba(91, 206, 250, 0.18) 100%
  );
  box-shadow: none;
}

body.theme-soft #volume-slider::-moz-range-track {
  background: rgba(91, 206, 250, 0.18);
}

body.theme-soft #volume-slider::-moz-range-progress {
  background: var(--trans-blue);
  box-shadow: none;
}

body.theme-soft #volume-slider::-webkit-slider-thumb,
body.theme-soft #volume-slider::-moz-range-thumb {
  background: var(--trans-pink);
  box-shadow: none;
}

body.theme-soft #bg-ascii {
  color: #59c3c3;
}

body.theme-soft #track-name,
body.theme-soft #music-wave,
body.theme-soft #track-time {
  color: var(--trans-white);
  text-shadow: none;
}

/* dysphoria en modo soft -- el bug tiene que verse igual de mal acá */
body.theme-soft.dysphoria-active .hud,
body.theme-soft.dysphoria-active .win {
  color: #ff8a8a;
}

body.theme-soft.dysphoria-active .directory,
body.theme-soft.dysphoria-active #console-input,
body.theme-soft.dysphoria-active .cursor {
  color: #ff8a8a;
}

body.theme-soft.dysphoria-active .win-titlebar {
  color: #ff8a8a;
}

body.theme-soft.dysphoria-active .hud {
  box-shadow:
    12px 12px 24px rgba(0, 0, 0, 0.4),
    -8px -8px 20px rgba(255, 43, 77, 0.18);
}

#alertMute.muted span {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
    animation: muteBlink 1.2s infinite;
}

#alertMute.muted span:nth-child(2) {
    animation-delay: .15s;
}

#alertMute.muted span:nth-child(3) {
    animation-delay: .30s;
}

#alertMute.muted span:nth-child(4) {
    animation-delay: .45s;
}

@keyframes muteBlink {
    0%,100% {
        opacity: .25;
    }

    50% {
        opacity: 1;
    }
}