/* TNT 2026 shared card UI: inline card links, hover preview, card panel (desktop) / bottom sheet (phone). */

/* [[Card]] links in articles */
.tnt-card-link, a[data-tnt-card]:not(.tnt-inline-card), span[data-tnt-card] { color: var(--tnt-gold-2); font-weight: 700; text-decoration: none; border-bottom: 2px solid rgba(230, 200, 133, 0.35); cursor: pointer; transition: border-color .15s, background-color .15s; -webkit-touch-callout: none; }
.tnt-card-link:hover, .tnt-card-link:focus-visible, .tnt-card-link[aria-expanded="true"] { color: var(--tnt-gold-2); border-bottom-color: var(--tnt-gold-2); background: rgba(197, 160, 89, 0.14); }
.tnt-prose .tnt-card-link { border-bottom-width: 2px; }
.tnt-inline-card { cursor: zoom-in; }

/* hover preview (fine pointers only) */
.tnt-cprev { position: fixed; left: 0; top: 0; z-index: 140; width: 236px; pointer-events: none; opacity: 0; transform: scale(.96); transition: opacity .14s ease, transform .18s var(--tnt-ease); will-change: left, top; }
.tnt-cprev.is-on { opacity: 1; transform: none; }
.tnt-cprev__imgs { display: flex; gap: 8px; }
.tnt-cprev.is-two { width: 480px; }
.tnt-cprev img { display: block; width: 100%; min-width: 0; aspect-ratio: 488 / 680; object-fit: cover; border-radius: 11px; background: #161616; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(197, 160, 89, 0.4); }
.tnt-cprev.is-loading .tnt-cprev__imgs::after { content: ""; display: block; width: 100%; aspect-ratio: 488 / 680; border-radius: 11px; background: linear-gradient(110deg, #161616 30%, #222 50%, #161616 70%) 0 0 / 300% 100%; animation: tntShimmer 1.1s linear infinite; box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.3); }
.tnt-cprev__name { display: block; margin-top: 8px; padding: 6px 10px; background: var(--tnt-bg-0); font-family: var(--tnt-font-ui); font-weight: 700; font-size: var(--tnt-ui-small); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tnt-gold-2); text-align: center; }
.tnt-cprev__name i { font-style: normal; color: var(--tnt-dim); }
@keyframes tntShimmer { to { background-position: -300% 0; } }

/* card dialog: shared shell */
html.tnt-cp-open { overflow: hidden; }
.tnt-cp { position: fixed; inset: 0; z-index: 150; }
.tnt-cp[hidden] { display: none; }
.tnt-cp__scrim { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(6, 6, 6, 0.82); cursor: pointer; animation: tntFade .18s ease-out; }
.tnt-cp__panel { position: absolute; display: flex; flex-direction: column; background: var(--tnt-bg-2); border-top: 4px solid var(--tnt-gold); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); outline: none; }
.tnt-cp__grab { display: none; }
.tnt-cp__head { flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.tnt-cp__titles { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tnt-cp__name { font-family: var(--tnt-font-display); font-size: 30px; line-height: 1; text-transform: uppercase; color: var(--tnt-white); }
.tnt-cp__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tnt-cp__tags span { padding: 3px 9px; background: #252525; color: var(--tnt-gold-2); font-family: var(--tnt-font-ui); font-weight: 700; font-size: var(--tnt-ui-small); letter-spacing: 0.04em; text-transform: uppercase; }
.tnt-cp__tags span:empty { display: none; }
.tnt-cp__tags .is-rar { background: var(--tnt-bg-0); }
.tnt-cp__tags .is-two { background: var(--tnt-accent-readable); color: var(--tnt-accent-ink); }
.tnt-cp__x { flex: 0 0 42px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; cursor: pointer; background: #252525; color: #fff; transition: background-color .15s; }
.tnt-cp__x:hover { background: #333; }
.tnt-cp__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-wrap: wrap; gap: 22px; padding: 20px; }
.tnt-cp__faces { display: none; }
.tnt-cp__imgs { flex: 0 1 300px; display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.tnt-cp.is-two .tnt-cp__imgs { flex: 1 1 480px; }
.tnt-cp__imgs figure { margin: 0; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tnt-cp__imgs img { width: 100%; aspect-ratio: 488 / 680; object-fit: cover; border-radius: 12px; background: #161616; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.tnt-cp__imgs figcaption { font-family: var(--tnt-font-ui); font-weight: 700; font-size: var(--tnt-ui-small); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tnt-muted); text-align: center; }
.tnt-cp:not(.is-two) .tnt-cp__imgs figcaption { display: none; }
.tnt-cp__info { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tnt-cp__face { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--tnt-bg-1); border-left: 3px solid var(--tnt-gold); }
.tnt-cp__fhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tnt-cp__fhead b { font-family: var(--tnt-font-display); font-weight: 400; font-size: 19px; line-height: 1.05; text-transform: uppercase; color: var(--tnt-white); }
.tnt-cp__cost { flex: 0 0 auto; display: flex; flex-wrap: nowrap; gap: 2px; }
.tnt-cp__cost .tnt-pip { --s: 20px; }
.tnt-cp__type { font-family: var(--tnt-font-ui); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; color: var(--tnt-gold-2); text-transform: uppercase; }
.tnt-cp__text { margin: 0; white-space: pre-line; font-size: 14px; line-height: 1.65; color: #d1d5db; }
.tnt-cp__text .tnt-pip { --s: 16px; display: inline-flex; vertical-align: -2px; margin: 0 1px; }
.tnt-cp__pt { align-self: flex-end; padding: 4px 12px; background: #252525; font-family: var(--tnt-font-display); font-size: 18px; color: var(--tnt-white); }
.tnt-cp__find { min-height: 40px; border: 0; cursor: pointer; background: #252525; color: var(--tnt-gold-2); font-family: var(--tnt-font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; box-shadow: inset 0 -2px 0 rgba(197, 160, 89, 0.45); }
.tnt-cp__find:hover { background: #2e2e2e; }
.tnt-cp__price { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; }
.tnt-cp__price span { font-family: var(--tnt-font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tnt-muted); }
.tnt-cp__price b { font-family: var(--tnt-font-display); font-weight: 400; font-size: 28px; color: var(--tnt-white); }
.tnt-cp__tcg { display: flex; align-items: stretch; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); transition: filter .15s, transform .12s; }
.tnt-cp__tcg:hover { filter: brightness(1.08); }
.tnt-cp__tcg:active, .tnt-cp__alt:active { transform: scale(.985); }
.tnt-cp__tcg > span:first-child { flex: 0 0 130px; display: flex; align-items: center; justify-content: center; padding: 0 12px; background: #fff; }
.tnt-cp__tcg > span:first-child img { height: 26px; width: auto; max-width: 100%; }
.tnt-cp__tcg > span:last-child { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 14px; background: #0968f6; color: #fff; font-family: var(--tnt-font-ui); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.tnt-cp__alts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tnt-cp__alt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; color: #fff; transition: filter .15s, transform .12s; }
.tnt-cp__alt:hover { color: #fff; filter: brightness(1.15); }
.tnt-cp__alt img { width: 34px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.tnt-cp__alt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tnt-cp__alt b { font-family: var(--tnt-font-display); font-weight: 400; font-size: 15px; line-height: 1; }
.tnt-cp__alt small { font-family: var(--tnt-font-ui); font-weight: 700; font-size: var(--tnt-ui-small); letter-spacing: 0.04em; text-transform: uppercase; }
.tnt-cp__alt--mp { background: #1a1a29; box-shadow: inset 0 -3px 0 #0088ff; } .tnt-cp__alt--mp small { color: #4db3ff; }
.tnt-cp__alt--wny { background: #050505; box-shadow: inset 0 0 0 2px #1fa3ec; } .tnt-cp__alt--wny small { color: #1fa3ec; }
.tnt-cp__more { font-family: var(--tnt-font-ui); font-weight: 700; font-size: var(--tnt-ui-small); letter-spacing: 0.04em; text-transform: uppercase; color: var(--tnt-dim); text-align: center; }
.tnt-cp__more a { color: var(--tnt-muted); }
.tnt-cp__more a:hover { color: var(--tnt-gold-2); }
.tnt-cp__err { padding: 18px; background: var(--tnt-bg-1); color: var(--tnt-text-2); font-size: 14px; }
/* loading state */
.tnt-cp.is-loading .tnt-cp__imgs img { animation: tntPulse 1.1s ease-in-out infinite alternate; }
.tnt-cp.is-loading .tnt-cp__info > * { opacity: .45; }
@keyframes tntPulse { from { opacity: .45; } to { opacity: .9; } }
/* highlight a row found with "show in decklist" */
.tnt-card-found { animation: tntFound 2.2s ease-out; }
@keyframes tntFound { 0%, 40% { box-shadow: inset 0 0 0 2px var(--tnt-gold), 0 0 0 4px rgba(197, 160, 89, 0.25); background-color: rgba(197, 160, 89, 0.16); } 100% { box-shadow: none; } }

/* desktop: centered panel */
@media (min-width: 761px) {
	.tnt-cp__panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, calc(100% - 32px)); max-height: calc(100vh - 32px); animation: tntPopIn .2s var(--tnt-ease); }
	.tnt-cp.is-two .tnt-cp__panel { width: min(1040px, calc(100% - 32px)); }
}
@keyframes tntPopIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* phone: bottom sheet */
@media (max-width: 760px) {
	.tnt-cp__panel { left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; border-top-width: 3px; border-radius: 16px 16px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6); animation: tntSheetUp .26s var(--tnt-ease); touch-action: pan-y; }
	.tnt-cp__panel.is-dragging { animation: none; transition: none; }
	.tnt-cp__panel.is-settling { transition: transform .22s var(--tnt-ease); }
	.tnt-cp__grab { display: block; flex: 0 0 auto; width: 44px; height: 5px; margin: 9px auto 0; border-radius: 3px; background: #3a3a3a; }
	.tnt-cp__head { padding: 10px 16px 12px; touch-action: none; }
	.tnt-cp__name { font-size: 24px; }
	.tnt-cp__tags span { font-size: 9px; padding: 3px 8px; }
	.tnt-cp__x { flex-basis: 44px; width: 44px; height: 44px; border-radius: 50%; }
	.tnt-cp__body { flex-direction: column; flex-wrap: nowrap; gap: 12px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
	.tnt-cp.is-two .tnt-cp__faces { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
	.tnt-cp__faces button { height: 40px; border: 0; cursor: pointer; background: var(--tnt-bg-3); color: #d1d5db; font-family: var(--tnt-font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
	.tnt-cp__faces button[aria-pressed="true"] { background: var(--tnt-gold); color: var(--tnt-gold-ink); }
	.tnt-cp__imgs, .tnt-cp.is-two .tnt-cp__imgs { flex: 0 0 auto; justify-content: center; }
	.tnt-cp__imgs figure { flex: 0 0 auto; width: min(250px, 66vw); }
	.tnt-cp.is-two .tnt-cp__imgs figure:not(.is-on), .tnt-cp.is-two .tnt-cp__face:not(.is-on) { display: none; }
	.tnt-cp__imgs figcaption { display: none; }
	.tnt-cp__info { flex: 0 0 auto; gap: 12px; }
	.tnt-cp__face { padding: 14px; }
	.tnt-cp__text { font-size: 14.5px; line-height: 1.6; }
	.tnt-cp__find { order: 9; min-height: 46px; }
	.tnt-cp__tcg > span:first-child { flex-basis: 110px; }
	.tnt-cp__alt { padding: 0 10px; gap: 8px; }
	.tnt-cp__alt img { width: 28px; }
}
@keyframes tntSheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.tnt-cprev, .tnt-cp__panel, .tnt-cp__scrim { animation: none !important; transition: none !important; }
}

/* generic / numeric mana symbols */
.tnt-pip--n { font-family: var(--tnt-font-display); font-size: calc(var(--s) * .62); line-height: 1; padding-top: 1px; }
