/* ─── 英文クイズ ───────────────────────────────────────────────────────────── */

/* ─── 型選択画面 ──────────────────────────────────────────────────────────── */
.sq-type-header {
  text-align: center;
  padding: 20px 0 24px;
}
.sq-type-title-main {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 900;
  color: #333;
}
.sq-type-sub {
  font-size: 1rem;
  color: #888;
  font-weight: 700;
  margin-top: 6px;
}

.sq-type-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.sq-type-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.sq-type-card::after {
  content: "▶";
  position: absolute;
  right: 22px;
  font-size: 1.1rem;
  opacity: .7;
}
.sq-type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.sq-type-card:active { transform: translateY(-1px); }

.sq-type-icon  { font-size: 2.4rem; flex-shrink: 0; }
.sq-type-title { font-size: 1.15rem; font-weight: 900; display: block; }
.sq-type-desc  { font-size: .82rem;  font-weight: 700; opacity: .88;   display: block; margin-top: 3px; }
.sq-type-count {
  margin-left: auto;
  margin-right: 28px;
  font-size: .85rem;
  font-weight: 800;
  background: rgba(255,255,255,.25);
  padding: 4px 12px;
  border-radius: 50px;
  flex-shrink: 0;
}

/* ─── セットバッジ ────────────────────────────────────────────────────────── */
.sq-set-badge-wrap {
  text-align: center;
  margin-bottom: 14px;
}
.sq-set-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 50px;
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .5px;
}



.sq-main {
  position: relative;
  z-index: 5;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ─── カード ──────────────────────────────────────────────────────────────── */
.sq-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 22px 24px;
  box-shadow: 0 6px 28px rgba(0,0,0,.10);
}

/* ─── 進捗バー ────────────────────────────────────────────────────────────── */
.sq-progress-bar {
  height: 8px;
  background: #EEE;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.sq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF7043, #FFB300);
  border-radius: 99px;
  transition: width .4s ease;
}

.sq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.sq-num   { font-size: .9rem; font-weight: 800; color: #888; }
.sq-score { font-size: .9rem; font-weight: 800; color: #FF7043; }

/* ─── 日本語の問題文 ──────────────────────────────────────────────────────── */
.sq-ja {
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 900;
  text-align: center;
  padding: 18px 16px;
  background: linear-gradient(135deg, #FFF8F0, #FFF3E0);
  border-radius: 16px;
  border-left: 5px solid #FF7043;
  margin-bottom: 18px;
  line-height: 1.7;
}

/* ─── 組み立て中の英文プレビュー ─────────────────────────────────────────── */
.sq-building {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 54px;
  padding: 10px 12px;
  background: #F5F5F5;
  border-radius: 14px;
  margin-bottom: 24px;
}
.sq-word-box {
  min-width: 64px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  border: 2.5px dashed #CCC;
  background: #fff;
  color: #aaa;
  transition: all .2s;
  letter-spacing: .5px;
}
.sq-word-box.filled {
  border-style: solid;
  border-color: #1976D2;
  background: #E3F2FD;
  color: #0D47A1;
}
.sq-word-box.correct {
  border-color: #43A047;
  background: #E8F5E9;
  color: #1B5E20;
}
.sq-word-box.wrong {
  border-color: #E53935;
  background: #FFEBEE;
  color: #B71C1C;
}
.sq-dot { font-size: 1.3rem; font-weight: 900; color: #555; }

/* ─── スロット（選択エリア）─────────────────────────────────────────────── */
.sq-slots {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.sq-slot-group {
  background: #FAFAFA;
  border: 2px solid #EEEEEE;
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color .2s;
}
.sq-slot-group.has-selection { border-color: #90CAF9; }
.sq-slot-group.all-correct   { border-color: #A5D6A7; background: #F1F8E9; }
.sq-slot-group.has-wrong     { border-color: #EF9A9A; background: #FFF8F8; }

.sq-slot-label {
  font-size: .82rem;
  font-weight: 900;
  color: #777;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sq-slot-label::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #FF7043;
}

.sq-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sq-choice {
  padding: 9px 20px;
  border: 2.5px solid #E0E0E0;
  border-radius: 50px;
  background: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .5px;
}
.sq-choice:hover:not(:disabled) {
  border-color: #1976D2;
  background: #E3F2FD;
  color: #0D47A1;
  transform: translateY(-2px);
}
.sq-choice.selected {
  border-color: #1976D2;
  background: #1976D2;
  color: #fff;
  box-shadow: 0 3px 10px rgba(25,118,210,.35);
}
.sq-choice.correct {
  border-color: #43A047;
  background: #43A047;
  color: #fff;
  box-shadow: 0 3px 10px rgba(67,160,71,.35);
}
.sq-choice.wrong {
  border-color: #E53935;
  background: #FFEBEE;
  color: #C62828;
}
.sq-choice.show-correct {
  border-color: #43A047;
  background: #E8F5E9;
  color: #1B5E20;
  animation: hint-pulse .6s ease;
}
.sq-choice:disabled { cursor: not-allowed; opacity: .7; transform: none !important; }

@keyframes hint-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* ─── こたえあわせボタン ──────────────────────────────────────────────────── */
.sq-check-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #FF7043, #FF8E53);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,112,67,.4);
  transition: all .2s;
  letter-spacing: .5px;
}
.sq-check-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,112,67,.55);
}
.sq-check-btn:disabled {
  background: #E0E0E0;
  color: #aaa;
  box-shadow: none;
  cursor: not-allowed;
}

/* ─── 正解フィードバック ──────────────────────────────────────────────────── */
.sq-feedback {
  display: none;
  text-align: center;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 900;
  margin-top: 16px;
  animation: fb-in .3s ease;
}
@keyframes fb-in {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.sq-feedback.correct-fb {
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  color: #2E7D32;
  border: 2px solid #A5D6A7;
}
.sq-feedback.wrong-fb {
  background: linear-gradient(135deg, #FFEBEE, #FFF8F8);
  color: #C62828;
  border: 2px solid #EF9A9A;
}
.sq-feedback-en {
  margin-top: 8px;
  font-size: 1.2rem;
  color: #1565C0;
  font-style: italic;
}

/* ─── つぎへボタン ────────────────────────────────────────────────────────── */
.sq-next-btn {
  display: none;
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #1976D2, #42A5F5);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(25,118,210,.38);
  transition: all .2s;
  letter-spacing: .5px;
}
.sq-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(25,118,210,.5);
}

/* ─── 🎉 全問正解アニメーション ───────────────────────────────────────────── */
@keyframes celebrate {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08) rotate(-2deg); }
  60%  { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1); }
}
.sq-card.all-correct-anim { animation: celebrate .5s ease; }

/* ─── 結果画面 ────────────────────────────────────────────────────────────── */
#sqResultScreen {
  display: none;
}
.sq-result-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 6px 28px rgba(0,0,0,.10);
}
.sq-result-stars {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: pop-in .5s ease;
}
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.sq-result-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #333;
  margin-bottom: 12px;
}
.sq-result-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: #FF7043;
  margin-bottom: 6px;
}
.sq-result-pct {
  font-size: 1rem;
  color: #888;
  font-weight: 700;
  margin-bottom: 28px;
}
.sq-result-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sq-btn-retry {
  padding: 14px;
  background: linear-gradient(135deg, #FF7043, #FF8E53);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,112,67,.38);
  transition: all .2s;
}
.sq-btn-retry:hover { transform: translateY(-2px); }
.sq-btn-back {
  padding: 14px;
  background: #F5F5F5;
  color: #555;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s;
}
.sq-btn-back:hover { background: #EEEEEE; }
