:root {
  --bg-color: #121212;
  --panel-bg: #1e1e1e;
  --control-bg: #2d2d2d;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-color: #007acc;
  --border-color: #333;
  --floor-color: rgb(0, 0, 0);
  --slider-track: #444;
  --slider-thumb: #fff;
}

body {
  margin: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 5px 400px;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

.resizer {
  background-color: #333;
  cursor: col-resize;
  transition: background-color 0.2s;
  z-index: 10;
}

.resizer:hover,
.resizer.resizing {
  background-color: var(--accent-color);
}

/* 2D View Toggle Button */
.view-toggle-btn {
  background-color: #444;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.view-toggle-btn:hover {
  background-color: #555;
  border-color: #666;
}

.view-toggle-btn.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(0, 122, 204, 0.5);
}

/* --- Scene / Simulation Area --- */
.scene {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1500px;
  box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 1;
  transition: all 0.5s ease;
}

/* 2D View Mode */
.scene.top-view {
  perspective: none;
  background: #222;
}

.scene.top-view #stage {
  transform: scale(0.8); /* 全体が見えるように少し縮小 */
}

.scene.top-view .floor {
  transform: none; /* 回転を解除して平面に */
  border: 2px solid #666;
  background-color: #111;
}

.scene.top-view .back-wall {
  display: none; /* 平面図では壁は邪魔なので消すか、線で表現 */
}

.scene.top-view .back-lights-container {
  /* 舞台奥ライトの位置調整 */
  transform: translate3d(-50%, -50%, 0);
  top: 5%; /* 舞台の上端付近に配置 */
  width: 90%;
  display: none; /* 2Dモードでは非表示にする */
}

.scene.top-view .back-light {
  transform: none; /* ライトの傾きを解除 */
  border: 2px solid #888;
  background: #333;
}

/* 平面図モードでのスポットライト表示 */
.scene.top-view .spotlight {
  border: 2px dashed rgba(255, 255, 255, 0.3); /* 照射範囲を点線で */
  background-image: none !important; /* グラデーションを消す */
  background-color: rgba(255, 255, 255, 0.1);
}

/* 中心点（灯体位置）を表示 */
.scene.top-view .spotlight::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 5px #000;
}

#stage {
  width: 90%;
  height: 90%;
  max-width: 1000px;
  max-height: 600px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-15deg) translateZ(-150px);
  aspect-ratio: 16/9;
  transition: transform 0.5s ease;
}

.floor {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #333;
  border: 1px solid #444;
  transform: rotateX(90deg) translateZ(-200px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  transform-style: preserve-3d;
  position: relative;
  transition: transform 0.5s ease;
}

.floor::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--floor-color);
  filter: blur(6px);
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: screen; /* 黒(0,0,0)の時は透明になり、色がある時だけ光るようにする */
}

.back-wall {
  position: absolute;
  width: 110%;
  height: 100%;
  background-color: #333;
  border: 1px solid #444;
  transform: translateZ(-400px) translateY(-95%) translateX(-5%);
  background: linear-gradient(to top, #222, #444);
}

/* --- Spotlights --- */
.spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform-origin: center;
  pointer-events: none;
}

#host-spotlight {
  top: 65%;
  left: 70%;
}
#back-right-spotlight {
  top: 45%;
  left: 65%;
}
#back-left-spotlight {
  top: 45%;
  left: 35%;
}
#front-left-spotlight {
  top: 65%;
  left: 30%;
}
#front-right-spotlight {
  top: 65%;
  left: 70%;
}

/* --- Back Lights --- */
.back-lights-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%; /* 舞台幅いっぱいに */
  /* 床の高さ(translateZ(-200px) after rotateX(90deg) -> Y=+200px)に合わせる */
  /* 奥(-350px)に配置 */
  transform: translate3d(-50%, calc(-50% + 200px), -350px);
  transform-style: preserve-3d;
  z-index: 10;
  background: transparent;
  border: none;
  padding: 0 5%; /* 両端に余白 */
  box-sizing: border-box;
  pointer-events: none; /* クリックを邪魔しないように */
  display: flex;
  justify-content: center;
}

.light-row {
  display: flex;
  gap: 0; /* gapなしで均等配置 */
  justify-content: space-between; /* 端から端まで配置 */
  align-items: flex-end; /* 下揃え */
  flex-wrap: nowrap;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.back-light {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  background: #111; /* JSが上書きするが初期値として */
  border: 1px solid #333;
  border-radius: 50%;
  position: relative;
  pointer-events: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  transform-style: preserve-3d;
  z-index: 2;
  /* 少し上向きに傾けて立体感を出す */
  transform: rotateX(-30deg);
  margin-bottom: 8px; /* スタンドのスペース */
}

/* 筐体の厚み（側面・背面） */
.back-light::after {
  content: "";
  position: absolute;
  top: 40%;
  left: -2px;
  right: -2px;
  bottom: -5px; /* 下に伸ばして厚みを出す */
  background: linear-gradient(to bottom, #333, #000);
  border: 1px solid #222;
  border-top: none;
  border-radius: 0 0 50% 50% / 0 0 100% 100%; /* 下半分を丸く */
  z-index: -1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

/* スタンド（脚） */
.back-light::before {
  content: "";
  position: absolute;
  bottom: -8px; /* 本体の下 */
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 4px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 1px;
  z-index: -2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.back-light.active {
  /* JSでbackgroundとbox-shadowが設定される */
  transform: rotateX(-30deg) translateY(-2px) scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.back-light.active::after {
  border-color: #444;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.back-light.active::before {
  background: #222;
}

/* --- Horizon Lights --- */
.horizon-light {
  position: absolute;
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.8;
}

#upper-left-horizon {
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(
      to right,
      rgba(74, 144, 255, 0.5) 0%,
      rgba(74, 144, 255, 0.5) 70%,
      rgba(74, 144, 255, 0) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(74, 144, 255, 0.5) 0%,
      rgba(74, 144, 255, 0) 100%
    );
}
#upper-right-horizon {
  top: 0;
  right: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(
      to left,
      rgba(255, 74, 144, 0.5) 0%,
      rgba(255, 74, 144, 0.5) 70%,
      rgba(255, 74, 144, 0) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(255, 74, 144, 0.5) 0%,
      rgba(255, 74, 144, 0) 100%
    );
}
#lower-left-horizon {
  bottom: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(
      to right,
      rgba(144, 255, 74, 0.3) 0%,
      rgba(144, 255, 74, 0.3) 70%,
      rgba(144, 255, 74, 0) 100%
    ),
    linear-gradient(
      to top,
      rgba(144, 255, 74, 0.3) 0%,
      rgba(144, 255, 74, 0) 100%
    );
}
#lower-right-horizon {
  bottom: 0;
  right: 0;
  width: 50%;
  height: 50%;
  background: linear-gradient(
      to left,
      rgba(255, 144, 74, 0.3) 0%,
      rgba(255, 144, 74, 0.3) 70%,
      rgba(255, 144, 74, 0) 100%
    ),
    linear-gradient(
      to top,
      rgba(255, 144, 74, 0.3) 0%,
      rgba(255, 144, 74, 0) 100%
    );
}

/* --- Vertical Fader Styles --- */
.fader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: transparent;
  border-radius: 4px;
  border: none;
  min-width: 60px;
}

.fader-wrapper {
  position: relative;
  width: 40px;
  height: 180px; /* フェーダーの長さ */
  display: flex;
  justify-content: center;
  align-items: center;
  background: #151515;
  border-radius: 4px;
  /* box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8); */
  margin: 10px 0;
}

.full-button {
  background-color: #333;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  width: 100%;
  margin-top: 5px;
  font-weight: bold;
  transition: all 0.2s;
}

.full-button:hover {
  background-color: #444;
  color: #fff;
}

.full-button.active {
  background-color: #ff9800;
  color: #000;
  border-color: #ff9800;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.full-button.blinking {
  animation: blink 0.5s infinite;
  background-color: #ff5722; /* 点滅時は少し赤っぽく */
  border-color: #ff5722;
}

/* 目盛り線 */
.fader-wrapper::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 2px;
  background: #333;
  transform: translateX(-50%);
  z-index: 0;
}

/* 目盛り（横線） */
.fader-wrapper::after {
  content: "";
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 25%;
  right: 25%;
  background: repeating-linear-gradient(
    to bottom,
    #444 0,
    #444 1px,
    transparent 1px,
    transparent 15px
  );
  z-index: 0;
  pointer-events: none;
}

input[type="range"].vertical-fader {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 160px; /* 高さになる */
  height: 40px; /* 幅になる */
  background: transparent;
  transform: rotate(-90deg);
  transform-origin: center;
  margin: 0;
  z-index: 1;
  cursor: pointer;
}

/* トラック（透明にして自前のデザインを表示） */
input[type="range"].vertical-fader::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
}

/* つまみ（リアルなデザイン） */
input[type="range"].vertical-fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 30px; /* つまみの幅（回転前は高さ） */
  width: 50px; /* つまみの高さ（回転前は幅） */
  background: linear-gradient(
    to right,
    #333,
    #555 20%,
    #888 50%,
    #555 80%,
    #333
  );
  border: 1px solid #111;
  border-radius: 2px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-top: 5px; /* 位置調整 */
  position: relative;
  z-index: 2;
}

/* つまみの中心線 */
input[type="range"].vertical-fader::-webkit-slider-thumb::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: #fff; /* 白い線 */
  transform: translateX(-50%);
}

/* Firefox対応 */
input[type="range"].vertical-fader::-moz-range-track {
  background: transparent;
}

input[type="range"].vertical-fader::-moz-range-thumb {
  height: 30px;
  width: 50px;
  background: linear-gradient(
    to right,
    #333,
    #555 20%,
    #888 50%,
    #555 80%,
    #333
  );
  border: 1px solid #111;
  border-radius: 2px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.fader-label {
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  margin-bottom: 5px;
  font-weight: bold;
}

.fader-value {
  font-family: "Consolas", monospace;
  font-size: 0.9rem;
  color: #0f0;
  background: #000;
  padding: 2px 5px;
  border-radius: 2px;
  min-width: 35px;
  text-align: center;
  border: 1px solid #333;
}

/* コンソール風レイアウト */
.console-row {
  display: flex;
  flex-wrap: nowrap; /* 折り返しなし */
  gap: 10px;
  justify-content: flex-start;
  overflow-x: auto; /* 横スクロールを許可 */
  padding-bottom: 15px; /* スクロールバーのスペース確保 */
  min-height: 350px; /* 高さを確保してスクロールバーと干渉しないように */
  align-items: flex-start;
}

/* スクロールバーのスタイル（Webkit） */
.console-row::-webkit-scrollbar {
  height: 8px;
}

.console-row::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 4px;
}

.console-row::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.console-row::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.console-section {
  display: flex;
  gap: 5px;
  background: #1a1a1a;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #333;
  flex-shrink: 0; /* 縮小しない */
}

/* --- Right Panel (Controls + Output) --- */
.right-panel {
  background-color: var(--panel-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  background-color: #1a1a1a;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px;
  cursor: pointer;
  font-weight: bold;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.tab-btn:hover {
  background-color: #252525;
  color: var(--text-color);
}

.tab-btn.active {
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  background-color: #222;
}

.tab-content {
  display: none !important;
}

.tab-content.active {
  display: flex !important;
}

.controls {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Scrollbar Styling */
.controls::-webkit-scrollbar,
.parameter-output::-webkit-scrollbar,
#current-params::-webkit-scrollbar,
#change-log::-webkit-scrollbar {
  width: 8px;
}
.controls::-webkit-scrollbar-track,
.parameter-output::-webkit-scrollbar-track,
#current-params::-webkit-scrollbar-track,
#change-log::-webkit-scrollbar-track {
  background: #1a1a1a;
}
.controls::-webkit-scrollbar-thumb,
.parameter-output::-webkit-scrollbar-thumb,
#current-params::-webkit-scrollbar-thumb,
#change-log::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}
.controls::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Control Sections */
.control-section {
  background-color: var(--control-bg);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.master-section {
  padding: 15px;
}

.master-section h3,
.control-section h4,
.controls h3 {
  margin: 0 0 15px 0;
  color: var(--text-color);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  font-weight: 600;
}

.controls h3 {
  margin-top: 10px;
  font-size: 1.1rem;
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
}

.master-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #282828 50%, #1a1a1a 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow-y: auto;
  border: 2px solid #333;
}

.master-section {
  background: linear-gradient(135deg, #3a3a3a 0%, #444 50%, #3a3a3a 100%);
  padding: 4px;
  border-radius: 0;
  border-left: 2px solid #666;
  border-top: none;
  border-right: none;
  border-bottom: none;
  display: flex !important;
  flex-direction: row;
  gap: 0;
  min-width: 150px;
  width: 150px;
  flex-shrink: 0;
  align-items: stretch;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.master-section h3 {
  display: none;
}

.master-controls {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex: 1;
}

.master-section .control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  border-left: 1px solid #666;
  padding: 0;
  background: transparent;
  box-shadow: none;
  min-width: 70px;
}

.master-section label {
  font-weight: bold;
  color: #fff;
  font-size: 0.7em;
  text-align: center;
}

#master-value,
#chase-value {
  color: #fff;
  font-weight: bold;
  font-size: 0.8em;
  text-align: center;
}

#chase-fader:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.controls h3 {
  display: none;
}

/* Faders container - everything except master */
.controls > *:not(.master-section) {
  display: flex !important;
  flex-wrap: wrap;
  flex: 1;
  align-content: flex-start;
}

.control-section {
  display: contents !important;
}

.control-section h4 {
  display: none;
}

.control-group {
  display: flex !important;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  padding: 0;
  background: linear-gradient(135deg, #2a2a2a 0%, #333 50%, #2a2a2a 100%);
  border-left: 1px solid #444;
  border-bottom: 1px solid #444;
  min-width: 50px;
  max-width: 70px;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-group label {
  font-weight: bold;
  color: #ccc;
  font-size: 0.65em;
  text-align: center;
  width: 100%;
  order: 2;
  line-height: 1.1;
  word-break: break-word;
}

/* Sliders */
input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--slider-track);
  border-radius: 3px;
  outline: none;
  margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--slider-thumb);
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-color);
}

input[type="color"] {
  width: 100%;
  height: 35px;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

/* --- Parameter Output --- */
.parameter-output {
  background-color: #252525;
  border-top: 1px solid var(--border-color);
  padding: 15px;
  display: flex;
  flex-direction: column;
  max-height: 35%;
  min-height: 200px;
  transition: all 0.3s ease;
}

.parameter-output.collapsed {
  max-height: 50px;
  min-height: 50px;
  padding-bottom: 0;
  overflow: hidden;
}

.parameter-output.collapsed .output-content,
.parameter-output.collapsed .output-buttons {
  display: none !important;
}

.output-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-color);
}

.toggle-panel-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.output-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.output-buttons button {
  background-color: #333;
  color: #ddd;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.output-buttons button:hover {
  background-color: #444;
  border-color: #555;
}

.output-content {
  display: flex;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.output-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1a1a1a;
  border-radius: 4px;
  padding: 5px;
}

.output-section h4 {
  margin: 5px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

#current-params,
#change-log {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  font-family: "Consolas", monospace;
  font-size: 0.8rem;
  color: #0f0;
  white-space: pre-wrap;
}

#change-log {
  color: #ff0;
}

.log-entry {
  padding: 2px 0;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-entry-text {
  flex: 1;
  word-break: break-all;
}

.log-entry-revert {
  background-color: #444;
  border: 1px solid #666;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 9px;
  color: #fff;
  cursor: pointer;
  margin-left: 5px;
}

.reset-button {
  background-color: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  font-weight: bold;
  margin-top: 5px;
}

.reset-button:hover {
  background-color: #b71c1c;
}

/* --- Back Light Beam Effect --- */
.back-light .beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px; /* ビームの幅を少し太く */
  height: 600px; /* ビームを長く */
  transform-origin: top center;
  /* 観客席（手前・上方向）に向かって伸びるように角度を調整 */
  /* 90degで手前（水平）、105degで少し上向き（カメラ目線） */
  transform: translate(-50%, 0%) rotateX(105deg);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 20;
  filter: blur(8px);
  border-radius: 50% 50% 0 0;
  mix-blend-mode: screen;
}
