/* Tap code translator: one panel, the letters as tiles with their knocks, then the result and the controls. */
.tapcode { display: grid; gap: 16px; margin: 28px 0 0; padding: 24px; border-radius: var(--r-panel); background: var(--panel); box-shadow: var(--shadow); }
.article .tapcode h2 { margin: 0; font-size: 26px; }
.article .tapcode h3 { margin: 0; font-size: 18px; }
.article .tapcode p { margin: 0; }
.article .tapcode .tapcode-note { color: var(--sec); font-size: 15px; }
.tapcode-app { display: grid; gap: 16px; }
.tapcode-app[hidden] { display: none; }
.tapcode-modes, .tapcode-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tapcode-modes .btn, .tapcode-actions .btn { min-height: 48px; }
.tapcode-modes .btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.tapcode-label { font-weight: 600; }
.tapcode textarea {
  width: 100%; min-height: 96px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-tile);
  background: var(--tile); color: var(--ink); font-size: 20px; line-height: 1.4; resize: vertical; overflow-wrap: anywhere;
}
.tapcode textarea::placeholder { color: var(--ter); }
.tapcode-output { display: grid; gap: 16px; min-width: 0; }
.tapcode-output[hidden] { display: none; }
.tapcode-output > div { display: grid; gap: 8px; min-width: 0; }
.article .tapcode .tapcode-result { padding: 14px 16px; border-radius: var(--r-tile); background: var(--tile); font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.article .tapcode .tapcode-notes { margin: 0; padding-left: 20px; color: var(--sec); font-size: 15px; }
.article .tapcode .tapcode-status { min-height: 1.5em; font-weight: 600; }

.article .tapcode-letters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.article .tapcode-letters { gap: 14px 24px; }
.article .tapcode-letters li { margin: 0; }
.article .tap-word-letters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tap-tile { display: grid; justify-items: center; gap: 6px; min-width: 56px; padding: 10px 8px 12px; border-radius: var(--r-tile); background: var(--tile); color: var(--ink); }
.tap-tile.on { background: var(--y); color: var(--on-y); }
.tap-tile.bad { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.tap-letter { font-size: 26px; line-height: 1; font-weight: 300; font-feature-settings: "ss06" 1; }
.tap-pair { font-size: 14px; font-weight: 650; white-space: nowrap; }
.tap-knocks { display: grid; gap: 4px; justify-items: start; }
.tap-run { display: flex; gap: 3px; }
.tap-run i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.45; }
.tap-run i.lit { opacity: 1; box-shadow: 0 0 0 2px currentColor; }

@media (max-width: 520px) {
  .tapcode { padding: 18px 16px; }
  .tapcode-modes .btn { flex: 1 1 100%; }
  .tapcode-actions .lamp { width: 44px; height: 44px; margin-left: auto; }
}
