/* ty.css: touch typing course (lane TY). Uses site.css tokens. */
.ty-hero {
  padding: 36px 0 12px;
}
.ty-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.1;
  margin: 6px 0 10px;
}
.ty-hero .lede {
  max-width: 46rem;
}
.ty-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.ty-head > div {
  flex: 1;
  min-width: 0;
}
.ty-art {
  flex: 0 0 120px;
  margin: 0;
  background: #fff7ed;
  border: 2px dashed #e6d5be;
  border-radius: 22px;
  padding: 8px;
}
.ty-art svg {
  display: block;
  width: 100%;
  height: auto;
}
.ty-art figcaption {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}
.ty-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}
.ty-keys li {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-bottom-width: 4px;
  border-radius: 10px;
  font: 700 1.2rem/1 var(--sans);
  background: #fff;
}
.ty-say {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font: 700 1rem var(--sans);
  cursor: pointer;
}
.ty-say svg {
  width: 22px;
  height: 22px;
}
.ty-tip {
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
}
.ty-app {
  margin: 16px 0 28px;
}
.ty-settings,
.ty-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.ty-settings label,
.ty-pick label {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
}
.ty-settings select,
.ty-pick select {
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  font: inherit;
  padding: 4px 8px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.ty-chk input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}
.ty-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.ty-steps button {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: #fff;
  font: 600 0.95rem var(--sans);
  cursor: pointer;
  color: var(--ink);
}
.ty-steps button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-alt);
  margin-right: 4px;
}
.ty-steps button[aria-current="step"] {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.ty-steps button[aria-current="step"] span {
  background: var(--blue);
  color: #fff;
}
.ty-stage {
  position: relative;
  border: 3px solid var(--line-strong);
  border-radius: 22px;
  background: #fff;
  padding: 18px 20px 10px;
  cursor: text;
}
.ty-stage:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.ty-stage:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.ty-text {
  font:
    500 clamp(1.35rem, 4.2vw, 2rem)/1.6 ui-monospace,
    "Cascadia Mono",
    Consolas,
    "Courier New",
    monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 6.6em;
  overflow: hidden;
  color: #6b6b6b;
  position: relative;
}
.ty-text span {
  border-radius: 4px;
}
.ty-text .ok {
  color: var(--green);
}
.ty-text .fixed {
  color: var(--red-ink);
  text-decoration: underline wavy var(--red);
  text-underline-offset: 4px;
}
.ty-text .cur {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
.ty-text .cur.err {
  background: var(--red-soft);
  box-shadow: 0 3px 0 var(--red);
}
.ty-text .sp.cur {
  min-width: 0.6em;
  display: inline-block;
}
.ty-hint {
  min-height: 1.6em;
  margin: 8px 0 0;
  font-size: 1.02rem;
}
.ty-focus {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--blue-ink);
  font-weight: 600;
}
.ty-stage:focus .ty-focus,
.ty-rain:focus .ty-focus {
  display: none;
}
.ty-clock {
  position: absolute;
  right: 14px;
  top: 8px;
  font: 700 1rem var(--sans);
  color: var(--blue-ink);
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  text-align: center;
  padding: 0 6px;
  border: 1.5px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 6px;
  font:
    700 0.95em ui-monospace,
    Consolas,
    monospace;
  background: #fff;
}
.ty-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ty-result {
  border: 3px solid var(--green);
  border-radius: 22px;
  background: var(--green-soft);
  padding: 18px 20px;
}
.ty-result:focus {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.ty-result h3 {
  margin: 0 0 10px;
  font-family: var(--display);
}
.ty-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.ty-stats div {
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 120px;
}
.ty-stats b {
  display: block;
  font: 800 1.8rem/1.1 var(--display);
}
.ty-stats span {
  font-size: 0.85rem;
  color: var(--muted);
}
.ty-stars {
  color: #b38600;
  letter-spacing: 2px;
  font-size: 1.2em;
}
.ty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.ty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 2px solid var(--blue);
  background: var(--blue);
  color: #fff;
  font: 700 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.ty-btn.ghost {
  background: #fff;
  color: var(--blue-ink);
}
.ty-btn:focus-visible,
.ty-steps button:focus-visible,
.ty-say:focus-visible,
.ty-lcard:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.ty-kb {
  margin-top: 16px;
  max-width: 760px;
}
.ty-kbsvg,
.ty-handsvg {
  display: block;
  width: 100%;
  height: auto;
}
.ty-handsvg {
  max-width: 460px;
  margin: 4px auto 0;
}
.ty-kbsvg .kl {
  font: 600 15px var(--sans);
  text-anchor: middle;
  fill: #121212;
}
.ty-kbsvg .kt {
  font-size: 11px;
  fill: #3a3a3a;
}
.ty-kbsvg .ks,
.ty-handsvg .ks {
  font-size: 11px;
}
.ty-handsvg .kl {
  font: 600 13px var(--sans);
  text-anchor: middle;
  fill: #5c5c5c;
}
.ty-kb .k,
.ty-kb .f {
  transition: fill 0.12s;
}
.ty-kb .k.on {
  stroke-width: 4;
  stroke: #121212;
  fill: #f2c230;
}
.ty-kb .f.on {
  stroke-width: 4;
  stroke: #121212;
  fill: #f2c230;
}
.ty-kb .k.hit {
  fill: #6fcf85;
}
.ty-kb .k.miss {
  fill: #d6453c;
}
.ty-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  margin: 10px 0;
}
.ty-legend i {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid;
  vertical-align: -4px;
  margin-right: 6px;
}
.ty-notouch {
  background: var(--yellow-soft);
  border: 2px solid var(--yellow);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.ty-notouch p {
  margin: 0 0 10px;
}
.ty-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.ty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.ty-lcard {
  position: relative;
  display: block;
  min-height: 96px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.ty-lcard:hover {
  border-color: var(--blue);
}
.ty-lcard .n {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-alt);
  font-weight: 800;
  margin-bottom: 6px;
}
.ty-lcard b {
  display: block;
  line-height: 1.25;
}
.ty-lcard small {
  color: var(--muted);
}
.ty-lcard.done {
  border-color: var(--green);
  background: var(--green-soft);
}
.ty-lcard.done .n {
  background: var(--green);
  color: #fff;
}
.ty-lcard .ty-stars {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 0.95rem;
}
.ty-codebox textarea {
  width: 100%;
  min-height: 84px;
  font:
    0.9rem ui-monospace,
    Consolas,
    monospace;
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  padding: 8px;
  box-sizing: border-box;
}
.ty-codemsg {
  min-height: 1.4em;
  font-weight: 600;
}
.ty-rain {
  position: relative;
  height: 360px;
  border: 3px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(#e9eefc, #fff 70%, #e3f3ea);
  overflow: hidden;
  padding: 14px;
}
.ty-rain:focus {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.ty-rain .drop {
  position: absolute;
  top: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--blue);
  font:
    600 1.25rem ui-monospace,
    Consolas,
    monospace;
  white-space: nowrap;
}
.ty-rain .drop b {
  color: var(--green);
}
.ty-typed {
  min-height: 1.4em;
  font:
    600 1.1rem ui-monospace,
    Consolas,
    monospace;
}
.ty-score {
  font-weight: 600;
  min-height: 1.4em;
}
.ty-note {
  font-size: 0.95rem;
  color: var(--muted);
}
.ty-lanterns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 16px;
  border: 3px solid var(--line-strong);
  border-radius: 22px;
  background: #1f2340;
}
.ty-lanterns:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.ty-lanterns .lan {
  position: relative;
  display: grid;
  place-items: center;
}
.ty-lanterns svg {
  width: 100%;
  max-width: 70px;
  fill: #3a3f63;
  stroke: #9aa0c8;
  stroke-width: 2;
}
.ty-lanterns b {
  position: absolute;
  top: 44%;
  font:
    800 1.6rem ui-monospace,
    Consolas,
    monospace;
  color: #fff;
}
.ty-lanterns .next svg {
  stroke: #fff;
  stroke-width: 3;
}
.ty-lanterns .lit svg {
  fill: #f2c230;
  stroke: #fff2bf;
  filter: drop-shadow(0 0 10px #f2c230);
}
.ty-lanterns .lit b {
  color: #121212;
}
.ty-chart {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
  background: #fff;
}
.ty-chart kbd {
  margin: 2px 0;
}
.ty-chart h2 {
  margin-top: 0;
}
.ty-cert {
  max-width: 760px;
  margin: 18px auto;
  border: 6px double var(--green);
  border-radius: 22px;
  padding: 34px 28px;
  text-align: center;
  background: #fff7ed;
}
.ty-cert h2 {
  font-family: var(--display);
  font-size: 2rem;
  margin: 6px 0;
}
.ty-cert .who {
  font: 800 2.2rem var(--display);
  border-bottom: 2px solid var(--ink);
  display: inline-block;
  min-width: 60%;
  margin: 10px 0;
}
.ty-cert .ty-art {
  width: 110px;
  margin: 0 auto;
}
.ty-namebox label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.ty-namebox input {
  min-height: 48px;
  font: inherit;
  padding: 4px 12px;
  border: 2px solid var(--line-strong);
  border-radius: 12px;
  width: min(100%, 340px);
  box-sizing: border-box;
}
body.ty-big .ty-text {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
}
body.ty-big .ty-kb {
  max-width: none;
}
body.ty-big .ty-hint {
  font-size: 1.25rem;
}
@media (max-width: 600px) {
  .ty-head {
    flex-direction: column-reverse;
  }
  .ty-art {
    flex-basis: auto;
    width: 96px;
  }
  .ty-stage {
    padding: 14px 12px 8px;
  }
  .ty-rain {
    height: 300px;
  }
  .ty-lanterns {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 10px;
  }
  .ty-lanterns b {
    font-size: 1.1rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ty-kb .k,
  .ty-kb .f {
    transition: none;
  }
}
@media print {
  header.top,
  footer,
  .skip,
  .toast,
  .noprint,
  .ty-say,
  .ty-namebox {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .ty-chart {
    break-inside: avoid;
    border: 0;
    padding: 0;
  }
  .ty-chart td,
  .ty-chart th {
    padding: 3px 8px;
  }
  .ty-chart kbd {
    margin: 1px 0;
  }
  .ty-pagebreak {
    break-before: page;
  }
  .ty-cert {
    border-width: 8px;
    margin: 0 auto;
  }
}
