/* Self-supervised learning lesson. All rules scoped under .selfsup-* */

.selfsup-sc { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* 1. label four: one photo card, a clock, four dots */
.selfsup-label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.selfsup-label .clock { position: absolute; top: 0; right: 0; font-family: var(--mono); font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.selfsup-label .clock b { color: var(--gold); font-size: 16px; }
.selfsup-label.done .clock { border-color: var(--gold-deep); }
.selfsup-label .card { width: 170px; height: 170px; display: grid; place-items: center; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); }
.selfsup-label .card.in { animation: selfsupIn .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes selfsupIn { from { transform: translateX(24px); opacity: 0; } }
.selfsup-label .card img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0,0,0,.5)); }
.selfsup-label .dots { display: flex; gap: 6px; }
.selfsup-label .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--raised); }
.selfsup-label .dots i.ok { background: var(--mint); } .selfsup-label .dots i.no { background: var(--red); }
.selfsup-labelrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.selfsup-labelrow .choice { justify-content: center; text-align: center; padding: 10px 6px; font-size: 15px; }


/* 2. hide words: each one becomes a question the text answers */
.selfsup-hide { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.selfsup-hide .txt { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 2px; padding: 22px 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.selfsup-w { position: relative; min-height: 44px; padding: 0 5px; border: 0; border-radius: 8px; background: none; font-family: var(--serif); font-size: 21px; line-height: 44px; color: var(--text); cursor: pointer; }
.selfsup-w:disabled { cursor: default; color: var(--text); opacity: 1; }
.selfsup-w .r { transition: color .25s; }
.selfsup-w .g { position: absolute; left: 50%; top: -12px; translate: -50% 0; white-space: nowrap; font: 800 12.5px var(--sans); color: var(--gold); opacity: 0; transition: opacity .2s; }
.selfsup-w.hid { background: #2a2440; background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(169,155,255,.14) 5px 7px); box-shadow: inset 0 0 0 2px var(--violet); animation: selfsupPop .25s cubic-bezier(.34,1.56,.64,1) both; }
.selfsup-w.hid .r { color: transparent; }
.selfsup-w.guessing .g, .selfsup-w.shown .g { opacity: 1; }
.selfsup-w.shown { background: none; box-shadow: inset 0 0 0 2px currentColor; }
.selfsup-w.shown .r { color: inherit; }
.selfsup-w.match { color: var(--mint); }
.selfsup-w.match .g::after { content: ' \2713'; }
.selfsup-w.match .g { color: var(--mint); }
.selfsup-w.miss { color: var(--gold); }
.selfsup-w.miss .g { color: var(--dim); text-decoration: line-through; }
@keyframes selfsupPop { from { transform: scale(.85); } }
.selfsup-hide .ctr { display: flex; justify-content: center; gap: 22px; font-size: 14px; color: var(--dim); }
.selfsup-hide .ctr b { font-family: var(--mono); font-size: 18px; color: var(--gold); margin-left: 6px; }
.selfsup-bump b { display: inline-block; animation: selfsupPop .3s cubic-bezier(.34,1.56,.64,1); }

/* 7. the ball and the covered second */
.selfsup-ballwrap { display: grid; place-items: center; }
.selfsup-ball { width: min(100%, 340px); height: auto; display: block; overflow: visible; }
.selfsup-ball .floor { stroke: var(--line-strong); stroke-width: 2; }
.selfsup-ball .table { fill: #c9b79c; } .selfsup-ball .leg { fill: #8d7b62; }
.selfsup-ball .ball { fill: var(--gold); stroke: var(--gold-deep); stroke-width: 2; }
.selfsup-ball .mask rect { fill: #2a2440; transition: opacity .5s; }
.selfsup-ball .mask .pt { fill: rgba(169,155,255,.10); }
.selfsup-ball .mask .edge { fill: none; stroke: rgba(234,227,215,.35); stroke-dasharray: 4 3; stroke-width: 1.5; }
.selfsup-ball .mask.lift rect { opacity: 0; }
.selfsup-ball .ghost { cursor: pointer; transition: opacity .3s; }
.selfsup-ball .ghost .hit { fill: transparent; }
.selfsup-ball .ghost .ring { fill: rgba(252,192,80,.08); stroke: var(--gold); stroke-width: 2; stroke-dasharray: 4 3; animation: selfsupGhost 1.6s ease-in-out 4; transform-box: fill-box; transform-origin: center; }
@keyframes selfsupGhost { 50% { transform: scale(1.15); } }
.selfsup-ball .ghost text { fill: var(--gold); font: 800 14px var(--sans); text-anchor: middle; pointer-events: none; }
.selfsup-ball .ghost.right .ring { stroke: var(--mint); fill: rgba(63,214,154,.2); animation: none; } .selfsup-ball .ghost.right text { fill: var(--mint); }
.selfsup-ball .ghost.wrong .ring { stroke: var(--red); fill: rgba(216,85,85,.2); animation: none; } .selfsup-ball .ghost.wrong text { fill: var(--red); }
.selfsup-ball .ghost.off { opacity: .3; pointer-events: none; } .selfsup-ball .ghost.right.off { opacity: .8; }
.selfsup-ball .mask.lift ~ .ghost { opacity: 0; }

@media (max-height: 700px) {
  .selfsup-label .card { width: 130px; height: 130px; }
  .selfsup-w { font-size: 19px; padding: 0 4px; }
  .selfsup-ball { width: min(100%, 300px); }
}
