* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  padding: 0;
  background: #050814;
  color: #f5f7ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #050814;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5acc7;
}

.title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
}

/* MAIN */
.main {
  padding: 16px;
  padding-bottom: 32px;
  flex: 1;
}

/* CARDS */
.card {
  background: #0b0f1f;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* PHRASE TEXT */
.english-text {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ipa-text {
  font-size: 18px;
  color: #9de1ff;
  margin-bottom: 4px;
}

.translated-text {
  font-size: 16px;
  color: #a5acc7;
  margin-bottom: 12px;
}

/* BUTTONS */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, #3ea6ff, #8b5cff);
  color: white;
}

.btn.record {
  width: 100%;
  background: #20263d;
  color: #f5f7ff;
}

.btn.record .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff4b5c;
  margin-right: 8px;
}

.btn.record .dot.live {
  animation: pulse 1s infinite;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #f5f7ff;
  padding-inline: 14px;
}

/* LAYOUT HELPERS */
.controls-row {
  margin-top: 8px;
}

.status-text {
  margin-top: 8px;
  font-size: 13px;
  color: #a5acc7;
  min-height: 18px;
}

/* RESULTS */
.results {
  margin-top: 12px;
  font-size: 14px;
}

.results-label {
  margin-top: 8px;
  margin-bottom: 4px;
  color: #a5acc7;
}

.results-box {
  padding: 8px;
  border-radius: 8px;
  background: #050814;
  min-height: 36px;
  word-wrap: break-word;
  line-height: 1.6;
}

/* ACCURACY SCORE */
.results-score {
  font-size: 18px;
  font-weight: 600;
}

.results-score.good { color: #4ade80; }
.results-score.ok { color: #facc15; }
.results-score.bad { color: #fb7185; }

/* NAVIGATION */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.counter {
  font-size: 13px;
  color: #a5acc7;
}

/* TIPS SECTION */
.tips-card h2 {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 8px;
}

.tips-card p, 
.tips-card li {
  font-size: 14px;
  color: #d0d4e6;
}

/* AD SECTIONS */
.ad-card {
  padding: 8px;
}

/* FOOTER */
.footer {
  padding: 10px 16px;
  font-size: 12px;
  color: #7f8499;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* RECORD DOT ANIMATION */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* WORD HIGHLIGHTING — GUARANTEED WORKING */
.word-hit {
  color: #4ade80 !important;      /* green */
  font-weight: 700 !important;
}

.word-wrong {
  color: #f43f5e !important;      /* red */
  font-weight: 700 !important;
}

.word-miss {
  color: #f43f5e !important;      /* missing word */
  font-weight: 700 !important;
  text-decoration: underline;
}

.word-extra {
  color: #fb923c !important;      /* orange extra word */
  font-weight: 700 !important;
}


/* Make the whole record button turn red while it is being pressed/held */
.btn.record:active {
  background: #c62828;
  color: #ffffff;
}


/* When JS marks record button as actively recording, make the whole button red */
.btn.record.recording {
  background: #c62828 !important;
  color: #ffffff !important;
}
