/* Dementia lesson. Scoped under .de-* */

/* the shelf: moments of her life down, kinds across */
.de-shelf { display: flex; flex-direction: column; gap: 5px; padding: 10px 10px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.de-head, .de-row { display: grid; grid-template-columns: 50px repeat(3, minmax(0, 1fr)); gap: 5px; align-items: center; }
.de-head span { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); text-align: center; line-height: 1.1; }
.de-row { border-bottom: 2px solid rgba(201,140,27,.28); padding-bottom: 5px; }
.de-dec { font-size: 12px; font-weight: 700; color: var(--dim); line-height: 1.1; }
.de-it {
  min-height: 38px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 3px 5px; border-radius: 8px;
  font-size: 13px; font-weight: 700; line-height: 1.12;
  border: 1px solid transparent; transition: opacity .5s, background .5s, color .5s, border-color .5s, box-shadow .5s;
}
.de-it.k0 { background: rgba(169,155,255,.2); color: #D8D1FF; }
.de-it.k1 { background: rgba(63,214,154,.16); color: #A9EFD3; }
.de-it.k2 { background: rgba(252,192,80,.18); color: #FFE0A3; }
.de-it.gone { background: transparent; color: transparent; border: 1px dashed var(--line); }
.de-it.last { background: var(--gold); color: #2A1B00; box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(252,192,80,.7); }
.de-count { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 2px 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.de-count b { font: 600 13px var(--mono); color: var(--text); text-transform: none; letter-spacing: 0; margin-left: 4px; }

/* the brain: a memory's pieces, the hippocampus, and the links */
.de-brainbox { display: flex; justify-content: center; }
.de-brain { width: 100%; max-width: 310px; height: auto; display: block; }
.de-brain .ctx { fill: #1d2440; stroke: var(--line-strong); stroke-width: 1.5; }
.de-brain .cb { fill: #181e36; stroke: var(--line); stroke-width: 1.2; }
.de-brain .hc { fill: none; stroke: var(--violet-bright); stroke-width: 9; stroke-linecap: round; transition: stroke .6s; }
.de-brain .hcl { fill: var(--violet-bright); font: 700 15px var(--sans); letter-spacing: .02em; }
.de-brain.hit .hc { stroke: #7a3b3b; stroke-dasharray: 3 3; }
.de-brain.hit .hcl { fill: #FF8A8A; }
.de-mem path { fill: none; stroke-width: 2; stroke-linecap: round; transition: opacity .3s, stroke .5s; }
.de-mem circle { stroke: var(--bg); stroke-width: 2; transition: fill .6s, opacity .6s; }
.de-mem text { font: 700 15px var(--sans); }
.de-mem.wed path { stroke: var(--violet-bright); } .de-mem.wed circle { fill: var(--violet-bright); } .de-mem.wed text { fill: #D8D1FF; }
.de-mem.brk path { stroke: var(--gold); } .de-mem.brk circle { fill: var(--gold); } .de-mem.brk text { fill: var(--gold); }
.de-mem.brk { animation: copyIn .4s both; }
.de-mem.broken path { stroke: var(--red); stroke-dasharray: 4 5; opacity: .35 !important; }
.de-mem.broken circle { fill: var(--faint); opacity: .5; }
.de-mem.broken text { fill: var(--faint); }

/* Ruth's reply on a visit */
.de-say { align-self: center; margin-bottom: 8px; padding: 7px 14px; border-radius: 14px; font-size: 14px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--dim); animation: copyIn .3s both; }
.de-say.yes { border-color: var(--gold); color: var(--gold); }
.de-say.no { color: var(--faint); }
.de-it.ping { animation: dePing .9s ease-out; }
.de-it.miss { animation: deMiss .9s ease-out; }
@keyframes dePing { 0% { box-shadow: 0 0 0 0 rgba(252,192,80,.9); } 100% { box-shadow: 0 0 0 10px rgba(252,192,80,0); } }
@keyframes deMiss { 0%, 60% { border-color: var(--red); background: rgba(216,85,85,.18); } }
.de-note { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; }

/* the visit's four tries, two by two */
.choices.de-tries { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.de-tries .choice { min-height: 58px; padding: 10px 12px; font-size: 14.5px; line-height: 1.2; justify-content: center; text-align: center; }

/* two songs */
.de-tunes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.de-tune { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); text-align: center; transition: border-color .5s, background .5s, opacity .5s, transform .2s; }
.de-tune b { font-size: 15px; color: var(--text); }
.de-tune em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.de-yr { font: 600 13px var(--mono); color: var(--dim); height: 14px; }
.de-plays { display: flex; gap: 6px; height: 14px; align-items: center; }
.de-plays i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); }
.de-plays i.on { background: var(--violet-bright); border-color: var(--violet-bright); }
.de-tune.playing { border-color: var(--violet-bright); transform: scale(1.03); }
.de-tune.lost { opacity: .55; border-style: dashed; }
.de-tune.known { border-color: var(--gold); background: rgba(252,192,80,.14); }
.de-tune.known em { color: var(--gold); }

@media (max-height: 700px) {
  .de-shelf { gap: 3px; padding: 7px 8px 5px; }
  .de-row { padding-bottom: 4px; }
  .de-it { min-height: 32px; }
  .de-brain { max-width: 290px; }
  .de-say { margin-bottom: 5px; padding: 5px 12px; font-size: 13px; }
  .de-tries .choice { min-height: 50px; font-size: 14px; }
}

/* the kinds of dementia */
.de-kinds { display: flex; flex-direction: column; gap: 8px; }
.de-k { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.de-k b { font-size: 15px; color: var(--text); }
.de-k span { font-size: 13.5px; color: var(--dim); line-height: 1.3; }
.de-k.on { border-color: var(--gold); box-shadow: 0 0 12px rgba(252,192,80,.25); }
.de-k.on b { color: var(--gold); }

/* tap the memory that breaks */
.de-brain.pickable .de-mem { cursor: pointer; }
.de-brain.pickable .de-mem circle { animation: dePulse 1.6s ease-in-out 3; }
.de-mem.picked text { text-decoration: underline; }
@keyframes dePulse { 50% { opacity: .55; } }
