/* HKIIT Stage3D — demo + label helpers (original) */
.stage3d-root,
.stage3d-canvas-host {
  width: 100%;
  height: 100%;
  min-height: 390px;
  background: #9eb6d6;
}

.stage3d-label {
  /* inline styles also set in JS for CDN robustness */
  font-variant-ligatures: none;
}

.stage3d-audience-label {
  font-variant-ligatures: none;
}

.stage3d-demo-page {
  margin: 0;
  font-family: system-ui, "Segoe UI", "Noto Sans TC", sans-serif;
  background: #0e1524;
  color: #e8eef8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.stage3d-demo-page header {
  padding: 8px 16px;
  border-bottom: 1px solid #2a3a55;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  background: #121c2e;
  flex: 0 0 auto;
}

.stage3d-demo-page header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.stage3d-demo-page header .sub {
  opacity: 0.75;
  font-size: 0.85rem;
}

/*
 * Layout: stage gets ~40% more relative height vs prior mini-mixer-heavy split.
 * Stage column spans full height; side stack (debug + compact mixer) is narrower
 * and the fake mixer is short. Shell Tab1 should mirror: stage viewport ~40% more
 * relative height than the mini-mixer strip (see docs/stage3d-contract.md §9).
 */
.stage3d-demo-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 280px);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  min-height: 0;
  /* Prefer tall stage area (~70–75vh usable after header) */
  min-height: calc(100vh - 52px);
}

#stage-root {
  grid-column: 1;
  grid-row: 1 / span 2;
  /* ~40% taller than prior 420px baseline → ~588px */
  min-height: 588px;
  height: 100%;
  border-right: 1px solid #2a3a55;
}

.stage3d-side {
  grid-column: 2;
  grid-row: 1;
  padding: 10px 12px;
  overflow: auto;
  border-bottom: 1px solid #2a3a55;
  background: #121c2e;
  min-height: 0;
}

.stage3d-mixer-fake {
  grid-column: 2;
  grid-row: 2;
  /* Compact mini mixer — shorter than before */
  padding: 6px 10px 8px;
  max-height: 168px;
  overflow: auto;
  background: #0a101c;
  border-top: 1px solid #2a3a55;
}

.stage3d-side h2,
.stage3d-mixer-fake h2 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: #f0d060;
}

.stage3d-mixer-fake h2 {
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.dbg-row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid #1e2a40;
}

.dbg-row .id {
  font-weight: 700;
  color: #9ec5ff;
}

.dbg-row button {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #c9a227;
  background: #2a2208;
  color: #ffe08a;
  cursor: pointer;
}

.dbg-row button:hover {
  background: #4a3a10;
}

.fake-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fake-ch {
  flex: 0 0 64px;
  background: #182338;
  border: 1px solid #2f4266;
  border-radius: 5px;
  padding: 4px;
  text-align: center;
  font-size: 0.68rem;
}

.fake-ch .screen {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  padding: 3px 2px;
  border-radius: 3px;
  border: 1px solid #556;
  background: #0c1524;
  color: #e8f0ff;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-size: 0.65rem;
}

.fake-ch .screen:hover {
  border-color: #ffee33;
  box-shadow: 0 0 8px rgba(255, 238, 51, 0.35);
}

.fake-ch label {
  display: block;
  opacity: 0.7;
  margin-top: 2px;
  font-size: 0.62rem;
}

.fake-ch input[type="range"] {
  width: 100%;
  height: 14px;
  margin: 0;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.35;
}

.stage3d-mixer-fake .hint {
  display: none; /* keep mixer strip compact; hints live in side panel */
}

@media (max-width: 860px) {
  .stage3d-demo-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(55vh, 1fr) auto auto;
    min-height: 0;
  }
  #stage-root {
    grid-column: 1;
    grid-row: 1;
    min-height: 55vh;
    border-right: none;
    border-bottom: 1px solid #2a3a55;
  }
  .stage3d-side,
  .stage3d-mixer-fake {
    grid-column: 1;
  }
  .stage3d-mixer-fake {
    max-height: 140px;
  }
}


/* --- Character Intro preview strip (demo / shell copyable) --- */
.stage3d-char-intro {
  flex: 0 0 auto;
  padding: 10px 16px 14px;
  border-top: 1px solid #2a3a55;
  background: #101a2c;
}

.stage3d-char-intro h2 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #f0d060;
}

.stage3d-char-intro > .hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
}

.stage3d-char-intro-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stage3d-char-card {
  flex: 0 0 auto;
  width: 140px;
  background: #152238;
  border: 1px solid #2f4266;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.stage3d-char-canvas-wrap {
  width: 140px;
  height: 168px;
  background: #0c182c;
}

.stage3d-char-preview {
  width: 100%;
  height: 100%;
  display: block;
}

.stage3d-char-label {
  padding: 6px 8px 8px;
  text-align: center;
  border-top: 1px solid #243552;
}

.stage3d-char-label strong {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #9ec5ff;
}

.stage3d-char-label span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  opacity: 0.8;
  color: #dce6f5;
}

@media (max-width: 860px) {
  .stage3d-char-card {
    width: 120px;
  }
  .stage3d-char-canvas-wrap {
    width: 120px;
    height: 144px;
  }
}
