/* Oedipus complex. Peg-doll families: want is violet, the grudge red, a warm
   bond mint. The father's hat is the thing the boy copies. */
.oed-hero img { width: 250px; }

/* the play */
.oed-play { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.oed-paint { width: 100%; max-width: 360px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5); display: block; }
.oed-cap { font-size: 12px; color: var(--dim); }
.oed-flips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 360px; }
.oed-flip { position: relative; height: 64px; perspective: 600px; }
.oed-flip span { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px 10px; border-radius: 14px; font-weight: 800; font-size: 15px; line-height: 1.15; text-align: center; backface-visibility: hidden; transition: transform .55s cubic-bezier(.3,1.3,.5,1); }
.oed-flip .f { background: var(--raised); border: 2px solid var(--line-strong); box-shadow: 0 4px 0 #070a14; }
.oed-flip .b { background: linear-gradient(160deg, #5a1f2c, #2e0b14); border: 2px solid var(--red); color: #ffd8d8; font-family: var(--serif); font-size: 19px; transform: rotateY(180deg); }
.oed-flip.on .f { transform: rotateY(-180deg); }
.oed-flip.on .b { transform: rotateY(0); }
.oed-quote { margin: 4px 0 0; padding: 10px 14px; max-width: 360px; border-left: 3px solid var(--gold); background: rgba(252,192,80,.07); border-radius: 0 12px 12px 0; font: italic 500 15px/1.35 var(--serif); animation: oedUp .5s ease both; }
.oed-quote cite { display: block; margin-top: 4px; font: 700 12px var(--sans); font-style: normal; color: var(--gold); }
@keyframes oedUp { from { opacity: 0; transform: translateY(10px); } }

/* steps row */
.oed-steps { display: flex; justify-content: center; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 13px; font-weight: 800; }
.oed-steps span { padding: 5px 10px; border-radius: 99px; border: 1.5px solid var(--line); color: var(--faint); transition: all .3s; }
.oed-steps span.on { color: var(--text); border-color: var(--violet-bright); background: rgba(123,92,253,.2); }
.oed-steps i { color: var(--faint); font-style: normal; }

/* family */
.oed-fam { position: relative; height: 232px; flex: none; width: 100%; max-width: 380px; margin: 0 auto; }
.oed-fam::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 38px; height: 22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(169,155,255,.18), transparent); z-index: 0; }
.oed-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.oed-l { fill: none; stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .7s ease; }
.oed-l.in { stroke-dashoffset: 0 !important; }
.oed-l.want { stroke: var(--violet-bright); }
.oed-l.rival { stroke: var(--red); animation: oedJit .9s linear infinite; animation-iteration-count: 3; }
.oed-l.warm { stroke: var(--mint); }
@keyframes oedJit { to { stroke-dashoffset: -24; } }
.oed-icons { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.oed-ic { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); animation: oedPop .45s cubic-bezier(.34,1.56,.64,1) both; }
.oed-ic svg { width: 22px; height: 22px; }
.oed-ic.want svg { fill: var(--violet-bright); }
.oed-ic.rival svg { fill: var(--red); }
.oed-ic.warm svg circle { fill: var(--mint); }
@keyframes oedPop { from { transform: scale(0); } }

.oed-p { position: absolute; bottom: 0; width: 84px; margin-left: -42px; display: flex; flex-direction: column; align-items: center; z-index: 1; padding: 0; transition: opacity .4s; }
.oed-doll { width: 58px; height: 116px; transform-origin: 50% 100%; transition: transform .6s cubic-bezier(.34,1.4,.64,1); }
.oed-p.kid .oed-doll { transform: scale(.66); margin-top: -39px; }
.oed-doll svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.oed-hat { transition: opacity .5s; }
.oed-name { margin-top: 4px; font-size: 13px; font-weight: 800; line-height: 1.1; text-align: center; min-height: 30px; }
.oed-name small { display: block; font-size: 12px; font-weight: 600; color: var(--dim); }
.oed-badges { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; margin-bottom: 4px; }
.oed-badge { padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; animation: oedPop .45s cubic-bezier(.34,1.56,.64,1) both; }
.oed-badge.rules { background: var(--violet); color: #fff; }
.oed-fam.scared .oed-p[data-k="dad"] .oed-doll { transform: scale(1.22); }
.oed-fam.scared .oed-p[data-k="boy"] .oed-doll { transform: scale(.56); }
.oed-p.copied .oed-doll { animation: oedHop .6s ease; }
@keyframes oedHop { 40% { translate: 0 -10px; } }

/* photo */

/* Freud vs Westermarck */
.oed-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin: 6px auto 0; }
.oed-side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.oed-side.in { opacity: 1; transform: none; }
.oed-side b { font-size: 13px; color: var(--dim); }
.oed-side span { font-weight: 800; font-size: 15px; }
.oed-side i { font-style: normal; color: var(--faint); font-size: 18px; line-height: 1; }
.oed-side .hot { color: #F28DB2; font-size: 20px; font-family: var(--serif); }
.oed-side .cold { color: #8AD4FF; font-size: 20px; font-family: var(--serif); }
.oed-side small { font-size: 13px; color: var(--dim); }
.oed-side.fr { border-color: rgba(242,141,178,.5); }
.oed-side.we { border-color: rgba(138,212,255,.5); }

/* the children's house */
.oed-house { position: relative; width: 100%; max-width: 360px; margin: 6px auto 0; }
.oed-roof { height: 44px; margin: 0 10px; background: linear-gradient(180deg, #6b3e2e, #4a2a20); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.oed-room { display: flex; justify-content: space-around; align-items: flex-end; height: 150px; padding: 0 8px 10px; background: linear-gradient(180deg, #1d2440, #151a2e); border: 2px solid #3a3f5c; border-top: 0; border-radius: 0 0 14px 14px; }
.oed-kid { width: 42px; height: 84px; transform-origin: 50% 100%; transition: transform .15s; }
.oed-kid svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.oed-age { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 800; color: #f3dcc5; }
.oed-age b { font-size: 16px; }

/* 2,769 marriages */
.oed-dots { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }
.oed-dots canvas { display: block; }
.oed-dotcap { font-size: 14px; font-weight: 700; color: var(--dim); }
.oed-dotcap b { color: var(--gold); font-size: 17px; }

@media (min-height: 760px) {
  .oed-fam { height: 270px; }
  .oed-doll { width: 70px; height: 140px; }
  .oed-p.kid .oed-doll { margin-top: -47px; }
  .oed-p { width: 92px; margin-left: -46px; }
  .oed-name { font-size: 14px; }
}
@media (max-height: 700px) {
  .oed-fam { height: 206px; }
  .oed-paint { max-width: 250px; }
  .oed-flip { height: 56px; }
  .oed-doll { width: 50px; height: 100px; }
  .oed-p.kid .oed-doll { margin-top: -34px; }
    .oed-room { height: 124px; }
  .oed-quote { font-size: 14px; }
  }
