/* Loss Aversion lesson. Everything scoped under .la-*. Losses are violet,
   never red: red is the wrong-answer sheet's. */

.la-sc { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* the flip */
.la-toss { position: relative; width: 150px; height: 200px; }
.la-coin { position: absolute; left: 15px; bottom: 26px; width: 120px; height: auto; filter: drop-shadow(0 14px 24px rgba(252,192,80,.25)); }
.la-shadow { position: absolute; left: 35px; bottom: 6px; width: 80px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.45); }
.la-spinning .la-coin { animation: laSpin 1.1s ease-in-out infinite; }
.la-spinning .la-shadow { animation: laShade 1.1s ease-in-out infinite; }
.la-landed .la-coin { animation: laLand .45s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes laSpin {
  0% { transform: translateY(0) rotateX(0); }
  50% { transform: translateY(-34px) rotateX(540deg); }
  100% { transform: translateY(0) rotateX(1080deg); }
}
@keyframes laLand { 0% { transform: translateY(-14px); } 100% { transform: none; } }
@keyframes laToss {
  0% { transform: translateY(0) rotateX(0); }
  45% { transform: translateY(-56px) rotateX(900deg); }
  80% { transform: translateY(0) rotateX(1440deg); }
  90% { transform: translateY(-8px) rotateX(1440deg); }
  100% { transform: translateY(0) rotateX(1440deg); }
}
@keyframes laShade { 0%, 100% { transform: scale(1); opacity: 1; } 45% { transform: scale(.55); opacity: .5; } }
.la-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.la-sides > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.la-sides small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.la-sides b { font: 600 18px var(--sans); }
.la-sides .h b { color: var(--mint); } .la-sides .t b { color: var(--violet-bright); }

/* the two piles */
.la-piles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; align-items: end; }
.la-col { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); text-align: center; }
.la-col small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.la-col b { font: 600 18px var(--sans); }
.la-col.t b { color: var(--violet-bright); }
.la-col.h { border-color: rgba(63,214,154,.5); touch-action: none; cursor: ns-resize; user-select: none; -webkit-user-select: none; }
.la-col.h b { color: var(--mint); }
.la-col.h.lift { border-color: var(--mint); background: rgba(63,214,154,.08); }
.la-pile { --la-step: 16px; position: relative; width: 112px; height: 182px; }
.la-pile img { position: absolute; left: 0; width: 112px; height: auto; animation: laBill .18s ease-out both; pointer-events: none; }
.la-pile.t img { filter: saturate(.25) brightness(.85); }
@keyframes laBill { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.la-grab { position: absolute; top: -13px; left: 50%; width: 30px; height: 26px; margin-left: -15px; border-radius: 13px; background: var(--mint); }
.la-grab::before { content: ''; position: absolute; left: 9px; top: 9px; width: 10px; height: 10px; border-left: 3px solid var(--mint-ink); border-top: 3px solid var(--mint-ink); transform: rotate(45deg); }

/* the scale */
.la-scale { width: min(100%, 340px); margin: 0 auto; }
.la-scale svg { width: 100%; height: auto; display: block; overflow: visible; }
.la-post { stroke: var(--line-strong); stroke-width: 4; stroke-linecap: round; fill: none; }
.la-hub { fill: var(--gold); }
.la-beam { stroke: var(--gold); stroke-width: 5; stroke-linecap: round; transition: all .7s cubic-bezier(.3,1.4,.5,1); }
.la-pan { transition: transform .7s cubic-bezier(.3,1.4,.5,1); }
.la-pan line { stroke: var(--line-strong); stroke-width: 1.5; }
.la-pan path { stroke: none; }
.la-pan.l path { fill: var(--violet); } .la-pan.r path { fill: var(--mint); }
.la-amt { font: 600 17px var(--mono); text-anchor: middle; }
.la-pan.l .la-amt { fill: var(--violet-bright); } .la-pan.r .la-amt { fill: var(--mint); }
.la-cap { font: 700 13px var(--sans); text-anchor: middle; fill: var(--dim); }
.la-felt { font: 600 13px var(--sans); fill: var(--dim); text-anchor: middle; }
.la-felt.v { font: 700 16px var(--mono); fill: var(--text); }
.la-pan.l .la-felt.v { fill: var(--violet-bright); } .la-pan.r .la-felt.v { fill: var(--mint); }

/* Tiger */
.la-photo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.la-photo img { width: 100%; max-width: 360px; max-height: 100%; min-height: 0; object-fit: cover; border-radius: 18px; }
.la-photo span { font-size: 13px; color: var(--dim); }

/* the green */
.la-green { position: relative; width: 100%; max-width: 360px; margin: 0 auto; padding: 82px 8px 10px; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #2f8f55 0%, #1f6b3f 60%, #17502f 100%); }
.la-hole { position: absolute; left: 50%; top: 34px; width: 26px; height: 16px; margin-left: -13px; border-radius: 50%; background: #06120b; box-shadow: inset 0 3px 4px rgba(0,0,0,.8); }
.la-hole::after { content: ''; position: absolute; left: 12px; bottom: 8px; width: 2px; height: 26px; background: #eee; }
.la-dist { position: absolute; left: 0; right: 0; top: 56px; text-align: center; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.75); }
.la-putts .choices.la-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.la-putts .choice { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; min-height: 0; background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.25); text-align: center; }
.la-putts .choice b { font-size: 15px; color: #fff; }
.la-putts .choice small { font-size: 12px; color: rgba(255,255,255,.8); font-weight: 600; }
.la-ball { display: block; width: 22px; height: 22px; margin-bottom: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, #ddd 60%, #aaa 100%); box-shadow: 0 3px 4px rgba(0,0,0,.4); transition: transform .7s cubic-bezier(.5,0,.6,1), opacity .3s .55s; }
.la-putts .choice.la-sink:nth-child(2) .la-ball { transform: translate(-80px, -76px) scale(.5); opacity: 0; }
.la-putts .choice.la-sink:nth-child(1) .la-ball { transform: translate(80px, -76px) scale(.5); opacity: 0; }

/* the checkout */
.la-shop { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.la-bag { width: 92px; height: auto; }
.la-meter { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.la-meter small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); text-align: center; }
.la-row { display: grid; grid-template-columns: 74px 1fr 76px; gap: 8px; align-items: center; }
.la-row span { font-size: 13px; font-weight: 700; }
.la-row i { display: block; height: 18px; border-radius: 9px; background: var(--raised); position: relative; overflow: hidden; }
.la-row i::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--line-strong); border-radius: 9px; transition: width .9s cubic-bezier(.3,1,.5,1); }
.la-row.fee.on i::after { background: var(--gold); }
.la-row.bonus.on i::after { background: var(--violet-bright); }
.la-row b { font: 700 14px var(--mono); }
.la-row.fee b { color: var(--gold); }

@media (max-height: 700px) {
  .la-toss { height: 160px; width: 130px; } .la-coin { width: 96px; left: 17px; }
  .la-pile { --la-step: 12px; height: 140px; width: 96px; } .la-pile img { width: 96px; }
  .la-bag { width: 64px; }
  .la-photo img { max-height: 44vh; }
  .la-green { padding-top: 78px; }
}
