/* Axiom — terminal-grade dark UI. One mono face, near-black surface steps
   (#000 → #111 → #191919 → #202020 borders), azure #2a7fff accent reserved for the
   primary action fill and left-border marks. 2px corners, no shadows.
   Layout: full-bleed two-pane workspace (sidebar list + thread), mail-client
   style — panes own their scroll, hairline borders do the separation. */

:root {
  --void: #000000;
  --carbon: #111111;
  --graphite: #191919;
  --iron: #202020;
  --slate: #3a3a3a;
  --pewter: #505050;
  --steel: #606060;
  --ash: #7e7e7e;
  --fog: #b4b4b4;
  --chalk: #d9d9d9;
  --paper: #eeeeee;
  --accent: #2a7fff;
  --accent-bright: #4a92ff;
  --purple: #8b5cf6;
  --purple-bright: #a78bfa;
  --danger: #e5484d;
  --danger-bright: #f2555a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--void);
  color: var(--paper);
  font: 400 14px/1.71 var(--mono);
}
body { display: flex; flex-direction: column; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* faint "streaming data" arrow texture behind everything (opaque panels cover
   it locally, so it reads in the gutters and empty areas only) */
#bgfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 12px 20px;
  color: #232323;
  font: 400 13px/1.9 var(--mono);
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}
/* reading a bug: fade the texture right down so it doesn't fight the thread */
body.thread-open #bgfield { opacity: 0.28; }

a { color: var(--paper); }
a:hover { color: var(--chalk); }

::selection { background: var(--accent); color: var(--paper); }

/* --- top nav --- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex: 0 0 56px;
  padding: 0 24px;
  background: var(--void);
  border-bottom: 1px solid var(--iron);
  position: relative;
  z-index: 2;
}
.nav .brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}
.nav .brand .mark { color: var(--accent-bright); }
.nav .brand .path { color: var(--steel); font-size: 12px; }
.nav .user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fog);
}
.nav .user img {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  border: 1px solid var(--slate);
}
.nav .user a { color: var(--steel); text-decoration: none; font-size: 12px; }
.nav .user a:hover { color: var(--fog); }

/* --- buttons --- */
.btn {
  display: inline-block;
  font: 700 14px/1.2 var(--mono);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 2px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-bright); color: #fff; }
.btn:disabled { background: var(--slate); color: var(--ash); cursor: default; }
.btn-ghost {
  display: inline-block;
  font: 400 13px/1.2 var(--mono);
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--pewter); }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-danger {
  display: inline-block;
  font: 700 13px/1.2 var(--mono);
  color: var(--danger-bright);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: 2px;
  padding: 9px 14px;
  cursor: pointer;
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-danger:disabled { opacity: 0.5; cursor: default; }

/* --- login hero --- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero .arrows {
  position: absolute;
  inset: 0;
  color: var(--slate);
  font-size: 12px;
  line-height: 2;
  white-space: pre;
  user-select: none;
  pointer-events: none;
  opacity: 0.5;
}
.hero .inner { position: relative; max-width: 480px; padding: 32px; }
.hero .prompt { color: var(--steel); font-size: 14px; margin-bottom: 8px; }
.hero h1 { font: 400 32px/1.25 var(--mono); margin: 0 0 16px; }
.hero p { color: var(--fog); margin: 0 0 32px; }

/* --- game picker --- */
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--steel);
}
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.game-card {
  display: block;
  background: var(--carbon);
  border: 1px solid var(--iron);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  padding: 32px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--paper);
}
.game-card:hover { background: var(--graphite); }
.game-card .name { font-size: 18px; margin-bottom: 4px; }
.game-card .meta { font-size: 12px; color: var(--steel); }

/* --- board: full-bleed two-pane workspace --- */
.board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
}

/* --- sidebar: bug list --- */
.list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--iron);
  background: var(--void); /* opaque: keeps the list clean over the bg texture */
}
.list-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--iron);
}
.list-head .game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
}
.list-head .game-name {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.list-head .game-name .count { color: var(--steel); font-size: 12px; letter-spacing: normal; text-transform: none; }
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.tab {
  font: 400 12px/1 var(--mono);
  color: var(--steel);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 10px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--fog); }
.tab.active { color: var(--paper); border-bottom-color: var(--accent); }
.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--iron);
  font-size: 12px;
  color: var(--steel);
}
.sort-row select { flex: 1; }
select {
  font: 400 12px var(--mono);
  color: var(--fog);
  background: var(--carbon);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 6px 8px;
}

.bug-rows { flex: 1; min-height: 0; overflow-y: auto; }
.bug-row {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--paper);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--iron);
  border-left: 2px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
}
.bug-row:hover { background: var(--carbon); }
.bug-row.active { background: var(--graphite); border-left-color: var(--accent); }
.bug-row .title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.bug-row .st-mark { flex: 0 0 auto; color: var(--fog); font-size: 12px; }
.bug-row .title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prio {
  flex: 0 0 auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fog);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 1px 5px;
}
.prio.p3 { color: var(--paper); border-color: var(--pewter); }
.bug-row .meta {
  margin-top: 3px;
  padding-left: 20px;
  font-size: 12px;
  color: var(--steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty { padding: 32px 16px; color: var(--steel); font-size: 12px; }

/* --- thread pane --- */
.thread {
  min-height: 0;
  overflow-y: auto;
}
.thread-inner {
  max-width: 1440px;
  padding: 28px 32px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 0 40px;
  align-items: start;
}
.t-right {
  border-left: 1px solid var(--iron);
  padding-left: 32px;
  position: sticky;
  top: 0;
}
@media (max-width: 1250px) {
  .thread-inner { grid-template-columns: 1fr; }
  .t-right { border-left: none; padding-left: 0; position: static; }
}
.thread-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--steel);
  font-size: 13px;
}
.thread-empty .glyph { font-size: 28px; color: var(--slate); }

.thread .back { display: none; margin-bottom: 16px; }
.crumb { font-size: 12px; color: var(--steel); margin-bottom: 6px; }
.crumb .sep { color: var(--slate); padding: 0 6px; }
.thread h2 { font: 400 24px/1.33 var(--mono); margin: 0 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  font-size: 12px;
  color: var(--fog);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 3px 9px;
}
.chip.status { color: var(--paper); border-color: var(--pewter); }
.byline { font-size: 12px; color: var(--steel); margin-bottom: 20px; }
.byline b { color: var(--fog); font-weight: 400; }
.mention {
  font: 400 12px var(--mono);
  color: var(--accent-bright);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: none;
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
}
.mention:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }

.controls {
  padding: 14px 16px;
  background: var(--graphite);
  border: 1px solid var(--slate);
  border-left: 2px solid var(--purple);
  border-radius: 2px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--fog);
}
.controls .controls-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--purple-bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.controls-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.controls .ctrl-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.controls .ctrl-row > span {
  flex: 0 0 64px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.controls .ctrl-row select { flex: 1; max-width: 240px; }
.controls-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.controls-actions .btn { padding: 8px 18px; }

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--steel);
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after { content: ""; flex: 1; border-top: 1px solid var(--iron); }

.body-card {
  background: var(--carbon);
  border: 1px solid var(--iron);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  padding: 16px 18px;
}

/* markdown output */
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md code {
  background: var(--graphite);
  border: 1px solid var(--iron);
  border-radius: 2px;
  padding: 1px 5px;
  font-size: 13px;
}
.md pre {
  background: var(--void);
  border: 1px solid var(--iron);
  border-radius: 2px;
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 8px;
}
.md pre code { background: none; border: none; padding: 0; }
.md ul { margin: 0 0 8px; padding-left: 20px; }
.md a { color: var(--chalk); }

/* attachments */
.atts { display: flex; flex-wrap: wrap; gap: 8px; }
.atts img {
  max-width: 220px;
  max-height: 140px;
  border: 1px solid var(--iron);
  border-radius: 2px;
  display: block;
}
.att-link {
  font-size: 12px;
  color: var(--fog);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 6px 10px;
  text-decoration: none;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-link:hover { border-color: var(--pewter); }
.composer-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--steel);
  border: 1px dashed var(--slate);
  border-radius: 2px;
  padding: 10px 14px;
}

/* comments */
.comment { margin-bottom: 18px; }
.comment .who { font-size: 12px; color: var(--steel); margin-bottom: 4px; }
.comment .who .name { color: var(--fog); }
.comment .who .dev-mark { color: var(--accent-bright); }
.comment .bubble {
  background: var(--carbon);
  border: 1px solid var(--iron);
  border-radius: 2px;
  padding: 10px 14px;
}
.comment.dev .bubble { background: var(--graphite); }
.event-line {
  font-size: 12px;
  color: var(--steel);
  margin: 14px 0;
  padding-left: 2px;
}
.event-line .name { color: var(--ash); }
.event-line .change { color: var(--fog); }

/* comment composer */
textarea, input[type="url"] {
  width: 100%;
  font: 400 14px/1.6 var(--mono);
  color: var(--paper);
  background: var(--carbon);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 10px 12px;
}
textarea { min-height: 90px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 1px solid var(--pewter); }
.composer { margin-top: 10px; }
/* captcha sits between the textarea and the send button */
.composer #ts-widget { margin-top: 12px; }
.composer #ts-widget:empty { display: none; }
.composer .actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
/* counter pushed to the left, button to the right, both on one centered line */
.composer .charcount {
  margin-right: auto;
  font-size: 12px;
  line-height: 1;
  color: var(--pewter);
}

.loading { padding: 64px; text-align: center; color: var(--steel); font-size: 12px; }

/* --- responsive --- */
@media (max-width: 1100px) {
  .board { grid-template-columns: 340px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .list { border-right: none; }
  .board.viewing .list { display: none; }
  .board:not(.viewing) .thread { display: none; }
  .thread .back { display: inline-block; }
  .thread-inner { padding: 20px 16px 40px; }
}
