/* Demo Theater — radio booth + matrix */

.theater-body { min-height: 100vh; }

.theater-main { padding-bottom: 3rem; }

.theater-hero {
  padding: 2.5rem 0 1.5rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.25fr 0.85fr;
  align-items: start;
}
@media (max-width: 900px) {
  .theater-hero { grid-template-columns: 1fr; }
}

.theater-lede { max-width: 38rem; }
.theater-lede strong { color: var(--green); font-weight: 650; }

.theater-intro {
  max-width: 38rem;
  margin: 0 0 1.25rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #152018aa, #121820);
}
.theater-intro .intro-kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber); margin: 0 0 .4rem;
}
.theater-intro p:last-child {
  margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55;
}
.theater-intro strong { color: var(--text); font-weight: 650; }

.theater-stats {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  margin: 0 0 1.25rem;
  font-family: var(--mono); font-size: .82rem; color: var(--muted);
}
.theater-stats .stat em {
  font-style: normal; color: var(--green); font-weight: 700; margin-right: .25rem;
}
.theater-stats .dim { color: var(--dim); }

.theater-actions {
  display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: .75rem;
}
.theater-actions .btn {
  border: none; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center;
  padding: .55rem 1.1rem; border-radius: 999px;
  text-decoration: none;
}
.theater-actions .btn:disabled {
  opacity: .45; cursor: not-allowed;
}
.theater-fine {
  font-size: .88rem; color: var(--dim); margin: 0;
}
.hp {
  position: absolute; left: -9999px; height: 0; overflow: hidden;
}

/* Poster */
.poster-card {
  position: relative;
  background: linear-gradient(160deg, #152018 0%, #121820 55%, #1a1520 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.2rem;
  box-shadow: 0 12px 40px #0006, inset 0 0 0 1px #7dd3a018;
  overflow: hidden;
}
.poster-marquee {
  margin: -1.35rem -1.4rem 0.85rem;
  padding: .35rem .75rem;
  background: linear-gradient(90deg, #3d2a10, #6b4a18, #3d2a10);
  border-bottom: 1px solid #e6c07b55;
  overflow: hidden;
}
.poster-marquee span {
  display: inline-block;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .22em;
  color: #f5d78e; white-space: nowrap;
  animation: marquee 12s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(8%); }
  100% { transform: translateX(-8%); }
}
.poster-kicker {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  color: var(--amber); margin-bottom: .35rem;
}
.poster-card h2 {
  margin: 0 0 .25rem; font-size: 1.35rem; letter-spacing: -0.02em;
}
.poster-sub {
  margin: 0 0 .85rem; font-size: .82rem; color: var(--muted);
  font-family: var(--mono);
}
.poster-card ol {
  list-style: none; margin: 0; padding: 0;
}
.poster-card li {
  display: flex; gap: .75rem; align-items: baseline;
  padding: .45rem 0; border-top: 1px solid #24304188;
  color: var(--muted); font-size: .95rem;
}
.poster-card li span {
  font-family: var(--mono); color: var(--green); font-weight: 700; min-width: 1.2rem;
}
.poster-ticket {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-top: 1rem; padding: .55rem .7rem;
  border: 1px dashed #7dd3a055; border-radius: 8px;
  background: #0d1410aa;
}
.ticket-stub {
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; color: var(--green);
  border: 1px solid var(--green-dim); border-radius: 4px;
  padding: .2rem .45rem;
}
.ticket-meta {
  font-family: var(--mono); font-size: .72rem; color: var(--dim);
}
.poster-note {
  margin: .85rem 0 0; font-size: .78rem; color: var(--dim);
  font-family: var(--mono);
}

/* Stage — slides in above architecture when the show starts */
.theater-stage {
  margin: 0.5rem auto 1.5rem;
  scroll-margin-top: 4.5rem;
}
.theater-stage[hidden] {
  display: none !important;
}
.theater-stage.curtain-up {
  animation: stagein .55s ease;
}
.theater-stage .scoreboard {
  animation: scorein .45s ease .1s both;
}
@keyframes stagein {
  from { opacity: 0; transform: translateY(-14px); max-height: 0; }
  to { opacity: 1; transform: none; max-height: 4000px; }
}
@keyframes scorein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Architecture sits below live show surfaces */
.arch-section {
  margin: 0.5rem auto 2.25rem;
  transition: margin .35s ease;
}
body.theater-on-air .arch-section {
  margin-top: 0.75rem;
}

.act-rail {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.act-chip {
  font-family: var(--mono); font-size: .78rem;
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
  background: var(--bg-elev);
  transition: .2s ease;
}
.act-chip.on {
  color: #0b0f14; background: var(--green); border-color: var(--green);
  font-weight: 650;
}
.act-chip.done {
  color: var(--green); border-color: var(--green-dim);
}

.booth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 860px) {
  .booth-grid { grid-template-columns: 1fr; }
}

.booth {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
  display: flex; flex-direction: column;
}
.booth-bar {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .85rem;
  background: #0d1218;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
}
.live-dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 0 transparent;
}
.live-dot.on {
  background: #e85d5d;
  box-shadow: 0 0 8px #e85d5d88;
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.term-dots { display: inline-flex; gap: 4px; }
.term-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3d4a5c; display: block;
}
.term-dots i:nth-child(1) { background: #e85d5d; }
.term-dots i:nth-child(2) { background: #e6c07b; }
.term-dots i:nth-child(3) { background: #7dd3a0; }

.booth-body {
  flex: 1;
  padding: .9rem 1rem 1.1rem;
  max-height: 380px;
  overflow-y: auto;
  font-size: .95rem;
  line-height: 1.55;
}
.booth-body.mono {
  font-family: var(--mono);
  font-size: .78rem;
  color: #8fdfb0;
  background: #070b0e;
  line-height: 1.45;
}

.radio-line {
  margin: 0 0 .65rem;
  padding-left: .75rem;
  border-left: 2px solid var(--amber);
  color: var(--text);
  animation: fadein .35s ease;
}
.radio-line .who {
  display: block;
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--amber); margin-bottom: .15rem;
}
.matrix-line {
  margin: 0 0 .2rem;
  opacity: 0;
  animation: matrixin .25s ease forwards;
  word-break: break-word;
}
.matrix-line .ts { color: #3d5a48; margin-right: .4rem; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes matrixin {
  from { opacity: 0; }
  to { opacity: .92; }
}

.scoreboard {
  position: relative;
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: 0 0 0 1px #7dd3a012, 0 16px 48px #0005;
}
.scoreboard.house-mode {
  box-shadow: 0 0 0 1px #e6c07b22, 0 16px 48px #0005;
}
.scoreboard-lights {
  height: 6px; margin: -1.25rem -1.35rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    repeating-linear-gradient(90deg,
      #7dd3a0 0 10px, #152018 10px 18px,
      #e6c07b 18px 28px, #152018 28px 36px,
      #e85d5d 36px 46px, #152018 46px 54px);
  opacity: .85;
}
.score-act {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber); margin: 0 0 .35rem;
}
.scoreboard h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
.scoreboard h2.pass { color: var(--green); text-shadow: 0 0 18px #7dd3a044; }
.scoreboard h2.fail { color: #e85d5d; }

.score-card { margin: 0 0 1.35rem; }
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
@media (max-width: 640px) {
  .score-grid { grid-template-columns: 1fr; }
}
.score-tile {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .85rem;
}
.score-tile .lbl {
  display: block;
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim); margin-bottom: .25rem;
}
.score-tile strong {
  font-size: .95rem; font-weight: 650; color: var(--text);
}
.score-tile.highlight strong.pos { color: var(--green); }
.score-tile.highlight strong.neg { color: var(--amber); }
.score-tile.net {
  grid-column: 1 / -1;
  border-color: var(--green-dim);
  background: linear-gradient(135deg, #152018, #121820);
}
.score-tile.net strong {
  font-size: 1.25rem; color: var(--green); font-family: var(--mono);
}
.score-note {
  margin: .85rem 0 0; font-size: .82rem; color: var(--dim);
  font-family: var(--mono);
}

.package-panel h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.package-panel .muted { color: var(--muted); font-size: .9rem; margin: 0 0 .75rem; }
.pkg-list {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: flex; flex-direction: column; gap: .35rem;
}
.pkg-list .muted { color: var(--muted); font-size: .9rem; padding: .35rem 0; }
.pkg-list .linkish,
button.linkish {
  background: none; border: none; color: var(--green); cursor: pointer;
  font: inherit; text-decoration: underline; padding: 0;
}
.pkg-list button {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--green); border-radius: 8px;
  padding: .55rem .8rem; font-size: .88rem;
}
.pkg-list button:hover { border-color: var(--green-dim); }
.pkg-list button.is-primary {
  border-color: var(--green-dim);
  box-shadow: inset 3px 0 0 var(--green);
}
.pkg-list button.is-active {
  background: #152018; border-color: var(--green); color: var(--text);
}
.pkg-viewer {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  margin-bottom: 1rem;
}
.pkg-viewer-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .45rem .75rem; background: #0d1218;
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
}
.btn-sm {
  padding: .25rem .6rem !important; font-size: .78rem !important;
  border-radius: 6px !important; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--muted);
}
.pkg-viewer-body {
  margin: 0; padding: .75rem .85rem 1rem;
  max-height: min(62vh, 640px); overflow: auto;
  font-family: var(--mono); font-size: .72rem;
  background: #070b0e; color: var(--text);
  /* Prefer no soft-wrap on ops sheets — horizontal scroll if still wide */
  white-space: pre;
  line-height: 1.4;
  overflow-x: auto;
  tab-size: 4;
}
/* Kitchen-table markdown glow */
.pkg-viewer-body.md {
  white-space: normal;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: .92rem;
  color: var(--text);
}
.pkg-viewer-body.md h1,
.pkg-viewer-body.md h2,
.pkg-viewer-body.md h3 {
  font-family: var(--sans, system-ui, sans-serif);
  letter-spacing: -0.02em;
  margin: 1.1rem 0 .45rem;
  color: var(--green);
}
.pkg-viewer-body.md h1 { font-size: 1.2rem; }
.pkg-viewer-body.md h2 { font-size: 1.05rem; border-bottom: 1px solid #24304188; padding-bottom: .25rem; }
.pkg-viewer-body.md h3 { font-size: .95rem; color: var(--amber); }
.pkg-viewer-body.md p { margin: .4rem 0 .65rem; color: var(--muted); line-height: 1.55; }
.pkg-viewer-body.md strong { color: var(--text); font-weight: 650; }
.pkg-viewer-body.md em { color: var(--amber); font-style: italic; }
.pkg-viewer-body.md blockquote {
  margin: .65rem 0; padding: .5rem .85rem;
  border-left: 3px solid var(--green);
  background: #0f1812; color: var(--muted); font-size: .88rem;
}
.pkg-viewer-body.md hr {
  border: 0; border-top: 1px dashed #243041; margin: 1rem 0;
}
.pkg-viewer-body.md table {
  width: 100%; border-collapse: collapse; margin: .65rem 0 1rem;
  font-family: var(--mono); font-size: .78rem;
}
.pkg-viewer-body.md th,
.pkg-viewer-body.md td {
  border: 1px solid #243041; padding: .35rem .5rem; text-align: left;
}
.pkg-viewer-body.md th {
  background: #0d1410; color: var(--green); font-weight: 650;
}
.pkg-viewer-body.md td { color: var(--text); }
.pkg-viewer-body.md tr:nth-child(even) td { background: #0a100c; }
.pkg-viewer-body.md code {
  font-family: var(--mono); font-size: .82em;
  background: #121820; padding: .05rem .3rem; border-radius: 4px;
  color: var(--green);
}
.pkg-viewer-body.md .md-line { white-space: pre-wrap; }

.cta-after {
  color: var(--muted); font-size: .95rem; margin: 0;
}
.cta-after a { font-weight: 600; }

footer .row {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
  color: var(--dim); font-size: .85rem;
  align-items: center;
}
footer .footer-whim {
  font-family: var(--mono); font-size: .78rem; color: var(--amber);
  letter-spacing: .04em;
}

/* ── Warm system badges ── */
.warm-badge-row {
  display: flex; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1.15rem;
}
.warm-badge {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .55rem; border-radius: 4px;
  border: 1px solid #3d8f6355;
  background: #0d1812;
  color: var(--green);
}
.warm-badge.live {
  border-color: #7dd3a0aa;
  box-shadow: 0 0 12px #7dd3a033;
  display: inline-flex; align-items: center; gap: .4rem;
}
.warm-badge.live i {
  width: .45rem; height: .45rem; border-radius: 50%;
  background: #7dd3a0;
  box-shadow: 0 0 6px #7dd3a0;
  animation: pulse 1.4s ease infinite;
}
.theater-intro code {
  font-family: var(--mono); font-size: .85em;
  background: #0d1410; color: var(--amber);
  padding: .05rem .3rem; border-radius: 3px;
}

/* ── AS/400-inspired network architecture (modern) ── */
.arch-panel {
  background:
    linear-gradient(180deg, #0a120e 0%, #0c1410 40%, #0b1014 100%);
  border: 2px solid #2a5a3e;
  border-radius: 6px;
  box-shadow:
    0 0 0 1px #7dd3a022,
    0 20px 50px #0008,
    inset 0 0 60px #7dd3a008;
  overflow: hidden;
}
.arch-panel-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem;
  padding: .45rem .85rem;
  background: linear-gradient(90deg, #0f2418, #143020 40%, #0f1a14);
  border-bottom: 1px solid #3d8f6388;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
}
.arch-sys { color: var(--green); font-weight: 700; }
.arch-status {
  color: #9eefb8; display: inline-flex; align-items: center; gap: .4rem;
}
.arch-blink {
  width: .5rem; height: .5rem; border-radius: 1px;
  background: #7dd3a0;
  box-shadow: 0 0 8px #7dd3a0;
  animation: pulse 1.2s step-end infinite;
}
.arch-panel-head {
  padding: 1.1rem 1.25rem .5rem;
}
.arch-panel-head h2 {
  margin: 0 0 .4rem; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--green);
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: .95rem;
  letter-spacing: .08em;
}
.arch-lead {
  margin: 0; max-width: 46rem;
  color: var(--muted); font-size: .95rem; line-height: 1.55;
}
.arch-lead strong { color: var(--text); }

.arch-diagram { padding: .5rem 1rem 1rem; }

/* Classic green-screen map */
.arch-ascii {
  margin: 0 0 1.1rem;
  padding: .9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.35;
  color: #8fefb0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      #00000018 2px,
      #00000018 4px
    ),
    #050a07;
  border: 1px solid #2a5a3e;
  border-radius: 4px;
  text-shadow: 0 0 6px #7dd3a044;
  white-space: pre;
}

/* Modern card flow (responsive) */
.arch-flow {
  display: none;
  align-items: stretch;
  gap: .45rem;
  flex-wrap: wrap;
}
@media (min-width: 920px) {
  .arch-flow {
    display: flex;
    flex-wrap: nowrap;
  }
  .arch-ascii { font-size: .72rem; }
}
@media (max-width: 919px) {
  .arch-flow {
    display: grid;
    grid-template-columns: 1fr;
  }
  .arch-arrow { transform: rotate(90deg); margin: .15rem auto; }
}
.arch-node {
  flex: 1 1 0;
  min-width: 0;
  background: #0d1611;
  border: 1px solid #2a5a3e;
  border-radius: 4px;
  padding: .75rem .7rem .7rem;
  position: relative;
}
.arch-node.warm {
  border-color: #7dd3a0;
  box-shadow: 0 0 0 1px #7dd3a044, 0 0 24px #7dd3a022;
  background: linear-gradient(160deg, #122418, #0d1611 60%);
}
.arch-node-tag {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  color: var(--amber); margin-bottom: .35rem;
}
.arch-node.warm .arch-node-tag { color: #9eefb8; }
.arch-node h3 {
  margin: 0 0 .35rem; font-size: .92rem; color: var(--text);
  font-family: var(--mono); font-weight: 650;
}
.arch-node p {
  margin: 0 0 .5rem; font-size: .8rem; color: var(--muted); line-height: 1.45;
}
.arch-node ul {
  margin: 0; padding: 0; list-style: none;
  font-family: var(--mono); font-size: .68rem; color: var(--green);
}
.arch-node li {
  padding: .12rem 0;
  border-top: 1px solid #1a3024;
}
.arch-node li:first-child { border-top: 0; }
.arch-arrow {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .08em;
  color: var(--amber);
  min-width: 2.2rem;
}
.arch-arrow span {
  border: 1px dashed #e6c07b55;
  padding: .25rem .35rem;
  border-radius: 3px;
  background: #12100a;
}

.arch-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1rem;
  padding: 0 1.25rem 1rem;
}
@media (max-width: 700px) {
  .arch-legend { grid-template-columns: 1fr; }
}
.arch-leg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .55rem;
  align-items: start;
}
.arch-pill {
  font-family: var(--mono); font-size: .65rem; font-weight: 700;
  letter-spacing: .06em;
  padding: .25rem .4rem;
  border: 1px solid #3d8f63;
  color: var(--green);
  background: #0a140f;
  white-space: nowrap;
}
.arch-pill.warm {
  border-color: #7dd3a0;
  box-shadow: 0 0 10px #7dd3a033;
  animation: pulse 2s ease infinite;
}
.arch-leg p {
  margin: 0; font-size: .82rem; color: var(--muted); line-height: 1.45;
}
.arch-leg code {
  font-family: var(--mono); font-size: .85em; color: var(--amber);
}
.arch-footnote {
  margin: 0;
  padding: .65rem 1.25rem .9rem;
  border-top: 1px solid #2a5a3e;
  font-family: var(--mono); font-size: .72rem; color: var(--dim);
  line-height: 1.5;
}
.arch-em { color: var(--green); }
.arch-footnote a { color: var(--amber); }
