/* Mental accounting lesson. Everything scoped under .ma-*. */

.ma-sc { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.ma-hero { display: grid; place-items: center; }
.ma-hero img { width: min(100%, 250px); height: auto; filter: drop-shadow(0 16px 26px rgba(0,0,0,.5)); }

/* the jar board */
.ma-board { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.ma-item { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 8px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); opacity: 0; transition: opacity .3s, border-color .25s; }
.ma-item.on { opacity: 1; animation: cardIn .25s both; }
.ma-item img { width: 64px; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.ma-item > div { display: flex; flex-direction: column; gap: 2px; }
.ma-item b { font-family: var(--serif); font-size: 18px; line-height: 1.15; }
.ma-item span { font-size: 13px; font-weight: 700; color: var(--dim); }
.ma-item.lost { border-color: var(--red); }
.ma-item.lost span { color: var(--red); }
.ma-item.good { border-color: var(--mint); }
.ma-item.bad { border-color: var(--red); }
.ma-item.bad b { color: var(--red); }

.ma-jars { display: flex; justify-content: center; gap: 12px; }
.ma-jar {
  position: relative; flex: 1 1 0; max-width: 150px; min-height: 132px; padding: 18px 8px 12px; overflow: hidden;
  border-radius: 8px 8px 18px 18px; background: var(--surface); border: 2px solid var(--line-strong); box-shadow: 0 4px 0 #070a14;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; color: var(--text);
  transition: border-color .2s, transform .08s;
}
.ma-jar:not(:disabled) { border-color: var(--gold); }
.ma-jar:disabled { opacity: 1; cursor: default; }
.ma-jar:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #070a14; }
.ma-jar .lid { position: absolute; top: 0; left: 0; right: 0; height: 10px; background: var(--raised); border-bottom: 1px solid var(--line); }
.ma-jar .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(252,192,80,.30), rgba(201,140,27,.5)); transition: height .6s cubic-bezier(.2,.8,.2,1); }
.ma-jar .lab { position: relative; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); text-align: center; line-height: 1.2; }
.ma-jar .amt { position: relative; font-family: var(--mono); font-size: 24px; font-weight: 600; }
.ma-jar.on { border-color: var(--gold); }
.ma-jar.on .amt { color: var(--gold); }
.ma-jar.bad, .ma-jar.short { border-color: var(--red); }
.ma-jar.bad .amt, .ma-jar.short .amt { color: var(--red); }
.ma-jars.three .ma-jar { min-height: 112px; }
.ma-jars.three .ma-jar .amt { font-size: 20px; }
.ma-tot { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ma-tot span { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ma-tot b { font-family: var(--mono); font-size: 18px; color: var(--text); }

/* the ticket and the note */
.ma-pocket { display: flex; justify-content: center; gap: 22px; }
.ma-pocket .ob { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ma-pocket .ob img { width: 112px; height: auto; display: block; filter: drop-shadow(0 12px 20px rgba(0,0,0,.5)); }
.ma-pocket .ob span { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }

/* bars on one scale */
.ma-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.ma-rows .rw { display: grid; grid-template-columns: 112px 1fr 58px; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--dim); animation: cardIn .25s both; }
.ma-rows .rw i { display: block; height: 12px; border-radius: 999px; background: #06080f; overflow: hidden; }
.ma-rows .rw b { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--faint); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.ma-rows .rw .v { font-family: var(--mono); font-size: 14px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.ma-rows .gold b { background: var(--gold); } .ma-rows .gold .v, .ma-rows .gold .lb { color: var(--gold); }
.ma-rows .truth b { background: var(--mint); } .ma-rows .truth .v, .ma-rows .truth .lb { color: var(--mint); }
.ma-rows .cap { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); text-align: center; margin-top: 2px; }

/* the same $25, two words */
.ma-two { display: flex; gap: 10px; }
.ma-two .g { flex: 1; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ma-two .g span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ma-two .g b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--text); margin: 2px 0 4px; }
.ma-two .g i { font-family: var(--mono); font-size: 15px; font-style: normal; color: var(--gold); }

@media (max-height: 700px) {
  .ma-jar { min-height: 112px; }
  .ma-jars.three .ma-jar { min-height: 96px; }
  .ma-jar .amt { font-size: 21px; }
  .ma-item { min-height: 56px; }
  .ma-item img { width: 52px; }
  .ma-hero img { width: min(100%, 210px); }
  .ma-pocket .ob img { width: 88px; }
}
