/* pixboard — synthwave pixel theme v2 */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e0a1f;
  --bg-2: #1a1430;
  --bg-3: #271e47;
  --fg: #f4eeff;
  --muted: #9d94c2;
  --pink: #ff5dcb;
  --pink-2: #ff7ad9;
  --cyan: #79e8ff;
  --green: #b9ff61;
  --yellow: #ffe156;
  --orange: #ff9b54;
  --border: #4a3d7a;
  --border-bright: #6e5cad;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'VT323', monospace;
  font-size: 20px;
  line-height: 1.45;
  min-height: 100vh;
  image-rendering: pixelated;
  /* subtle scanline overlay + radial glow */
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(255, 93, 203, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 10%, rgba(121, 232, 255, 0.14), transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.015) 3px,
      rgba(255, 255, 255, 0.015) 4px
    );
  background-attachment: fixed;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.12s; }
a:hover { color: var(--pink); }

::selection { background: var(--pink); color: var(--bg); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 20px; }

/* ========== HEADER ========== */
header.site {
  border-bottom: 2px solid var(--border-bright);
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(26, 20, 48, 0.95), rgba(14, 10, 31, 0.85));
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 0 rgba(255, 93, 203, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4);
}

header.site .wrap { padding: 0; max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

header.site h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--pink);
  text-shadow:
    2px 2px 0 var(--bg),
    4px 4px 0 var(--cyan);
  letter-spacing: 1px;
}

header.site .nav {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}
header.site .nav a {
  margin-left: 14px;
  color: var(--fg);
  padding: 6px 10px;
  border: 2px solid transparent;
  display: inline-block;
}
header.site .nav a:hover {
  color: var(--pink);
  border-color: var(--pink);
  background: rgba(255, 93, 203, 0.08);
}

/* ========== TYPO ========== */
h1, h2, h3 { line-height: 1.2; }

.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--pink);
  margin: 28px 0 12px;
  text-shadow: 2px 2px 0 var(--bg-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--pink), transparent);
}

.muted { color: var(--muted); font-size: 16px; }

hr {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 18px 0;
  position: relative;
}

/* ========== BOARDS LIST ========== */
.board-card {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border: 2px solid var(--border);
  padding: 16px 20px;
  margin: 12px 0;
  border-radius: 4px;
  position: relative;
  transition: all 0.15s;
  display: block;
}
.board-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  pointer-events: none;
  border-top: 2px solid rgba(255, 93, 203, 0.4);
  border-left: 2px solid rgba(255, 93, 203, 0.4);
}
.board-card:hover {
  border-color: var(--pink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--cyan);
  text-decoration: none;
}
.board-card .tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--pink);
  margin-bottom: 6px;
  text-shadow: 1px 1px 0 var(--bg);
}
.board-card .name { font-size: 28px; color: var(--green); }
.board-card .desc { color: var(--muted); margin-top: 2px; }

/* ========== GALLERY ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.gallery-card {
  background: var(--bg-2);
  border: 2px solid var(--border);
  display: block;
  overflow: hidden;
  transition: all 0.15s;
  border-radius: 3px;
  position: relative;
}
.gallery-card:hover {
  border-color: var(--pink);
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--pink), 10px 10px 0 rgba(121, 232, 255, 0.4);
  text-decoration: none;
}
.gallery-card img {
  width: calc(100% - 16px);
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  display: block;
  image-rendering: pixelated;
  margin: 8px;
  border: 3px solid var(--pink);
  box-shadow: 0 0 0 1px var(--bg), 4px 4px 0 var(--cyan);
}
.gallery-card:hover img {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--bg), 4px 4px 0 var(--green);
}
.gallery-card .no-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--bg-3);
  margin: 8px;
  border: 3px dashed var(--border);
}
.gallery-meta { padding: 10px 12px 12px; }
.gallery-subject {
  color: var(--green);
  font-size: 19px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-stats { color: var(--fg); font-size: 16px; }
.gallery-time { color: var(--muted); font-size: 14px; margin-top: 2px; }

.board-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: var(--bg);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 4px 7px;
  border-radius: 2px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

/* ========== THREAD VIEW ========== */
.post {
  background: var(--bg-2);
  border: 2px solid var(--border);
  padding: 14px 18px;
  margin: 10px 0;
  border-radius: 3px;
  position: relative;
}
.post.op {
  border-left: 4px solid var(--pink);
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
}
.post .meta, .thread .meta {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.post .content {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 8px;
  font-size: 19px;
}
.post img, .thread img {
  max-width: 280px;
  max-height: 280px;
  image-rendering: pixelated;
  cursor: pointer;
  border: 2px solid var(--border-bright);
  margin: 8px 0;
  display: block;
  background: #fff;
  transition: all 0.12s;
}
.post img:hover, .thread img:hover { border-color: var(--pink); }
.post img.expanded, .thread img.expanded {
  max-width: 100%;
  max-height: none;
}

.poster-id {
  font-family: 'Press Start 2P', monospace;
  background: var(--bg-3);
  padding: 3px 7px;
  border-radius: 2px;
  color: var(--green);
  font-size: 10px;
  border: 1px solid var(--border);
}

/* ========== FORMS ========== */
form.post-form {
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 2px solid var(--border);
  padding: 18px;
  margin: 18px 0;
  border-radius: 4px;
  position: relative;
}
form.post-form::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  pointer-events: none;
  border-top: 2px solid rgba(121, 232, 255, 0.3);
  border-left: 2px solid rgba(121, 232, 255, 0.3);
}
form.post-form h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 12px;
  text-shadow: 1px 1px 0 var(--bg);
}

input[type="text"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--border);
  padding: 10px 12px;
  font-family: 'VT323', monospace;
  font-size: 19px;
  margin: 5px 0;
  border-radius: 2px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 93, 203, 0.2);
}
textarea { min-height: 90px; resize: vertical; }
input[type="file"] { margin: 8px 0; color: var(--fg); font-family: 'VT323', monospace; }

button {
  background: var(--pink);
  color: var(--bg);
  border: none;
  padding: 10px 22px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.5px;
  transition: all 0.12s;
  box-shadow: 3px 3px 0 var(--cyan);
}
button:hover {
  background: var(--cyan);
  box-shadow: 3px 3px 0 var(--pink);
  transform: translate(-1px, -1px);
}
button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--cyan);
}
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--border); }

label.muted { font-size: 16px; }

.error {
  color: #ffb3b3;
  background: linear-gradient(135deg, #401a1a, #2e1414);
  border: 2px solid #ff5555;
  padding: 8px 14px;
  margin: 8px 0;
  border-radius: 2px;
  font-size: 18px;
}

/* ========== CTA ========== */
.cta-draw {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: var(--bg);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 12px 18px;
  border-radius: 3px;
  margin: 10px 0;
  letter-spacing: 0.5px;
  box-shadow: 4px 4px 0 var(--cyan);
  transition: all 0.12s;
}
.cta-draw:hover {
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: var(--bg);
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pink);
}
.cta-draw:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--cyan);
}

/* ========== LOADING ========== */
.loading {
  display: inline-block;
  color: var(--muted);
  font-size: 16px;
}
.loading::after {
  content: '...';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ========== EMPTY STATE ========== */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  border: 2px dashed var(--border);
  border-radius: 4px;
  margin: 16px 0;
}
.empty .pix-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

/* ========== UTILITIES ========== */
.right { float: right; }
.clear::after { content: ""; display: table; clear: both; }
