/* Android版KagariCollectorと同じ配色に合わせている。
   colors.xml (android/KagariCollector/.../res/values/colors.xml) 参照:
   bg_dark #2B2B2B / surface_gray #585858 / text_light #FFF / text_light_secondary #CCC
   icon_listening #666 / icon_ok #E53935 / icon_ng #3355FF */

:root {
  --bg-dark: #2b2b2b;
  --surface-gray: #585858;
  --text-light: #ffffff;
  --text-light-secondary: #cccccc;
  --icon-listening: #666666;
  --icon-ok: #e53935;
  --icon-ng: #3355ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px;
}

.hidden {
  display: none !important;
}

.spacer {
  flex: 1;
}

/* --- 開始画面 --- */

.intro-text {
  margin: 24px 0 0;
  font-size: 20px;
  line-height: 1.5;
}

.detail-text {
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light-secondary);
}

.name-row {
  display: flex;
  align-items: flex-end;
}

.icon-button {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: var(--surface-gray);
}

.icon-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.name-input {
  width: 100%;
  padding: 12px;
  font-size: 24px;
  text-align: center;
  color: var(--text-light-secondary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-light-secondary);
}

.name-input::placeholder {
  color: var(--text-light-secondary);
}

.start-row {
  display: flex;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 12px;
}

.start-note {
  margin: 0 0 32px;
  text-align: center;
  font-size: 14px;
  color: var(--text-light-secondary);
}

/* --- ボタン共通 --- */

.btn {
  border: none;
  border-radius: 4px;
  color: var(--text-light);
  background: var(--surface-gray);
  font-size: 16px;
  padding: 14px 16px;
}

.btn:disabled {
  opacity: 0.4;
}

.btn-inline {
  align-self: flex-start;
  margin-top: 24px;
}

.btn-start {
  flex: 2;
  font-size: 20px;
}

.btn-block {
  width: 100%;
  margin-top: 12px;
  font-size: 16px;
}

/* --- 録音画面 --- */

.recording-caption {
  margin-top: 24px;
  text-align: center;
  color: var(--text-light-secondary);
  font-size: 18px;
}

.phrase-text {
  height: 72px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 40px;
  text-align: center;
}

/* ic_listening/ic_result_ok/ic_result_ng は黒地の透過PNG(Android版のimageTintList前提の
   素材)なので、maskとして使いbackground-colorで色を付ける(imgのfilterでは狙った色を
   安定して出せないため) */
.result-icon {
  width: 140px;
  height: 140px;
  margin: 24px auto 0;
  display: block;
  background-color: transparent;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.result-icon.listening {
  background-color: var(--icon-listening);
  mask-image: url("icons/ic_listening.png");
  -webkit-mask-image: url("icons/ic_listening.png");
  animation: blink 1.4s ease-in-out infinite;
}

.result-icon.ok {
  background-color: var(--icon-ok);
  mask-image: url("icons/ic_result_ok.png");
  -webkit-mask-image: url("icons/ic_result_ok.png");
}

.result-icon.ng {
  background-color: var(--icon-ng);
  mask-image: url("icons/ic_result_ng.png");
  -webkit-mask-image: url("icons/ic_result_ng.png");
}

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

.progress-track {
  height: 8px;
  margin-bottom: 24px;
  background: #3a3a3a;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text-light);
  transition: width 0.15s ease-out;
}

/* --- 完了画面 --- */

.done-title {
  text-align: center;
  font-size: 24px;
  margin: 0;
}

.upload-status {
  text-align: center;
  margin-top: 12px;
  color: var(--text-light-secondary);
  font-size: 14px;
}

/* --- トースト（マイク権限エラー等） --- */

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 24px;
  padding: 14px 16px;
  background: #454545;
  color: var(--text-light);
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}
