/* 舞台の絵（LED・立ち絵）。stage.css の舞台の部分と同じ見た目を、リハーサルルームでも使うために分けたもの。
   舞台の見た目を変えるときは stage.css と両方を直してください */
.stage-scene {
  position: relative;
  width: min(800px, 100%);
  height: auto;
  aspect-ratio: 1920 / 700;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(220, 224, 255, .22);
  border-radius: 9px;
  background: #0c0d1a;
}

/* 舞台（butai_syukusyo.webp）の中央の透過窓の奥に、プロフィールと同じLED風の画面を置く */
.stage-led {
  position: absolute;
  left: 34.2%;
  top: .6%;
  width: 31.7%;
  height: 61.2%;
  z-index: 0;
  overflow: hidden;
  /* プロフィールの背景と同じ、暗めの紺色＋走査線 */
  background-color: #343454;
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4) 2px, transparent 2px, transparent 4px);
}
.stage-led-standing {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: 290% auto;
  background-position: 45% 2%;
  filter: brightness(1.45) contrast(1.7) saturate(1.5) blur(1.5px);
}
/* まとめたセリフ（2～5人）のときは、立ち絵だけを人数分の縦長の枠に並べる。区切りは2pxの黒い線 */
.stage-led-group {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--led-group-count, 2), minmax(0, 1fr));
  gap: 2px;
  background: #000;
}
.stage-led-group[hidden] { display: none; }
.stage-led-group-cell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #343454;
}
/* 立ち絵だけにLED風の加工をかける（枠の紺色は明るくしない） */
.stage-led-group-cell::before {
  position: absolute;
  inset: 0;
  background-image: var(--led-standing, none);
  background-repeat: no-repeat;
  background-size: auto 215%;
  background-position: 50% 2%;
  filter: brightness(1.45) contrast(1.7) saturate(1.5) blur(1.5px);
  content: "";
}
/* 台本に画像が出たら、画像全体が入るように合わせる（余白は黒） */
.stage-led-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}
.stage-led-image[hidden] { display: none; }
.stage-led::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, .5) 2px, transparent 2px, transparent 4px);
  content: "";
  pointer-events: none;
}
/* 台本の画像はLED風の加工をせず、そのまま映す */
.stage-led.is-image::after { display: none; }
.stage-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("../images/butai_syukusyo.webp") center / 100% 100% no-repeat;
  /* プロフィールと同じように舞台の絵を少しぼかす */
  filter: blur(1.5px);
  pointer-events: none;
}

.stage-scene::after {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 26%;
  content: "";
  background: linear-gradient(to top, rgba(3, 3, 10, .5), transparent);
  pointer-events: none;
}

.stage-cast {
  position: absolute;
  inset: 20% 7% 5%;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2px, 1.2vw, 16px);
}

.stage-cast-member {
  position: relative;
  display: grid;
  margin: 0;
  width: min(18%, 125px);
  min-width: 0;
  max-width: 125px;
  height: 100%;
  flex: 0 1 18%;
  align-items: end;
  justify-items: center;
}

.stage-cast-member img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 7px rgba(0, 0, 0, .55));
}

.stage-cast-member span {
  position: absolute;
  z-index: 3;
  bottom: 5px;
  max-width: 92%;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(7, 8, 21, .76);
  color: #fff;
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-cast-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  margin: 0;
  place-items: center;
  color: rgba(255, 255, 255, .76);
  text-shadow: 0 2px 12px #000;
}

@media (max-width: 640px) {
  .stage-scene { width: 100%; height: auto; }
}
