/* Tà Long Giáng Thế: the 7 boss cards (boss-cards.js, docs/dac-ta-the-boss-ta-long.md). One row that scrolls sideways,
   Rồng 1 sao last and 1.2× bigger. The cards size to the row's height (a size container), so a phone held sideways
   (html.rotated, where vh is the phone's long side) and a desktop both fit; the text sizes follow the card's width
   (210 px = the spec's sizes). */
html .boss-overlay .bl-grid.tl-rail { flex: 1 1 0; min-height: 150px; display: flex; gap: 16px; align-items: center; justify-content: safe center; padding: 10px 24px 14px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; container-type: size; }
html .boss-overlay .bl-grid.tl-rail::-webkit-scrollbar { display: none; }
html .boss-overlay .bl-grid.tl-rail ~ .bl-story { flex: 0 0 auto; }
.tl-card { position: relative; flex: 0 0 auto; height: min(280px, 83cqh); aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; color: #f9f3e7; font: inherit; text-align: center; scroll-snap-align: center; isolation: isolate; container-type: inline-size; cursor: pointer; transition: transform 150ms; -webkit-tap-highlight-color: transparent; }
.tl-card.final { height: min(336px, 100cqh); margin-left: 16px; }
.tl-card > img, .tl-card > i { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.tl-card > i { background: center / 100% 100% no-repeat; }
.tl-bg { border-radius: 6%; z-index: 0; }
.tl-boss { z-index: 2; transform-origin: 50% 48%; animation: tl-breath 3s ease-in-out infinite alternate; }
.tl-fx { z-index: 3; animation: tl-flicker 1.5s ease-in-out infinite alternate; }
.tl-card.final .tl-fx { z-index: 1; }   /* Rồng 1 sao: its effect behind it, the seven orbs on its chest stay clear */
.tl-frame { z-index: 5; filter: drop-shadow(0 0 3px var(--glow)); animation: tl-rim 3s ease-in-out infinite alternate; }
.tl-card > .tl-frame-dead, .tl-card > .tl-stamp, .tl-card > .tl-lock { display: none; }
.tl-plate { z-index: 6; }
.tl-card > .tl-orb { inset: auto; left: 7.5%; top: 1.3%; width: 14.5%; height: auto; z-index: 8; }
.tl-card > .tl-crown { left: 45%; top: .5%; width: 10%; }
.tl-card > .tl-element { inset: auto; left: 78%; top: 1.6%; width: 13.5%; height: auto; z-index: 8; }
.tl-card > .tl-lock { z-index: 7; }
.tl-card > .tl-stamp { inset: auto; left: 10%; top: 21%; width: 80%; height: auto; aspect-ratio: 2 / 1; transform: rotate(-12deg); z-index: 9; }
.tl-particles { position: absolute; inset: 0 0 41%; overflow: hidden; pointer-events: none; z-index: 4; }
.tl-particles img { position: absolute; left: var(--x); top: var(--y); width: 4.8cqw; height: 4.8cqw; opacity: .6; animation: tl-drift 4s ease-in-out infinite; animation-delay: var(--d); }
.tl-shine { z-index: 7; overflow: hidden; border-radius: 6%; }
.tl-shine::after { content: ''; position: absolute; inset: -50%; background: linear-gradient(120deg, transparent 45%, #fff6c766 50%, transparent 55%); animation: tl-shine 6s linear infinite; }
/* the text the game writes, on the name board's dark lower part (60–99%) */
.tl-card > b, .tl-card > small, .tl-card > span, .tl-card > em { position: absolute; left: 8%; width: 84%; z-index: 10; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; text-shadow: 0 1px 2px #000; }
.tl-name { top: 62.1%; font-size: 6.67cqw; font-weight: 900; letter-spacing: .3px; text-transform: uppercase; }
.tl-reward { top: 67.3%; font-size: 4.8cqw; color: #f8d582; }
.tl-trait { top: 69.8%; display: flex; align-items: center; justify-content: center; gap: 1.9cqw; font-size: 4.8cqw; color: #e2e7f0; }
.tl-trait img, .tl-skill img { flex: none; width: 5.7cqw; height: 5.7cqw; }
.tl-skill { top: 74%; display: flex; align-items: center; justify-content: center; gap: 1.4cqw; font-size: 4.8cqw; color: #f5f5ff; }
.tl-skill img { width: 7.1cqw; height: 7.1cqw; }
.tl-skill span { overflow: hidden; text-overflow: ellipsis; }
.tl-hp { top: 81.1%; font-size: 4.8cqw; font-weight: 800; }
.tl-track { display: block; height: 2.9cqw; margin-bottom: 1.4cqw; border: 1px solid #b59b72; border-radius: 2cqw; background: #080c15; overflow: hidden; }
.tl-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ba3830, #ff9c54); transition: width 300ms; }
.tl-meta { top: 87.7%; font-size: 4.8cqw; color: #e2e7f0; }
.tl-action { top: 91.8%; height: 6.2%; display: flex; align-items: center; justify-content: center; background: url('assets/ta-long/cards/1x/shared/talong-btn-fight.webp?v=20261127') center / 100% 100% no-repeat; font-size: 5.2cqw; font-weight: 900; color: #20150b; text-shadow: none; }
.tl-label { top: 52%; display: none; padding: 2.4cqw 0; background: #310d15e8; color: #ffd7d7; font-size: 4.8cqw; font-weight: 800; }
.tl-card.final .tl-name { top: 60.9%; font-size: 6.75cqw; }
.tl-card.final .tl-reward { top: 66.2%; font-size: 4cqw; }
.tl-card.final .tl-trait { top: 70.3%; font-size: 3.8cqw; }
.tl-card.final .tl-skill { top: 74.5%; font-size: 3.8cqw; }
.tl-card.final .tl-trait img, .tl-card.final .tl-skill img { width: 4.6cqw; height: 4.6cqw; }
.tl-card.final .tl-hp, .tl-card.final .tl-meta, .tl-card.final .tl-action { font-size: 4cqw; }
/* tap states */
@media (hover: hover) { .tl-card[data-state=active]:hover, .tl-card[data-state=rejoin]:hover { transform: translateY(-6px) scale(1.03); } .tl-card[data-state=active]:hover .tl-frame, .tl-card[data-state=rejoin]:hover .tl-frame { filter: drop-shadow(0 0 7px var(--glow)); } }
.tl-card[data-state=active]:active, .tl-card[data-state=rejoin]:active { transform: scale(.97); transition-duration: 80ms; }
.tl-card:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 12px; }
.tl-card:not([data-state=active]):not([data-state=rejoin]) { cursor: default; }
.tl-card.invalid { animation: tl-shake 200ms 2; }
/* states */
.tl-card[data-state=rejoin] .tl-action { background-image: url('assets/ta-long/cards/1x/shared/talong-btn-rejoin.webp?v=20261127'); }
.tl-card[data-state=waiting] .tl-action, .tl-card[data-state=locked] .tl-action { background-image: url('assets/ta-long/cards/1x/shared/talong-btn-disabled.webp?v=20261127'); color: #fff; font-weight: 600; text-shadow: 0 1px 2px #000; }
.tl-card[data-state=dead] .tl-action, .tl-card[data-state=teamdead] .tl-action { background: none; color: #f1d3a0; font-weight: 600; text-shadow: 0 1px 2px #000; }
.tl-card:not([data-state=active]):not([data-state=rejoin]) .tl-boss { animation: none; }
.tl-card:not([data-state=active]):not([data-state=rejoin]) .tl-particles,
.tl-card:not([data-state=active]):not([data-state=rejoin]) .tl-shine { display: none; }
.tl-card[data-state=dead] .tl-boss { filter: grayscale(1) brightness(.55); }
.tl-card[data-state=dead] .tl-bg { filter: grayscale(1) brightness(.5); }
.tl-card[data-state=dead] .tl-fx, .tl-card[data-state=dead] .tl-frame { display: none; }
.tl-card[data-state=dead] > .tl-frame-dead, .tl-card[data-state=dead] > .tl-stamp { display: block; }
.tl-card[data-state=dead] .tl-orb, .tl-card[data-state=dead] .tl-element { filter: grayscale(1) brightness(.65); }
.tl-card[data-state=waiting] .tl-boss, .tl-card[data-state=waiting] .tl-bg { filter: saturate(.7); }
.tl-card[data-state=waiting] .tl-fx, .tl-card[data-state=teamdead] .tl-fx, .tl-card[data-state=locked] .tl-fx { display: none; }
.tl-card[data-state=teamdead] .tl-boss { filter: grayscale(.85) brightness(.7); }
.tl-card[data-state=teamdead] .tl-label { display: block; }
.tl-card[data-state=locked] .tl-boss { filter: brightness(.35); }
.tl-card[data-state=locked] > .tl-lock { display: block; }
/* the moments */
.tl-card.dying { animation: tl-deathshake 300ms; }
.tl-card.dying::after { content: ''; position: absolute; inset: 0; z-index: 20; border-radius: 6%; background: #fff; animation: tl-flash 120ms forwards; pointer-events: none; }
.tl-card.dying .tl-boss, .tl-card.dying .tl-bg { transition: filter 600ms; }
.tl-card.dying > .tl-stamp { animation: tl-stamp 250ms 350ms cubic-bezier(.2, 1.5, .4, 1) both; }
.tl-card.unlocking > .tl-lock { display: block; animation: tl-unlock 800ms forwards; }
.tl-card.unlocking .tl-boss { animation: tl-light 800ms; }
.tl-card.respawning { animation: tl-respawn 500ms both; }
@keyframes tl-breath { to { transform: scale(1.015); } }
@keyframes tl-flicker { to { opacity: .78; } }
@keyframes tl-rim { to { filter: drop-shadow(0 0 5px var(--glow)); } }
@keyframes tl-drift { 50% { transform: translate(3px, -13px); opacity: .2; } }
@keyframes tl-shine { 0%, 70% { transform: translateX(-85%); } 100% { transform: translateX(85%); } }
@keyframes tl-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes tl-deathshake { 0%, 100% { transform: translate(0); } 20% { transform: translate(-4px, 1px); } 40% { transform: translate(4px, -1px); } 60% { transform: translate(-3px, 0); } 80% { transform: translate(3px, 1px); } }
@keyframes tl-flash { from { opacity: .9; } to { opacity: 0; } }
@keyframes tl-stamp { from { transform: rotate(-12deg) scale(1.6); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
@keyframes tl-unlock { 30% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; filter: brightness(2.5); } }
@keyframes tl-light { from { filter: brightness(.35); } to { filter: brightness(1); } }
@keyframes tl-respawn { from { filter: brightness(2.2) saturate(0); } to { filter: none; } }
html.perf-low .tl-boss, html.perf-low .tl-fx, html.perf-low .tl-frame, html.perf-low .tl-shine::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .tl-card, .tl-card *, .tl-card::after { animation: none !important; transition-duration: 200ms !important; } .tl-particles { display: none; } }
/* phone held sideways: a slimmer top, the row takes the room */
html.short .boss-overlay .bl-grid.tl-rail { padding: 4px 14px 6px; gap: 12px; justify-content: flex-start; }
html.short .boss-overlay .bl-grid.tl-rail ~ .bl-story { padding: 0 3%; font-size: 12px; }
