/* =========================================================
   BeamCatalog — Terminal UI Styles
   Mobile + macOS Dock safe (iOS keyboard-proof)
========================================================= */

/* ─────────────────────────────
   GLOBAL RESET
───────────────────────────── */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #111;
  color: #0f0;
}

/* ─────────────────────────────
   MAIN STAGE (TERMINAL LAYOUT)
───────────────────────────── */
.stage {
  max-width: 900px;
  margin: auto;
  padding: 16px;

  height: 100dvh;              /* iOS-safe dynamic viewport */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────────────────────
   HEADER (STATIC)
───────────────────────────── */
.hero {
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.hero h1,
.hero p {
  margin: 5px;
}

.subtitle {
  color: #8f8;
  font-size: 0.9rem;
}

/* ─────────────────────────────
   VIEW BOX (ONLY SCROLL AREA)
───────────────────────────── */
.view-box {
  flex: 1;
  min-height: 0;               /* REQUIRED for flex scrolling */
  border: 1px solid #0f0;
  padding: 8px;

  overflow-y: auto;
  white-space: pre;            /* ASCII tables stay aligned */

  display: flex;
  flex-direction: column;

  -webkit-overflow-scrolling: touch;
/*  scroll-behavior: smooth; */
}

/* ─────────────────────────────
   OUTPUT BLOCKS
───────────────────────────── */
.block {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 10px;
  line-height: 1.45;
  white-space: inherit;        /* inherit from view-box */
}

.block.system {
  color: #6f6;
  opacity: 0.85;
}

.block.error {
  color: #f66;
}

.block.ownership {
  color: #ff0;
  font-weight: bold;
  margin-top: 12px;
}

/* ─────────────────────────────
   CURING ANIMATION
───────────────────────────── */
.block.system.curing::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

/* ─────────────────────────────
   INPUT BAR (PINNED / iOS SAFE)
───────────────────────────── */
.input-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;

  display: flex;
  align-items: center;

  background: #111;
  padding-bottom: env(safe-area-inset-bottom);
}

.input-bar input {
  width: 100%;
  padding: 12px;
  font-size: 18px;             /* prevents iOS zoom */

  background: #000;
  color: #0f0;
  border: 1px solid #0f0;
  outline: none;

  caret-color: #0f0;
}

/* Placeholder (Safari-safe) */
.input-bar input::placeholder {
  color: rgba(0, 255, 0, 0.35);
  opacity: 1;
}

.input-bar input::-webkit-input-placeholder {
  color: rgba(0, 255, 0, 0.35);
}

.input-bar input::-moz-placeholder {
  color: rgba(0, 255, 0, 0.35);
}

/* ─────────────────────────────
   OPTIONAL MOBILE HISTORY BUTTON
───────────────────────────── */
#history-btn {
  padding: 10px;
  cursor: pointer;
  opacity: 0.5;
  user-select: none;
}

@media (min-width: 601px) {
  #history-btn {
    display: none;
  }
}