/* Paper terminal view (2D/3D/Papier/PDP-11 share one game). */
.tty {
  --lh: 20px;
  --cols: 76;
  width: min(calc(92vw - 32px), 860px);
  height: calc(var(--size) + 40px);
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55);
}

.tty-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #1a1816;
  font-size: .85rem;
}
.tty-bar select, .tty-bar button {
  padding: 4px 8px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #33302c;
  color: #eee;
  font: inherit;
  font-weight: 400;
}
.tty-hint { margin-left: auto; color: #999; }
.tty-check { display: flex; align-items: center; gap: 4px; color: #ccc; }

.paper-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(ellipse at bottom, #3a3632, #1c1a18 75%);
}

.paper {
  width: calc(var(--cols) * 1ch + 130px);
  min-height: 100%;
  flex-shrink: 0;
  padding: 0 50px;
  font: 600 15px/var(--lh) "Courier New", Courier, monospace;
  color: #1d1d2b;
  background:
    radial-gradient(circle, #24211f 5px, transparent 6px) 12px 0 / 20px 40px repeat-y,
    radial-gradient(circle, #24211f 5px, transparent 6px) right 12px top 0 / 20px 40px repeat-y,
    #fbfbf2;
  box-shadow: 0 0 30px rgba(0, 0, 0, .6);
}

.lines {
  min-height: 100%;
  padding-left: 6px;
  border-left: 1px dashed #c9c9bb;
  border-right: 1px dashed #c9c9bb;
  /* Green-bar listing paper, with a perforation every 66 lines. */
  background:
    repeating-linear-gradient(to bottom, transparent 0 calc(66 * var(--lh) - 2px), #b8b8a8 calc(66 * var(--lh) - 2px) calc(66 * var(--lh))),
    repeating-linear-gradient(to bottom, #d9ecd6 0 calc(3 * var(--lh)), transparent calc(3 * var(--lh)) calc(6 * var(--lh)));
}

.line { position: relative; height: var(--lh); white-space: pre; }
.layer { position: absolute; left: 0; top: 0; text-shadow: 0 0 .7px rgba(20, 20, 40, .8); }

.head {
  position: absolute;
  top: -5px;
  left: calc(var(--col, 0) * 1ch);
  width: 2.2ch;
  height: calc(var(--lh) + 10px);
  border-radius: 3px;
  background: linear-gradient(to bottom, #55504a, #1f1d1b 45%, #8b1a1a 46% 60%, #1f1d1b 61%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .55);
  opacity: .9;
  pointer-events: none;
  transition: left 30ms linear;
}

.torn-sheet { transform-origin: bottom left; }

.printer {
  position: relative;
  height: 64px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, #d7cfb9, #b9b09a);
  border-top: 4px solid #8d8574;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .5);
}
.printer.asr33 { background: linear-gradient(to bottom, #cfc9b3, #a8a28c); }
.slot {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 8px;
  height: 8px;
  border-radius: 4px;
  background: #1b1916;
}
.brand {
  position: absolute;
  left: 24px;
  bottom: 12px;
  color: #3d3a33;
  font: 700 17px/1 "Arial Black", "Segoe UI", sans-serif;
  letter-spacing: 2px;
}
.lamp {
  position: absolute;
  right: 24px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5a1d1d;
}
.lamp.on { background: #ff3b2f; box-shadow: 0 0 12px #ff3b2f; }

/* /blindpdp11: only the paper, full screen, no menus. */
#blind-input {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 40px;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
}
html.blind, html.blind body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1c1a18;
}
html.blind header,
html.blind .panel,
html.blind .player-row,
html.blind .eval-bar,
html.blind .board,
html.blind .board3d,
html.blind .tty-bar { display: none !important; }
html.blind .layout, html.blind .board-area, html.blind .board-wrap { display: block; padding: 0; gap: 0; }
html.blind .tty {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100dvh;
  border-radius: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
html.blind .paper-view { padding-top: env(safe-area-inset-top); }
html.blind .paper {
  width: 100%;
  padding: 0 28px;
  box-shadow: none;
}
html.blind .printer { height: 52px; }
html.blind .brand { font-size: 14px; bottom: 9px; }
html.blind .lamp { bottom: 11px; }

@media print {
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .paper { position: absolute; left: 0; top: 0; box-shadow: none; }
  .head { display: none; }
}
