/* ==========================================================================
   vocab-test / style.css
   이 도구에서만 쓰는 스타일. 색·간격은 css/common.css 의 변수만 씁니다.

   🔴 CSP 가 style-src 'self' 라 인라인 style 을 못 씁니다.
      막대 길이는 data-pct 속성으로 넘기고 파일 끝의 규칙이 폭을 정합니다.
   ========================================================================== */

/* 화면에는 안 보이지만 스크린 리더는 읽는 문구 */
.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
}

.empty-note {
  max-width: 46ch;
  margin: var(--space-3) auto 0;
  font-size: 14px;
}

/* --- 검사 진행 ------------------------------------------------------------ */

.quiz-panel {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.quiz-panel:focus {
  outline: none;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.quiz-count {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.quiz-count span {
  color: var(--color-text);
}

.quiz-quit {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}

.bar {
  overflow: hidden;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
}

.bar__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  transition: width 160ms ease;
}

.word-card {
  display: grid;
  min-height: 190px;
  align-content: center;
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-5);
  background: var(--color-surface-soft);
  text-align: center;
}

.word-card__label {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.word-card__word {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: clamp(34px, 9vw, 56px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.answer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.answer-btn {
  min-height: 64px;
  font-size: 18px;
}

.answer-btn.is-chosen {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.key-hint {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(23, 32, 51, 0.14);
  font-size: 12px;
  font-weight: var(--weight-bold);
}

.quiz-foot {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.quiz-foot .button {
  justify-self: start;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}

.quiz-foot .button:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.quiz-foot .field-hint {
  margin: 0;
}

/* --- 결과 ----------------------------------------------------------------- */

.estimate-card {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  text-align: center;
}

.estimate-card__label {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.estimate-card__value {
  margin-bottom: var(--space-2);
  color: var(--color-primary);
  font-size: clamp(34px, 8vw, 52px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.estimate-card__range {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
  font-size: 14px;
}

.estimate-card__level {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: var(--weight-bold);
}

.notice--warn {
  color: var(--color-warning);
  font-weight: var(--weight-bold);
}

.result-subhead {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-size: 19px;
  font-weight: var(--weight-bold);
}

.level-box {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.level-box p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.level-exam {
  margin-top: var(--space-3);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.band-list {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  margin: 0;
  list-style: none;
}

.band {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.band__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.band__label {
  font-weight: var(--weight-bold);
}

.band__score {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.band__foot {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.unknown-box {
  display: grid;
  gap: var(--space-4);
}

.unknown-empty {
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.unknown-group {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.unknown-group__title {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.unknown-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  padding: 0;
  margin: 0;
  list-style: none;
}

.unknown-word {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-2);
  font-size: 14px;
  line-height: 1.5;
}

.unknown-word b {
  overflow-wrap: anywhere;
}

.unknown-word span {
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.form-actions--wrap {
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.form-actions--wrap .button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 760px) {
  .quiz-foot .button,
  .form-actions--wrap .button {
    width: 100%;
    justify-self: stretch;
  }

  .unknown-words {
    grid-template-columns: 1fr;
  }

  .band__head {
    align-items: start;
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* --- 막대 길이 -------------------------------------------------------------
   🔴 인라인 style 이 CSP 로 막혀 있어, JS 는 data-pct="0"~"100" 만 넣고
      폭은 아래 규칙이 정합니다. 진행바와 구간 막대가 함께 씁니다.
   -------------------------------------------------------------------------- */
.bar__fill[data-pct="0"] { width: 0%; }
.bar__fill[data-pct="1"] { width: 1%; }
.bar__fill[data-pct="2"] { width: 2%; }
.bar__fill[data-pct="3"] { width: 3%; }
.bar__fill[data-pct="4"] { width: 4%; }
.bar__fill[data-pct="5"] { width: 5%; }
.bar__fill[data-pct="6"] { width: 6%; }
.bar__fill[data-pct="7"] { width: 7%; }
.bar__fill[data-pct="8"] { width: 8%; }
.bar__fill[data-pct="9"] { width: 9%; }
.bar__fill[data-pct="10"] { width: 10%; }
.bar__fill[data-pct="11"] { width: 11%; }
.bar__fill[data-pct="12"] { width: 12%; }
.bar__fill[data-pct="13"] { width: 13%; }
.bar__fill[data-pct="14"] { width: 14%; }
.bar__fill[data-pct="15"] { width: 15%; }
.bar__fill[data-pct="16"] { width: 16%; }
.bar__fill[data-pct="17"] { width: 17%; }
.bar__fill[data-pct="18"] { width: 18%; }
.bar__fill[data-pct="19"] { width: 19%; }
.bar__fill[data-pct="20"] { width: 20%; }
.bar__fill[data-pct="21"] { width: 21%; }
.bar__fill[data-pct="22"] { width: 22%; }
.bar__fill[data-pct="23"] { width: 23%; }
.bar__fill[data-pct="24"] { width: 24%; }
.bar__fill[data-pct="25"] { width: 25%; }
.bar__fill[data-pct="26"] { width: 26%; }
.bar__fill[data-pct="27"] { width: 27%; }
.bar__fill[data-pct="28"] { width: 28%; }
.bar__fill[data-pct="29"] { width: 29%; }
.bar__fill[data-pct="30"] { width: 30%; }
.bar__fill[data-pct="31"] { width: 31%; }
.bar__fill[data-pct="32"] { width: 32%; }
.bar__fill[data-pct="33"] { width: 33%; }
.bar__fill[data-pct="34"] { width: 34%; }
.bar__fill[data-pct="35"] { width: 35%; }
.bar__fill[data-pct="36"] { width: 36%; }
.bar__fill[data-pct="37"] { width: 37%; }
.bar__fill[data-pct="38"] { width: 38%; }
.bar__fill[data-pct="39"] { width: 39%; }
.bar__fill[data-pct="40"] { width: 40%; }
.bar__fill[data-pct="41"] { width: 41%; }
.bar__fill[data-pct="42"] { width: 42%; }
.bar__fill[data-pct="43"] { width: 43%; }
.bar__fill[data-pct="44"] { width: 44%; }
.bar__fill[data-pct="45"] { width: 45%; }
.bar__fill[data-pct="46"] { width: 46%; }
.bar__fill[data-pct="47"] { width: 47%; }
.bar__fill[data-pct="48"] { width: 48%; }
.bar__fill[data-pct="49"] { width: 49%; }
.bar__fill[data-pct="50"] { width: 50%; }
.bar__fill[data-pct="51"] { width: 51%; }
.bar__fill[data-pct="52"] { width: 52%; }
.bar__fill[data-pct="53"] { width: 53%; }
.bar__fill[data-pct="54"] { width: 54%; }
.bar__fill[data-pct="55"] { width: 55%; }
.bar__fill[data-pct="56"] { width: 56%; }
.bar__fill[data-pct="57"] { width: 57%; }
.bar__fill[data-pct="58"] { width: 58%; }
.bar__fill[data-pct="59"] { width: 59%; }
.bar__fill[data-pct="60"] { width: 60%; }
.bar__fill[data-pct="61"] { width: 61%; }
.bar__fill[data-pct="62"] { width: 62%; }
.bar__fill[data-pct="63"] { width: 63%; }
.bar__fill[data-pct="64"] { width: 64%; }
.bar__fill[data-pct="65"] { width: 65%; }
.bar__fill[data-pct="66"] { width: 66%; }
.bar__fill[data-pct="67"] { width: 67%; }
.bar__fill[data-pct="68"] { width: 68%; }
.bar__fill[data-pct="69"] { width: 69%; }
.bar__fill[data-pct="70"] { width: 70%; }
.bar__fill[data-pct="71"] { width: 71%; }
.bar__fill[data-pct="72"] { width: 72%; }
.bar__fill[data-pct="73"] { width: 73%; }
.bar__fill[data-pct="74"] { width: 74%; }
.bar__fill[data-pct="75"] { width: 75%; }
.bar__fill[data-pct="76"] { width: 76%; }
.bar__fill[data-pct="77"] { width: 77%; }
.bar__fill[data-pct="78"] { width: 78%; }
.bar__fill[data-pct="79"] { width: 79%; }
.bar__fill[data-pct="80"] { width: 80%; }
.bar__fill[data-pct="81"] { width: 81%; }
.bar__fill[data-pct="82"] { width: 82%; }
.bar__fill[data-pct="83"] { width: 83%; }
.bar__fill[data-pct="84"] { width: 84%; }
.bar__fill[data-pct="85"] { width: 85%; }
.bar__fill[data-pct="86"] { width: 86%; }
.bar__fill[data-pct="87"] { width: 87%; }
.bar__fill[data-pct="88"] { width: 88%; }
.bar__fill[data-pct="89"] { width: 89%; }
.bar__fill[data-pct="90"] { width: 90%; }
.bar__fill[data-pct="91"] { width: 91%; }
.bar__fill[data-pct="92"] { width: 92%; }
.bar__fill[data-pct="93"] { width: 93%; }
.bar__fill[data-pct="94"] { width: 94%; }
.bar__fill[data-pct="95"] { width: 95%; }
.bar__fill[data-pct="96"] { width: 96%; }
.bar__fill[data-pct="97"] { width: 97%; }
.bar__fill[data-pct="98"] { width: 98%; }
.bar__fill[data-pct="99"] { width: 99%; }
.bar__fill[data-pct="100"] { width: 100%; }
