/* Vice City Stories — console, matrix mode, agent, system log, easter eggs, wipe */
#conbox {
  width: min(680px, 100%) !important;
  padding: 0 !important;
  background: #020a04 !important;
  border-color: #2dff7a !important;
  box-shadow:
    0 0 36px #2dff7a,
    inset 0 0 26px rgba(45, 255, 122, 0.18) !important;
  font-family: "Courier New", monospace;
  color: #2dff7a !important;
}
#conbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #0b2a14;
  border-bottom: 1px solid #2dff7a;
  font:
    10px "Press Start 2P",
    "Courier New",
    monospace;
  color: #2dff7a;
  letter-spacing: 0.08em;
}
#conbar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2dff7a;
  opacity: 0.5;
}
#conx {
  top: 5px !important;
  color: #2dff7a !important;
  text-shadow: 0 0 8px #2dff7a !important;
}
#conout {
  height: min(340px, 46vh);
  overflow: auto;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 6px rgba(45, 255, 122, 0.6);
}
#conout .e {
  color: #ff6b6b;
  text-shadow: none;
}
#conout .w {
  color: #ffd23c;
  text-shadow: none;
}
#conout .d {
  color: #7fffb0;
}
#conout .u {
  color: #fff;
}
#conin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid rgba(45, 255, 122, 0.4);
}
#conin span {
  white-space: nowrap;
}
#conin input {
  flex: 1;
  min-width: 0;
  background: none !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff !important;
  font:
    14px "Courier New",
    monospace !important;
  padding: 0 !important;
  caret-color: #2dff7a;
}
#conchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}
#conchips button {
  font:
    9px "Press Start 2P",
    "Courier New",
    monospace;
  color: #2dff7a;
  background: #04140a;
  border: 1px solid #2dff7a;
  padding: 8px 10px;
  cursor: pointer;
  touch-action: manipulation;
}
#conchips button:hover {
  background: #2dff7a;
  color: #020a04;
}
#conbtn {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 40;
  font:
    9px "Press Start 2P",
    "Courier New",
    monospace;
  letter-spacing: 0.04em;
  color: #c9a0ff;
  background: linear-gradient(180deg, #2a0f4a, #12051f);
  border: 2px solid #a45cff;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(164, 92, 255, 0.7),
    3px 3px 0 #000;
  touch-action: manipulation;
  transition: all 0.2s;
}
#conbtn:hover {
  color: #fff;
  box-shadow:
    0 0 18px #a45cff,
    3px 3px 0 #000;
}
#conbtn.on {
  color: #020a04;
  background: #2dff7a;
  border-color: #9bffc0;
  box-shadow:
    0 0 16px #2dff7a,
    3px 3px 0 #000;
}
#mx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s;
}
#site.matrix #mx {
  opacity: 1;
}
#site.matrix {
  background: #000 !important;
}
#site.matrix #rbg {
  opacity: 0;
}
#site.matrix .nb:not(:hover):not(.on):not([data-p="allow"]) span.lb {
  color: #7dffae !important;
  text-shadow: 0 0 8px #2dff7a !important;
}
#site.matrix #gameFrame {
  background: #000;
}
body:has(#site.matrix) {
  background: #000;
}
#site.matrix > *:not(#mx):not(#rbg) {
  filter: grayscale(1) sepia(1) hue-rotate(var(--mh, 72deg)) saturate(3.2) brightness(1.05) contrast(1.08);
}
#site.matrix #gameFrame {
  filter: grayscale(1) sepia(1) hue-rotate(var(--mh, 72deg)) saturate(3.2) brightness(1.05) contrast(1.08) !important;
}
#egfx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}
.egg {
  position: fixed;
  z-index: 9997;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  white-space: pre;
  text-align: center;
  font:
    clamp(13px, 2.3vw, 26px)/1.7 "Press Start 2P",
    "Courier New",
    monospace;
  letter-spacing: 0.06em;
  color: #d8ffe6;
  text-shadow:
    0 0 6px #2dff7a,
    0 0 18px #2dff7a,
    0 0 36px #2dff7a;
  transition:
    transform 0.22s cubic-bezier(0.2, 1.6, 0.4, 1),
    opacity 0.15s;
}
.egg.in {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.egg.suck {
  transition:
    transform 0.95s cubic-bezier(0.65, 0, 0.95, 0.35),
    opacity 0.95s ease-in,
    filter 0.95s ease-in;
  transform: translate(-50%, -50%) scale(0.02) rotate(200deg);
  opacity: 0;
  filter: blur(7px) brightness(0.4);
}
#agent {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s;
}
#agent.show {
  opacity: 1;
}
#agbox {
  width: min(430px, 100%);
  padding: 22px;
  background: #050505;
  border: 2px solid #ff2d4d;
  box-shadow:
    0 0 34px #ff2d4d,
    inset 0 0 22px rgba(255, 45, 77, 0.25);
  font-family: "Courier New", monospace;
  color: #ffd0d6;
  text-align: center;
  animation: agb 0.5s steps(2) 3;
}
@keyframes agb {
  50% {
    box-shadow:
      0 0 6px #ff2d4d,
      inset 0 0 6px rgba(255, 45, 77, 0.2);
  }
}
#agbox h4 {
  margin: 0 0 12px;
  font:
    12px "Press Start 2P",
    "Courier New",
    monospace;
  color: #ff2d4d;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px #ff2d4d;
}
#agbox p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
}
#agbox .bt {
  display: flex;
  gap: 14px;
  justify-content: center;
}
#agbox button {
  font:
    11px "Press Start 2P",
    "Courier New",
    monospace;
  padding: 12px 18px;
  cursor: pointer;
  background: #050505;
  border: 2px solid #ff2d4d;
  color: #ff2d4d;
  box-shadow: 0 0 12px rgba(255, 45, 77, 0.6);
  touch-action: manipulation;
}
#agbox button:hover {
  background: #ff2d4d;
  color: #050505;
}
#agbox button.y {
  border-color: #2dff7a;
  color: #2dff7a;
  box-shadow: 0 0 12px rgba(45, 255, 122, 0.6);
}
#agbox button.y:hover {
  background: #2dff7a;
  color: #050505;
}
#syslog {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 25;
  width: 250px;
  display: none;
  padding: 9px 10px;
  background: rgba(0, 10, 3, 0.78);
  border: 1px solid rgba(45, 255, 122, 0.55);
  box-shadow: 0 0 14px rgba(45, 255, 122, 0.35);
  font:
    10.5px/1.45 "Courier New",
    monospace;
  color: #2dff7a;
  pointer-events: none;
  overflow: hidden;
}
#site.matrix #syslog {
  display: block;
}
#syslog .h {
  font:
    8px "Press Start 2P",
    "Courier New",
    monospace;
  color: #d8ffe6;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(45, 255, 122, 0.4);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
#syslog .st {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(45, 255, 122, 0.3);
  padding-bottom: 5px;
}
#syslog .st b {
  color: #d8ffe6;
  font-weight: normal;
  text-align: right;
}
#sllog {
  height: 112px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0.9;
}
#sllog div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
#sllog .w {
  color: #d8ffe6;
}
@media (max-width: 900px) {
  #syslog {
    display: none !important;
  }
}
@keyframes glt {
  0% {
    transform: translate(0, 0);
    clip-path: inset(0);
  }
  10% {
    transform: translate(-8px, 2px) skewX(-6deg);
    clip-path: inset(12% 0 55% 0);
  }
  20% {
    transform: translate(9px, -3px);
    clip-path: inset(60% 0 8% 0);
  }
  30% {
    transform: translate(-5px, 0) skewX(5deg);
    clip-path: inset(0);
  }
  40% {
    transform: translate(6px, 3px);
    clip-path: inset(35% 0 30% 0);
  }
  55% {
    transform: translate(-10px, -2px) skewX(-4deg);
    clip-path: inset(0);
  }
  70% {
    transform: translate(4px, 0);
    clip-path: inset(70% 0 5% 0);
  }
  85% {
    transform: translate(-3px, 1px);
    clip-path: inset(0);
  }
  100% {
    transform: none;
    clip-path: inset(0);
  }
}
@keyframes gltt {
  0%,
  100% {
    text-shadow: none;
  }
  25% {
    text-shadow:
      3px 0 #fff,
      -3px 0 #2dff7a;
  }
  60% {
    text-shadow:
      -4px 0 #fff,
      4px 0 #1b9e48;
  }
}
#win.glitch {
  animation:
    glt 0.55s steps(1) 1,
    gltt 0.55s linear 1;
  filter: contrast(1.4) brightness(1.25);
}
#win.glitch * {
  animation: gltt 0.5s linear 1;
}
#wipe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  transition: opacity 1.2s;
}

/* ---- FX easter eggs (console: shake · snow · destroy · barrel roll · flip · disco) ---- */
#site.fxshake{animation:fxshake .09s linear infinite}
@keyframes fxshake{0%{transform:translate(0,0)}25%{transform:translate(-7px,4px) rotate(-.4deg)}50%{transform:translate(6px,-5px) rotate(.4deg)}75%{transform:translate(-4px,-3px)}100%{transform:translate(5px,5px)}}
#site.fxroll{animation:fxroll 1.2s cubic-bezier(.5,0,.3,1)}
@keyframes fxroll{to{transform:rotate(360deg)}}
#site.fxflip{transform:rotate(180deg);transition:transform .8s cubic-bezier(.4,1.4,.5,1)}
#site.fxdisco{animation:fxdisco 1.2s linear infinite}
@keyframes fxdisco{0%{filter:hue-rotate(0) saturate(1.6)}50%{filter:hue-rotate(180deg) saturate(2.2) brightness(1.15)}100%{filter:hue-rotate(360deg) saturate(1.6)}}
#fxsnow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:9996;image-rendering:pixelated}
