/* Base theme color variable */
body {
  --terminal-color: #ff5a00;
  margin: 0;
  padding: 20px;
  background-color: #1b0931;
  color: var(--terminal-color);
  font-family: monospace;
  transition:all 0.2s linear;
  box-sizing:border-box;
  min-height:100dvh;
  overflow-x:hidden;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)), url(/assets/ZirkFriend.png) center / cover no-repeat;
}


/* Input + terminal display */
#terminal {
  white-space: pre-wrap;
  color: var(--terminal-color);
  max-width:600px;
}

.input-line {
  display: flex;
  align-items: center;
}

input {
  background: none;
  border: none;
  color: var(--terminal-color);
  font-family: monospace;
  font-size: 1em;
  flex: 1;
  outline: none;
}


/* Glitch effect for words */
.glitch-word {
  display: inline-block;
  position: relative;
  color: var(--terminal-color);
  animation: flicker 0.15s infinite, shift 0.25s infinite;
}

@keyframes flicker {
  0%   { opacity: 1; }
  25%  { opacity: 0.6; }
  50%  { opacity: 1; }
  75%  { opacity: 0.2; }
  100% { opacity: 1; }
}

@keyframes shift {
  0%   { transform: translate(0px, 0px); }
  25%  { transform: translate(-1px, 1px); }
  50%  { transform: translate(1px, -1px); }
  75%  { transform: translate(-2px, 0px); }
  100% { transform: translate(0px, 2px); }
}



/* Flash warning before going red */
/* Quick rupture flash */
/* Safer, lower-intensity rupture pulse */
.flash-warning {
  animation: rupturePulse 0.6s ease-in-out;
}

@keyframes rupturePulse {
  0%   { background-color: #200; filter: none; }
  25%  { background-color: #400; filter: contrast(1.5) brightness(1.2); }
  50%  { background-color: #600; filter: contrast(1.3) brightness(1.1); }
  75%  { background-color: #300; filter: contrast(1.2) brightness(1); }
  100% { background-color: #000; filter: none; }
}

/* Violent screen shake for corruption */
.shake {
  animation: shakeAnim 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shakeAnim {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-3px, -2px) rotate(-0.5deg); }
  20% { transform: translate(3px, 2px) rotate(0.5deg); }
  30% { transform: translate(-2px, 3px) rotate(-1deg); }
  40% { transform: translate(2px, -3px) rotate(1deg); }
  50% { transform: translate(-3px, 1px) rotate(-0.3deg); }
  60% { transform: translate(3px, -1px) rotate(0.3deg); }
  70% { transform: translate(-1px, 1px) rotate(-0.2deg); }
  80% { transform: translate(1px, -1px) rotate(0.2deg); }
  90% { transform: translate(0.5px, -0.5px) rotate(0deg); }
}



/* When corrupted, all text is red */
body.corrupted {
    --terminal-color: red;
    background-color: black;
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 1)), url(/assets/ZirkCorrupted.png) center / cover no-repeat;
}

/* Output formatting */
.command-line {
  margin-top: 1em;
}

.command-output {
  margin-bottom: 1em;
  white-space: pre-wrap;
}
/* ===========================================
   SCREEN GLITCH OVERLAY EFFECT (corruption)
=========================================== */
body.corrupted::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    rgba(255,0,0,0.03) 0px,
    rgba(255,0,0,0.06) 1px,
    transparent 2px
  );
  animation: screenFlicker 0.15s infinite;
  z-index: 999;
}

body.corrupted::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to right,
    rgba(255,0,0,0.04) 0px,
    rgba(255,0,0,0.08) 2px,
    transparent 4px
  );
  mix-blend-mode: lighten;
  animation: tearShift 1s infinite ease-in-out alternate;
  z-index: 998;
}

@keyframes screenFlicker {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.25; }
}

@keyframes tearShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(3px, -1px); }
  50% { transform: translate(-2px, 2px); }
  75% { transform: translate(2px, -1px); }
  100% { transform: translate(0px, 0px); }
}
/* ===========================================
   RANDOM GLITCH BURSTS
=========================================== */
.glitch-burst {
  position: absolute;
  top: calc(10% + 80% * var(--rand-y, 0.5));
  left: 0;
  width: 100%;
  height: 6px;
  background: repeating-linear-gradient(
    to right,
    rgba(255, 0, 0, 0.2) 0px,
    rgba(255, 100, 100, 0.4) 10px,
    rgba(255, 0, 0, 0.2) 20px
  );
  animation: burstGlitch 0.1s ease-in-out forwards;
  pointer-events: none;
  z-index: 1000;
}

@keyframes burstGlitch {
  0% { opacity: 0; transform: translateY(0) scaleY(0.8); }
  15% { opacity: 1; transform: translateY(-1px) scaleY(1); }
  50% { opacity: 0.8; transform: translateY(1px) scaleY(1.1); }
  100% { opacity: 0; transform: translateY(0) scaleY(0.8); }
}

