.typing-dojo-page {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px) 20px clamp(46px, 6vw, 76px);
}

.typing-dojo-hero {
  max-width: 760px;
  padding-bottom: 28px;
}

.typing-dojo-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.typing-dojo-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.typing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.typing-dojo-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.typing-menu-panel,
.typing-play-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.typing-menu-panel {
  padding: 18px;
}

.typing-menu-list {
  display: grid;
  gap: 8px;
}

.typing-menu-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.typing-menu-button:hover:not(:disabled),
.typing-menu-button.is-active {
  border-color: var(--accent);
  background: #fff6ef;
}

.typing-menu-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.typing-menu-button span {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.typing-menu-button strong {
  line-height: 1.25;
}

.typing-menu-button em,
.typing-progress-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
  line-height: 1.45;
}

.typing-progress-note {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.typing-play-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.stage-meter {
  display: grid;
  gap: 8px;
}

.stage-label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
}

.stage-label-row span {
  font-weight: 900;
}

.stage-label-row span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.stage-track {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.stage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.typing-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.typing-stats span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.adventure-lane {
  padding: 12px 8px;
}

.adventure-path {
  position: relative;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(63, 107, 82, 0.16), rgba(191, 63, 47, 0.12)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(24, 32, 31, 0.05) 42px 43px);
  overflow: hidden;
}

.path-marker {
  position: absolute;
  top: 6px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
}

.start-marker {
  left: 8px;
}

.goal-marker {
  right: 8px;
}

.hero-token,
.monster-token {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: white;
  font-size: 1.15rem;
  font-weight: 900;
  transform: translate(-50%, -50%);
  transition: left 220ms ease;
}

.hero-token {
  color: var(--green);
}

.monster-token {
  color: var(--accent);
}

.typing-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.typing-card-top,
.typing-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.typing-card-top span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.typing-prompt-label,
.typing-input-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.typing-target {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.typing-meaning {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.typing-feedback-line {
  min-height: 30px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.typing-input {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
}

.typing-input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 91, 127, 0.16);
}

.typing-input.is-correct {
  border-color: var(--green);
}

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

.typing-summary {
  padding: 18px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #f1f8f3;
}

.typing-summary h2 {
  margin-top: 0;
}

.typing-summary p {
  color: var(--muted);
}

.typing-guide-panel {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.typing-guide-panel .section-heading p:not(.eyebrow) {
  color: var(--muted);
}

.typing-guide-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.typing-guide-note {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.typing-guide-note h3 {
  margin-top: 0;
}

.typing-guide-note p {
  margin: 8px 0 0;
  color: var(--muted);
}

.typing-guide-table-wrap {
  overflow-x: auto;
}

.typing-guide-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.typing-guide-table th,
.typing-guide-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.typing-guide-table th {
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.typing-guide-table td:first-child,
.typing-guide-table td:nth-child(2) {
  font-weight: 900;
}

@media (max-width: 780px) {
  .typing-dojo-shell {
    grid-template-columns: 1fr;
  }

  .typing-stats,
  .typing-guide-grid {
    grid-template-columns: 1fr;
  }

  .typing-menu-panel,
  .typing-play-panel {
    padding: 14px;
  }

  .typing-card-top,
  .typing-controls,
  .typing-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .typing-controls .button,
  .typing-hero-actions .button {
    width: 100%;
  }

  .typing-target {
    min-height: 78px;
  }
}
