/* ============================================================
   DAGKnight BBS Terminal — game.css
   ============================================================ */

/* ---------- Scroll-down arrow ---------- */

.scroll-arrow-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  margin: -3rem 0 1rem;
  gap: 0.3rem;
  animation: arrow-bounce 2s ease-in-out infinite;
}

.scroll-arrow-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.8;
}

.scroll-arrow {
  font-size: 2rem;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(112, 199, 186, 0.6);
  line-height: 1;
}

.scroll-arrow-link:hover .scroll-arrow-text {
  opacity: 1;
  color: var(--primary);
}

.scroll-arrow-link:hover .scroll-arrow {
  text-shadow: 0 0 20px rgba(112, 199, 186, 0.9);
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ---------- Game intro section ---------- */

.game-intro {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.game-tech-note {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
}

.game-tech-note h3 {
  font-family: var(--font-display);
  color: var(--accent-gold);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.tech-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tech-row {
  display: grid;
  grid-template-columns: 160px 30px 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tech-game {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.tech-arrow {
  color: var(--accent-gold);
  text-align: center;
  font-size: 1.1rem;
}

.tech-chain {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.tech-chain code {
  color: var(--primary);
  background: rgba(112, 199, 186, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .tech-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .tech-arrow { display: none; }
  .tech-game { margin-top: 0.5rem; }
}

/* ---------- Terminal ---------- */

#terminal {
  position: relative;
  height: 700px;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 1.5rem;
  overflow: hidden;
  background: #000;
  border: 1px solid #33ff33;
  box-shadow: 0 0 20px rgba(51, 255, 51, 0.15), inset 0 0 60px rgba(0, 0, 0, 0.8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #33ff33;
  display: flex;
  flex-direction: column;
}

/* CRT scanline overlay */
#terminal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

#terminal-output {
  position: relative;
  z-index: 1;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: hidden;
  word-wrap: break-word;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #33ff33 #000;
}

#terminal-output::-webkit-scrollbar { width: 4px; }
#terminal-output::-webkit-scrollbar-track { background: #000; }
#terminal-output::-webkit-scrollbar-thumb { background: #33ff33; }

/* ---------- Text classes ---------- */

.t-green { color: #33ff33; }
.t-gold { color: #d4a847; }
.t-red { color: #ff4444; }
.t-cyan { color: #44ffff; }
.t-dim { color: #338833; }
.t-white { color: #cccccc; }
.t-magenta { color: #ff44ff; }
.t-bold { font-weight: 700; }

.line {
  display: block;
  min-height: 1.6em;
}

.line-ascii {
  color: #d4a847;
  line-height: 1.15;
}

/* ---------- Menu options ---------- */

.menu-option {
  display: block;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.menu-option:hover {
  color: #d4a847;
  text-shadow: 0 0 6px rgba(212, 168, 71, 0.5);
}

.menu-key {
  color: #d4a847;
  font-weight: 700;
}

/* ---------- Input area ---------- */

#terminal-input {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  border-top: 1px solid #1a661a;
  padding-top: 0.5rem;
}

#terminal-input.hidden { display: none; }

.prompt-char {
  color: #d4a847;
  font-weight: 700;
  margin-right: 0.5rem;
  font-size: 1rem;
}

#input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #33ff33;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  caret-color: #33ff33;
}

/* ---------- HP/XP bars ---------- */

.bar-track {
  display: inline-block;
  width: 20ch;
  background: #1a1a1a;
  border: 1px solid #338833;
  height: 1em;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.3s;
}

.bar-hp { background: #33ff33; }
.bar-xp { background: #d4a847; }

/* ---------- Typewriter cursor ---------- */

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  background: #33ff33;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ---------- Disclaimer ---------- */

.chain-disclaimer {
  max-width: 800px;
  margin: 1.5rem auto;
  padding: 1rem 1.5rem;
  background: rgba(212, 168, 71, 0.08);
  border: 1px solid rgba(212, 168, 71, 0.25);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.chain-disclaimer strong {
  color: var(--accent-gold);
}

.chain-disclaimer a {
  color: var(--primary);
  text-decoration: none;
}

/* ---------- Chain activity log ---------- */

#chain-log {
  max-width: 800px;
  margin: 0 auto 3rem;
  background: #050510;
  border: 1px solid #1a3a5c;
  box-shadow: 0 0 15px rgba(68, 255, 255, 0.08);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #44ffff;
}

.chain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #1a3a5c;
  background: rgba(68, 255, 255, 0.04);
}

.chain-title {
  color: #44ffff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.chain-status {
  color: #d4a847;
  font-size: 0.7rem;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chain-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #d4a847;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.chain-dot-live {
  background: #33ff33;
  animation: pulse-dot-live 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; box-shadow: 0 0 6px #d4a847; }
}

@keyframes pulse-dot-live {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; box-shadow: 0 0 8px #33ff33; }
}

.ce-info {
  color: #338888;
  font-style: italic;
}

#chain-feed {
  height: 180px;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: #1a3a5c #050510;
}

#chain-feed::-webkit-scrollbar { width: 3px; }
#chain-feed::-webkit-scrollbar-track { background: #050510; }
#chain-feed::-webkit-scrollbar-thumb { background: #1a3a5c; }

.chain-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(26, 58, 92, 0.3);
  opacity: 0;
  animation: chain-fade-in 0.3s forwards;
}

@keyframes chain-fade-in {
  to { opacity: 1; }
}

.chain-entry .ce-time {
  color: #336688;
}

.chain-entry .ce-hash {
  color: #44ffff;
}

.chain-entry .ce-txs {
  color: #338888;
}

.chain-entry .ce-parents {
  color: #336688;
}

/* Covenant tx highlight */
.chain-entry.covenant-tx {
  background: rgba(212, 168, 71, 0.06);
  border-left: 2px solid #d4a847;
  padding-left: 0.5rem;
}

.chain-entry.covenant-tx .ce-label {
  color: #d4a847;
  font-weight: 700;
}

.chain-entry.covenant-tx .ce-detail {
  color: #887744;
  font-size: 0.7rem;
}

.ce-txlink {
  color: var(--primary, #70c7ba);
  text-decoration: none;
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.5rem;
}
.ce-txlink:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  #terminal {
    height: 500px;
    margin: 1rem;
    padding: 1rem;
    font-size: 0.75rem;
  }

  #chain-log {
    margin: 0 1rem 2rem;
    font-size: 0.65rem;
  }

  #chain-feed { height: 140px; }

  .chain-disclaimer {
    margin: 1rem;
  }
}
