/* Morse decode card on the 2D wave generator. Scoped to #morse / .morse-* */

.morse-jump{
  margin:0 auto 18px;
  max-width:680px;
  text-align:center;
}
.morse-jump a{
  color:var(--cyan);
  text-decoration:underline;
  text-underline-offset:3px;
}

.morse-section{
  padding:28px 0 12px;
  scroll-margin-top:calc(var(--nav-h, 64px) + 16px);
}
.morse-section .wrap{max-width:860px}
.morse-card{
  border-color:rgba(34,230,255,.45);
  transition:box-shadow .4s ease, border-color .4s ease;
}
.morse-section.morse-focus .morse-card,
.morse-card.morse-focus{
  border-color:var(--gold);
  box-shadow:0 0 0 1px rgba(255,201,74,.35),0 0 36px rgba(34,230,255,.28),0 0 70px rgba(155,92,255,.18);
}
.morse-card .t-heading{margin-bottom:8px}
.morse-card .t-body{margin-top:10px}
.morse-card .morse-lead{margin-bottom:18px}

.morse-canvas-wrap{
  position:relative;
  margin:18px auto 12px;
  width:100%;
  border-radius:14px;
  overflow:hidden;
  background:#090516;
  border:1px solid rgba(34,230,255,.45);
  box-shadow:0 0 0 1px rgba(255,46,200,.18),0 0 28px rgba(34,230,255,.16);
}
.morse-canvas-wrap canvas{
  display:block;
  width:100%;
  height:180px;
}
@media (min-width:601px){
  .morse-canvas-wrap canvas{height:220px}
}

.morse-wave-caption{margin:8px auto 0;font-size:14px;max-width:640px}

.morse-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin:14px 0 8px;
}
.morse-actions .btn{width:auto;min-width:min(100%, 200px);padding:0 22px}

.morse-status{
  min-height:1.5em;
  margin:8px auto 4px;
  max-width:640px;
  text-align:center;
  color:var(--ink-soft);
  font-size:var(--b-size);
  line-height:1.5;
}
.morse-status.is-good{color:var(--cyan)}
.morse-status.is-hint{color:var(--gold)}

.morse-words{
  display:flex;
  flex-wrap:wrap;
  gap:16px 22px;
  justify-content:center;
  margin:16px 0 8px;
}
.morse-word{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.morse-word-label{
  font-family:var(--c-font);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--gold);
}
.morse-letter-row{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
}
.morse-letter{
  width:42px;
  height:48px;
  padding:0;
  text-align:center;
  text-transform:uppercase;
  font-family:var(--h-font);
  font-size:22px;
  letter-spacing:0;
  color:var(--ink);
  background:rgba(12,7,20,.85);
  border:1px solid rgba(34,230,255,.45);
  border-radius:10px;
  caret-color:var(--cyan);
}
.morse-letter:focus{
  outline:3px solid var(--gold);
  outline-offset:2px;
  border-color:var(--gold);
}
.morse-letter.is-right{
  border-color:var(--cyan);
  box-shadow:0 0 12px rgba(34,230,255,.35);
  color:var(--cyan);
}
.morse-letter.is-revealed{
  border-color:var(--gold);
  color:var(--gold);
}
.morse-word-tools{
  display:flex;
  justify-content:center;
}
.morse-word-tools button{
  background:none;
  border:0;
  padding:4px 6px;
  color:var(--cyan);
  font-family:var(--c-font);
  font-size:12px;
  letter-spacing:.06em;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.morse-word-tools button:disabled{
  color:var(--ink-soft);
  text-decoration:none;
  cursor:default;
  opacity:.7;
}

@media (max-width:420px){
  .morse-letter{width:36px;height:44px;font-size:18px}
}

.morse-help-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  margin:12px 0 6px;
}
.morse-help-row .btn{width:auto;min-width:min(100%, 180px)}

.morse-key{
  margin:22px 0 8px;
  padding-top:16px;
  border-top:1px solid rgba(34,230,255,.2);
  text-align:center;
}
.morse-key-h{
  font-family:var(--s-font);
  font-size:var(--s-size);
  letter-spacing:var(--s-ls);
  font-weight:400;
  color:var(--gold);
  text-align:center;
  margin:0 0 6px;
}
.morse-key-sub{margin-bottom:14px}
.morse-key-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
  list-style:none;
  margin:0;
  padding:0;
}
@media (min-width:420px){
  .morse-key-grid{grid-template-columns:repeat(5, minmax(0, 1fr))}
}
@media (min-width:640px){
  .morse-key-grid{grid-template-columns:repeat(7, minmax(0, 1fr));gap:10px}
}
.morse-key-grid li{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:64px;
  padding:8px 4px;
  border-radius:10px;
  background:rgba(12,7,20,.7);
  border:1px solid rgba(155,92,255,.35);
}
.morse-key-letter{
  font-family:var(--h-font);
  font-size:16px;
  color:var(--ink);
  line-height:1;
}
.morse-key-code{
  font-family:var(--b-font);
  font-size:15px;
  letter-spacing:.08em;
  white-space:nowrap;
  color:var(--cyan);
  line-height:1;
}

.morse-try{
  margin:22px 0 4px;
  padding-top:16px;
  border-top:1px solid rgba(34,230,255,.2);
  text-align:center;
}
.morse-try-h{
  font-family:var(--s-font);
  font-size:var(--s-size);
  letter-spacing:var(--s-ls);
  font-weight:400;
  color:var(--gold);
  text-align:center;
  margin:0 0 6px;
}
.morse-try-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin-top:12px;
}
.morse-try-row label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.morse-try-row input{
  width:min(100%, 280px);
  min-height:50px;
  border-radius:12px;
  background:rgba(12,7,20,.85);
  border:1px solid rgba(34,230,255,.45);
  padding:12px 16px;
  font:400 16px/1.4 var(--b-font);
  color:var(--ink);
}
.morse-try-row .btn{width:auto;min-width:160px}

.morse-reveal{
  margin:18px 0 8px;
  padding:20px 16px;
  border-radius:14px;
  text-align:center;
  background:rgba(12,7,20,.7);
  border:1px solid rgba(255,201,74,.5);
  box-shadow:0 0 28px rgba(255,201,74,.16);
}
.morse-reveal[hidden]{display:none}
.morse-reveal-kicker{
  font-family:var(--c-font);
  font-size:12px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--gold);
  margin:0 0 8px;
}
.morse-reveal-msg{
  font-family:var(--h-font);
  font-size:clamp(22px, 5vw, 34px);
  letter-spacing:.06em;
  line-height:1.25;
  color:var(--ink);
  margin:0 0 12px;
  text-shadow:0 0 18px rgba(34,230,255,.35);
}
.morse-reveal .t-body{margin-top:0}

/* Screenshot isolation: ?shot=focus or ?shot=solved */
html.morse-shot .topbar,
html.morse-shot footer,
html.morse-shot .wow-bottombar,
html.morse-shot .wow-generator,
html.morse-shot .tp-cta,
html.morse-shot .wow-learn,
html.morse-shot .wow-method-note,
html.morse-shot .skip,
html.morse-shot .morse-jump,
html.morse-shot dialog,
html.morse-shot .arti-host{
  display:none !important;
}
html.morse-shot body,
html.morse-shot .wow-page{
  padding:16px 0 28px !important;
}
html.morse-shot .morse-section{padding-top:8px}
