/* ============================================================
   3Powers — terminal component.
   A real terminal replay, not a screenshot: rows are typed in
   character by character. Palette matches the engine's output.
   ============================================================ */

.terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-edge);
  border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  container-type: inline-size;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--term-chrome);
  border-bottom: 1px solid var(--term-edge);
}
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.terminal-bar i:nth-child(1) { background: #c9534d; }
.terminal-bar i:nth-child(2) { background: #cfa94d; }
.terminal-bar i:nth-child(3) { background: #5da35f; }
.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--term-dim);
}

.terminal-body {
  padding: 22px 26px 20px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--term-txt);
  min-height: 21.6em;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
}
.terminal-body .row { display: block; min-height: 1.72em; }
.terminal-body .row.blank { min-height: 0.9em; }

/* segment colours */
.t-txt { color: var(--term-txt); }
.t-d   { color: var(--term-dim); }
.t-c   { color: var(--term-cyan); }
.t-ok  { color: var(--term-green); }
.t-no  { color: var(--term-red); }
.t-am  { color: var(--term-amber); }
.t-mg  { color: var(--term-magenta); }
.t-b   { font-weight: 600; }

.terminal-caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  vertical-align: -0.16em;
  background: var(--term-cyan);
}
@media (prefers-reduced-motion: no-preference) {
  body[data-motion="on"] .terminal-caret { animation: caret-blink 0.9s steps(1) infinite; }
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* ---- footer: caption + frame ticks + transport ---- */
.terminal-foot {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 12px 20px 13px;
  border-top: 1px solid var(--term-edge);
}
.terminal-caption {
  flex: 1;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--term-txt);
}
.terminal-transport { display: flex; align-items: center; gap: 6px; flex: none; }
.tbtn {
  border: 1px solid var(--term-edge);
  background: transparent;
  color: var(--term-dim);
  border-radius: var(--radius-sharp);
  width: 30px; height: 26px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.tbtn:hover { color: var(--term-cyan); border-color: var(--term-cyan); }
.tbtn svg { width: 12px; height: 12px; fill: currentColor; }

.ticks { display: flex; gap: 9px; flex: none; }
.ticks button {
  width: 30px; height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--term-idle);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ticks button:hover { transform: scaleY(2); }
.ticks button[aria-current="true"] { background: var(--term-cyan); }
.ticks button[data-done="true"] { background: #4d6b74; }

@container (max-width: 620px) {
  .terminal-body { font-size: 10.5px; padding: 16px 14px; }
  .terminal-foot { flex-wrap: wrap; }
  .ticks button { width: 18px; }
}
