/* Transformer lesson. All rules scoped under .tf-* */
.tf-sc { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.tf-note { text-align: center; font-size: 12px; color: var(--faint); }

/* word chips */
.tf-row { display: flex; flex-wrap: wrap; gap: 6px 5px; justify-content: center; }
.tf-w {
  display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; min-height: 34px; border-radius: 10px;
  font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--dim);
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 #070a14; transition: border-color .2s, background .2s, color .2s, opacity .3s;
}
.tf-w.on { color: var(--text); border-color: var(--violet-bright); background: color-mix(in srgb, var(--violet) 22%, var(--surface)); }
.tf-w.src { color: #fff; border-color: var(--violet-bright); background: color-mix(in srgb, var(--violet) 30%, var(--surface)); }
.tf-w.hot { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.tf-w.flash { animation: tfFlash .5s ease-out; }
@keyframes tfFlash { 30% { box-shadow: 0 3px 0 #070a14, 0 0 0 4px rgba(169,155,255,.45); } }

/* the race */
.tf-lane { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: #0D1224; border: 1px solid var(--line); }
.tf-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tf-hd span { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.tf-hd b { font-family: var(--mono); font-size: 13px; color: var(--gold); }
.tf-lane.tf-new .tf-hd span { color: var(--violet-bright); }
.tf-lane.done { border-color: var(--violet-bright); }

/* the stack */
.tf-pics { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tf-pic { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--dim); font: 700 13px var(--sans); transition: opacity .4s, border-color .4s, transform .4s; }
.tf-pic:disabled { opacity: 1; cursor: default; }
.tf-pic img { display: block; width: 100%; height: 56px; object-fit: contain; }
.tf-pic.lit { border-color: var(--gold); color: var(--gold); transform: scale(1.05); }
.tf-pic.off { opacity: .3; }
.tf-or { font-family: var(--serif); font-size: 17px; color: var(--faint); }
.tf-cap { min-height: 36px; margin-bottom: 14px; text-align: center; font-size: 14px; line-height: 1.3; color: var(--dim); }
.tf-cap b { color: var(--gold); }
.tf-tower { position: relative; display: flex; flex-direction: column; touch-action: none; cursor: grab; border-radius: 14px; background: #0D1224; border: 1px solid var(--line); }
.tf-floor, .tf-ground { position: relative; height: 46px; border-bottom: 1px dashed rgba(169,155,255,.2); transition: background .3s; }
.tf-ground { border-bottom: 0; }
.tf-floor i, .tf-ground i { position: absolute; left: 0; top: 0; bottom: 0; width: 24px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; font-weight: 700; color: var(--faint); border-right: 1px solid rgba(169,155,255,.14); }
.tf-floor.lit { background: rgba(123,92,253,.12); }
.tf-floor.lit i { color: var(--violet-bright); }
.tf-ride { position: absolute; left: 26px; right: 2px; bottom: 5px; pointer-events: none; }
.tf-ride .tf-row { flex-wrap: nowrap; gap: 3px; }
.tf-ride .tf-w { font-size: 14px; padding: 3px 5px; min-height: 34px; }
.tf-looks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tf-arc { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }

/* the needle between the two bats */
.tf-gauge { display: grid; grid-template-columns: 76px 1fr 76px; align-items: center; gap: 8px; }
.tf-end { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line-strong); color: var(--dim); font: 700 12px var(--sans); transition: opacity .4s, border-color .3s, transform .3s; }
.tf-end:disabled { opacity: 1; cursor: default; }
.tf-end img { display: block; width: 100%; height: 44px; object-fit: contain; }
.tf-end.mine { border-color: var(--violet-bright); color: var(--violet-bright); }
.tf-end.lit { border-color: var(--gold); color: var(--gold); transform: scale(1.05); }
.tf-end.off { opacity: .35; }
.tf-track { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(252,192,80,.25), rgba(169,155,255,.35)); }
.tf-needle { position: absolute; top: -10px; width: 6px; height: 32px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.6); transition: left .7s cubic-bezier(.2,.8,.2,1); }

/* the race on a page */
.tf-page { align-self: center; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); font-size: 13px; font-weight: 700; color: var(--dim); }
.tf-prog { height: 14px; border-radius: 7px; background: var(--raised); overflow: hidden; }
.tf-prog i { display: block; height: 100%; width: 0; background: var(--dim); border-radius: 7px; }
.tf-lane.tf-new .tf-prog i { background: var(--violet-bright); }

/* steps */
.tf-bars { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; background: #0D1224; border: 1px solid var(--line); }
.tf-bar { display: grid; grid-template-columns: 58px 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; }
.tf-bar span { font-size: 14px; font-weight: 700; color: var(--text); grid-row: 1 / 3; }
.tf-bar i { display: block; height: 14px; border-radius: 7px; background: var(--raised); overflow: hidden; }
.tf-bar i b { display: block; height: 100%; width: 0; border-radius: 7px; background: var(--dim); }
.tf-bar.gpt i b { background: var(--gold); }
.tf-bar em { font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--gold); }

/* order */
.tf-order { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.tf-orow { display: flex; gap: 8px; }
.tf-order .tf-w { font-size: 20px; padding: 6px 12px; min-height: 44px; color: var(--text); position: relative; }
.tf-w.same { border-color: var(--violet-bright); transition: rotate .4s; }
.tf-w.j0 { rotate: -7deg; } .tf-w.j1 { rotate: 5deg; } .tf-w.j2 { rotate: -3deg; }
.tf-w sup { position: absolute; top: -9px; right: -7px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: #2A1B00; font: 700 12px/20px var(--sans); text-align: center; opacity: 0; transform: scale(.5); transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1); }
.tf-w.stamped sup { opacity: 1; transform: none; }

/* photo */
.tf-photo { display: flex; justify-content: center; }
.tf-grid { display: grid; grid-template-columns: repeat(3, 40px); grid-auto-rows: 59px; gap: 0; transition: gap .4s; }
.tf-grid.cut { gap: 5px; }
.tf-grid.line { grid-template-columns: repeat(9, 30px); grid-auto-rows: 44px; gap: 4px; }
.tf-tile { display: block; background-size: 300% 300%; background-repeat: no-repeat; border-radius: 4px; background-color: #1A2136; }
.tf-tile.on { box-shadow: 0 0 0 2px var(--violet-bright); }

@media (max-height: 700px) {
  .tf-floor, .tf-ground { height: 40px; }
  .tf-pic img { height: 46px; }
  .tf-end img { height: 34px; }
  .tf-end { padding: 3px; }
  .tf-cap { font-size: 13px; min-height: 34px; margin-bottom: 10px; }
  .tf-sc { gap: 8px; }
}
