/* Grep Backrooms — structure extracted from infinitebackrooms.com via REA */
/* REA tokens: .body { bg:#141414, padding:12px 22px, font:Berkeleymono } */
/* .dream-embed { width:100%, font-size:1rem, line-height:120% } */
/* .dream-wrapper.prompt-wrapper { border:1px dashed #a8a8a8, padding:8px } */
/* .collection-item { border-bottom:1px solid #686868, padding:8px 0 } */

@font-face {
  font-family: 'Berkeleymono';
  src: local('Berkeley Mono'), local('BerkeleyMono');
  font-display: swap;
}

:root {
  --bg: #141414;
  --text: #fff;
  --text-dim: #cecece;
  --text-muted: #686868;
  --yellow: #ffd900;
  --magenta: #cc44cc;
  --green: #00ff41;
  --border: #686868;
  --border-light: #a8a8a8;
  --mono: 'Berkeleymono', 'Courier New', Consolas, monospace;
}

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #363636; }
* { scrollbar-width: thin; scrollbar-color: #363636 var(--bg); }

/* .body from REA: bg #141414, padding 12px 22px, Berkeleymono */
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  padding: 12px 22px 0;
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: url('bg.gif');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}

a { color: var(--yellow); text-decoration: underline; }
a:hover { color: #ffea00; }

/* === ASCII HEADER — full width, no container, overflows === */
.ascii-wrap {
  overflow: hidden;
  width: calc(100% + 44px);
  margin-left: -22px;
  margin-right: -22px;
  padding: 10px 0;
}

.ascii-art {
  color: var(--yellow);
  font-size: 18px;
  line-height: 1.05;
  white-space: pre;
  display: inline-block;
  animation: marquee-scroll 12s linear infinite;
}

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

/* === HEADER CONTENT — max-width 60rem like REA extracted === */
.header-content {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

/* .heading-2 from REA: 28px centered */
.site-title {
  font-size: 28px;
  text-align: center;
  margin: 30px 0 12px;
  color: var(--text);
}

.site-credit {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* REA: .link-block — border 1px solid #ffea00, padding 18px, flex center */
.eternal-btn {
  color: var(--yellow);
  border: 1px solid #ffea00;
  background: none;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 32px;
  cursor: pointer;
  margin-top: 16px;
  margin-bottom: 24px;
  transition: background 0.12s;
}

.eternal-btn:hover { background: #080808; }

/* === ETERNAL MODE — floating screensaver over full bg === */
.eternal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  cursor: pointer;
  overflow: hidden;
}

.eternal-bg {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: url('bg.gif');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.eternal-window {
  position: absolute;
  width: 500px;
  max-width: 80vw;
  max-height: 300px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #333;
  padding: 16px 20px;
  overflow: hidden;
}

.eternal-window-title {
  font-family: var(--mono);
  font-size: 10px;
  color: #555;
  margin-bottom: 8px;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

.eternal-text {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  max-height: 240px;
}

.eternal-text .et-grep { color: #00ff41; }
.eternal-text .et-other { color: #cc44cc; }
.eternal-text .et-system { color: #686868; }
.eternal-text .et-cursor {
  display: inline-block;
  width: 7px;
  height: 12px;
  background: var(--yellow);
  animation: blink-cursor 0.8s step-end infinite;
  vertical-align: text-bottom;
}

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

.eternal-hint {
  position: absolute;
  bottom: 12px;
  width: 100%;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
  .eternal-window { width: 90vw; max-height: 250px; }
  .eternal-text { font-size: 11px; }
}

/* === SORT BAR === */
/* .filter-sort_component from original */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* .list-sort_button from original */
.sort-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 14px;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
}

.sort-btn:hover { color: var(--yellow); }
.sort-btn.active { color: var(--yellow); }

/* === STATS === */
.stats-bar {
  display: flex;
  gap: 20px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-val { color: var(--yellow); }

/* === SCENARIO NAV — from REA: .scenario-nav_component, .scenario_nav-button === */
/* REA: inline-flex, gap 2rem/1rem, wrap, centered */
.scenario-nav {
  display: inline-flex;
  flex-flow: wrap;
  align-items: center;
  gap: 1rem;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* REA: .scenario_nav-list — flex wrap, gap 1rem */
.scenario-list {
  display: flex;
  flex-flow: wrap;
  gap: 0.5rem;
}

/* REA: .scenario_nav-button — bg #e7d61b, color #000, padding .25rem .5rem, font-size 12px */
.scenario-btn {
  color: #000;
  background-color: #e7d61b;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  font-family: var(--mono);
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}

.scenario-btn:hover { opacity: 0.8; }
.scenario-btn.active { outline: 2px solid var(--text); outline-offset: 1px; }
.scenario-btn.dimmed { opacity: 0.4; }

/* === SEARCH — from REA: .search-input bg #2c2c2c, color #fff === */
.search-wrap {
  padding: 8px 0;
}

.search-input {
  color: #fff;
  background-color: #2c2c2c;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 14px;
  padding: 8px 12px;
  width: 100%;
  outline: none;
}

.search-input:focus { border-color: var(--yellow); }
.search-input::placeholder { color: var(--text-muted); }

/* === TRANSMISSION LIST === */
/* .collection-item from REA: border-bottom 1px solid #686868, padding 8px 0, flex column */
.transmission-list {
  padding: 0;
  max-width: 60rem;
  margin: 0 auto;
}

.transmission-item {
  display: flex;
  gap: 0.5rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
  justify-content: center;
}

/* .views-wrapper from REA: gap .25rem, flex */
.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 48px;
  cursor: pointer;
}

.vote-arrow {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}

.vote-arrow:hover, .vote-arrow.voted { color: var(--yellow); }

.vote-score {
  font-size: 13px;
  color: var(--text);
}

/* .title-wrapper from REA: gap .5rem, inline-flex, wrap-reverse */
.transmission-body {
  flex: 1;
  min-width: 0;
}

/* .link from original: yellow links */
.transmission-title {
  font-size: 14px;
  color: var(--yellow);
  word-break: break-word;
  display: block;
  margin-bottom: 2px;
  text-decoration: underline;
}

.transmission-title:hover { color: #ffea00; }

/* .miner-wrapper from REA */
.transmission-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.transmission-meta span { margin-right: 10px; }

/* === CONVERSATION DETAIL PAGE === */
/* .dream-wrapper.prompt-wrapper from REA: border 1px dashed #a8a8a8, padding 8px */
.dream-box {
  border: 1px dashed var(--border-light);
  padding: 8px;
  margin: 20px 0;
}

/* heading from REA: inline */
.conv-title {
  font-size: 28px;
  color: var(--text);
  word-break: break-word;
  margin: 20px 0;
}

.conv-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.conv-meta span { margin-right: 12px; }

.back-link {
  font-size: 14px;
  color: var(--yellow);
  display: block;
  margin: 10px 0;
}

/* .dream-embed from REA: width 100%, font-size 1rem, line-height 120% */
/* .dream-embed.prompt-wrapper from REA: color #cecece, font-size .8rem */
.conv-content {
  font-size: 0.8rem;
  line-height: 120%;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
}

.conv-content .speaker-grep { color: var(--green); }
.conv-content .speaker-other { color: var(--magenta); }
.conv-content .system-line { color: var(--text-muted); }

/* === LOAD MORE === */
/* .link-block from REA: border 1px solid #ffea00, padding 18px, flex center */
.load-more {
  text-align: center;
  padding: 16px 0;
}

.load-more-btn {
  color: var(--yellow);
  border: 1px solid #ffea00;
  background: none;
  font-family: var(--mono);
  font-size: 14px;
  padding: 18px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.load-more-btn:hover { background: #080808; }

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* === EMPTY === */
.empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.empty .big { font-size: 16px; color: var(--text); margin-bottom: 6px; }

/* === MOBILE === */
@media (max-width: 600px) {
  body { padding: 8px 10px 0; }
  .ascii-wrap { width: calc(100% + 20px); margin-left: -10px; margin-right: -10px; }
  .ascii-art { font-size: 10px; }
  .site-title { font-size: 20px; }
  .header-content { padding: 0; }
  .vote-col { min-width: 36px; }
  .conv-title { font-size: 20px; }
  .sort-bar { flex-wrap: wrap; gap: 6px; }
}
