/* ==========================================================================
   Tivity Cards – estilos frontend
   ========================================================================== */
:root {
	--tpc-accent: #D9A84A;
	--tpc-accent-2: #FFCB80;
	--tpc-dark: #0b1b2b;
	--tpc-ratio: 0.714;
}
.tpc-empty, .tpc-admin-notice { text-align: center; width: 100%; margin: 1em auto; font-size: 1.1em; }
.tpc-admin-notice { background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; padding: 10px 14px; border-radius: 8px; font-size: 14px; }

/* --------------------------------------------------------------------------
   Carta (giro 3D + brillo)
   -------------------------------------------------------------------------- */
.tpc-card {
	position: relative;
	width: var(--tpc-card-w, 100%);
	max-width: 100%;
	aspect-ratio: var(--tpc-ratio, 0.714);
	perspective: 1400px;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.tpc-card[role="button"] { cursor: pointer; }
.tpc-card__inner {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transition: transform var(--tpc-flip, 0.9s) cubic-bezier(0.4, 0.2, 0.2, 1);
	will-change: transform;
}
.tpc-card__inner.is-flipped { transform: rotateY(180deg); }
.tpc-card__face {
	position: absolute;
	inset: 0;
	border-radius: var(--tpc-card-radius, 14px);
	overflow: hidden;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	background: var(--tpc-face-bg, #0b1b2b);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	transform: translateZ(0);
}
.tpc-card__front { transform: rotateY(180deg); }
.tpc-card__face img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}
/* Recorte configurable (Ajustes): escala y desplazamiento del anverso para ocultar bordes */
.tpc-card__front img {
	transform: translate(var(--tpc-img-x, 0%), var(--tpc-img-y, 0%)) scale(var(--tpc-img-scale, 1));
	transform-origin: center;
}
.tpc-card__front img[src=""] { visibility: hidden; }
/* Brillo holográfico (posición controlada por JS con --mx/--my) */
.tpc-card__shine {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	background:
		radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 45%),
		linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, 0.18) 35%, rgba(120, 255, 255, 0.2) 50%, rgba(255, 230, 120, 0.18) 65%, transparent 80%);
	background-size: 100% 100%, 300% 300%;
	background-position: 0 0, calc(var(--mx, 50%) * 1) calc(var(--my, 50%) * 1);
	mix-blend-mode: screen;
}
.tpc-holo .tpc-card--owned:hover .tpc-card__shine,
.tpc-holo .tpc-card--owned.is-tilting .tpc-card__shine,
.tpc-card--revealed .tpc-card__shine,
.tpc-modal .tpc-card .tpc-card__shine { opacity: 1; }

/* Brillo exterior */
.tpc-glow .tpc-card--owned .tpc-card__face,
.tpc-card--revealed .tpc-card__face,
.tpc-modal .tpc-card .tpc-card__face {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 var(--tpc-glow, 18px) 2px var(--tpc-glow-color, var(--tpc-accent));
}
.tpc-glow-rarity .tpc-card--owned .tpc-card__face,
.tpc-card--revealed .tpc-card__face,
.tpc-modal .tpc-card .tpc-card__face { --tpc-glow-color: var(--tpc-rarity, var(--tpc-accent)); }

/* Hover */
.tpc-hover-lift .tpc-card--owned:hover { transform: translateY(-8px); transition: transform 0.25s ease; }
.tpc-hover-tilt .tpc-card--owned .tpc-card__inner { transition: transform var(--tpc-flip, 0.9s) cubic-bezier(0.4, 0.2, 0.2, 1); }
.tpc-hover-tilt .tpc-card--owned.is-tilting .tpc-card__inner { transition: transform 0.08s linear; }

/* Pendientes */
.tpc-card--locked { opacity: var(--tpc-locked-opacity, 0.5); filter: grayscale(1); }
.tpc-locked-silhouette .tpc-card--locked .tpc-card__front img { filter: brightness(0) contrast(0) opacity(0.6); }

/* Pie de carta */
.tpc-card__caption { margin-top: 10px; color: var(--tpc-name-color, #fff); font-size: var(--tpc-name-size, 15px); line-height: 1.3; }
.tpc-card__number { opacity: 0.7; font-size: 0.85em; }
.tpc-card__name { font-weight: 700; }
.tpc-card__rarity { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.5px; }
.tpc-card--grid { width: 100%; aspect-ratio: auto; }
.tpc-card--grid .tpc-card__inner { position: relative; width: 100%; aspect-ratio: var(--tpc-ratio, 0.714); }

/* --------------------------------------------------------------------------
   Colección
   -------------------------------------------------------------------------- */
.tpc-collection { width: 100%; box-sizing: border-box; }
.tpc-collection__counter { text-align: center; font-weight: 700; font-size: 1.15em; margin-bottom: 1.2em; }
.tpc-collection__grid {
	display: grid;
	grid-template-columns: repeat(var(--tpc-cols, 4), minmax(0, 1fr));
	gap: var(--tpc-gap, 22px);
	align-items: start;
}

/* --------------------------------------------------------------------------
   Recompensa (revelado)
   -------------------------------------------------------------------------- */
.tpc-reward { text-align: center; width: 100%; color: var(--tpc-text, #fff); }
.tpc-reward__title { color: var(--tpc-title, var(--tpc-accent)); font-size: 2em; font-weight: 700; margin: 0 0 0.3em; line-height: 1.15; }
.tpc-reward__subtitle { opacity: 0.9; max-width: 640px; margin: 0 auto 1.4em; line-height: 1.5; }
.tpc-reward__cards {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: clamp(10px, 3vw, 32px);
	flex-wrap: wrap;
	min-height: calc(var(--tpc-card-w, 240px) / var(--tpc-ratio, 0.714) + 40px);
	padding: 10px 0 20px;
	perspective: 1600px;
}
.tpc-reward .tpc-card { width: var(--tpc-card-w, 240px); flex: 0 0 auto; }
.tpc-reward .tpc-card--pick .tpc-card__face { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 22px 2px var(--tpc-glow, var(--tpc-accent)); }
/* Reparto inicial */
.tpc-reward .tpc-card--pick { opacity: 0; transform: translateY(60px) scale(0.8); }
.tpc-reward.is-dealt .tpc-card--pick {
	animation: tpc-deal 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
	animation-delay: var(--tpc-delay, 0ms);
}
/* Abanico en modo elegir */
.tpc-reward--choose.is-dealt .tpc-reward__cards--3 .tpc-card--pick:nth-child(1) { --tpc-rot: -7deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--3 .tpc-card--pick:nth-child(3) { --tpc-rot: 7deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--4 .tpc-card--pick:nth-child(1) { --tpc-rot: -9deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--4 .tpc-card--pick:nth-child(2) { --tpc-rot: -3deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--4 .tpc-card--pick:nth-child(3) { --tpc-rot: 3deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--4 .tpc-card--pick:nth-child(4) { --tpc-rot: 9deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--5 .tpc-card--pick:nth-child(1) { --tpc-rot: -10deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--5 .tpc-card--pick:nth-child(2) { --tpc-rot: -5deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--5 .tpc-card--pick:nth-child(4) { --tpc-rot: 5deg; }
.tpc-reward--choose.is-dealt .tpc-reward__cards--5 .tpc-card--pick:nth-child(5) { --tpc-rot: 10deg; }
.tpc-reward.is-dealt .tpc-card--pick:not(.is-chosen):not(.is-dimmed) { transition: transform 0.3s ease; }
.tpc-reward.is-dealt .tpc-card--pick:not(.is-chosen):not(.is-dimmed):hover,
.tpc-reward.is-dealt .tpc-card--pick:not(.is-chosen):not(.is-dimmed):focus-visible {
	transform: translateY(-16px) rotate(var(--tpc-rot, 0deg)) scale(1.04) !important;
}
.tpc-reward.is-waiting .tpc-card--pick { animation: tpc-deal 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards, tpc-breathe 2.4s ease-in-out 0.8s infinite; animation-delay: var(--tpc-delay, 0ms), 0.8s; }
.tpc-reward .tpc-card--pick.is-dimmed { opacity: 1; transform: rotate(var(--tpc-rot, 0deg)); animation: tpc-dim 0.5s ease forwards !important; pointer-events: none; }
.tpc-reward .tpc-card--pick.is-chosen { opacity: 1; transform: rotate(var(--tpc-rot, 0deg)); animation: tpc-chosen 0.6s ease forwards !important; z-index: 2; pointer-events: none; }
.tpc-reward .tpc-card--pick.is-chosen .tpc-card__face { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 40px 6px var(--tpc-rarity, var(--tpc-glow, var(--tpc-accent))); }
.tpc-reward .tpc-card--pick.is-chosen .tpc-card__shine { opacity: 1; }
.tpc-reward__result { margin-top: 10px; animation: tpc-fade-up 0.6s ease; }
.tpc-reward__result-title { color: var(--tpc-title, var(--tpc-accent)); font-size: 1.7em; font-weight: 700; margin: 0.2em 0; }
.tpc-reward__result-text { opacity: 0.95; margin-bottom: 0.6em; }
.tpc-reward__meta { display: inline-flex; gap: 10px; align-items: center; margin-bottom: 1em; font-size: 0.95em; }
.tpc-reward__rarity { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.5px; }
.tpc-reward__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.tpc-reward__error { color: #ff6b6b; font-weight: 600; margin-top: 10px; }

/* Botones */
.tpc-btn {
	cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font: inherit; line-height: 1.2; text-decoration: none !important; transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.tpc-btn:not([class*="us-btn-style"]) { background: var(--tpc-accent); color: #0b1b2b !important; border: 2px solid var(--tpc-accent-2); padding: 0.75em 1.6em; border-radius: 30px; font-weight: 600; }
.tpc-btn:hover { transform: translateY(-2px); }
.tpc-btn--ghost:not([class*="us-btn-style"]) { background: transparent; color: var(--tpc-accent) !important; }
.tpc-btn.is-active:not([class*="us-btn-style"]) { box-shadow: 0 0 0 3px rgba(255, 203, 128, 0.5); }
.tpc-btn[disabled] { opacity: 0.5; pointer-events: none; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.tpc-modal {
	position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center;
	padding: 16px; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(4px); animation: tpc-fade-in 0.25s ease; box-sizing: border-box;
}
.tpc-modal.is-closing { animation: tpc-fade-out 0.2s ease forwards; }
.tpc-modal__panel {
	--tpc-bg: #0b1b2b; --tpc-color: #fff; --tpc-title-c: var(--tpc-accent); --tpc-border: var(--tpc-accent); --tpc-width: 560px;
	position: relative; width: 100%; max-width: var(--tpc-width); max-height: calc(100vh - 32px); overflow: auto;
	background: var(--tpc-bg); color: var(--tpc-color); border: 2px solid var(--tpc-border); border-radius: 22px; padding: 34px 28px 26px; text-align: center;
	box-shadow: 0 0 36px 4px rgba(217, 168, 74, 0.45), 0 24px 60px rgba(0, 0, 0, 0.5); box-sizing: border-box; animation: tpc-zoom-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.tpc-modal__panel--wide { --tpc-width: 960px; }
.tpc-modal__close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--tpc-title-c); font-size: 32px; line-height: 1; cursor: pointer; padding: 4px 8px; opacity: 0.85; transition: opacity 0.2s, transform 0.2s; z-index: 2; }
.tpc-modal__close:hover { opacity: 1; transform: rotate(90deg); }
.tpc-modal__title { color: var(--tpc-title-c); font-size: 1.8em; font-weight: 700; margin: 0 0 0.3em; line-height: 1.15; }
.tpc-modal__sub { opacity: 0.85; margin-bottom: 0.8em; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.tpc-modal__card { margin: 0.6em auto 1em; display: flex; justify-content: center; }
.tpc-modal__card .tpc-card { width: var(--tpc-modal-card, 320px); cursor: pointer; }
.tpc-modal__hint { font-size: 0.85em; opacity: 0.65; margin: -0.4em 0 1em; }
.tpc-modal__html { text-align: left; line-height: 1.55; margin: 0.4em 0 1em; }
.tpc-modal__html img { max-width: 100%; height: auto; }
.tpc-modal__date { font-size: 0.9em; opacity: 0.75; margin-bottom: 0.8em; }
.tpc-modal__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 0.6em; }
.tpc-modal__image { margin: 0.4em auto 1em; }
.tpc-modal__image img { width: var(--tpc-img, 220px); height: var(--tpc-img, 220px); max-width: 70vw; max-height: 70vw; object-fit: cover; border-radius: 50%; animation: tpc-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both; filter: drop-shadow(0 0 18px rgba(255, 203, 128, 0.6)); }
.tpc-modal__badge-anim img { animation: tpc-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both, tpc-glow-pulse 2.4s ease-in-out 0.9s infinite; }

/* Visor 3D dentro del modal */
.tpc-viewer { display: none; margin-top: 10px; }
.tpc-modal.is-3d .tpc-viewer { display: block; }
.tpc-modal.is-3d .tpc-modal__card, .tpc-modal.is-3d .tpc-modal__html, .tpc-modal.is-3d .tpc-modal__hint, .tpc-modal.is-3d .tpc-modal__date { display: none; }
.tpc-viewer__stage { position: relative; width: 100%; height: var(--tpc-viewer-h, 60vh); min-height: 320px; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid rgba(255, 255, 255, 0.15); }
.tpc-viewer__stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; background-size: cover; background-position: center; }
.tpc-viewer__stage:fullscreen { border-radius: 0; }
.tpc-viewer__stage:fullscreen model-viewer { height: 100vh; }
.tpc-viewer__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #333; font-weight: 600; background: rgba(255, 255, 255, 0.8); z-index: 1; }
.tpc-viewer__stage.is-dark .tpc-viewer__loading { color: #fff; background: rgba(0, 0, 0, 0.5); }
.tpc-viewer__loading.is-hidden { display: none; }
.tpc-viewer__bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; }
.tpc-viewer__group { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; padding: 4px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.tpc-viewer__label { font-size: 0.8em; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.tpc-viewer__bar .tpc-btn { padding: 0.5em 1em; font-size: 0.9em; }
.tpc-viewer__bar select { font: inherit; font-size: 0.9em; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3); color: inherit; }
.tpc-viewer__bg-thumb { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); cursor: pointer; background-size: cover; background-position: center; padding: 0; }
.tpc-viewer__bg-thumb.is-active { border-color: var(--tpc-accent); box-shadow: 0 0 0 3px rgba(255, 203, 128, 0.4); }
.tpc-viewer__noanim { font-size: 0.85em; opacity: 0.7; }
.tpc-viewer-inline { width: 100%; border-radius: 14px; overflow: hidden; }
.tpc-viewer-inline .tpc-viewer { display: block; margin: 0; }
.tpc-viewer-inline .tpc-viewer__stage { height: 100%; }

/* --------------------------------------------------------------------------
   Popup de zoom (ampliar carta)
   -------------------------------------------------------------------------- */
.tpc-zoom { position: fixed; inset: 0; z-index: 9999999; background: rgba(0, 0, 0, 0.9); display: flex; flex-direction: column; animation: tpc-fade-in 0.25s ease; touch-action: none; }
.tpc-zoom__stage { flex: 1 1 auto; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; }
.tpc-zoom__stage.is-dragging { cursor: grabbing; }
.tpc-zoom__card { position: relative; width: var(--tpc-zoom-w, 70vh); max-width: 100%; aspect-ratio: var(--tpc-ratio, 0.714); border-radius: var(--tpc-card-radius, 14px); overflow: hidden; background: var(--tpc-face-bg, #0b1b2b); box-shadow: 0 0 40px 4px rgba(255, 203, 128, 0.35), 0 30px 80px rgba(0, 0, 0, 0.6); transform-origin: center; will-change: transform; animation: tpc-zoom-in 0.3s ease; user-select: none; -webkit-user-select: none; }
.tpc-zoom__card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tpc-zoom__card img.tpc-zoom__front { transform: translate(var(--tpc-img-x, 0%), var(--tpc-img-y, 0%)) scale(var(--tpc-img-scale, 1)); }
.tpc-zoom__bar { flex: 0 0 auto; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(0, 0, 0, 0.5); }
.tpc-zoom__bar .tpc-btn { padding: 0.55em 1.1em; font-size: 0.95em; }
.tpc-zoom__level { color: #fff; font-size: 0.9em; opacity: 0.8; min-width: 48px; text-align: center; }
.tpc-zoom__hint { color: #fff; opacity: 0.6; font-size: 0.8em; width: 100%; text-align: center; }
.tpc-zoom__close { position: absolute; top: 14px; right: 18px; z-index: 2; background: rgba(0, 0, 0, 0.5); border: 2px solid #fff; color: #fff; font-size: 26px; line-height: 1; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.tpc-zoom__title { position: absolute; top: 20px; left: 20px; right: 80px; color: #fff; font-weight: 700; font-size: 1.1em; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); z-index: 2; }
@media (max-width: 640px) { .tpc-zoom__card { --tpc-zoom-w: 80vw; } .tpc-zoom__hint { display: none; } }

/* --------------------------------------------------------------------------
   Insignias
   -------------------------------------------------------------------------- */
.tpc-badges { display: grid; grid-template-columns: repeat(var(--tpc-b-cols, 4), minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1024px) { .tpc-badges { grid-template-columns: repeat(min(var(--tpc-b-cols, 4), 3), minmax(0, 1fr)); } }
@media (max-width: 640px) { .tpc-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tpc-badge { background: var(--tpc-b-bg); border: 2px solid var(--tpc-b-border); border-radius: 18px; padding: 16px 10px; text-align: center; color: #fff; box-shadow: 0 0 16px 1px color-mix(in srgb, var(--tpc-b-border) 50%, transparent); transition: transform 0.25s ease; }
.tpc-badge[role="button"] { cursor: pointer; }
.tpc-badge[role="button"]:hover { transform: translateY(-5px); }
.tpc-badge__image { position: relative; width: var(--tpc-b-size, 110px); height: var(--tpc-b-size, 110px); margin: 0 auto 10px; max-width: 100%; }
.tpc-badge__image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; box-shadow: 0 0 14px 2px color-mix(in srgb, var(--tpc-b-border) 60%, transparent); }
.tpc-badge__lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2em; }
.tpc-badge--locked { opacity: 0.45; }
.tpc-badge--locked img { filter: grayscale(1); }
.tpc-badge__title { color: var(--tpc-b-title); font-weight: 700; }
.tpc-badge__short { font-size: 0.85em; opacity: 0.8; }

/* --------------------------------------------------------------------------
   Progreso y efectos
   -------------------------------------------------------------------------- */
.tpc-progress { position: relative; width: 100%; height: var(--tpc-p-h, 18px); background: var(--tpc-p-bg, rgba(255,255,255,.15)); border-radius: var(--tpc-p-r, 12px); overflow: hidden; margin: 0.5em 0; }
.tpc-progress__bar { height: 100%; background: var(--tpc-p-color, var(--tpc-accent)); border-radius: inherit; box-shadow: 0 0 12px var(--tpc-p-color, var(--tpc-accent)); transition: width 1.2s ease; }
.tpc-progress__text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75em; font-weight: 700; color: var(--tpc-p-text, #fff); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.tpc-count { font-weight: 700; }
.tpc-fx { position: fixed; inset: 0; pointer-events: none; z-index: 99999999; overflow: hidden; }
.tpc-fx__p { position: absolute; bottom: -40px; will-change: transform, opacity; animation: tpc-rise linear forwards; }
.tpc-fx__p--fall { bottom: auto; top: -40px; animation-name: tpc-fall; }
.tpc-fx__bubble { border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.8), rgba(173,216,230,.25)); }
.tpc-fx__star { color: #ffd86b; text-shadow: 0 0 10px #ffb300; }
.tpc-fx__spark { width: 6px; height: 6px; border-radius: 50%; background: #ffe08a; box-shadow: 0 0 10px 3px rgba(255,215,120,.9); }
body.tpc-modal-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes tpc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tpc-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes tpc-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes tpc-zoom-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tpc-pop { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.12) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes tpc-glow-pulse { 0%, 100% { filter: drop-shadow(0 0 12px rgba(255,203,128,.5)); } 50% { filter: drop-shadow(0 0 30px rgba(255,203,128,.95)); } }
@keyframes tpc-deal { from { opacity: 0; transform: translateY(60px) scale(0.8) rotate(0); } to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--tpc-rot, 0deg)); } }
@keyframes tpc-breathe { 0%, 100% { transform: translateY(0) rotate(var(--tpc-rot, 0deg)); } 50% { transform: translateY(-6px) rotate(var(--tpc-rot, 0deg)); } }
@keyframes tpc-dim { from { opacity: 1; transform: rotate(var(--tpc-rot, 0deg)); } to { opacity: 0.15; transform: scale(0.85) translateY(20px) rotate(var(--tpc-rot, 0deg)); filter: grayscale(1); } }
@keyframes tpc-chosen { from { opacity: 1; transform: rotate(var(--tpc-rot, 0deg)); } to { opacity: 1; transform: scale(1.06) rotate(0) translateY(-6px); } }
@keyframes tpc-rise { 0% { transform: translateY(0) translateX(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-110vh) translateX(var(--dx, 0)) rotate(var(--rot, 0)); opacity: 0; } }
@keyframes tpc-fall { 0% { transform: translateY(0) translateX(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(110vh) translateX(var(--dx, 0)) rotate(var(--rot, 0)); opacity: 0; } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
	.tpc-reward .tpc-card { width: min(var(--tpc-card-w, 240px), 28vw); }
	.tpc-reward__cards--1 .tpc-card, .tpc-reward__cards--2 .tpc-card, .tpc-reward .tpc-card--revealed { width: min(var(--tpc-card-w, 240px), 42vw); }
	.tpc-reward .tpc-card--pick.is-chosen { width: min(var(--tpc-card-w, 240px), 42vw); }
	.tpc-reward__cards { gap: 10px; min-height: 0; }
	.tpc-reward__title { font-size: 1.5em; }
	.tpc-modal { padding: 10px; }
	.tpc-modal__panel { padding: 30px 16px 20px; border-radius: 18px; max-height: calc(100vh - 20px); }
	.tpc-modal__title { font-size: 1.4em; }
	.tpc-modal__card .tpc-card { width: min(var(--tpc-modal-card, 320px), 72vw); }
	.tpc-viewer__stage { --tpc-viewer-h: 55vh; min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
	.tpc-card__inner, .tpc-modal__panel, .tpc-reward .tpc-card--pick { animation: none !important; transition: none !important; opacity: 1; transform: none; }
}
