/* ══════════════════════════════════════
   ACTIVITY.CSS — Full activity page styles
══════════════════════════════════════ */

/* ─── Topic cards (Level 1 — list of topics) ─── */
.hw-topic-list,
.hw-topic-cards {
  padding: 0 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.hw-topic-card {
  border-radius: 16px; overflow: hidden;
  border: 1.5px solid var(--border);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  background: var(--white);
}
.hw-topic-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.hw-topic-card:active { transform: scale(0.98); }
.hw-topic-banner {
  height: 6px; width: 100%;
}
.hw-topic-body {
  padding: 18px 20px 16px;
  display: flex; align-items: center; gap: 16px;
}
.hw-topic-icon { font-size: 34px; flex-shrink: 0; }
.hw-topic-info { flex: 1; }
.hw-topic-name { font-size: 16px; font-weight: 900; color: var(--black); line-height: 1.2; }
.hw-topic-meta { font-size: 10px; color: var(--mid); margin-top: 4px; font-weight: 400; }
.hw-topic-progress-wrap { margin-top: 10px; }
.hw-topic-progress-label {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--mid); margin-bottom: 4px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.hw-topic-bar-outer { background: var(--border); border-radius: 10px; height: 5px; overflow: hidden; }
.hw-topic-bar-inner { height: 100%; border-radius: 10px; transition: width 0.4s; }
.hw-topic-arrow {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  background: var(--off); color: var(--mid);
  transition: all 0.15s;
}
.hw-topic-card:hover .hw-topic-arrow { color: var(--white); }

/* ─── Activity list (Level 2 — activities inside a topic) ─── */
.act-list-page { display: none; }
.act-list-page.active { display: block; }

.act-list-hero {
  padding: 28px 22px 24px; border-bottom: 1px solid var(--border);
  position: relative;
}
.act-list-hero::before {
  content: ''; position: absolute;
  left: 0; top: 0; width: 4px; height: 100%;
}
.act-list-eyebrow {
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.act-list-eyebrow::before { content: ''; width: 16px; height: 2px; display: block; }
.act-list-title { font-size: 26px; font-weight: 900; color: var(--black); line-height: 1.1; letter-spacing: -0.5px; }
.act-list-sub { font-size: 12px; color: var(--mid); margin-top: 6px; line-height: 1.6; }

.act-cards { padding: 0 22px; display: flex; flex-direction: column; gap: 10px; }
.act-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: stretch;
}
.act-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.act-card.act-done { background: #f7fdf9; border-color: #c3e6d0; }
.act-card-stripe { width: 4px; flex-shrink: 0; }
.act-card-body { flex: 1; padding: 14px 16px; }
.act-card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.act-card.act-done .act-card-title { color: var(--green); }
.act-card-meta { font-size: 10px; color: var(--mid); margin-top: 3px; font-weight: 400; }
.act-card-status {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
}
.act-status-pill {
  font-size: 8px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 20px;
}
.act-status-done   { background: #e8f5ee; color: var(--green); }
.act-status-retry  { background: #fff8e6; color: var(--orange); }
.act-status-new    { background: var(--off); color: var(--mid); border: 1px solid var(--border); }
.act-score-badge {
  font-size: 11px; font-weight: 900; color: var(--blue);
}
.act-card-right {
  padding: 14px 16px 14px 0;
  display: flex; align-items: center;
  font-size: 18px; color: var(--mid);
}

/* ══════════════════════════════════════
   ACTIVITY PAGE (Level 3 — the quiz itself)
══════════════════════════════════════ */
.act-page { display: none; }
.act-page.active { display: block; }

/* header */
.act-header {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 57px; background: var(--white); z-index: 5;
}
.act-header-info { flex: 1; }
.act-header-title { font-size: 14px; font-weight: 900; color: var(--black); line-height: 1.2; }
.act-header-sub { font-size: 10px; color: var(--mid); margin-top: 2px; }
.act-progress-strip {
  height: 3px; background: var(--border); width: 100%;
}
.act-progress-fill {
  height: 100%; background: var(--blue);
  transition: width 0.3s ease;
}

/* question counter */
.act-q-counter {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--mid);
  padding: 14px 22px 0;
}

/* question card */
.act-question {
  margin: 12px 22px 0;
  background: var(--off); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px 18px;
}
.act-q-type-tag {
  font-size: 8px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
  display: inline-block; margin-bottom: 12px;
}
.act-q-type-mc   { background: #e8f0f9; color: var(--blue); }
.act-q-type-fill { background: #f7fce0; color: #7a8c00; }
.act-q-type-drag { background: #fdecea; color: var(--red); }
.act-q-type-match{ background: #ebe8f9; color: #7c3aed; }

.act-q-text {
  font-size: 15px; font-weight: 700; color: var(--black);
  line-height: 1.5; margin-bottom: 8px;
}
.act-q-hint {
  font-size: 11px; color: var(--mid); font-weight: 400;
  line-height: 1.5; margin-bottom: 16px;
  background: var(--white); border-radius: 8px;
  padding: 10px 12px; border: 1px solid var(--border);
  white-space: pre-line;
}
.act-q-example {
  background: var(--white); border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0; padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 11px; color: #444; line-height: 1.6;
  white-space: pre-line;
}

/* ── Multiple choice ── */
.mc-options { display: flex; flex-direction: column; gap: 8px; }
.mc-option {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 13px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.15s; font-family: 'Montserrat', sans-serif;
  text-align: left; width: 100%;
}
.mc-option:hover { border-color: var(--blue); background: #f0f6ff; }
.mc-option.selected { border-color: var(--blue); background: #e8f0f9; }
.mc-option.correct  { border-color: var(--green); background: #e8f5ee; pointer-events: none; }
.mc-option.wrong    { border-color: var(--red); background: #fdecea; pointer-events: none; }
.mc-option.disabled { pointer-events: none; opacity: 0.5; }
.mc-letter {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--off); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: var(--mid);
  flex-shrink: 0; transition: all 0.15s;
}
.mc-option.selected .mc-letter { background: var(--blue); border-color: var(--blue); color: var(--white); }
.mc-option.correct  .mc-letter { background: var(--green); border-color: var(--green); color: var(--white); }
.mc-option.wrong    .mc-letter { background: var(--red); border-color: var(--red); color: var(--white); }
.mc-text { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }

/* ── Fill in the blank ── */
.fill-wrap { position: relative; }
.fill-input {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 14px; font-family: 'Montserrat', sans-serif;
  color: var(--text); background: var(--white); outline: none;
  transition: border-color 0.15s;
}
.fill-input:focus { border-color: var(--blue); }
.fill-input.correct { border-color: var(--green); background: #e8f5ee; color: var(--green); }
.fill-input.wrong   { border-color: var(--red); background: #fdecea; color: var(--red); }
.fill-input:disabled { opacity: 0.8; }

/* ── Drag & drop ── */
.drag-sentence {
  font-size: 15px; font-weight: 600; color: var(--black);
  line-height: 2.2; margin-bottom: 14px; word-spacing: 4px;
}
.drag-blank {
  display: inline-block; min-width: 90px; height: 28px;
  border-bottom: 2.5px solid var(--blue); margin: 0 4px;
  vertical-align: middle; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--blue);
  padding: 0 8px; transition: all 0.15s;
  border-radius: 4px 4px 0 0;
}
.drag-blank.filled  { background: #e8f0f9; }
.drag-blank.correct { border-color: var(--green); background: #e8f5ee; color: var(--green); }
.drag-blank.wrong   { border-color: var(--red); background: #fdecea; color: var(--red); }
.drag-pool {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.drag-chip {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.drag-chip:hover  { border-color: var(--blue); background: #f0f6ff; color: var(--blue); }
.drag-chip.used   { opacity: 0.35; pointer-events: none; }

/* ── Match / Connect ── */
.match-wrap { display: flex; gap: 10px; }
.match-col  { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.match-item {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 0.15s; text-align: center;
  min-height: 42px; display: flex; align-items: center; justify-content: center;
}
.match-item.selected { border-color: var(--blue); background: #e8f0f9; color: var(--blue); }
.match-item.matched  { border-color: var(--green); background: #e8f5ee; color: var(--green); pointer-events: none; }
.match-item.wrong    { border-color: var(--red); background: #fdecea; color: var(--red); }
.match-item.disabled { pointer-events: none; opacity: 0.5; }

/* ── Nav buttons ── */
.act-nav {
  padding: 20px 22px; display: flex; gap: 10px;
}
.act-btn-next {
  flex: 1; padding: 14px; background: var(--blue); color: var(--white);
  border: none; border-radius: 12px; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  font-family: 'Montserrat', sans-serif; transition: background 0.15s;
}
.act-btn-next:hover { background: #153d6a; }
.act-btn-next:disabled { background: var(--border); color: var(--mid); cursor: default; }
.act-btn-check {
  flex: 1; padding: 14px; background: var(--red); color: var(--white);
  border: none; border-radius: 12px; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  font-family: 'Montserrat', sans-serif; transition: background 0.15s;
}
.act-btn-check:hover { background: #c0392b; }

/* ══════════════════════════════════════
   RESULTS SCREEN
══════════════════════════════════════ */
.act-results {
  padding: 40px 22px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.act-results-score-ring {
  width: 110px; height: 110px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 24px; border: 5px solid var(--border);
  position: relative;
}
.act-results-score-ring.excellent { border-color: var(--green); background: #e8f5ee; }
.act-results-score-ring.good      { border-color: var(--blue);  background: #e8f0f9; }
.act-results-score-ring.ok        { border-color: var(--orange);background: #fff8e6; }
.act-results-score-ring.bad       { border-color: var(--red);   background: #fdecea; }
.act-results-score-n {
  font-size: 30px; font-weight: 900; color: var(--black); line-height: 1;
}
.act-results-score-l {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--mid); margin-top: 2px;
}
.act-results-title { font-size: 22px; font-weight: 900; color: var(--black); margin-bottom: 6px; }
.act-results-sub { font-size: 12px; color: var(--mid); line-height: 1.6; margin-bottom: 28px; }

/* review list */
.act-review-list {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
  text-align: left; margin-bottom: 28px;
}
.act-review-item {
  background: var(--off); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.act-review-item.r-correct { background: #e8f5ee; border-color: #c3e6d0; }
.act-review-item.r-wrong   { background: #fdecea; border-color: #f5c6c3; }
.act-review-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.act-review-body { flex: 1; }
.act-review-q    { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.act-review-your { font-size: 10px; color: var(--mid); }
.act-review-correct-ans { font-size: 10px; color: var(--green); font-weight: 700; margin-top: 2px; }

.act-retry-btn {
  width: 100%; padding: 14px; background: var(--blue); color: var(--white);
  border: none; border-radius: 12px; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  font-family: 'Montserrat', sans-serif; margin-bottom: 10px;
}
.act-retry-btn.locked {
  background: var(--off); color: var(--mid);
  border: 1px solid var(--border); cursor: default;
}
.act-back-btn-results {
  width: 100%; padding: 13px; background: none; color: var(--mid);
  border: 1px solid var(--border); border-radius: 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: 'Montserrat', sans-serif;
}

/* ══════════════════════════════════════
   🔊 LISTENING
══════════════════════════════════════ */
.act-q-type-listen { background: #e8f5ee; color: #1a7a40; }
.act-q-type-speak  { background: #fdecea; color: #c0392b; }

.listen-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.listen-play-btn {
  width: 100%; max-width: 280px;
  padding: 18px 24px;
  background: var(--blue); color: var(--white);
  border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; font-family: 'Montserrat', sans-serif;
  transition: all 0.2s; box-shadow: 0 4px 16px rgba(26,78,134,0.3);
}
.listen-play-btn:hover   { background: #153d6a; transform: translateY(-1px); }
.listen-play-btn.playing { background: var(--green); animation: pulse 0.8s infinite; }
.listen-play-btn.played  { background: #153d6a; }
.listen-play-icon  { font-size: 28px; }
.listen-play-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(45,160,90,0.3); }
  50%       { box-shadow: 0 4px 28px rgba(45,160,90,0.6); }
}

.listen-played-hint {
  font-size: 11px; color: var(--mid); font-weight: 600;
  margin-top: 4px; text-align: center;
}
.listen-play-again {
  background: none; border: none; font-size: 11px; color: var(--mid);
  cursor: pointer; font-family: 'Montserrat', sans-serif; font-weight: 600;
  padding: 4px 0; text-decoration: underline;
}
.listen-play-again:hover { color: var(--blue); }

/* ══════════════════════════════════════
   🎤 SPEAKING — Game style
══════════════════════════════════════ */
.speak-game-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 4px 0;
}

/* header tag + phonetic */
.speak-game-header { text-align: center; }
.speak-game-tag {
  display: inline-block;
  background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 14px; border-radius: 20px;
  margin-bottom: 8px;
}
.speak-game-hint {
  font-size: 13px; color: var(--mid); font-style: italic;
  font-weight: 400; line-height: 1.5;
}

/* target number display */
.speak-game-target {
  width: 100%;
  background: linear-gradient(135deg, var(--blue) 0%, #0d3260 100%);
  border-radius: 20px; padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(26,78,134,0.35);
  position: relative; overflow: hidden;
}
.speak-game-target::before {
  content: ''; position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.speak-game-target::after {
  content: ''; position: absolute;
  bottom: -20px; left: -20px;
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.speak-game-number-display {
  font-size: 28px; font-weight: 900; color: var(--white);
  letter-spacing: 2px; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.speak-game-region {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7);
  margin: 6px 0 4px; letter-spacing: 0.5px;
}

/* sound wave animation */
.speak-wave-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; height: 36px;
}
.speak-wave-bar {
  width: 4px; background: var(--border);
  border-radius: 4px; height: 8px;
  transition: background 0.2s;
}
.speak-wave-wrap.active .speak-wave-bar {
  background: var(--red);
  animation: waveBounce 0.6s ease-in-out infinite;
}
.speak-wave-wrap.active .speak-wave-bar:nth-child(1) { animation-delay: 0s;    height: 14px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(2) { animation-delay: 0.1s;  height: 28px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(3) { animation-delay: 0.2s;  height: 36px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(4) { animation-delay: 0.15s; height: 22px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(5) { animation-delay: 0.05s; height: 30px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(6) { animation-delay: 0.25s; height: 18px; }
.speak-wave-wrap.active .speak-wave-bar:nth-child(7) { animation-delay: 0.1s;  height: 12px; }

@keyframes waveBounce {
  0%, 100% { transform: scaleY(0.5); }
  50%       { transform: scaleY(1.2); }
}

/* record button */
.speak-game-btn {
  width: 100%; padding: 16px 24px;
  background: var(--red); color: var(--white);
  border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; font-family: 'Montserrat', sans-serif;
  transition: all 0.2s; box-shadow: 0 4px 20px rgba(237,81,69,0.35);
}
.speak-game-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(237,81,69,0.45); }
.speak-game-btn:disabled { background: var(--border); color: var(--mid); box-shadow: none; cursor: default; transform: none; }
.speak-game-btn.recording {
  background: #c0392b;
  animation: recordPulse 0.7s ease-in-out infinite;
}
.speak-record-icon  { font-size: 22px; }
.speak-record-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(192,57,43,0.4); }
  50%       { box-shadow: 0 8px 36px rgba(192,57,43,0.7); transform: scale(1.02); }
}

/* transcript result */
.speak-result-wrap {
  width: 100%; background: var(--off);
  border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
}
.speak-result-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--mid); margin-bottom: 6px;
}
.speak-result-text {
  font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4;
}

/* unsupported */
.speak-unsupported {
  background: #fff8e6; border: 1px solid #fde9a0;
  border-radius: 12px; padding: 18px; font-size: 12px;
  color: #7a5a00; line-height: 1.6; text-align: center;
}
.speak-skip-btn {
  margin-top: 12px; padding: 10px 20px;
  background: var(--off); border: 1px solid var(--border);
  border-radius: 10px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: 'Montserrat', sans-serif; color: var(--mid);
}