* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  background: #f7f9fc;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* スマホのブラウザUI分を差し引いた実際の表示高さ */
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ===== ヘッダー ===== */
.header {
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e3e8ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header h1 { font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #475569; }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.dot-gray  { background: #b0b8c4; }
.dot-green { background: #22c55e; }
.dot-red   { background: #ef4444; }

/* ===== 字幕エリア ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: row; /* 日本語・ベトナム語を左右に並べる */
  padding: 12px;
  gap: 12px;
  overflow: hidden;
}
.subtitle-pane {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.subtitle-pane.jp { border-left: 6px solid #3b82f6; }
.subtitle-pane.vn { border-left: 6px solid #f97316; }
.pane-label { font-size: 13px; color: #64748b; margin-bottom: 8px; font-weight: 600; }
.subtitle-text {
  flex: 1;
  font-size: 20px;
  line-height: 1.5;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.subtitle-text .interim { color: #94a3b8; }

/* ===== フッター(開始/停止ボタン) ===== */
.footer {
  padding: 12px 16px 16px;
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1px solid #e3e8ef;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lang-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}
.lang-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.lang-btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn.active.ja { border-color: #3b82f6; background: #3b82f6; color: #ffffff; }
.lang-btn.active.vi { border-color: #f97316; background: #f97316; color: #ffffff; }
.lang-btn.active { border-color: #3b82f6; background: #3b82f6; color: #ffffff; }

.toggle-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  background: #22c55e;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, transform 0.1s;
}
.toggle-btn:active { transform: scale(0.96); }
.toggle-btn.active { background: #ef4444; }
.hint { font-size: 13px; color: #64748b; text-align: center; min-height: 1.2em; padding: 0 8px; }

/* ============================================================
   Phase 2 追加スタイル（入室画面・終了オーバーレイ）
   ============================================================ */
.hidden { display: none !important; }

.app { display: flex; flex-direction: column; height: 100vh; }

.gate, .ended {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: #f4f6f8; padding: 24px;
}
.gate-card, .ended-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.10); padding: 28px 24px; text-align: center;
}
.gate-title { font-size: 24px; margin: 0 0 6px; color: #1b2733; }
.gate-lead { font-size: 15px; color: #50606e; margin: 0 0 18px; }
.gate-input {
  width: 100%; box-sizing: border-box; font-size: 22px; letter-spacing: 2px;
  text-align: center; text-transform: uppercase; padding: 14px 12px;
  border: 2px solid #cfd8e0; border-radius: 12px; margin-bottom: 14px;
}
.gate-input:focus { outline: none; border-color: #2f80ed; }
.gate-btn {
  width: 100%; font-size: 18px; font-weight: 700; color: #fff; background: #2f80ed;
  border: none; border-radius: 12px; padding: 14px; cursor: pointer;
}
.gate-btn:disabled { background: #9bb8e6; }
.gate-msg { min-height: 22px; margin-top: 12px; font-size: 14px; color: #d23b3b; white-space: pre-wrap; }
.gate-note { margin-top: 16px; font-size: 12px; color: #8a98a5; line-height: 1.6; }

.ended-msg { font-size: 16px; color: #1b2733; line-height: 1.7; margin-bottom: 18px; white-space: pre-wrap; }
