/* Cognitive dissonance lesson. All rules scoped under .cd-* */

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

/* the clock and the peg board */
.cd-clock { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); }
.cd-clock::before { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--gold); }
.cd-hand { position: absolute; left: 50%; top: 8px; width: 3px; height: 24px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); transform-origin: 50% 24px; }
.cd-clock span { position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translateX(-50%); white-space: nowrap; font: 700 13px var(--mono); color: var(--dim); }
.cd-board { display: grid; grid-template-columns: repeat(3, 56px); gap: 10px; padding: 12px; margin-top: 22px; border-radius: 18px; background: #6A4A32; border: 3px solid #8E6A4C; }
.cd-peg { width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; background: #3A2618; display: grid; place-items: center; cursor: pointer; }
.cd-peg i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #D9B98A; box-shadow: inset 0 -3px 0 #A88658; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.cd-peg b { display: block; width: 4px; height: 24px; border-radius: 2px; background: #6A4A32; }
.cd-peg.on i { transform: rotate(90deg); }
.cd-loop .cd-peg i { animation: cdTurn .55s steps(1) infinite; }
.cd-loop .cd-peg:nth-child(2n) i { animation-delay: .2s; }
@keyframes cdTurn { 0% { transform: rotate(0); } 50% { transform: rotate(90deg); } }

/* the hallway */
.cd-hall { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding-top: 8px; }
.cd-hall img { height: 170px; max-width: 100%; object-fit: contain; display: block; }
.cd-hall span { font-size: 13px; color: var(--dim); font-weight: 600; }
.cd-say { position: relative; margin-top: 14px; min-height: 48px; padding: 12px 18px; border-radius: 20px; border: 2px solid var(--gold); background: var(--surface); color: var(--text); font: 700 18px var(--serif); }
.cd-say::after { content: ''; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px; margin-left: -7px; background: var(--surface); border-left: 2px solid var(--gold); border-top: 2px solid var(--gold); transform: rotate(45deg); }
.cd-say.said { background: var(--gold); color: #1d1405; transform: translateY(-4px); transition: all .25s; }
.cd-say.said::after { background: var(--gold); }

/* the clash */
.cd-clash { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; max-width: 340px; margin: 0 auto; }
.cd-thoughts { width: 100%; }
.cd-thoughts .choices.cd-two { display: flex; flex-direction: column; gap: 46px; width: 100%; }
.cd-thoughts .choice { position: relative; min-height: 60px; padding: 14px 16px; border-radius: 22px; justify-content: center; text-align: center; font: 700 19px var(--serif); }
.cd-thoughts .choice span { display: block; }
.cd-new { display: none !important; color: var(--gold); }
.cd-strike .cd-old { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .55; transition: opacity .3s; }
.cd-rewrite .cd-old { display: none !important; }
.cd-rewrite .cd-new { display: block !important; animation: cdIn .4s ease-out both; }
@keyframes cdIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cd-zap { position: absolute; left: 50%; top: 50%; width: 60px; height: 30px; margin: -15px 0 0 -30px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.cd-clash { position: relative; }
.cd-zap i { display: block; width: 4px; height: 28px; border-radius: 2px; background: var(--gold); transform: skewX(-20deg); opacity: 0; }
.cd-buzz .cd-zap i { animation: cdZap .35s ease-in-out infinite alternate; }
.cd-buzz .cd-zap i:nth-child(2) { animation-delay: .12s; } .cd-buzz .cd-zap i:nth-child(3) { animation-delay: .24s; }
@keyframes cdZap { from { opacity: .2; transform: skewX(-20deg) scaleY(.6); } to { opacity: 1; transform: skewX(20deg) scaleY(1.1); } }
.cd-buzz .cd-thoughts .choice { animation: cdShake .18s linear 6; }
@keyframes cdShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.cd-calm .cd-zap { opacity: 0; transition: opacity .2s; }

/* the $20 replay */
.cd-stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cd-th { padding: 14px 16px; border-radius: 22px; background: var(--surface); border: 2px solid var(--line-strong); text-align: center; font: 700 19px var(--serif); }
.cd-buzz .cd-th:not(.cd-why) { animation: cdShake .18s linear 6; }
.cd-why { max-height: 0; padding: 0 16px; opacity: 0; overflow: hidden; border-width: 0; color: var(--gold); transition: max-height .4s, padding .4s, opacity .4s; }
.cd-paid .cd-why { max-height: 80px; padding: 14px 16px; opacity: 1; border-width: 2px; border-color: var(--gold); }
.cd-stack + .cd-zap, .cd-clash > .cd-zap { z-index: 1; }

/* the pay */
.cd-pic { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.cd-pic img { height: 100px; max-width: 100%; object-fit: contain; display: block; }
.cd-pic span { font-size: 13px; color: var(--dim); font-weight: 600; }
.cd-scale { width: 100%; max-width: 330px; padding: 46px 8px 0; }
.cd-line { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--raised), var(--line-strong)); }
.cd-mk { position: absolute; left: var(--x); top: -50px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-style: normal; opacity: 0; transition: opacity .5s; }
.cd-mk::after { content: ''; width: 3px; height: 14px; margin-top: 2px; background: currentColor; border-radius: 2px; }
.cd-mk b { font: 800 16px var(--mono); line-height: 1.1; }
.cd-mk span { font: 700 12px var(--mono); }
.cd-m1 { color: var(--gold); top: 2px; flex-direction: column-reverse; }
.cd-m1::after { margin: 0 0 2px; }
.cd-m20 { color: #8FA8E8; }
.cd-shown .cd-mk { opacity: 1; }
.cd-ends { display: flex; justify-content: space-between; margin-top: 52px; font-size: 12px; font-weight: 700; color: var(--dim); }

/* the doubt */
.cd-doubt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 26px; border-radius: 20px; background: var(--surface); border: 2px dashed var(--line-strong); text-align: center; }
.cd-doubt small { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.cd-doubt b { font: 700 30px var(--serif); }
.cd-doubt span { font-size: 15px; color: var(--dim); }
.cd-doubt em { margin-top: 6px; font-style: normal; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }

/* the racetrack: one 1-to-7 track */
.cd-sure { width: 100%; max-width: 330px; display: flex; flex-direction: column; gap: 4px; }
.cd-sure > small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); text-align: center; margin-bottom: 46px; }
.cd-st { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--raised), var(--line-strong)); }
.cd-pin { position: absolute; left: var(--x); bottom: 4px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-style: normal; opacity: 0; transition: opacity .5s; white-space: nowrap; }
.cd-pin::after { content: ''; width: 3px; height: 12px; margin-top: 2px; background: currentColor; border-radius: 2px; }
.cd-pin b { font-size: 12px; font-weight: 700; }
.cd-pin span { font: 800 16px var(--mono); }
.cd-pin.a { color: #8FA8E8; } .cd-pin.b { color: var(--gold); transition-delay: .4s; }
.cd-shown .cd-pin { opacity: 1; }
.cd-sure .cd-ends { margin-top: 6px; }

/* the phone review */
.cd-review { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 330px; }
.cd-mine { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); border: 2px solid var(--gold); }
.cd-mine small, .cd-card small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.cd-mine b { font: 700 20px var(--serif); }
.cd-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line-strong); }
.cd-card b { font: 700 18px var(--serif); line-height: 1.3; }
.cd-card span { font-size: 13px; color: var(--gold); font-weight: 700; }

/* the racetrack */
.cd-track-sc { position: relative; width: 100%; max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.cd-bg { width: 150px; height: auto; opacity: .9; margin-bottom: -6px; }
.cd-pair { width: 100%; }
.cd-pair .choices.cd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.cd-pair .choice { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; min-height: 0; text-align: center; }
.cd-pair .choice img { height: 104px; width: auto; }
.cd-pair .choice b { font-size: 15px; }
.cd-pair .choice small { font-size: 12px; color: var(--dim); font-weight: 600; line-height: 1.2; }
.cd-score { font-style: normal; font: 700 15px var(--mono); color: var(--dim); }
.cd-score:empty { display: none; }
.cd-hi .cd-score { color: var(--gold); }

@media (max-height: 700px) {
  .cd-board { grid-template-columns: repeat(3, 48px); gap: 8px; margin-top: 20px; } .cd-peg { width: 48px; height: 48px; }
  .cd-clock { width: 52px; height: 52px; } .cd-hand { height: 18px; top: 7px; transform-origin: 50% 18px; }
  .cd-hall img { height: 120px; }
  .cd-pic img { height: 76px; }
  .cd-thoughts .choices.cd-two { gap: 36px; }
  .cd-pair .choice img { height: 76px; }
  .cd-bg { width: 110px; }
}
