/* 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-item > .ma-pay { display: flex; flex-direction: row; align-items: center; gap: 14px; }
.ma-pay > div { display: flex; flex-direction: column; gap: 2px; }
.ma-pay > b { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--gold); }
.ma-pump { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.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); }

/* both nights */
.ma-nights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma-night { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.ma-night small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ma-night b { font-family: var(--serif); font-size: 18px; line-height: 1.2; min-height: 44px; }
.ma-night span { font-family: var(--mono); font-size: 15px; color: var(--text); }
.ma-night strong { font-size: 15px; font-weight: 800; }
.ma-night.yes strong { color: var(--mint); } .ma-night.no strong { color: var(--red); }

/* 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 jar rules */
.ma-rules { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); }
.ma-rules small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ma-rules p { display: flex; gap: 12px; align-items: baseline; margin: 0; font: 600 18px/1.3 var(--serif); color: var(--text); }
.ma-rules p b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--raised); font: 600 15px var(--mono); color: var(--gold); }
.ma-rules p.lit { color: var(--gold); }
.ma-rules p.lit b { background: var(--gold); color: #17130D; }

/* 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); }

/* envelopes */
.ma-envs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ma-env { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 132px; padding: 12px; border-radius: 14px; text-align: left;
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 #070a14; transition: border-color .2s; }
.ma-ei { display: flex; gap: 6px; height: 40px; align-items: flex-end; }
.ma-ei i { display: block; width: 50px; height: 34px; border-radius: 4px; background: #e9dcc0; position: relative; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.ma-ei i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, transparent 49%, rgba(0,0,0,.18) 50%, transparent 51%), linear-gradient(20deg, transparent 49%, rgba(0,0,0,.18) 50%, transparent 51%); }
.ma-ei i.ph::before { content: ""; position: absolute; z-index: 1; left: 14px; top: 6px; width: 22px; height: 20px; border-radius: 3px; background: radial-gradient(circle at 35% 45%, #6b4a2e 0 3px, transparent 4px), radial-gradient(circle at 68% 45%, #6b4a2e 0 3px, transparent 4px), linear-gradient(#9fc3e6, #cfe3f5); border: 2px solid #fff; }
.ma-env > b { font-family: var(--serif); font-size: 18px; }
.ma-env > em { font-style: normal; font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--dim); }
.ma-env > strong { font-size: 13px; font-weight: 800; min-height: 16px; }
.ma-env.two > strong { color: var(--mint); } .ma-env.one > strong { color: var(--dim); }
.ma-env.right { border-color: var(--mint); }

@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; }
  .ma-env { min-height: 0; padding: 10px; }
  .ma-rules p { font-size: 16px; }
}
