/* ============================================================
   화면 테스트 전용 스타일
   - 랜딩: 검사 카드 + 준비 안내
   - 무대: 전체화면 오버레이(단색/그라데이션/잔상/터치)
   ============================================================ */

/* ---------- 도입부 ---------- */
.tool-intro { margin-top: clamp(28px, 4vw, 44px); }
.tool-intro h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.3;
  margin: 10px 0 14px;
}
.tool-intro .lead { max-width: 62ch; color: var(--color-text); }
.tool-intro .lead-note {
  margin-top: 10px;
  font-size: .88rem;
  color: var(--color-text-sub);
}

/* ---------- 시작 패널 ---------- */
.st-panel { margin-top: 22px; padding: clamp(18px, 3vw, 28px); }

.st-prep {
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 3px;
  padding: 14px 16px;
  background: var(--color-surface);
  font-size: .93rem;
}
.st-prep strong { display: block; margin-bottom: 6px; }
.st-prep ol { margin: 0; padding-left: 20px; color: var(--color-text-sub); }
.st-prep li { margin: 3px 0; }

.st-course-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  margin-top: 16px;
  padding: 16px 20px;
  font-size: 1.08rem;
  font-weight: 700;
}
.st-course-sub {
  font-size: .82rem;
  font-weight: 400;
  opacity: .85;
}
.st-howto {
  margin: 10px 0 0;
  text-align: center;
  font-size: .85rem;
  color: var(--color-text-sub);
}

/* 개별 검사 카드 */
.st-tests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.st-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, transform .15s;
}
.st-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.st-name { font-weight: 700; }
.st-desc { font-size: .85rem; color: var(--color-text-sub); line-height: 1.5; }

/* 카드 머리의 미리보기 조각 */
.st-chip {
  display: flex;
  width: 90px;
  height: 18px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.st-chip i { flex: 1; background: var(--c); }
.st-chip-bleed {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(255,255,240,.5), transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(255,255,240,.4), transparent 45%),
    #000;
}
.st-chip-grad { background: linear-gradient(90deg, #000, #fff); }
.st-chip-uni { background: #9a9a9a; }
.st-chip-ghost { position: relative; background: #9a9a9a; }
.st-chip-ghost i {
  position: absolute;
  top: 4px; left: 12px;
  width: 26px; height: 10px;
  background: linear-gradient(90deg, transparent, #222 65%);
}
.st-chip-touch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  padding: 1px;
}
.st-chip-touch i { background: #4a7fa5; }
.st-chip-touch i:nth-child(2), .st-chip-touch i:nth-child(7) { background: transparent; }

/* ---------- 검사 무대 ---------- */
.st-stage {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.st-fill { position: absolute; inset: 0; }

/* 잔상 검사: 회색 바탕에 왕복하는 사각형 두 개 */
.st-ghostwrap {
  position: absolute;
  inset: 0;
  background: #9a9a9a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18vh;
}
.st-track { position: relative; height: 12vmin; }
.st-runner {
  position: absolute;
  top: 0;
  left: 0;
  width: 18vmin;
  height: 12vmin;
  animation: st-run var(--dur, 2.4s) linear infinite alternate;
}
.st-runner-dark { background: #111; }
.st-runner-light { background: #fdfdfd; }
@keyframes st-run {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw - 18vmin)); }
}

/* 터치 테스트 캔버스 */
.st-touchcv { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 안내(HUD): 화면 하단, 잠시 보였다가 사라짐 */
.st-hud {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(20, 20, 20, .82);
  color: #f2efe8;
  cursor: default;
  transition: opacity .5s;
}
.st-hud.is-faded { opacity: 0; pointer-events: none; }
.st-hint { margin: 0 0 8px; font-size: .92rem; line-height: 1.55; }
.st-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.st-step { font-size: .8rem; opacity: .75; }
.st-hud-btns { display: flex; gap: 6px; }
.st-hud-btns button {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
  background: transparent;
  color: #f2efe8;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
.st-hud-btns button:hover { border-color: #fff; }

/* 완료 패널 */
.st-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  cursor: default;
}
.st-done-box {
  width: min(440px, calc(100% - 40px));
  padding: 26px 24px;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: center;
}
.st-done-box h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}
.st-done-box p { margin: 0 0 18px; font-size: .92rem; color: var(--color-text-sub); line-height: 1.6; }
.st-done-btns { display: flex; gap: 10px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .st-card { transition: none; }
}
