/* Involuntary memory. Everything scoped under .im-*. */

.im-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.im-note { font-size: 12px; color: var(--faint); text-align: center; }

/* the task card */
.im-tally { font-size: 14px; font-weight: 700; color: var(--dim); }
.im-tally b { font-family: var(--mono); color: var(--gold); }
.im-frame { width: 100%; max-width: 320px; height: 190px; border-radius: 20px; background: #F4EEE2; color: #1B1A22;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 6px 0 #B9AE98;
  transition: box-shadow .2s, background .2s; }
.im-frame:active { transform: translateY(3px); box-shadow: 0 3px 0 #B9AE98; }
.im-frame.im-in { animation: imIn .22s ease-out both; }
@keyframes imIn { from { opacity: .2; transform: scale(.97); } }
.im-frame.im-got { background: #DDF6EA; box-shadow: 0 6px 0 var(--mint); }
.im-frame.im-done { background: var(--surface); color: var(--dim); box-shadow: none; }
.im-frame.shake { animation: imShake .3s; }
@keyframes imShake { 30% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.im-lines { width: 120px; height: 72px; }
.im-lines line { stroke: #1B1A22; stroke-width: 4; stroke-linecap: round; }
.im-ph { font: italic 500 22px var(--serif); color: #4A4538; }
.im-dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 320px; }
.im-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--raised); }
.im-dots i.on { background: var(--violet-bright); }

/* the phrases, all at once */
.im-cloud { width: 100%; max-width: 340px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 6px; }
.im-cloud span { font: italic 500 16px var(--serif); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--dim);
  animation: imFloat .5s calc(var(--k) * 40ms) both; transition: color .3s, border-color .3s, box-shadow .3s; }
@keyframes imFloat { from { opacity: 0; transform: translateY(8px); } }
.im-cloud.lit span { color: var(--text); border-color: var(--gold); box-shadow: 0 0 12px rgba(252,192,80,.25); }

/* the busy task */
.im-cards2 { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.im-mini { width: 120px; height: 84px; border-radius: 14px; background: #F4EEE2; color: #1B1A22; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.im-mini .im-lines { width: 64px; height: 38px; }
.im-mini em { font: italic 500 14px var(--serif); color: #4A4538; }
.im-mini.im-sum b { font: 700 20px var(--mono); }
.im-plus { font-size: 22px; font-weight: 800; color: var(--dim); }
.im-sc .gauge { width: 100%; max-width: 320px; }

/* the counter */
.im-counter { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.im-counter b { font: 700 40px var(--mono); color: var(--gold); min-width: 110px; text-align: center; padding: 4px 12px; border-radius: 14px; background: #0b0f1c; border: 2px solid var(--gold-deep); }
.im-counter span { font-size: 12px; color: var(--faint); }
.im-strip { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 8px; }
.im-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.im-row > span { font-size: 13px; font-weight: 700; color: var(--dim); line-height: 1.2; }
.im-ticks { display: flex; flex-wrap: wrap; gap: 3px; min-height: 22px; align-items: center; }
.im-ticks i { width: 9px; height: 20px; border-radius: 3px; animation: imTick .2s both; }
.im-row.a .im-ticks i { background: var(--gold); }
.im-row.b .im-ticks i { background: #8A8FA8; }
@keyframes imTick { from { transform: scaleY(0); } }

/* the race */
.im-race { width: 100%; max-width: 340px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.im-lane { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); min-height: 210px; }
.im-lane small { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.im-lane > b { font-size: 14px; line-height: 1.25; }
.im-path { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.im-step { font-size: 13px; font-weight: 600; padding: 5px 8px; border-radius: 9px; background: var(--raised); color: var(--dim); animation: imFloat .3s both; }
.im-step.last { background: rgba(252,192,80,.2); color: var(--text); border: 1px solid var(--gold); }

/* Proust */
.im-hero img { width: 170px; display: block; filter: drop-shadow(0 14px 24px rgba(123,92,253,.35)); }
.im-two { width: 100%; max-width: 340px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.im-two span { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--dim); line-height: 1.3; }
.im-two b { color: var(--gold); font-size: 14px; }

@media (max-height: 700px) {
  .im-frame { height: 160px; }
  .im-hero img { width: 130px; }
  .im-lane { min-height: 0; padding: 10px 8px; }
  .im-step { padding: 3px 7px; }
  .im-path { gap: 4px; }
  .im-cloud { gap: 6px; padding-top: 0; }
  .im-cloud span { font-size: 14px; padding: 4px 10px; }
}
.im-two.im-hide { visibility: hidden; }
