* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 2vh 2vw;
  background: radial-gradient(ellipse at center, #0d1f14 0%, #030805 100%);
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Courier New", monospace;
}

#window {
  height: 96vh;
  display: flex;
  flex-direction: column;
  border: 1px solid #1f6b3a;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 10, 5, 0.92);
  box-shadow: 0 0 30px rgba(51, 255, 102, 0.25), inset 0 0 60px rgba(0, 0, 0, 0.8);
}

#titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(#1b2a20, #101a14);
  border-bottom: 1px solid #1f6b3a;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red {
  background: #ff5f56;
}

.yellow {
  background: #ffbd2e;
}

.green {
  background: #27c93f;
}

#title {
  flex: 1;
  text-align: center;
  color: #7fae8c;
  font-size: 13px;
  margin-right: 52px;
}

#statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 6px 14px;
  font-size: 12px;
  color: #7fae8c;
  background: #07120b;
  border-bottom: 1px solid #12361f;
}

#terminal {
  flex: 1;
  overflow-y: auto;
  padding: 0px;
  color: #33ff66;
  font-size: 15px;
  line-height: 1.55;
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.6);
  scrollbar-width: none;
}

#terminal::-webkit-scrollbar {
  display: none;
}

.line,
#input-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.dim {
  color: #4f8f64;
  text-shadow: none;
}

.ok {
  color: #33ff66;
}

.warn {
  color: #ffbd2e;
  text-shadow: 0 0 6px rgba(255, 189, 46, 0.6);
}

.info {
  color: #4de3ff;
  text-shadow: 0 0 6px rgba(77, 227, 255, 0.6);
}

.user {
  color: #ff4d6d;
  text-shadow: 0 0 6px rgba(255, 77, 109, 0.6);
}

.path {
  color: #4de3ff;
}

#cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: #33ff66;
  box-shadow: 0 0 8px #33ff66;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.22) 3px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.55) 100%);
  animation: flicker 6s infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  48% {
    opacity: 1;
  }

  50% {
    opacity: 0.88;
  }

  52% {
    opacity: 1;
  }
}

#hidden-input {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 16px;
}

.hidden {
  display: none;
}

.blockcursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: #33ff66;
  box-shadow: 0 0 8px #33ff66;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

.art {
  margin: 0 auto;
  width: fit-content;
  text-align: left;
  white-space: pre;
  font-family: monospace;
  font-size: min(5vw, 2.6vh);
  line-height: 1;
}
#prank {
  --cell: min(3vw, 1.8vh);
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) 14px env(safe-area-inset-bottom, 0px);
  overflow-y: auto;
  background: #000;
  color: #fff;
  font-family: system-ui, sans-serif;
  text-align: center;
}
#prank.hidden, #p-reveal.hidden, #p-final.hidden { display: none; }

#p-reveal, #p-final {
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#p-reveal { gap: 3vh; }
#p-final { padding: 12px 0; }

.px { display: grid; gap: 1px; width: max-content; margin: 0 auto; }
.px i { display: block; width: var(--cell); height: var(--cell); }
.px.gold i.on { background: #ffd54a; }
.px.gold i.dim { background: #7a6420; }
.px.white i.on { background: #fff; }
.px.pink i.on { background: #ff8fb1; }
.px.pink i.dim { background: #c2587a; }
.px i.flame { background: #ffd54a; }
.px i.can { background: #fff; }
.px.word + .px.word { margin-top: calc(var(--cell) * 2); }

#p-banner {
  max-width: 100%;
  margin: 4px auto;
  padding: 8px 14px;
  border-radius: 8px;
  background: #ffd54a;
  color: #000;
  font-size: min(9vw, 5vh);
  font-weight: 800;
}

#p-sub { margin-bottom: 16px; font-size: 16px; }
#p-cake { margin-top: calc(var(--cell) * 2); }
#p-note {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin-top: 16px;
  padding: 12px;
  background: #111;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes glitch {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-5px, 2px); }
  40%  { transform: translate(5px, -2px); }
  60%  { transform: translate(-3px, -1px); }
  80%  { transform: translate(4px, 2px); }
  100% { transform: translate(0, 0); }
}
#prank.glitch #p-reveal {
  animation: glitch 0.3s linear 5;
  filter: drop-shadow(4px 0 #f0f) drop-shadow(-4px 0 #0ff);
}
@media (prefers-reduced-motion: reduce) {
  #prank.glitch #p-reveal { animation: none; }
}

@media (max-width: 600px) {
  body {
    padding: 0;
    min-height: 0;
  }

  #window {
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  #title {
    min-width: 0;
    margin-right: 0;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #statusbar {
    font-size: 10px;
    gap: 4px 12px;
    padding: 5px 10px;
  }

  #terminal {
    font-size: 13px;
    padding: 10px 8px 10px 2px;
  }
}