/* Green-phosphor terminal look, in the spirit of a Правец-82 monitor. */

:root {
  --bg: #0a0f0a;
  --panel: #0e150e;
  --fg: #33ff66;
  --dim: #1f9c44;
  --faint: #145c2c;
  --accent: #aaffc3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "PT Mono", "Courier New", ui-monospace, monospace;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

main {
  width: 100%;
  max-width: 46rem;
}

/* faint scanlines */
.crt {
  position: relative;
}
.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 4px);
}

h1 {
  font-size: 2.6rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(51, 255, 102, 0.45);
}

.cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.subtitle { color: var(--dim); line-height: 1.5; margin: 0 0 1.5rem; }
.subtitle strong { color: var(--fg); font-weight: normal; }

.panel {
  background: var(--panel);
  border: 1px solid var(--faint);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 0 24px rgba(51, 255, 102, 0.07);
}

label { display: block; color: var(--dim); margin-bottom: 0.4rem; }

textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--faint);
  border-radius: 4px;
  padding: 0.7rem;
  font: inherit;
  font-size: 1.15rem;
  resize: vertical;
}
textarea:focus { outline: 1px solid var(--dim); }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.speed { flex: 1 1 14rem; margin: 0; }
.speed .hint { display: block; color: var(--faint); font-size: 0.8rem; }
input[type="range"] { width: 100%; accent-color: var(--fg); }

button, .button {
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover:not(:disabled), .button:hover { background: var(--accent); }
button:disabled { background: var(--faint); cursor: wait; }

canvas {
  width: 100%;
  height: 96px;
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--faint);
  border-radius: 4px;
  cursor: pointer; /* click to seek */
}

.transport {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
#playpause {
  min-width: 3.2rem;
  padding: 0.45rem 0;
  font-size: 1rem;
}
#time { color: var(--dim); min-width: 4.5rem; }
.transport input[type="range"] { flex: 1; width: auto; }
.transport .button { margin-left: auto; }

.examples {
  margin: 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--dim);
}
.examples .ex {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--faint);
  padding: 0.35rem 0.8rem;
  font-size: 0.95rem;
}
.examples .ex:hover { border-color: var(--fg); background: transparent; }

.help { color: var(--dim); line-height: 1.55; }
.help h2 { font-size: 1.1rem; color: var(--fg); }
.help table { border-collapse: collapse; }
.help td { padding: 0.15rem 1rem 0.15rem 0; vertical-align: top; }
.help td:first-child { color: var(--fg); white-space: nowrap; }
.help code { color: var(--accent); }

a { color: var(--accent); }

footer { margin-top: 2rem; color: var(--faint); font-size: 0.85rem; }
footer a { color: var(--dim); }
