* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background-color: #008080;
  background-image:
    radial-gradient(#13a0a0 1.5px, transparent 1.5px),
    radial-gradient(#13a0a0 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  color: #000;
  font-family: "VT323", "Courier New", monospace;
  font-size: 20px;
  line-height: 1.25;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }

/* ---------- scrolling hazard marquee ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: #ffe300;
  color: #b00000;
  border-bottom: 4px solid #000;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.marquee-track {
  display: inline-block;
  animation: scroll 24s linear infinite;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- desktop + window ---------- */
.desktop {
  max-width: 680px;
  margin: 24px auto;
  padding: 0 14px;
}

.window {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: 0 0 0 2px #808080, 8px 8px 0 rgba(0,0,0,0.35);
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(90deg, #00007b 0%, #1084d0 100%);
  color: #fff;
  padding: 5px 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}
.titlebar-text { display: flex; align-items: center; gap: 8px; }
.lockmark { display: inline-flex; }
.titlebar-buttons { display: flex; gap: 4px; }
.tb-btn {
  width: 22px; height: 20px;
  display: grid; place-items: center;
  background: #c0c0c0; color: #000;
  border: 2px solid; border-color: #fff #000 #000 #fff;
  font-family: "VT323", monospace; font-size: 18px; line-height: 1;
}
.tb-close { font-weight: bold; }

.window-body { padding: 14px; }

/* ---------- hero / seal / badges ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.seal {
  flex: 0 0 auto;
  width: 96px; height: 96px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 50%, #ff00ff 0 54%, #c800c8 54% 100%);
  border: 3px solid #000;
  border-radius: 50%;
  font-family: "Press Start 2P", monospace;
  box-shadow: 4px 4px 0 #000;
  animation: wobble 3s ease-in-out infinite;
}
.seal-top { font-size: 14px; }
.seal-mid { font-size: 12px; margin: 4px 0; letter-spacing: 1px; }
.seal-bot { font-size: 16px; color: #ffe300; }
@keyframes wobble {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

.hero-text { flex: 1; min-width: 0; }
.hero-text h1 {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
  color: #000080;
}
.badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  padding: 5px 6px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  color: #000;
}
.badge-pink { background: #ff66cc; }
.badge-cyan { background: #00ffff; }
.badge-lime { background: #66ff33; }

.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- chat ---------- */
.chat {
  background: #ffffff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 2px 2px 0 #000;
  height: 320px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.msg { display: flex; }
.msg-bot { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }
.bubble {
  max-width: 80%;
  padding: 7px 10px;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-size: 21px;
  line-height: 1.2;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg-bot .bubble { background: #00ffff; color: #000; }
.msg-user .bubble { background: #ffe300; color: #000; }

.typing .bubble { display: inline-flex; gap: 5px; align-items: center; }
.typing .dot {
  width: 8px; height: 8px;
  background: #000;
  animation: hop 1s infinite steps(2);
}
.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes hop { 0%,50%{ transform: translateY(0);} 51%,100%{ transform: translateY(-4px);} }

/* ---------- composer ---------- */
.composer { display: flex; gap: 10px; margin-top: 12px; }
#message {
  flex: 1;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 2px 2px 0 #0a0a0a;
  padding: 8px 10px;
  font-family: "VT323", monospace;
  font-size: 22px;
  color: #000;
}
#message:focus { outline: 3px solid #ff00ff; outline-offset: 1px; }
#send {
  flex: 0 0 auto;
  background: #c0c0c0;
  border: 2px solid; border-color: #fff #000 #000 #fff;
  box-shadow: 2px 2px 0 #000;
  padding: 0 14px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: #000;
  cursor: pointer;
}
#send:active { border-color: #000 #fff #fff #000; box-shadow: none; transform: translate(2px,2px); }
#send:focus-visible { outline: 3px solid #ff00ff; outline-offset: 2px; }
#send:disabled { color: #808080; cursor: default; }

/* ---------- disclaimer + QR ---------- */
.disclaimer {
  margin-top: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: #ffe300;
  border: 4px dashed #b00000;
  padding: 12px;
}
.disclaimer-text { flex: 1; min-width: 0; }
.disclaimer p { margin: 0 0 7px; font-size: 20px; }
.disclaimer .disclaimer-head {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  color: #b00000;
  margin: 0 0 10px;
}
.disclaimer-link a { color: #0000ee; font-size: 19px; word-break: break-all; }
.disclaimer-scan { color: #333; }
.qr {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-decoration: none;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  padding: 8px;
}
.qr img { display: block; width: 150px; height: 150px; }
.qr-caption {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #000;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 16px;
  text-align: center;
  color: #e6ffff;
  font-size: 19px;
  text-shadow: 1px 1px 0 #000;
}
.counter { background: #000; color: #00ff00; padding: 2px 6px; border: 1px solid #00ff00; }
.footsep { margin: 0 8px; opacity: 0.7; }
.under-construction { color: #ffe300; }
.footnote { margin: 10px 0 0; font-size: 16px; color: #d6ffff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- narrow screens ---------- */
@media (max-width: 540px) {
  body { font-size: 18px; }
  .hero { flex-direction: column; text-align: center; }
  .disclaimer { flex-direction: column; text-align: center; }
  .marquee { font-size: 9px; }
  .hero-text h1 { font-size: 11px; }
}

/* ---------- respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .seal { animation: none; }
  .blink { animation: none; }
  .typing .dot { animation: none; }
  .chat { scroll-behavior: auto; }
  #send:active { transform: none; }
}
