/* 日本語⇄ミャンマー語 音声翻訳 PWA
   スマホ縦画面・片手操作前提。ミャンマー文字は Noto Sans Myanmar を優先 */

:root {
  --navy: #0e2038;
  --navy-light: #1b3a5e;
  --gold: #c9a227;
  --gold-light: #e0bc45;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-sub: #667080;
  --border: #dde3ea;
  --ok: #2e7d32;
  --ng: #c62828;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Noto Sans Myanmar", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  /* iPhoneのノッチ・ホームバー領域を避ける */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}

/* ---------- ヘッダー ---------- */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px 14px;
}

.app-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 10px;
}

.direction-toggle {
  display: flex;
  gap: 8px;
}

.dir-btn {
  flex: 1;
  min-height: 52px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid var(--navy-light);
  border-radius: 12px;
  background: var(--navy-light);
  color: #b9c5d4;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dir-btn.active {
  background: var(--gold);
  border-color: var(--gold-light);
  color: var(--navy);
}

.dir-btn .arrow { font-weight: 400; }

/* ---------- 結果表示 ---------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 12px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.result-source,
.result-target {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.source-text {
  font-size: 15px;
  color: var(--text-sub);
  min-height: 1.4em;
  line-height: 1.5;
}

.result-target {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
}

.target-text {
  /* 相手に画面を見せられる大きさ */
  font-size: 30px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
}

.placeholder {
  color: #aab3bf;
  font-weight: 400;
  font-size: 15px;
}

/* ---------- 録音ボタン ---------- */
.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.record-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  background: var(--navy);
  color: var(--gold-light);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 32, 56, 0.35);
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.record-btn:active { transform: scale(0.95); }

/* 聞き取り中: 金色に反転して点滅 */
.record-btn.recording {
  background: var(--gold);
  color: var(--navy);
  animation: recording-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.55); }
  50% { box-shadow: 0 0 0 14px rgba(201, 162, 39, 0); }
}

.record-label {
  font-size: 12px;
  font-weight: 600;
}

.record-note {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

/* ---------- 手入力欄 ---------- */
.hidden { display: none !important; }

.manual-input {
  display: flex;
  gap: 8px;
}

.manual-input input[type="password"] {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.manual-input textarea {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  resize: none;
}

.manual-input textarea:disabled { background: #eef1f5; color: var(--text-sub); }

.manual-btn {
  min-width: 92px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.manual-btn:disabled { background: #b6bfca; cursor: default; }

/* ---------- フッター ---------- */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-sub);
}

.server-status.ok { color: var(--ok); }
.server-status.ng { color: var(--ng); }
