@font-face {
  font-family: 'Home Bargains Calculator';
  src: url(/fonts/home-bargains-calculator.otf) format('opentype');
  font-weight: 400;
}

body {
  background: #000;
  color: #aaa;
  font-family: 'Home Bargains Calculator', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #0ff;
  text-decoration: none;
}
a:visited {
  color: #0aa;
}
a:hover {
  color: #f00;
}

.archived-notice {
  background-color: black;
  color: white;
  margin: -10px -10px 20px -10px;
  width: 101%;
  border: 1px solid #333;
  font-family: 'Courier New', monospace;
}
.archived-notice p {
  margin: 0;
  font-size: 11px;
  text-align: center;
  padding: 3px 0;
}
.archived-notice a {
  color: white;
}
.archived-notice a:hover {
  color: #ff0000;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0px;
  position: relative;
}

.ascii-title {
  font-family: monospace;
  white-space: pre;
  font-size: 8px;
  line-height: 1.1;
  color: #0f0;
  text-align: center;
  margin: 20px 0 10px;
  opacity: 0.9;
  text-shadow: 0 0 4px #0f0;
}

.nav {
  display: flex;
  gap: 25px;
  margin: 25px 0 35px;
  padding-bottom: 8px;
  border-bottom: 1px solid #fff;
  flex-wrap: wrap;
  justify-content: center;
}
.nav a {
  font-size: 18px;
  color: #888;
  position: relative;
}
.nav a:hover {
  color: #f00;
}
.nav a[href="/"] {
  color: #f00;
}
.nav a[href="/"]::after {
  content: "•";
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  color: #f00;
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
  position: relative;
}

.text-area {
  position: relative;
}

.text-block {
  margin-bottom: 30px;
  position: relative;
  z-index: 10;
  color: #ccc;
}
.text-block p {
  margin: 0 0 18px 0;
  position: relative;
  text-shadow: 
    -1px 0 rgba(255, 0, 0, 0.5),
    1px 0 rgba(0, 255, 255, 0.5),
    0 0 2px white,
    10px 15px 1.8px rgba(255, 255, 255, 0.4);
  z-index: 1;
}
.text-block p::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.2) 0px,
    rgba(0, 0, 0, 0.2) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 2;
}

.debris {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.debris1, .debris2, .debris3, .debris4 {
  position: absolute;
  font-family: 'Home Bargains Calculator', monospace;
  color: rgba(150, 150, 150, 0.45);
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
  white-space: normal;
  max-width: 400px;
  animation: flicker 0.15s infinite steps(1);
}

.debris1 p, .debris2 p, .debris3 p, .debris4 p {
  margin: 0;
}

.red {
  color: rgba(255, 0, 0, 0.45) !important;
}
.cyan {
  color: rgba(0, 255, 255, 0.45) !important;
}
.green {
  color: rgba(0, 255, 0, 0.45) !important;
}

@keyframes flicker {
  0% { opacity: 0.5; }
  20% { opacity: 0.8; }
  40% { opacity: 0.4; }
  60% { opacity: 0.9; }
  80% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.debris1 {
  top: 30px;
  left: 20px;
}
.debris2 {
  top: 180px;
  left: 120px;
}
.debris3 {
  top: 280px;
  left: 200px;
}
.debris4 {
  top: 420px;
  left: 40px;
}

.eye-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eye-container {
  position: relative;
  display: inline-block;
  margin: 20px 0;
  max-width: 100%;
}

.ascii-eyes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre;
  font-size: 7px;
  line-height: 1;
  color: rgba(0, 255, 0, 0.25);
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  overflow: hidden;
}

.ascii-trio8 {
  font-family: monospace;
  white-space: pre;
  font-size: 7px;
  line-height: 1;
  color: #fff;
  opacity: 0.9;
  background: transparent;
  padding: 0;
  border: none;
  position: relative;
  z-index: 5;
}

.eye-gif-top {
  position: absolute;
  top: 10%;
  right: -5%;
  transform: rotate(5deg);
  pointer-events: none;
  z-index: 10;
  width: 40px;
  image-rendering: pixelated;
  opacity: 1;
}

.footer {
  display: flex;
  justify-content: flex-start;
  padding: 15px 0 5px;
  font-size: 11px;
  border-top: 1px solid #fff;
  margin-top: 20px;
}

.footer p {
  color: #0ff;
  margin: 0;
}

::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: #111;
}
::-webkit-scrollbar-thumb {
  background: #333;
}
::-webkit-scrollbar-thumb:hover {
  background: #f00;
}

img {
  image-rendering: pixelated;
}

/* ---------- mobile stuff ---------- */
@media screen and (max-width: 600px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
    overflow-x: hidden;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ascii-title {
    font-size: 4px;
    white-space: pre;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    margin: 10px 0;
  }

  .nav {
    gap: 12px;
    justify-content: flex-start;
  }
  .nav a {
    font-size: 16px;
  }

  .text-block p {
    font-size: 13px;
    word-break: break-word;
    text-shadow: 
      -1px 0 rgba(255, 0, 0, 0.5),
      1px 0 rgba(0, 255, 255, 0.5),
      0 0 2px white,
      10px 15px 1.8px rgba(255, 255, 255, 0.4);
  }

  .text-block p::after {
    background: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.2) 0px,
      rgba(0, 0, 0, 0.2) 2px,
      transparent 2px,
      transparent 4px
    );
  }

  .debris1, .debris2, .debris3, .debris4 {
    max-width: 90%;
    font-size: 11px;
    white-space: normal;
    word-break: break-word;
    color: rgba(150, 150, 150, 0.45);
  }

  .debris1 { top: 20px; left: 5px; }
  .debris2 { top: 160px; left: 40px; }
  .debris3 { top: 260px; left: 70px; }
  .debris4 { top: 400px; left: 15px; }

  .eye-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ascii-back {
    font-size: 4px;
    color: rgba(0, 255, 0, 0.25);
    font-family: 'Courier New', Courier, monospace;
  }

  .ascii-eye {
    font-size: 4px;
    white-space: pre;
  }

  .eye-gif-top {
    width: 25px;
    top: 5%;
    right: -2%;
  }

  .footer p {
    font-size: 10px;
  }
}

/* ---------- credits styles ---------- */
.credits-icon {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 999;
  cursor: pointer;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.credits-icon:hover {
  opacity: 1;
}

.credits-panel {
  position: fixed;
  bottom: 60px;
  left: 15px;
  width: 300px;
  max-width: calc(100vw - 30px);
  background: #000;
  border: 2px solid #333;
  padding: 1.5rem;
  z-index: 1000;
  display: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  font-family: 'Home Bargains Calculator', 'Courier New', monospace;
  color: #ccc;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}
.credits-panel.show {
  display: block;
}
.credits-panel .close-credits {
  float: right;
  cursor: pointer;
  color: #0ff;
  font-size: 1.8rem;
  line-height: 1;
  transition: color 0.2s;
}
.credits-panel .close-credits:hover {
  color: #f00;
}
.credits-panel h4 {
  color: #0f0;
  margin: 0 0 1rem 0;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
  font-size: 1.2rem;
}
.credits-panel pre {
  color: #aaa;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
  overflow-x: hidden;
  margin-bottom: 1rem;
  font-family: inherit;
}
.credits-panel a {
  display: block;
  margin: 0.6rem 0;
  color: #0ff;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.credits-panel a:visited {
  color: #0aa;
}
.credits-panel a:hover {
  color: #f00;
}