/* Escalation of commitment lesson. Everything scoped under .ec-*. */

.ec-sc { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ec-hero { width: min(80%, 300px); }
.ec-hero img { width: 100%; display: block; }

/* 1967: the two divisions */
.ec-divs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ec-div {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px;
  border-radius: 14px; background: var(--surface); border: 2px solid var(--line); text-align: left; box-shadow: 0 4px 0 #070a14;
  transition: border-color .25s, background .25s, opacity .3s;
}
.ec-div b { font-family: var(--serif); font-size: 18px; font-weight: 700; line-height: 1.15; }
.ec-div span { font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--dim); min-height: 32px; }
.ec-div em { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.ec-sp { width: 100%; height: 56px; display: block; margin: 6px 0 2px; overflow: visible; }
.ec-sp line { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ec-sp path { fill: none; stroke: var(--dim); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ec-div.mine { border-color: var(--violet-bright); background: rgba(123,92,253,.12); }
.ec-div.mine .ec-sp path { stroke: var(--violet-bright); }
.ec-div.off { opacity: .45; }

/* the chart, 1957 to 1972 */
.ec-chart { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.ec-ch { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.ec-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ec-zero { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.ec-now { stroke: var(--violet-bright); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .7; }
.ec-ax { font: 700 12px var(--sans); fill: var(--faint); }
.ec-y72 { opacity: 0; transition: opacity .3s; }
.ec-chart.on .ec-y72 { opacity: 1; }
.ec-l { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ec-l.oth { stroke: var(--faint); }
.ec-l.mine { stroke: var(--violet-bright); }
.ec-l.oth.ec-f { stroke: var(--mint); }
.ec-l.mine.ec-f { stroke: var(--red); }
.ec-key { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.2; }
.ec-key .mine { color: var(--violet-bright); }
.ec-key .oth { color: var(--dim); text-align: right; }
.ec-chart.done .ec-key .oth { color: var(--mint); }
.ec-chart.done .ec-key .mine { color: var(--red); }

/* 1972: where things stand */
.ec-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ec-sum > div { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.ec-sum small { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.ec-sum b { font-family: var(--serif); font-size: 17px; line-height: 1.15; }
.ec-sum span { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.ec-sum .mine { border-color: var(--violet-bright); } .ec-sum .mine span { color: var(--red); }
.ec-sum .oth span { color: var(--mint); }

/* 1972: the split */
.ec-split { display: flex; width: 100%; gap: 4px; height: 58px; }
.ec-sb { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 8px; border-radius: 10px; overflow: hidden; transition: flex-grow .15s; }
.ec-sb b { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.ec-sb span { font-size: 12px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.ec-sb.mine { background: rgba(169,155,255,.18); border: 2px solid var(--violet-bright); color: var(--violet-bright); }
.ec-sb.oth { background: rgba(63,214,154,.12); border: 2px solid var(--mint); color: var(--mint); text-align: right; align-items: flex-end; }
.ec-sb.none { padding: 0; border-width: 0; }
.ec-sb.none * { display: none; }

/* the study's two halves */
.ec-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ec-g { padding: 14px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.ec-g.me { border-color: var(--violet-bright); }
.ec-g b { display: block; font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.ec-g span { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--dim); }

/* the four groups */
.ec-gw { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ec-gh { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); text-align: center; }
.ec-grid { display: grid; grid-template-columns: 76px 1fr 1fr; gap: 8px; align-items: stretch; }
.ec-grid > em { font-style: normal; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); text-align: center; align-self: end; }
.ec-grid > b { font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--text); align-self: center; }
.ec-cell { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 60px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); transition: border-color .25s, background .25s; }
.ec-cell strong { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--faint); }
.ec-cell i { display: block; height: 8px; border-radius: 999px; background: #06080f; overflow: hidden; }
.ec-cell i b { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--dim); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.ec-cell.shown strong { color: var(--text); }
.ec-cell.gold strong { color: var(--gold); } .ec-cell.gold i b { background: var(--gold); }
.ec-cell.big { border-color: var(--gold); background: rgba(252,192,80,.10); }
.ec-cell.lit { border-color: var(--mint); background: rgba(63,214,154,.10); }
.ec-you { font-size: 13px; font-weight: 700; color: var(--violet-bright); text-align: center; opacity: 0; transition: opacity .3s; }
.ec-you b { font-family: var(--mono); font-weight: 600; }
.ec-you.on { opacity: 1; }

/* the name */
.ec-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ec-card { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); text-align: center; transition: border-color .25s, background .25s; }
.ec-card small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ec-card b { font-family: var(--serif); font-size: 19px; line-height: 1.2; }
.ec-card span { font-size: 13px; font-weight: 700; color: var(--dim); line-height: 1.25; }
.ec-card.gold { border-color: var(--gold); background: rgba(252,192,80,.08); }
.ec-card.gold b { color: var(--gold); }

/* two banks */
.ec-banks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ec-bank { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); text-align: center; transition: border-color .25s, background .25s; }
.ec-bank svg { width: 64px; height: auto; fill: var(--dim); }
.ec-bank .ec-loan { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--red); }
.ec-bank em { font-style: normal; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--text); min-height: 34px; }
.ec-bank strong { font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--dim); min-height: 16px; }
.ec-bank.win { border-color: var(--mint); background: rgba(63,214,154,.10); }
.ec-bank.win strong { color: var(--mint); }

/* the memo */
.ec-memo { width: 100%; padding: 16px 18px; border-radius: 6px; background: #e9e1cf; color: #1d1a14; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.ec-mh { font: 700 12px var(--mono); letter-spacing: .02em; text-transform: uppercase; color: #5a5347; border-bottom: 1px solid rgba(0,0,0,.2); padding-bottom: 8px; margin-bottom: 10px; }
.ec-memo p { margin: 0; font: 500 16px/1.4 var(--mono); }

/* the stadium */
.ec-stad { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line-strong); text-align: center; }
.ec-stad small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ec-stad b { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--gold); }
.ec-stad span { font-size: 14px; font-weight: 700; color: var(--dim); }

@media (max-height: 700px) {
  .ec-sp { height: 40px; }
  .ec-div { padding: 10px; }
  .ec-div b { font-size: 16px; }
  .ec-chart svg { max-height: 200px; }
  .ec-cell { min-height: 50px; padding: 6px 8px; }
  .ec-cell strong { font-size: 17px; }
  .ec-memo { padding: 12px 14px; }
  .ec-memo p { font-size: 14px; }
  .ec-bank svg { width: 50px; }
}
