/* Old-school amber/green CRT terminal — Crypt of the Shared Shadow */

:root {
  --bg: #050807;
  --fg: #5cffb0;
  /* phosphor green */
  --fg-dim: #2da472;
  --fg-bright: #b6ffe0;
  --accent: #ffb454;
  /* amber for events/system */
  --danger: #ff6464;
  --chat: #9ad9ff;
  --self: #ffffff;
  --bar: #0a1410;
  --bar-fg: #5cffb0;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Courier New', 'Lucida Console', Monaco, monospace;
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}

.crt {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  position: relative;
  text-shadow: 0 0 2px var(--fg), 0 0 8px rgba(92, 255, 176, 0.35);
}

/* Scanlines */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.18) 3px,
      rgba(0, 0, 0, 0) 4px);
  z-index: 50;
  mix-blend-mode: multiply;
}

/* CRT vignette */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(ellipse at center, rgba(92, 255, 176, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 40;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: var(--bar);
  color: var(--bar-fg);
  border-bottom: 1px solid var(--fg-dim);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 20;
}

.status-center {
  opacity: 0.85;
}

.status-right {
  color: var(--danger);
}

.status-right.connected {
  color: var(--fg-bright);
}

/* Main row: text + art side-by-side */
.main-row {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* Output area */
.output {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 14px 18px 8px 18px;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-dim) transparent;
}

.output::-webkit-scrollbar {
  width: 8px;
}

.output::-webkit-scrollbar-thumb {
  background: var(--fg-dim);
  border-radius: 4px;
}

/* Art panel */
.art-panel {
  flex: 0 0 50%;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  white-space: pre;
  color: var(--fg-dim);
  font-size: 11px;
  line-height: 1.15;
  border-left: 1px solid var(--fg-dim);
  z-index: 10;
}

.art-panel.active {
  display: flex;
}

.line {
  margin: 0 0 4px 0;
}

.line.system {
  color: var(--accent);
}

.line.event {
  color: var(--fg-dim);
  font-style: italic;
}

.line.room {
  color: var(--fg-bright);
}

.line.chat {
  color: var(--chat);
}

.line.self {
  color: var(--self);
}

.line.echo {
  color: var(--fg-dim);
}

.line.error {
  color: var(--danger);
}

/* Prompt */
.prompt-form {
  display: flex;
  align-items: center;
  padding: 8px 14px 12px 14px;
  border-top: 1px solid var(--fg-dim);
  background: var(--bg);
  z-index: 10;
}

.prompt-glyph {
  color: var(--fg-bright);
  margin-right: 8px;
  font-weight: bold;
}

.prompt-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  caret-color: transparent;
  /* we draw our own */
  text-shadow: inherit;
}

.cursor {
  color: var(--fg-bright);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

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

/* Subtle phosphor flicker */
@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  47% {
    opacity: 0.985;
  }

  49% {
    opacity: 0.96;
  }

  52% {
    opacity: 1;
  }

  85% {
    opacity: 0.99;
  }
}

.crt {
  animation: flicker 6s infinite;
}

@media (max-width: 600px) {

  html,
  body {
    font-size: 14px;
  }

  .status-bar {
    font-size: 11px;
    padding: 5px 10px;
  }

  .art-panel {
    display: none !important;
  }
}