/* STARCHITECT home · "Command one fight" vignette (issue #3)
   Roles: gold = the operator's decision and the chosen path; cyan = live links and sensors; dashed slate = lost.
   Square corners, no gradients, no pills. Three motion tokens, shared with cmd-scene.js. */
.cmd {
  --cmd-signal: 600ms linear;
  --cmd-decide: 1200ms cubic-bezier(.65, 0, .35, 1);
  --cmd-settle: 400ms cubic-bezier(.16, 1, .3, 1);
  --cmd-lost: #6B7588;
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); grid-template-areas: "side stage";
  gap: 40px; align-items: start; text-align: left;
}
.cmd-stage { grid-area: stage; margin: 0; }
.cmd-side { grid-area: side; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }

/* Keep the page width fixed while the vignette changes height (classic scrollbars). */
html { scrollbar-gutter: stable; }
/* Every prompt and every consequence panel shares one grid cell, so the column keeps the height of the tallest. */
.cmd-stack { display: grid; }
.cmd-stack > * { grid-area: 1 / 1; visibility: hidden; }
.cmd-stack > .is-on { visibility: visible; }

/* ---- scene ---- */
.cmd-view { position: relative; aspect-ratio: 16 / 10; background: var(--void); border: 1px solid var(--hair); overflow: hidden; }
.cmd-poster, .cmd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cmd-poster { object-fit: cover; }
.cmd-canvas { opacity: 0; transition: opacity var(--cmd-settle); }
.cmd-live .cmd-canvas { opacity: 1; }
.cmd-live .cmd-poster { visibility: hidden; transition: visibility 0s 400ms; }
.cmd-labels { position: absolute; inset: 0; pointer-events: none; transition: opacity var(--cmd-settle); display: none; }
.cmd-live .cmd-labels { display: block; }
.cmd-tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; margin: -30px 0 0 14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan);
  padding: 2px 6px; background: rgba(6, 11, 23, .72); border-left: 1px solid currentColor;
}
.cmd-tag[data-node="G1"], .cmd-tag[data-node="G2"] { margin: 8px 0 0 10px; }
.cmd-tag.is-flip { margin-left: -14px; translate: -100% 0; border-left: 0; border-right: 1px solid currentColor; }
.cmd-tag.is-below { margin-top: 10px; }
.cmd-tag.is-lost { color: var(--cmd-lost); border-left-style: dashed; text-decoration: line-through; text-decoration-thickness: 1px; }
.cmd-tag.is-chosen { color: var(--gold); }
.cmd-strip {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 7px 14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
  background: rgba(6, 11, 23, .82); border-top: 1px solid var(--hair);
}
.cmd-readout {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 2px 0;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--bone);
}
.cmd-ladder { display: inline-flex; gap: 4px; flex: none; }
.cmd-ladder i {
  font-style: normal; width: 24px; height: 24px; display: inline-grid; place-items: center;
  border: 1px solid var(--hair); color: var(--mute-text); font-size: 12px; letter-spacing: 0;
}
.cmd-ladder i.is-on { border-color: var(--gold); color: var(--gold); }
.cmd[data-state="t0"] .cmd-ladder i.is-on { border-color: var(--cyan); color: var(--cyan); }
.cmd-ladder i.is-lost { border-style: dashed; border-color: var(--cmd-lost); color: var(--cmd-lost); text-decoration: line-through; }

/* ---- decision ---- */
.cmd-say { margin: 0; font-size: 18px; line-height: 1.6; color: var(--bone); max-width: 34em; }
.cmd [hidden] { display: none !important; }
.cmd-sever { border-radius: 0; }
.cmd-sever:disabled { opacity: .45; cursor: default; pointer-events: none; }
.cmd-coas { display: grid; gap: 8px; width: 100%; }
.cmd-coa {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%;
  padding: 14px 16px 13px; background: var(--panel); color: var(--bone); cursor: pointer; text-align: left;
  border: 1px solid var(--hair); border-top: 4px solid transparent; border-radius: 0;
  font-family: var(--font-sans); transition: border-color var(--cmd-settle), background var(--cmd-settle);
}
.cmd-coa b { font-size: 19px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cmd-coa span { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); }
.cmd-coa:hover:not(:disabled) { border-color: var(--gold); border-top-color: transparent; }
.cmd-coa.is-chosen { border-top-color: var(--gold); background: #15223A; }
.cmd-coa.is-chosen span { color: var(--gold); }
.cmd-coa:disabled { cursor: default; color: var(--mute-text); background: transparent; }
.cmd-coa:disabled span { color: var(--mute-text); }
.cmd-out { width: 100%; }
.cmd-panel { border-left: 1px solid var(--gold); padding: 2px 0 2px 18px; }
.cmd-panel.is-on { animation: cmd-settle var(--cmd-settle) both; }
.cmd-out-tier { margin: 0 0 6px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.cmd-out-text { margin: 0; font-size: 17px; line-height: 1.6; color: var(--bone); }
.cmd-hop { display: flex; gap: 0; margin-top: 14px; }
.cmd-hop button {
  padding: 9px 14px; background: transparent; color: var(--slate); cursor: pointer; border-radius: 0;
  border: 1px solid var(--hair); font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
}
.cmd-hop button + button { border-left: 0; }
.cmd-hop button b { font-weight: 500; color: var(--bone); }
.cmd-hop button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }
.cmd-hop button[aria-pressed="true"] + button { border-left: 1px solid var(--hair); }
.cmd-hop button[aria-pressed="true"] b { color: var(--gold); }
.cmd-foot { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.cmd-foot .btn-outline { border-radius: 0; }
.cmd-foot .btn-ghost { background: transparent; border: 0; }
.cmd-foot .btn:disabled { opacity: .4; cursor: default; pointer-events: none; }
.cmd-pace { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--mute-text); line-height: 2; padding-top: 18px; border-top: 1px solid var(--hair); width: 100%; }
.cmd-noscript { font-size: 15px; line-height: 1.6; color: var(--slate); }
.cmd .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.cmd button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.cmd-coa:focus-visible { outline-offset: 2px; }

@keyframes cmd-settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Phones: tap-through panels over a poster frame per state. */
@media (max-width: 767.98px) {
  /* Order: prompt, Sever, choices, then the poster and readout, then the consequence. */
  .cmd { display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .cmd-side { display: contents; }
  .cmd-say { order: 1; } .cmd-sever { order: 2; align-self: flex-start; } .cmd-coas { order: 3; }
  .cmd-stage { order: 4; scroll-margin: 96px 0 16px; } .cmd-out { order: 5; } .cmd-foot { order: 6; }
  .cmd-pace { order: 7; } .cmd-side > .btn-ghost { order: 8; align-self: flex-start; } .cmd-noscript { order: 9; }
  .cmd-readout { flex-wrap: wrap; font-size: 12px; }
  /* The poster sits in normal flow and the strip goes beneath it, so the strip never covers a label. */
  .cmd-view { aspect-ratio: auto; }
  .cmd-poster { position: static; height: auto; }
  .cmd-strip { position: static; font-size: 12px; letter-spacing: .06em; padding: 6px 10px; }
  .cmd-say { font-size: 17px; }
}
@media (min-width: 768px) and (max-width: 1080px) {
  .cmd { grid-template-columns: 1fr; grid-template-areas: "stage" "side"; }
  .cmd-coas { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion: no camera moves, paths drawn at once, panels swap. */
@media (prefers-reduced-motion: reduce) {
  .cmd-panel.is-on { animation: none; }
  .cmd-canvas, .cmd-labels, .cmd-coa { transition: none; }
}
