/* =============================================================
   ARCADE · typing.css
   ============================================================= */

.game-page--typing {
  --accent: var(--cyan);
  --accent-soft: rgba(77, 225, 255, 0.14);
}

/* -------------------------------------------------------------
   Text stage
   ------------------------------------------------------------- */
.typ-wrap {
  position: relative;
  width: 100%;
  padding: 1.6rem 1.8rem 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #101018;
}

.typ-progress {
  height: 3px;
  margin-bottom: 1.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.typ-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.2s linear;
}

.typ-text {
  max-height: clamp(180px, 34vh, 300px);
  overflow-y: auto;
  padding-right: 0.4rem;
  scrollbar-width: thin;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  line-height: 2;
  letter-spacing: 0.01em;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
}

.typ-text span {
  border-radius: 4px;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}

.typ-text .is-pending {
  color: var(--dim);
}

.typ-text .is-done {
  color: var(--text);
}

.typ-text .is-wrong {
  color: var(--coral);
  background: rgba(255, 107, 74, 0.14);
}

.typ-text .is-current {
  color: var(--text);
  background: rgba(77, 225, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(77, 225, 255, 0.35) inset;
}

.typ-text .is-space.is-wrong {
  background: rgba(255, 107, 74, 0.28);
}

/* real input: visually hidden but focusable */
.typ-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.typ-hint {
  margin-top: 1.2rem;
  font-size: 0.78rem;
  color: var(--dim);
  text-align: center;
}

.typ-hint.is-live {
  color: var(--accent);
}

/* -------------------------------------------------------------
   Toolbar
   ------------------------------------------------------------- */

.typ-hud .hud__v.is-hot {
  color: var(--accent);
}

.typ-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 900px;
}

.typ-toolbar .hint {
  font-size: 0.78rem;
  color: var(--dim);
}

.typ-toolbar .hint b {
  color: var(--muted);
  font-weight: 600;
}

.typ-toolbar .btn {
  padding: 0.55rem 1.05rem;
  font-size: 0.82rem;
}

.diff--typ button {
  font-size: 0.74rem;
}

/* -------------------------------------------------------------
   Responsive / motion
   ------------------------------------------------------------- */
@media (max-width: 560px) {
  .typ-wrap {
    padding: 1.1rem 1.1rem 1rem;
  }

  .typ-text {
    line-height: 1.9;
  }

  .typ-toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .typ-toolbar .btn {
    width: 100%;
  }

  .typ-toolbar .hint {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typ-text span,
  .typ-progress span {
    transition: none;
  }
}