/* Working memory. Everything scoped under .wm-*. */

.wm-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wm-note { font-size: 13px; color: var(--dim); text-align: center; max-width: 300px; }
.wm-hero img { display: block; width: 300px; max-width: 100%; max-height: 34vh; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 18px 30px rgba(123, 92, 253, .3)); }

/* the flash card */
.wm-flash { width: 112px; height: 112px; border-radius: 22px; display: grid; place-items: center; background: #F4EEE2; color: #1B1A22;
  font: 700 64px var(--serif); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.wm-flash.wm-wait { background: transparent; border: 2px dashed var(--line-strong); box-shadow: none; color: var(--faint); font-size: 30px; }
.wm-flash.wm-gap { background: rgba(244, 238, 226, .12); box-shadow: none; }
.wm-flash.wm-in { animation: wmIn .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wmIn { from { opacity: 0; transform: scale(.94); } }
.wm-dots { display: flex; gap: 6px; }
.wm-dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line-strong); }
.wm-dots i.now { border-color: var(--violet-bright); background: var(--violet-bright); }
.wm-dots i.done { background: var(--raised); border-color: var(--dim); }

/* typing back */
.wm-slots { display: grid; grid-template-columns: repeat(12, minmax(0, 26px)); gap: 4px; justify-content: center; width: 100%; }
.wm-slots i { height: 36px; border-radius: 8px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font: 700 17px var(--serif); font-style: normal; color: var(--text); background: var(--raised); }
.wm-slots i.on { border-color: var(--violet-bright); box-shadow: 0 0 0 2px rgba(169, 155, 255, .3); }
.wm-pad { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 380px; margin: 0 auto; }
.wm-key { height: 44px; min-width: 0; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--raised); color: var(--text); font: 700 18px var(--sans); padding: 0; }
.wm-key.wm-back { font-size: 18px; color: var(--dim); }
.wm-key.wm-done { color: #1B1A22; background: var(--gold); border-color: var(--gold); font-size: 14px; }
.wm-key.hit { background: var(--violet); border-color: var(--violet-bright); color: #fff; }

/* letter tiles: a score row */
.wm-row { display: flex; gap: 3px; justify-content: center; }
.wm-t { width: 24px; height: 32px; border-radius: 7px; display: grid; place-items: center; font: 700 16px var(--serif); font-style: normal; background: #F4EEE2; color: #1B1A22; }
.wm-t.y { background: var(--gold); color: #1B1A22; }
.wm-t.n { background: transparent; border: 1.5px solid var(--faint); color: var(--faint); }
.wm-grp { gap: 10px; }
.wm-g { display: flex; gap: 3px; }
.wm-res { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wm-n { font: 700 28px var(--mono); color: var(--text); }
.wm-both { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.wm-lab { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.wm-lab span { font: 700 12px var(--sans); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.wm-lab b { font: 700 16px var(--mono); color: var(--text); }

/* twelve become four */
.wm-merge .wm-t { width: 20px; }
.wm-merge .wm-g { gap: 2px; }
.wm-merge .wm-grp { gap: 3px; transition: gap .5s cubic-bezier(.2,.8,.2,1); }
.wm-merge .wm-g { padding: 4px; border-radius: 11px; border: 2px solid transparent; transition: border-color .5s, background .5s, padding .5s; }
.wm-merge.on .wm-grp { gap: 8px; }
.wm-merge.on .wm-g { border-color: var(--violet-bright); background: rgba(123, 92, 253, .16); }
.wm-cap { position: relative; height: 24px; width: 100%; text-align: center; font: 700 15px var(--sans); }
.wm-cap span { position: absolute; left: 0; right: 0; top: 0; transition: opacity .4s; }
.wm-cap .a { color: var(--dim); }
.wm-cap .b { color: var(--violet-bright); opacity: 0; }
.wm-cap.on .a { opacity: 0; }
.wm-cap.on .b { opacity: 1; }

/* the bench: four chunks and one that doesn't fit */
.wm-bench { position: relative; width: 300px; max-width: 100%; height: 150px; }
.wm-top { position: absolute; left: 10px; right: 50px; top: 40px; display: flex; gap: 6px; padding: 0 8px 8px; border-bottom: 12px solid #8A5A36; border-radius: 0 0 6px 6px; }
.wm-blk { flex: 1; height: 40px; border-radius: 9px; display: grid; place-items: center; background: #F4EEE2; color: #1B1A22; font: 700 15px var(--serif); letter-spacing: .04em; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.wm-legs { position: absolute; left: 24px; right: 64px; top: 100px; height: 44px; display: flex; justify-content: space-between; }
.wm-legs i { width: 12px; height: 100%; background: #6E4526; border-radius: 3px; }
.wm-drop { position: absolute; right: 0; top: 96px; width: 48px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: rgba(244, 238, 226, .35); color: #1B1A22; font: 700 15px var(--serif); transform: rotate(18deg); }

/* SF */
.wm-sf { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 8px; }
.wm-sfl { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px; }
.wm-sfl span { font: 700 12px var(--sans); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.wm-sfl b { font: 700 20px var(--mono); color: var(--text); }
.wm-sfl b.wm-q { color: var(--gold); }
.wm-dg { display: flex; flex-wrap: wrap; gap: 1px 3px; font: 600 13px var(--mono); color: var(--text); margin-bottom: 6px; }
.wm-dg i { font-style: normal; width: 9px; text-align: center; }
.wm-dg.short i { font-size: 20px; width: 18px; }
.wm-dg.long { color: var(--gold); }
.wm-run { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border-radius: 16px; border: 2px solid var(--violet-bright); background: rgba(123, 92, 253, .14); animation: wmIn .3s both; }
.wm-run b { font: 700 36px var(--mono); color: var(--text); }
.wm-run span { font-size: 14px; color: var(--dim); }

@media (max-height: 700px) {
  .wm-hero img { max-height: 28vh; }
  .wm-flash { width: 96px; height: 96px; font-size: 54px; }
}

.wm-r2 .wm-grp { gap: 3px; transition: gap .5s; }
.wm-r2.on .wm-grp { gap: 10px; }
.wm-cards { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 12px; }
.wm-cardx { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: #F4EEE2; color: #1B1A22; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.wm-cardx small { font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #6B6558; }
.wm-cardx b { font: 700 22px var(--serif); letter-spacing: .06em; }
