/* =====================================================
   vocab-quiz.css — 英語単語クイズUI
   ===================================================== */

#vocab-quiz-app * { box-sizing: border-box; margin: 0; padding: 0; }

#vocab-quiz-app {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  color: #1a1a2e;
}

/* カード共通 */
.vq-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 32px 28px;
  animation: vq-fadein 0.3s ease;
}
@keyframes vq-fadein { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* =====================================================
   スタート画面
   ===================================================== */
.vq-logo {
  font-size: 22px;
  font-weight: 700;
  color: #0F6E56;
  margin-bottom: 28px;
  letter-spacing: 0.04em;
}
.vq-form { display: flex; flex-direction: column; gap: 20px; }
.vq-field { display: flex; flex-direction: column; gap: 6px; }
.vq-field label { font-size: 13px; font-weight: 500; color: #555; }
.vq-field select,
.vq-field input[type="number"] {
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.2s;
}
.vq-field select:focus,
.vq-field input:focus { border-color: #1D9E75; }
.vq-hint { font-size: 12px; color: #1D9E75; font-weight: 500; }

/* =====================================================
   ボタン
   ===================================================== */
.vq-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  letter-spacing: 0.02em;
}
.vq-btn:active { transform: scale(0.97); }
.vq-btn-primary { background: #1D9E75; color: #fff; width: 100%; padding: 14px; font-size: 16px; }
.vq-btn-primary:hover { opacity: 0.92; }
.vq-btn-next {
  width: 100%;
  margin-top: 16px;
  background: #f0f4f8;
  color: #1a1a2e;
  border: 1.5px solid #ddd;
}
.vq-btn-next:hover { background: #e4eaf0; }

/* =====================================================
   問題画面
   ===================================================== */
.vq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.vq-phase-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}
.vq-phase-new    { background: #E1F5EE; color: #085041; }
.vq-phase-review { background: #E6F1FB; color: #0C447C; }
.vq-counter { font-size: 13px; color: #888; }

.vq-progress-bar {
  height: 4px;
  background: #eee;
  border-radius: 99px;
  margin-bottom: 24px;
  overflow: hidden;
}
.vq-progress-fill {
  height: 100%;
  background: #1D9E75;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* タイマー */
.vq-timer-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}
.vq-timer-ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.vq-ring-bg { fill: none; stroke: #eee; stroke-width: 4; }
.vq-ring-fg {
  fill: none;
  stroke: #1D9E75;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s;
}
.vq-timer-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  transition: color 0.3s;
}

/* 単語表示 */
.vq-word-wrap { text-align: center; margin-bottom: 28px; }
.vq-word {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.vq-word-sub { font-size: 13px; color: #999; }

/* 選択肢 */
.vq-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.vq-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8f9fa;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  color: #1a1a2e;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1.5;
}
.vq-choice:hover:not(:disabled) {
  background: #edf7f3;
  border-color: #1D9E75;
  transform: translateX(2px);
}
.vq-choice:disabled { cursor: default; }
.vq-choice-num {
  min-width: 28px;
  height: 28px;
  background: #e8e8e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #555;
  flex-shrink: 0;
}
.vq-choice-text { flex: 1; }

/* 正解・不正解スタイル */
.vq-choice.vq-correct {
  background: #E1F5EE;
  border-color: #1D9E75;
}
.vq-choice.vq-correct .vq-choice-num { background: #1D9E75; color: #fff; }
.vq-choice.vq-wrong {
  background: #FCEBEB;
  border-color: #E24B4A;
}
.vq-choice.vq-wrong .vq-choice-num { background: #E24B4A; color: #fff; }

/* フィードバック */
.vq-feedback { text-align: center; min-height: 24px; font-weight: 600; font-size: 14px; }
.vq-fb-ok { color: #0F6E56; }
.vq-fb-ng { color: #A32D2D; }

/* =====================================================
   フェーズ移行・結果・その他
   ===================================================== */
.vq-transition { text-align: center; }
.vq-transition-icon {
  font-size: 48px;
  color: #1D9E75;
  margin-bottom: 16px;
}
.vq-transition h2 { font-size: 22px; margin-bottom: 10px; }
.vq-transition p  { color: #666; margin-bottom: 24px; }

.vq-result { text-align: center; }
.vq-result-title { font-size: 14px; color: #888; margin-bottom: 8px; font-weight: 500; }
.vq-result-rate {
  font-size: 72px;
  font-weight: 800;
  color: #1D9E75;
  line-height: 1;
  margin-bottom: 24px;
}
.vq-result-rate span { font-size: 32px; }
.vq-result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 16px;
}
.vq-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vq-stat-val { font-size: 28px; font-weight: 700; color: #1a1a2e; }
.vq-stat-val.vq-ok { color: #1D9E75; }
.vq-stat-val.vq-ng { color: #E24B4A; }
.vq-stat-label { font-size: 12px; color: #888; }
.vq-result-msg { color: #555; margin-bottom: 24px; font-size: 15px; }

.vq-loading, .vq-error, .vq-msg {
  text-align: center;
  padding: 48px 28px;
  color: #888;
}
.vq-spinner {
  width: 36px; height: 36px;
  border: 3px solid #eee;
  border-top-color: #1D9E75;
  border-radius: 50%;
  animation: vq-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes vq-spin { to { transform: rotate(360deg); } }

/* スマホ対応 */
@media (max-width: 480px) {
  .vq-card { padding: 24px 16px; }
  .vq-word { font-size: 28px; }
  .vq-choice { font-size: 13px; padding: 12px 14px; }
  .vq-result-rate { font-size: 56px; }
}
