/* TutorMe front-end fixes 2026-11-17 (tm-fixes-1117). Scoped overrides only.
   1  Card decks        ([data-stage-rail].tm-wd: Wins + competitions when not in phone-rolodex mode)
   3  Competition cards   (#competition-cards[data-wins-rolodex], max-width:700px)
   4  Registration trigger (.tm-reg-hit inside the "Your next stage" title) */

/* 1. Card deck (Wins EN+zh, Upcoming competitions) whenever the rail is not in phone-rolodex mode:
   our controller owns the position; no native snap/scrollbar. Class .tm-wd is added by the script. */
html #main [data-stage-rail].tm-wd{overflow:hidden!important;scroll-snap-type:none!important;scroll-behavior:auto!important;scrollbar-width:none}
html #main [data-stage-rail].tm-wd::-webkit-scrollbar{display:none}
/* Bleed: widen the clip box into the arrow gutters so a dragged/falling card is not cut at the card edge. */
html #main [data-stage-rail].tm-wd{--tm-wd-bleed:24px;padding-left:var(--tm-wd-bleed)!important;padding-right:var(--tm-wd-bleed)!important;margin-left:calc(-1*var(--tm-wd-bleed))!important;margin-right:calc(-1*var(--tm-wd-bleed))!important;width:auto!important;max-width:none!important}
@media (min-width:761px){html #main .wins-carousel [data-stage-rail].tm-wd{--tm-wd-bleed:44px}html #main .upcoming-view [data-stage-rail].tm-wd{--tm-wd-bleed:40px}}
html #main [data-stage-rail].tm-wd>*{backface-visibility:hidden}
/* At rest the bleed is clipped away (no peeking neighbour, arrows stay visible and clickable); it opens only while a card moves. */
html #main [data-stage-rail].tm-wd{clip-path:inset(0 var(--tm-wd-bleed))}
html #main [data-stage-rail].tm-wd.tm-wd-moving{clip-path:none}
html #main .competition-showcase .wins-carousel #wins-cards.tm-wd{padding-bottom:64px!important;margin-bottom:-48px!important} /* room for the drop */
html #main [data-stage-rail].tm-wd.tm-wd-dragging,html #main [data-stage-rail].tm-wd.tm-wd-dragging *{cursor:grabbing!important}

/* 3. Competition cards, small screens: card height = its own content, link inside, no inner scroll.
   The rail is no longer a scroll container; html/body already clip horizontal overflow. */
@media (max-width:700px){
 html #main .upcoming-browser #competition-cards[data-wins-rolodex="true"]{display:block!important;position:relative;height:auto!important;max-height:none!important;overflow:visible!important;scroll-snap-type:none!important;overscroll-behavior:auto!important;touch-action:pan-y pinch-zoom}
 html #main .upcoming-browser #competition-cards[data-wins-rolodex="true"]>.stage-card{width:100%!important;max-width:none!important;min-height:0!important;height:auto!important;margin:0!important;box-sizing:border-box;backface-visibility:hidden}
 html #main .upcoming-browser #competition-cards[data-wins-rolodex="true"]>.stage-card[hidden]{display:none!important}
 html #main .upcoming-browser #competition-cards[data-wins-rolodex="true"]>.stage-card[inert]:not([hidden]){position:absolute!important;top:2px;left:0;right:0}
}

/* 4. Registration: the whole title + icon + handwritten note area is one trigger. */
.upcoming-heading .tm-title-play>.tm-reg-hit{position:absolute;left:var(--tm-reg-l,-10px);top:var(--tm-reg-t,-10px);width:var(--tm-reg-w,calc(100% + 20px));height:var(--tm-reg-h,calc(100% + 20px));z-index:-2;pointer-events:auto;background:transparent}
.upcoming-heading .tm-title-play[data-tm-reg]{cursor:default}
.upcoming-heading .tm-title-play[data-tm-reg]:focus{outline:none}
.upcoming-heading .tm-title-play[data-tm-reg]:focus-visible{outline:3px solid #d81665;outline-offset:6px;border-radius:6px}
