/* XAI-VAI Forum — retro 90s stylesheet.
   No external fonts, no external images, no JavaScript. */

:root {
  --navy: #000044;
  --navy-2: #000080;
  --blue: #1084d0;
  --silver: #c0c0c0;
  --silver-light: #e8e8e8;
  --silver-dark: #808080;
  --ink: #000000;
  --link: #0000ee;
  --link-visited: #551a8b;
  --yellow: #ffff00;
  --lime: #00ff66;
  --red: #cc0000;
  --panel: #d4d0c8;
  --shadow: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  background: #000018;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.11) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, 0.09) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 78%, rgba(255, 255, 255, 0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 84%, rgba(255, 255, 255, 0.08) 0 1px, transparent 2px),
    linear-gradient(180deg, #000020 0%, #000033 45%, #000018 100%);
  background-size: 190px 190px, 240px 240px, 310px 310px, 270px 270px, 100% 100%;
  font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

/* Slowly drifting star layer. */
.starfield {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle, #ffffff 0 1px, transparent 1.4px),
    radial-gradient(circle, #9fd8ff 0 1px, transparent 1.4px),
    radial-gradient(circle, #ffe98a 0 1px, transparent 1.4px);
  background-size: 170px 170px, 230px 230px, 310px 310px;
  background-position: 0 0, 40px 60px, 90px 20px;
  animation: star-drift 90s linear infinite;
}

@keyframes star-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-170px, 230px, 0); }
}

.page {
  position: relative;
  z-index: 1;
  width: min(1020px, calc(100% - 24px));
  margin: 18px auto;
  background: var(--silver);
  border: 4px ridge #f0f0f0;
  box-shadow: 0 0 0 2px #000, 0 14px 40px var(--shadow);
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--red);
  background: var(--yellow);
  text-decoration: none;
}

a:active {
  color: #ffffff;
  background: var(--red);
}

/* ------------------------------------------------------------------ header */

.site-header {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding: 10px;
  background: linear-gradient(180deg, #000080 0%, #000055 60%, #000033 100%);
  border-bottom: 4px ridge #d8d8d8;
}

.logo-link {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
}

.logo {
  display: block;
  width: 430px;
  max-width: 100%;
  height: auto;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000, inset 0 0 0 1px #3a6ea5;
  image-rendering: pixelated;
}

.header-side {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  color: var(--lime);
  border: 2px inset #666;
  padding: 5px 0;
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 255, 102, 0.8);
}

.marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 22s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.top-links {
  text-align: right;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
}

.top-links a {
  color: var(--yellow);
}

.top-links a:hover {
  color: #000;
  background: var(--yellow);
}

.sep {
  color: #8fb8e8;
  padding: 0 3px;
}

.counter {
  align-self: flex-end;
  background: #000;
  color: #d8d8d8;
  border: 2px inset #999;
  padding: 3px 8px;
  font-size: 11px;
  font-family: "Courier New", Courier, monospace;
  white-space: nowrap;
}

.counter .digits {
  color: var(--lime);
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.9);
}

/* -------------------------------------------------------------------- nav */

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--panel);
  border-bottom: 2px outset #ffffff;
}

.main-nav a {
  display: inline-block;
  padding: 4px 14px;
  color: #000;
  background: var(--silver);
  border: 2px outset #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
}

.main-nav a:hover {
  background: #e8e8e8;
  color: #000;
}

.main-nav a:active {
  border-style: inset;
  background: #b0b0b0;
}

.status-bar {
  padding: 5px 8px;
  background: #000;
  color: #b8ffb8;
  border-bottom: 2px solid #333;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  text-align: center;
}

.status-bar b {
  color: #ffffff;
}

.blink {
  color: var(--lime);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.new-badge {
  display: inline-block;
  padding: 0 5px;
  color: #ffffff;
  background: var(--red);
  border: 1px solid #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  animation: blink 1.2s steps(2, start) infinite;
}

/* ------------------------------------------------------------------ forum */

main {
  padding: 10px;
}

.forum {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  background: #808080;
  border: 3px ridge #f0f0f0;
}

.forum th {
  padding: 4px 8px;
  color: #ffffff;
  background: linear-gradient(180deg, #1084d0 0%, #000080 100%);
  border: 2px outset #8fc4ef;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.forum td {
  padding: 7px 8px;
  background: #ffffff;
  border: 2px inset #d0d0d0;
  vertical-align: middle;
}

.forum tr.category td {
  padding: 4px 8px;
  background: #000080;
  color: var(--yellow);
  border: 2px outset #4a7ab5;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
}

.forum tr.thread:hover td {
  background: #fffbe0;
}

.col-icon {
  width: 34px;
  text-align: center;
}

.col-stats {
  width: 130px;
  text-align: center;
  font-size: 11px;
  white-space: nowrap;
}

.col-last {
  width: 150px;
  font-size: 11px;
  white-space: nowrap;
}

.thread-title {
  font-size: 13px;
  font-weight: bold;
}

.thread-desc {
  margin-top: 2px;
  color: #444;
  font-size: 11px;
  line-height: 1.25;
}

/* Pixel-ish folder icons drawn with CSS only. */
.folder {
  display: inline-block;
  position: relative;
  width: 22px;
  height: 15px;
  margin-top: 3px;
  background: #e8c34a;
  border: 1px solid #6b5410;
  box-shadow: inset 0 0 0 1px #fff2a8;
}

.folder::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -4px;
  width: 9px;
  height: 5px;
  background: #e8c34a;
  border: 1px solid #6b5410;
  border-bottom: none;
}

.folder.hot {
  background: #ff6a4a;
  border-color: #7a1a0a;
  box-shadow: inset 0 0 0 1px #ffd0c0;
}

.folder.hot::before {
  background: #ff6a4a;
  border-color: #7a1a0a;
  box-shadow: inset 0 0 0 1px #ffd0c0;
}

/* --------------------------------------------------------------- columns */

.columns {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.box {
  background: var(--panel);
  border: 3px ridge #f0f0f0;
  padding: 8px 10px;
}

.box h2,
.last-post h2 {
  margin: 0 0 6px;
  padding: 3px 7px;
  color: #ffffff;
  background: linear-gradient(180deg, #000080, #000055);
  border: 2px outset #4a7ab5;
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.box p {
  margin: 5px 0;
}

.online-list .user {
  color: #000080;
  font-weight: bold;
}

.muted {
  color: #555;
}

.small {
  font-size: 11px;
}

.news-list {
  margin: 4px 0 0;
  padding: 0 0 0 16px;
  font-size: 11px;
}

.news-list li {
  margin: 3px 0;
}

.news-list .date {
  color: #000080;
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
}

.poll-form {
  display: grid;
  gap: 2px;
  margin: 4px 0 6px;
  font-size: 11px;
}

.poll-form label {
  cursor: pointer;
}

.poll-form label:hover {
  color: #000080;
  background: #ffffb0;
}

.retro-btn {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 12px;
  color: #000;
  background: var(--silver);
  border: 2px outset #ffffff;
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.retro-btn:active {
  border-style: inset;
  background: #b0b0b0;
}

.poll-result {
  height: 13px;
  margin: 3px 0;
  background: #000;
  border: 1px solid #666;
  font-size: 9px;
  line-height: 13px;
}

.poll-result span {
  display: block;
  height: 100%;
  padding-left: 4px;
  color: #000;
  background: repeating-linear-gradient(90deg, #00c000 0 6px, #00a000 6px 12px);
  border-right: 2px solid #005000;
}

/* -------------------------------------------------------------- last post */

.last-post {
  margin-top: 10px;
  background: var(--panel);
  border: 3px ridge #f0f0f0;
  padding: 8px 10px;
}

.post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #ffffff;
  border: 2px inset #d0d0d0;
  padding: 10px;
}

.post-avatar {
  flex: 0 0 110px;
  text-align: center;
  padding: 6px;
  background: #e8e8e8;
  border: 2px outset #ffffff;
  font-size: 10px;
}

.post-avatar img {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 5px;
  border: 2px solid #000;
  image-rendering: pixelated;
}

.avatar-name {
  font-weight: bold;
  color: #000080;
}

.avatar-rank {
  color: #777;
}

.post-body {
  flex: 1 1 auto;
  min-width: 0;
}

.post-meta {
  padding-bottom: 5px;
  border-bottom: 1px solid #c0c0c0;
  margin-bottom: 7px;
  font-size: 11px;
}

.post-number {
  float: right;
  color: #777;
  font-family: "Courier New", Courier, monospace;
}

.post-body p {
  margin: 6px 0;
  font-size: 12px;
}

.post-figure {
  margin: 10px 0;
  padding: 8px;
  background: #e8e8e8;
  border: 2px inset #ffffff;
  text-align: center;
}

.post-figure img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  border: 2px solid #000;
  image-rendering: pixelated;
}

.post-figure figcaption {
  margin-top: 5px;
  color: #555;
  font-size: 10px;
  font-style: italic;
}

.signature {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #999;
  font-size: 10px;
}

code {
  padding: 1px 3px;
  background: #f0f0f0;
  border: 1px solid #c0c0c0;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
}

/* -------------------------------------------------- under construction */

.under-construction {
  margin: 12px auto 4px;
  width: min(520px, 100%);
  padding: 10px;
  text-align: center;
  color: #000;
  background: repeating-linear-gradient(45deg, #ffd800 0 14px, #111 14px 28px);
  border: 4px ridge #ffffff;
  box-shadow: 0 0 0 2px #000;
}

.under-construction span {
  display: inline-block;
  padding: 4px 12px;
  color: var(--yellow);
  background: #000;
  border: 2px solid var(--yellow);
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  letter-spacing: 2px;
  animation: blink 1.4s steps(2, start) infinite;
}

.under-construction small {
  display: block;
  margin-top: 5px;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  background: #ffd800;
  padding: 2px 5px;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  padding: 10px;
  text-align: center;
  color: #d8d8d8;
  background: #000033;
  border-top: 4px ridge #d8d8d8;
  font-size: 11px;
}

.footer-links a {
  color: var(--yellow);
}

.footer-links a:hover {
  color: #000;
}

.footer-copy {
  margin: 7px 0;
  color: #b0c8e8;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  color: #000;
  background: var(--silver);
  border: 2px outset #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: bold;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
  }

  .logo {
    width: 100%;
    max-width: 520px;
  }

  .columns {
    grid-template-columns: 1fr;
  }

  .col-last {
    display: none;
  }

  .forum th.col-last {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 12px;
  }

  .page {
    width: calc(100% - 10px);
    margin: 6px auto;
  }

  .col-stats {
    display: none;
  }

  .post {
    flex-direction: column;
  }

  .post-avatar {
    flex-basis: auto;
    width: 100%;
  }

  .main-nav a {
    padding: 3px 8px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
