@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&family=Baloo+2:wght@500;700;800&display=swap');

.yhwp-wrap {
  --blue: #1565C0;
  --blue-light: #E3F2FD;
  --yellow: #FFD600;
  --yellow-dark: #F9A825;
  --green: #2E7D32;
  --green-light: #E8F5E9;
  --red: #C62828;
  --red-light: #FFEBEE;
  --grey: #546E7A;
  --bg: #F0F7FF;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(21,101,192,0.10);
  font-family: 'Nunito', sans-serif;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.yhwp-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

/* CARD */
.yhwp-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.yhwp-card-title {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* SCORE ROW */
.yhwp-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.yhwp-score-bubble {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  border-radius: 14px;
  padding: 10px 18px;
  text-align: center;
  min-width: 78px;
  box-shadow: 0 3px 12px rgba(249,168,37,.22);
}
.yhwp-score-num {
  font-family: 'Baloo 2', cursive;
  font-size: 28px;
  font-weight: 800;
  color: #4E342E;
  line-height: 1;
}
.yhwp-score-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #795548;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.yhwp-streak {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #FFF3E0;
  border: 2px solid #FFCC02;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #E65100;
}
.yhwp-counter {
  text-align: right;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
}
.yhwp-counter small {
  display: block;
  font-size: 11px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--grey);
  text-transform: uppercase;
}

/* PROGRESS */
.yhwp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.yhwp-progress-bg {
  flex: 1;
  height: 8px;
  background: #E3F2FD;
  border-radius: 8px;
  overflow: hidden;
}
.yhwp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #42A5F5);
  border-radius: 8px;
  transition: width .4s ease;
}
.yhwp-progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  min-width: 36px;
  text-align: right;
}

/* SENTENCE CARD */
.yhwp-sentence-card {
  background: var(--blue);
  border-radius: var(--radius);
  padding: 22px 20px 16px;
  box-shadow: 0 6px 28px rgba(21,101,192,.18);
  position: relative;
  overflow: hidden;
}
.yhwp-sentence-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.yhwp-sentence-lbl {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.yhwp-sentence-text {
  font-family: 'Baloo 2', cursive;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}
.yhwp-sentence-vi {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  margin-top: 6px;
  font-style: italic;
}
.yhwp-btn-listen {
  margin-top: 12px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 10px;
  padding: 6px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.yhwp-btn-listen:hover { background: rgba(255,255,255,.25); }

/* RESULT WORDS */
.yhwp-result-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}
.yhwp-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Baloo 2', cursive;
  transition: all .3s;
}
.yhwp-chip.correct { background: var(--green-light); color: var(--green); border: 2px solid #A5D6A7; }
.yhwp-chip.wrong   { background: var(--red-light);   color: var(--red);   border: 2px solid #EF9A9A; text-decoration: line-through; }
.yhwp-spoken-info  { width: 100%; margin-top: 8px; font-size: 12px; color: #90A4AE; }

/* MIC */
.yhwp-mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.yhwp-btn-mic {
  width: 78px; height: 78px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(21,101,192,.30);
  transition: transform .15s, background .2s;
}
.yhwp-btn-mic:hover { transform: scale(1.06); }
.yhwp-btn-mic:active { transform: scale(0.95); }
.yhwp-btn-mic.recording {
  background: var(--red);
  animation: yhwp-pulse 1.2s infinite;
}
@keyframes yhwp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(198,40,40,.40); }
  70%  { box-shadow: 0 0 0 18px rgba(198,40,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(198,40,40,0); }
}
.yhwp-mic-hint {
  font-size: 13px;
  color: var(--grey);
  font-weight: 600;
  text-align: center;
}
.yhwp-transcript-live {
  background: #F5F5F5;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: #546E7A;
  font-style: italic;
  text-align: center;
  border: 1.5px dashed #B0BEC5;
  width: 100%;
}

/* CONTROLS */
.yhwp-controls { display: flex; gap: 10px; }
.yhwp-btn-next {
  flex: 1;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
}
.yhwp-btn-next:hover { background: #1B5E20; }
.yhwp-btn-next:active { transform: scale(.97); }
.yhwp-btn-retry {
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 14px;
  padding: 13px 16px;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.yhwp-btn-retry:hover { background: var(--blue-light); }

/* FINISH */
.yhwp-finish {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.yhwp-finish-emoji { font-size: 54px; margin-bottom: 10px; }
.yhwp-finish-title {
  font-family: 'Baloo 2', cursive;
  font-size: 24px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
}
.yhwp-finish-score {
  font-size: 48px;
  font-weight: 900;
  color: var(--yellow-dark);
  font-family: 'Baloo 2', cursive;
  line-height: 1;
}
.yhwp-finish-sub { font-size: 14px; color: var(--grey); margin: 6px 0 22px; }
.yhwp-btn-restart {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* STATUS / ALERT */
.yhwp-status {
  text-align: center;
  font-size: 13px;
  color: var(--grey);
  padding: 4px 0;
}
.yhwp-status.error { color: var(--red); font-weight: 600; }
.yhwp-status.ok    { color: var(--green); font-weight: 700; }
.yhwp-alert {
  background: #FFF3E0;
  border: 2px solid #FFCC02;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  color: #E65100;
  font-weight: 600;
  text-align: center;
}
.yhwp-hidden { display: none !important; }
