:root {
  --bg: #070908;
  --bg-2: #0c110e;
  --panel: rgba(10, 16, 14, 0.88);
  --line: #1c2a24;
  --cyan: #3ee0ff;
  --cyan-dim: rgba(62, 224, 255, 0.14);
  --magenta: #ff3cac;
  --magenta-dim: rgba(255, 60, 172, 0.16);
  --acid: #d6ff3e;
  --amber: #ffb020;
  --text: #e8f0ea;
  --muted: #8a9a90;
  --dim: #5c6b62;
  --ok: #5dffb1;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --font-display: "Orbitron", "Exo 2", sans-serif;
  --font-ui: "Exo 2", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 8% -12%, rgba(62, 224, 255, 0.11), transparent 60%),
    radial-gradient(720px 420px at 108% 8%, rgba(255, 60, 172, 0.1), transparent 55%),
    radial-gradient(600px 280px at 50% 120%, rgba(214, 255, 62, 0.05), transparent 50%),
    linear-gradient(180deg, #0a100c 0%, var(--bg) 42%, #050706 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(62, 224, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 224, 255, 0.08) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.75), transparent 78%);
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #050706;
  color: var(--ok);
}

.boot[hidden] { display: none !important; }

.boot-log {
  width: min(560px, 88vw);
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.boot-skip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
}

.cmdbar {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 7, 0.85);
}

.cmdbar-hash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(
    -18deg,
    transparent 0 8px,
    rgba(62, 224, 255, 0.25) 8px 9px
  );
}

.cmdbar-inner {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.cmdbar-inner b { color: var(--cyan); font-weight: 500; }
.cmdbar-inner #clock { margin-left: auto; color: var(--text); letter-spacing: 0.06em; }

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 1.8s ease-in-out infinite;
}

.wrap {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand { text-decoration: none; color: inherit; }

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand h1 span { color: var(--magenta); }

.brand-kicker {
  margin-top: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

.sys {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.sys b { color: var(--ok); font-weight: 500; }

.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq i {
  display: block;
  width: 3px;
  background: var(--magenta);
  animation: eq 0.9s ease-in-out infinite;
  transform-origin: bottom;
}

.eq i:nth-child(1) { height: 6px; animation-delay: 0s; }
.eq i:nth-child(2) { height: 14px; animation-delay: 0.12s; background: var(--cyan); }
.eq i:nth-child(3) { height: 9px; animation-delay: 0.24s; }
.eq i:nth-child(4) { height: 16px; animation-delay: 0.08s; background: var(--acid); }
.eq i:nth-child(5) { height: 7px; animation-delay: 0.3s; }

.hero {
  padding: 28px 0 8px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--magenta);
  text-transform: uppercase;
}

.hero h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero p {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.boards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  min-height: 0;
  height: calc(100vh - 230px);
  max-height: 680px;
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.pane-head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.pane--dev .pane-head h3 { color: var(--amber); }
.pane--live .pane-head h3 { color: var(--ok); }
.pane--later .pane-head h3 { color: #c9b37a; }
.pane--archive .pane-head h3 { color: var(--dim); }

.pane-head em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.pane-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.pane-empty {
  margin: auto;
  padding: 24px 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 12px;
}

.section-head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.section-head em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  padding: 12px 12px 10px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 12px 12px 0;
  border-color: transparent #050706 transparent transparent;
  pointer-events: none;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--cyan);
}

.card--game::before { background: var(--magenta); }
.card--eng::before { background: var(--cyan); }
.card--sim::before { background: var(--acid); }
.card--club::before { background: var(--amber); }
.card--archive::before { background: var(--dim); }

.pill--dead {
  color: var(--muted);
  border-color: var(--line);
}

.pill--hold {
  color: #c9b37a;
  border-color: rgba(201, 179, 122, 0.45);
}

.pill--wip {
  color: var(--amber);
  border-color: rgba(255, 176, 32, 0.45);
}

.card--wip {
  cursor: default;
}

.card--wip:hover,
.card--wip:focus-visible {
  transform: none;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

a,
button {
  touch-action: pan-y;
}

button.card {
  width: 100%;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.card {
  touch-action: pan-y;
}

.card:hover,
.card:focus-visible {
  border-color: var(--cyan);
  background: rgba(14, 24, 20, 0.96);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(62, 224, 255, 0.08), var(--shadow);
  outline: none;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--magenta);
}

.pill {
  margin-right: auto;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ok);
  border: 1px solid rgba(93, 255, 177, 0.28);
  padding: 2px 6px;
}

.ico {
  width: 32px;
  height: 32px;
  color: var(--cyan);
  flex: 0 0 auto;
}

.card h4 {
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}

.host {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.02em;
}

.board-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-decoration: none;
  white-space: nowrap;
}

.board-link:hover,
.board-link:focus-visible {
  color: var(--cyan);
}

.layout > aside {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 230px);
  max-height: 680px;
}

.blog {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 12px 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}

.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  padding: 5px 8px;
  cursor: pointer;
}

.chip:hover,
.chip:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
  outline: none;
}

.chip.is-on {
  color: #07100c;
  background: var(--cyan);
  border-color: var(--cyan);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.pane-list::-webkit-scrollbar,
.news-list::-webkit-scrollbar {
  width: 8px;
}

.pane-list::-webkit-scrollbar-thumb,
.news-list::-webkit-scrollbar-thumb {
  background: var(--line);
}

.pane-list::-webkit-scrollbar-track,
.news-list::-webkit-scrollbar-track {
  background: transparent;
}

.news-empty,
.news-item button {
  font: inherit;
}

.news-empty {
  padding: 16px 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.news-item { display: none; }
.news-item.is-shown { display: block; }

.news-item button {
  width: 100%;
  touch-action: pan-y;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  padding: 10px 10px 8px;
}

.news-item button:hover,
.news-item button:focus-visible {
  border-color: var(--line);
  background: rgba(62, 224, 255, 0.04);
  outline: none;
}

.news-item.is-open button {
  border-color: rgba(62, 224, 255, 0.35);
  background: var(--cyan-dim);
}

.news-meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.tag { color: var(--acid); letter-spacing: 0.12em; }
.tag-GAME { color: var(--magenta); }
.tag-SIM { color: var(--acid); }
.tag-ENG { color: var(--cyan); }
.tag-SYS { color: var(--amber); }

.news-item h4 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.news-item .excerpt {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.news-body {
  display: none;
  margin: 0 10px 10px;
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.news-item.is-open .news-body { display: block; }
.news-item.is-open .excerpt { display: none; }

.chat {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.chat-head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.chat-head em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

.chat-log {
  list-style: none;
  margin: 0;
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
}

.chat-empty {
  margin: 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.chat-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

.chat-line time {
  color: var(--dim);
  margin-right: 8px;
}

.chat-line b {
  color: var(--cyan);
  font-weight: 500;
  margin-right: 6px;
}

.chat-form {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  min-width: 0;
  font: 13px var(--font-mono);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--cyan);
}

.chat-form button {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0 12px;
  cursor: pointer;
}

.chat-form button:hover,
.chat-form button:focus-visible {
  border-color: var(--ok);
  outline: none;
}

.chat-form button:disabled {
  color: var(--dim);
  cursor: default;
}

.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.foot-label,
.keys {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}

.keys { letter-spacing: 0.08em; text-transform: none; margin-top: 4px; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: rgba(8, 12, 16, 0.7);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.badge svg { width: 14px; height: 14px; flex: 0 0 14px; }

.badge:hover,
.badge:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  outline: none;
}

.badge--magenta:hover,
.badge--magenta:focus-visible {
  border-color: var(--magenta);
  color: var(--magenta);
}

.tea {
  flex: 1 0 100%;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--dim);
  text-decoration: none;
  opacity: 0.7;
}

.tea:hover,
.tea:focus-visible {
  color: var(--muted);
  opacity: 1;
  outline: none;
}

.counter {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  min-width: 132px;
  padding: 10px 12px 8px;
  background: rgba(8, 12, 10, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.counter-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
}

.counter-num {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.counter-sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.counter-sub span { color: var(--magenta); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9;
  transform: translateX(-50%);
  padding: 10px 14px;
  background: #12080e;
  border: 1px solid var(--magenta);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: var(--shadow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes eq {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

@media (max-width: 1100px) {
  .wrap {
    display: flex;
    flex-direction: column;
  }
  .topbar { order: 1; }
  .chat { order: 2; }
  .layout {
    order: 3;
    grid-template-columns: 1fr;
  }
  .foot { order: 4; }
  .boards,
  .layout > aside {
    height: auto;
    max-height: none;
  }
  .boards {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .pane--dev,
  .pane--later,
  .pane--archive { min-height: 140px; }
  .pane-list {
    overflow: visible;
    overscroll-behavior: auto;
    flex: 0 0 auto;
    min-height: auto;
  }
  .layout > aside {
    height: 380px;
    max-height: 380px;
  }
}

@media (max-width: 720px) {
  .chat-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .chat-form input[name="text"] {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .sys { justify-content: flex-start; }
  .wrap { padding-bottom: 28px; }
  .section-head em { display: none; }
  .cmdbar-inner #clock { margin-left: 0; }
  .counter {
    position: static;
    margin: 18px auto 8px;
    width: min(220px, calc(100% - 32px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .scanlines, .led, .eq i { animation: none; }
  .boot { display: none !important; }
}
