/* ===== 타이핑 속도 게임 ===== */

.typing-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 문장 표시 영역 */
.typing-sentence {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px;
  font-size: 1.3rem;
  line-height: 1.8;
  letter-spacing: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  user-select: none;
  min-height: 160px;
  font-feature-settings: "ss01" off;
}

.typing-char {
  color: var(--text-dim);
  transition: color 0.08s, background 0.08s;
  border-radius: 3px;
  padding: 0 1px;
}

.typing-char.correct {
  color: var(--text);
}

.typing-char.wrong {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.18);
  text-decoration: underline wavy currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.typing-char.current {
  background: rgba(var(--accent-rgb), 0.32);
  color: var(--text);
  border-radius: 4px;
  position: relative;
  animation: caret-pulse 1s ease-in-out infinite;
}

@keyframes caret-pulse {
  0%, 100% { background: rgba(var(--accent-rgb), 0.32); }
  50%      { background: rgba(var(--accent-rgb), 0.55); }
}

/* 입력 필드 — 화면엔 단순한 박스, 실제 입력은 여기서 받음 */
.typing-input-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.typing-input {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.15s;
}

.typing-input:focus {
  border-color: var(--accent);
}

.typing-input:disabled {
  opacity: 0.5;
}

.typing-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* 시작 오버레이 */
.typing-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s;
  z-index: 1;
}

.typing-overlay:hover {
  opacity: 0.95;
}

.typing-overlay-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.typing-overlay-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.typing-overlay-sub {
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 28em;
}

.typing-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  margin-top: 4px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.typing-overlay-cta {
  margin-top: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.typing-stage.started .typing-overlay {
  display: none;
}

/* 통계 */
.typing-stats .stat-value.warn { color: #ff6b6b; }
