/* =========================================================================
   全体設定
   ========================================================================= */
body {
  margin: 0;
  padding: 0;
  background-color: #ffffff; /* シンプルな白背景 */
  color: #333333; /* 読みやすい濃いグレー */
  font-family: 'Noto Sans JP', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* =========================================================================
   UI コンポーネント
   ========================================================================= */

/* インジケーター (カメラ動作中) */
.indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666666;
}

.indicator .dot {
  width: 10px;
  height: 10px;
  background-color: #4CAF50;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
  animation: blink 1.5s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.3; }
}

/* メインコンテナ */
.container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* メッセージ表示 (エラー、ローディング) */
.status-message {
  font-size: 18px;
  margin-bottom: 20px;
  color: #555555;
}

.error-message {
  color: #d32f2f;
  font-size: 16px;
  /* オレンジっぽい背景・枠を削除してシンプルなテキストに */
  padding: 10px 0;
  margin-bottom: 20px;
}

/* 表情表示エリア */
.expression-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.expression-label {
  font-size: 28px;
  margin: 0 0 15px 0;
  min-height: 40px; /* 文字がないときのレイアウト崩れ防止 */
  font-weight: 700;
  letter-spacing: 2px;
}

.expression-image {
  width: 100%;
  max-width: 250px; /* 大幅に小さく調整 */
  height: auto;
  min-height: 150px; /* 小さくした分領域も縮小 */
  object-fit: contain;
  /* 背景色や影（枠っぽく見えるもの）を無くしてシンプルに */
  transition: opacity 0.3s ease-in-out;
  margin-bottom: 15px;
  opacity: 1; /* デフォルトで表示しておく */
}

.expression-score {
  font-size: 14px;
  color: #aaaaaa;
  min-height: 20px;
}

/* =========================================================================
   ユーティリティクラス
   ========================================================================= */
.hidden {
  display: none !important;
}

/* =========================================================================
   カメラと感情パラメーターウィジェット（右下）
   ========================================================================= */
#camera-widget {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 200px; /* 小さめに表示 */
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 10px;
  display: flex; /* JavaScriptで初期化後に表示するため通常はflexまたはnone */
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  border: 1px solid #eeeeee;
}

#video {
  width: 100%;
  border-radius: 4px;
  background-color: #000;
  display: block; /* 以前はdisplay:noneでしたが表示するように変更 */
  transform: scaleX(-1); /* カメラ映像を鏡写しにする場合 */
}

/* 感情パラメータのプログレスバーコンテナ */
#emotion-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.emotion-bar-row {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #555;
  height: 12px;
}

.emotion-label {
  width: 45px;
  text-align: right;
  margin-right: 8px;
  white-space: nowrap;
}

.progress-container {
  flex: 1;
  background-color: #efefef;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background-color: #4CAF50;
  height: 100%;
  width: 0%;
  transition: width 0.1s ease-out, background-color 0.1s;
}
