/* The model card, BADGE GRID design (Live\Browse\CardsGrid draws the markup, Live\Browse\CardDesign the per-tag rules).
   One picture, then ONE overlay (.mc-ui) that is a column: a top band (two rows of lanes) and a foot (a row of lanes, the show banner, the name strip). Every lane has one fixed height (--tg, the icon size),
   so left and right badges are always level, and what does not fit a lane wraps to a second row that is clipped away whole: a badge is shown complete or not at all. Colours: the site's own, --msg-*,
   and the per-tag rules the designer prints (.tg-<tag> { --tg-bg ... }). */
.bp-cards { --gap: 8px; list-style: none; margin: 0; padding: 0; }
.bp-grid { container-type: inline-size; }
@media (max-width: 991px) { .bp-grid { margin-top: 16px; } }
.bp-grid > .bp-cards { --n: 6; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cmin, 200px), 1fr)); gap: var(--gap); width: auto; }
@container (max-width: 699px) { .bp-grid > .bp-cards { --n: 3; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); } }
@container (max-width: 479px) { .bp-grid > .bp-cards { --n: 2; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); } }
@keyframes card-spin { to { transform: rotate(360deg); } }
@keyframes card-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
:root { --tgb: 28px; --edge: 8px; --tgap: 4px; --maxlen: 14; --lx: 0px; --tn-show-bg: var(--msg-accent-2); --tn-show-fg: var(--msg-on-accent); }

/* the card and its picture */
.model-card { position: relative; display: list-item; margin: 0; list-style: none; text-align: center; border-radius: 4px; overflow: hidden; container-type: inline-size; container-name: tncard; }
.model-card.mcl-overlay { aspect-ratio: 4 / 3; }
.model-card.browse-nomatch { grid-column: 1 / -1; aspect-ratio: auto; overflow: visible; }
.mc-pic { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.card-link { position: absolute; inset: 0; display: block; color: var(--msg-white); text-decoration: none; cursor: pointer; }
.video-wrapper { position: absolute; inset: 0; display: flex; overflow: hidden; }
.thumbnail-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; max-width: 100%; transition: opacity .3s ease-in-out; font-size: 0; color: transparent; }
.thumbnail-image:hover { filter: brightness(93%); }
.video-live, .video-player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; opacity: 0; transition: opacity .1s ease-in-out; pointer-events: none; }
.video-wrapper.loading::before { content: ''; position: absolute; top: 50%; left: 50%; z-index: 10; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 4px solid color-mix(in srgb, var(--msg-white) 30%, transparent); border-top-color: var(--msg-accent-2); border-radius: 50%; animation: card-spin .8s linear infinite; }
.thumbnail-image.is-breathing { animation: card-breathe 1s ease-in-out 2; }
.home-track .home-grid > li { float: none; width: auto; height: auto; margin: 0; }

/* the overlay: top band, foot. Nothing in it can be reached by a click except the follow button: the card under it is the link. */
.mc-ui, .mc-info, .mc-rib { --tg: var(--tgb); }
.mc-ui { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; padding: var(--edge) var(--edge) 0; overflow: hidden; pointer-events: none; }
.mc-top, .mc-foot { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--tgap); min-width: 0; }
.mc-foot { margin: 0 calc(var(--edge) * -1); }
.mc-foot > .mc-row, .mc-foot > .card-show { margin: 0 var(--edge); }
.mcl-info .mc-ui { padding-bottom: var(--edge); }
.mcl-info .mc-foot { margin-bottom: 0; }
.mc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--tgap); align-items: center; }
.mc-lane { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tgap); height: calc(var(--tg) + var(--lx)); row-gap: calc(var(--tg) + var(--lx) + 12px); overflow: hidden; min-width: 0; }
.mc-lane:empty { display: none; }
.mc-l { grid-column: 1; }
.mc-r { grid-column: 2; justify-self: end; justify-content: flex-end; max-width: 55cqw; }
.mc-l:only-child { grid-column: 1 / -1; }
.mc-r:only-child { grid-column: 1 / -1; max-width: none; width: 100%; } /* a row with only a right lane: it may use the whole row, still pushed to the right */

/* the name strip: glued to the bottom edge of the picture (name over the picture), or under the picture (name and tags under it) */
.card-name { display: flex; align-items: center; gap: 8px; box-sizing: border-box; min-width: 0; font: 700 14px/1.2 Arial, Helvetica, sans-serif; text-align: left; }
.mcl-overlay .card-name { min-height: 30px; padding: 6px var(--edge); background: linear-gradient(0deg, color-mix(in srgb, var(--msg-black) 74%, transparent), transparent); color: var(--msg-white); text-shadow: 0 1px 3px color-mix(in srgb, var(--msg-black) 80%, transparent); }
/* the dot before the name: online = the fixed "on" green with a soft ring, offline = a plain grey. (Both used to be shades of the site's red, which look the same in a red look.) */
.card-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: color-mix(in srgb, var(--msg-white) 45%, transparent); }
.card-dot.is-on { background: var(--msg-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--msg-green) 30%, transparent); }
.card-user { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-nr { display: flex; flex: none; flex-wrap: nowrap; height: auto; margin-left: auto; overflow: hidden; }
.mc-nr .tg { height: auto; min-height: 0; padding: 0; }

/* the info layout: the name and a row of small tags under the picture */
.model-card.mcl-info { aspect-ratio: auto; background: var(--msg-surface); border-radius: 6px; }
.mcl-info .mc-pic { position: relative; inset: auto; aspect-ratio: 4 / 3; }
.mc-info { padding: 8px 10px 10px; text-align: left; color: var(--msg-text); }
.mcl-info .card-name { color: var(--msg-text); font-size: 15px; }
.card-subject { display: none; }
.mcl-info .card-subject { margin: 2px 0 0; padding: 0; font-size: 13px; line-height: 1.3; color: var(--msg-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.mc-meta { margin-top: 6px; }
.mc-metalane { justify-content: flex-start; }

/* one badge (the designer's rules per tag set the variables) */
.tg { --tgi: max(18px, calc(var(--tg) + var(--tg-d, 0px))); display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--tgi) * .18); flex: none; box-sizing: border-box; height: var(--tgi); min-width: var(--tgi); padding: 0 calc(var(--tgi) * .3); border: 1px solid var(--tg-bd, transparent); border-radius: calc(var(--tgi) * var(--tg-rad, 0) / 100); background: var(--tg-bg, transparent); color: var(--tg-fg, var(--msg-white)); font-size: calc(var(--tgi) * .42); font-weight: 700; line-height: 1; white-space: nowrap; text-decoration: none; text-shadow: var(--tg-shadow, none); pointer-events: none; max-width: 100%; overflow: hidden; }
.tg-ico { width: var(--tgi); padding: 0; }
.tg-img { min-width: 0; padding: 0; }
.tg-i { display: flex; flex: none; align-items: center; justify-content: center; width: calc(var(--tgi) * .54); height: calc(var(--tgi) * .54); width: round(to-zero, calc(var(--tgi) * .54), 2px); height: round(to-zero, calc(var(--tgi) * .54), 2px); } /* the svg inside is centred on its own drawing: nothing here can push it off the middle */
.tg-i svg { display: block; width: 100%; height: 100%; }
.tg-t { flex: 0 1 auto; min-width: 0; max-width: calc(var(--maxlen) * 1ch + 1ch); overflow: hidden; text-overflow: ellipsis; text-transform: var(--tg-caps, none); letter-spacing: .02em; }
.tg .card-flag { display: block; width: calc(var(--tgi) * .65); height: calc(var(--tgi) * .65); }
.mc-meta .tg-online_time { color: var(--msg-muted); }
button.tg { pointer-events: auto; position: relative; font-family: inherit; cursor: pointer; }
button.tg::after { content: ""; position: absolute; inset: -8px; } /* a 44 px tap area around the badge */
button.tg.is-on { color: var(--msg-gold); }
button.tg:focus-visible { outline: 2px solid var(--msg-ring); outline-offset: 2px; }

/* the show banner (a private show, a ticket show, a group show) and the ticket panel */
.card-show { display: flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: var(--tg); padding: 3px 6px 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--tn-show-bg) 92%, transparent); color: var(--tn-show-fg); font-size: 12px; line-height: 1.3; text-align: left; white-space: nowrap; }
.card-show b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.card-show .w-s { display: none; }
.card-join { margin-left: auto; padding: 2px 12px; border-radius: 999px; background: var(--tn-show-fg); color: var(--tn-show-bg); font-size: 12px; font-weight: 700; }
.card-panel { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 12px 56px; text-align: center; background: color-mix(in srgb, var(--msg-black) 64%, transparent); color: var(--msg-white); }
.card-panel-t { max-width: 100%; font-size: 15px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-panel-go { padding: 7px 16px; border-radius: 6px; background: var(--tn-show-bg); color: var(--tn-show-fg); font-size: 13px; font-weight: 700; }
.card-panel-p { display: none; } /* the price is on the show bar under the panel ("Ticket 30 tk"); a second line of it only slid behind that bar on a small card */
.card-panel-vip { position: absolute; right: var(--edge); bottom: 40px; padding: 1px 6px; border-radius: 4px; background: var(--tn-show-bg); color: var(--tn-show-fg); font-size: 11px; font-weight: 800; font-style: normal; }
.mc-ui:has(.card-panel) .mc-brow { display: none; } /* the panel owns the picture: the lower lanes would show through it */
.mcl-info .card-panel { padding-bottom: 12px; }

/* the small bar that offers a fresh list when models came online or left (browse-live.js) */
.bp-fresh { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); min-height: 44px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--msg-accent); color: var(--msg-on-accent); font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px color-mix(in srgb, var(--msg-black) 45%, transparent); }
@media (max-width: 900px) { .bp-fresh { bottom: 76px; } }

/* ---- smaller cards: the badges get one step smaller, then the second rows go, then the lower lane row of a card in a show. The card measures itself (the admin's smallest cards are 170 px wide). */
@container tncard (max-width: 259px) { .mc-ui, .mc-info, .mc-rib { --tg: max(22px, calc(var(--tgb) - 4px)); } .card-show .w-l { display: none; } .card-show .w-s { display: inline; } }
@container tncard (max-width: 239px) { .mc-row2 { display: none; } }
@container tncard (max-width: 209px) {
  .mc-ui, .mc-info, .mc-rib { --tg: max(20px, calc(var(--tgb) - 6px)); --edge: 6px; --lx: 0px; } /* small cards: no room for a larger badge, it is drawn like the others */
  .mc-ui .tg, .mc-info .tg { --tg-d: 0px; }
  .card-show.is-private .w-p { display: none; }
  .card-show { font-size: 11px; padding-left: 7px; }
  .card-panel { gap: 5px; padding: 34px 8px 38px; } .card-panel-vip { display: none; } .card-panel-t { font-size: 13px; -webkit-line-clamp: 1; } .card-panel-go { padding: 5px 12px; font-size: 12px; }
  .mcl-info .card-subject { -webkit-line-clamp: 1; min-height: 1.3em; }
}
@container tncard (max-width: 169px) {
  .card-show .w-p { display: none; }
  .card-join { padding: 2px 8px; }
  .mc-ui:has(.card-show) .mc-brow { display: none; } /* a card in a show has no room for both rows: the show badge wins */
  .card-panel-t, .card-panel-p { display: none; } .card-panel { justify-content: flex-end; }
}

/* a corner ribbon: a band across a top corner of the picture (a sale, New, Promoted). Only on cards 240 px and wider: the two top lanes on that side start after it, so a badge is never under it.
   On narrower cards there is no room, so the ribbon is left out and the same tag is a badge in its own lane instead (.rib-alt). */
.rib-alt { display: none; }
.mc-rib { display: none; }
@container tncard (min-width: 240px) {
  .rib-alt { display: none !important; } /* beats the lane's own display rule: the ribbon replaces this badge */
  .mc-rib { --rs: calc(var(--tg) * 2.3); position: absolute; top: 0; z-index: 4; display: block; width: var(--rs); height: var(--rs); overflow: hidden; pointer-events: none; }
  .mc-rib-tl { left: 0; }
  .mc-rib-tr { right: 0; }
  .mc-rib b { position: absolute; top: calc(var(--rs) * .24); width: calc(var(--rs) * 1.7); box-sizing: border-box; padding: 2px 4px; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; background: var(--tg-bg); color: var(--tg-fg); text-transform: var(--tg-caps); font-size: calc(var(--tg) * .4); font-weight: 700; line-height: 1.3; box-shadow: 0 1px 4px color-mix(in srgb, var(--msg-black) 40%, transparent); }
  .mc-rib-tl b { left: calc(var(--rs) * -.46); transform: rotate(-45deg); }
  .mc-rib-tr b { right: calc(var(--rs) * -.46); transform: rotate(45deg); }
  /* left: a spacer as the first item of the lane (a badge that does not fit after it wraps to the clipped row whole, never half hidden); right: the lane itself is moved in and kept as wide as before */
  .mc-ui.rib-tl .mc-top .mc-row:first-child .mc-l::before, .mc-ui.rib-tl .mc-top .mc-row2 .mc-l::before { content: ""; flex: none; height: 1px; margin-right: calc(var(--tgap) * -1); }
  .mc-ui.rib-tl .mc-top .mc-row:first-child .mc-l::before { width: calc(var(--tg) * 2.3 - var(--edge) + var(--tgap)); }
  .mc-ui.rib-tl .mc-top .mc-row2 .mc-l::before { width: max(0px, calc(var(--tg) * 2.3 - var(--edge) - var(--tg) - var(--tgap) * 2)); }
  .mc-ui.rib-tr .mc-top .mc-row:first-child .mc-r { margin-right: calc(var(--tg) * 2.3 - var(--edge) + var(--tgap)); max-width: calc(55cqw - var(--tg) * 2.3); }
  .mc-ui.rib-tr .mc-top .mc-row2 .mc-r { margin-right: max(0px, calc(var(--tg) * 2.3 - var(--edge) - var(--tg) - var(--tgap) * 2)); max-width: calc(55cqw - var(--tg) * 2.3); }  /* a row with only one lane: that lane spans the row, so it is moved away from the ribbon instead */
  .mc-ui.rib-tl .mc-top .mc-row:first-child .mc-r:only-child { width: auto; margin-left: calc(var(--tg) * 2.3 - var(--edge) + var(--tgap)); }
  .mc-ui.rib-tl .mc-top .mc-row2 .mc-r:only-child { width: auto; margin-left: max(0px, calc(var(--tg) * 2.3 - var(--edge) - var(--tg) - var(--tgap) * 2)); }
  .mc-ui.rib-tr .mc-top .mc-row:first-child .mc-l:only-child { margin-right: calc(var(--tg) * 2.3 - var(--edge) + var(--tgap)); }
  .mc-ui.rib-tr .mc-top .mc-row2 .mc-l:only-child { margin-right: max(0px, calc(var(--tg) * 2.3 - var(--edge) - var(--tg) - var(--tgap) * 2)); }
}
.model-card[hidden] { display: none !important; } /* !important: the card's own display rule would otherwise beat the [hidden] attribute (aff-check.js hides other sites' models a visitor may not see) */
