/* Eventos aleatorios: capa encima de toda la web que solo captura el clic
   sobre el propio evento y sobre el aviso. */

#ht-re-layer {
	position: fixed;
	inset: 0;
	z-index: 99990;
	overflow: hidden;
	pointer-events: none;
}

.ht-re-sprite {
	position: absolute;
	left: 0;
	top: 0;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	overflow: hidden;
	pointer-events: auto;
	cursor: crosshair;
	will-change: transform;
	-webkit-tap-highlight-color: transparent;
}

.ht-re-sprite:hover,
.ht-re-sprite:focus,
.ht-re-sprite:active {
	background: none;
	outline: none;
}

.ht-re-sprite:focus-visible {
	outline: 2px dashed #fff;
}

.ht-re-sprite.is-hit {
	cursor: default;
	pointer-events: none;
}

.ht-re-sprite__img {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	max-width: none;
	user-select: none;
	-webkit-user-drag: none;
}

.ht-re-sprite.is-wrecked .ht-re-sprite__img {
	filter: brightness(0.5) sepia(0.4) contrast(1.15);
	transition: filter 0.25s;
}

/* Blindado: oscuro, con escudos encima que se van apagando */
.ht-re-sprite.is-armored .ht-re-sprite__img {
	filter: grayscale(0.7) brightness(0.62) contrast(1.35);
}

.ht-re-armor {
	position: absolute;
	top: 4px;
	left: 50%;
	display: flex;
	gap: 3px;
	transform: translateX(-50%);
	pointer-events: none;
}

.ht-re-armor i {
	width: 12px;
	height: 12px;
	background: #ffd54a;
	border: 2px solid #fff;
	border-radius: 2px;
	box-shadow: 0 0 0 1px #000;
	transition: background 0.2s, transform 0.2s;
}

.ht-re-armor.is-gone {
	opacity: 0;
	transition: opacity 0.4s ease-in 0.25s;
}

.ht-re-armor i.is-off {
	background: #444;
	transform: scale(0.8);
}

.ht-re-sprite.is-dented .ht-re-sprite__img {
	animation: ht-re-dent 0.35s ease-out;
}

@keyframes ht-re-dent {
	0% { transform: translate(0, 0); filter: brightness(3); }
	25% { transform: translate(-5px, 2px); }
	50% { transform: translate(4px, -2px); filter: grayscale(0.7) brightness(0.62) contrast(1.35); }
	75% { transform: translate(-2px, 1px); }
	100% { transform: translate(0, 0); }
}

/* Robar un coche: furni y avatares a escala de sala, pixel nitido */
.ht-re-sprite.is-steal {
	overflow: visible;
}

.ht-re-sprite.is-steal .ht-re-sprite__img,
.ht-re-walker img {
	image-rendering: pixelated;
}

.ht-re-walker {
	position: absolute;
	left: 0;
	top: 0;
	will-change: transform;
	pointer-events: none;
}

.ht-re-walker img {
	display: block;
	max-width: none;
}

.ht-re-walker.is-appearing img {
	animation: ht-re-appear 0.15s ease-out;
}

@keyframes ht-re-appear {
	from { opacity: 0; }
}

.ht-re-walker.is-leaving {
	animation: ht-re-fade 0.5s ease-in 1.3s forwards;
}

.ht-re-puff--tire {
	width: 26px;
	height: 26px;
	margin: -13px 0 0 -13px;
	background: radial-gradient(circle, rgba(220, 220, 220, 0.9) 0%, rgba(200, 200, 200, 0.45) 45%, rgba(200, 200, 200, 0) 70%);
	animation-duration: 0.9s;
}

/* Misil: cuerpo gris, punta roja y llama que parpadea */
.ht-re-missile {
	position: absolute;
	left: 0;
	top: 0;
	width: 30px;
	height: 8px;
	margin: -4px 0 0 -15px;
	border-radius: 2px 5px 5px 2px;
	background: linear-gradient(180deg, #f2f2f2 0%, #c4c8cc 50%, #8d9399 100%);
	box-shadow: 0 0 0 1px #000;
	will-change: transform;
}

.ht-re-missile::before {
	content: "";
	position: absolute;
	right: -7px;
	top: 0;
	border-left: 8px solid #d32f2f;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
}

.ht-re-missile::after {
	content: "";
	position: absolute;
	left: -14px;
	top: 1px;
	width: 14px;
	height: 6px;
	border-radius: 50% 0 0 50%;
	background: linear-gradient(90deg, rgba(255, 120, 0, 0) 0%, #ff7a00 45%, #ffe27a 100%);
	animation: ht-re-flame 0.08s linear infinite alternate;
}

@keyframes ht-re-flame {
	from { transform: scaleX(0.7); opacity: 0.85; }
	to { transform: scaleX(1.15); opacity: 1; }
}

/* Humo: degradado radial para que los bordes se fundan y no se vean bolitas */
.ht-re-puff {
	position: absolute;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(245, 245, 245, 0.9) 0%, rgba(245, 245, 245, 0.5) 40%, rgba(245, 245, 245, 0) 70%);
	animation: ht-re-puff 0.7s ease-out forwards;
}

.ht-re-puff--dark {
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	background: radial-gradient(circle, rgba(45, 45, 45, 0.75) 0%, rgba(60, 60, 60, 0.4) 40%, rgba(70, 70, 70, 0) 70%);
	animation-duration: 1.3s;
}

@keyframes ht-re-puff {
	from { transform: scale(0.5); opacity: 1; }
	to { transform: translate(var(--dx, 0), var(--dy, 0)) scale(2.4); opacity: 0; }
}

/* Explosion */
.ht-re-boom {
	position: absolute;
	width: 0;
	height: 0;
}

.ht-re-boom.is-small {
	transform: scale(0.45);
}

.ht-re-boom__flash {
	position: absolute;
	width: 130px;
	height: 130px;
	margin: -65px 0 0 -65px;
	border-radius: 50%;
	background: radial-gradient(circle, #fff 0%, #ffe066 22%, #ff8a00 46%, rgba(255, 60, 0, 0.6) 62%, rgba(255, 60, 0, 0) 72%);
	animation: ht-re-flash 0.65s ease-out forwards;
}

.ht-re-boom__ring {
	position: absolute;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid rgba(255, 210, 90, 0.9);
	border-radius: 50%;
	animation: ht-re-ring 0.5s ease-out forwards;
}

.ht-re-boom__bit {
	position: absolute;
	width: 7px;
	height: 7px;
	margin: -3px 0 0 -3px;
	background: #ff9a1a;
	box-shadow: 0 0 0 1px #000;
	animation: ht-re-bit 0.95s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

.ht-re-boom__bit:nth-child(3n) {
	background: #444;
}

.ht-re-boom__bit:nth-child(3n + 1) {
	background: #ffd84d;
}

@keyframes ht-re-flash {
	0% { transform: scale(0.15); opacity: 1; }
	60% { opacity: 1; }
	100% { transform: scale(1.4); opacity: 0; }
}

@keyframes ht-re-ring {
	from { transform: scale(0.5); opacity: 1; }
	to { transform: scale(4); opacity: 0; }
}

@keyframes ht-re-bit {
	from { transform: translate(0, 0) rotate(0); opacity: 1; }
	to { transform: translate(var(--tx), calc(var(--ty) + 40px)) rotate(240deg); opacity: 0; }
}

/* Atrapar */
.ht-re-sparkle {
	position: absolute;
	width: 0;
	height: 0;
}

.ht-re-sparkle__star {
	position: absolute;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	background: #ffe14d;
	clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
	animation: ht-re-star 0.9s ease-out forwards;
}

.ht-re-sparkle__star:nth-child(even) {
	background: #fff;
}

@keyframes ht-re-star {
	from { transform: translate(0, 0) scale(0.4) rotate(0); opacity: 1; }
	to { transform: translate(var(--tx), var(--ty)) scale(1.2) rotate(120deg); opacity: 0; }
}

.ht-re-gift {
	position: absolute;
	width: 48px;
	height: auto;
	margin: -24px 0 0 -24px;
	animation: ht-re-drop 1.1s cubic-bezier(0.45, 0, 0.9, 0.5) forwards, ht-re-fade 0.4s ease-in 1.8s forwards;
}

@keyframes ht-re-drop {
	0% { transform: translateY(0) rotate(-8deg); }
	70% { transform: translateY(var(--fall)) rotate(4deg); }
	82% { transform: translateY(calc(var(--fall) - 16px)) rotate(-2deg); }
	100% { transform: translateY(var(--fall)) rotate(0); }
}

@keyframes ht-re-fade {
	to { opacity: 0; }
}

/* Cantidad que flota donde se consiguio */
.ht-re-gain {
	position: absolute;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 4px;
	transform: translate(-50%, -50%);
	font-family: 'Ubuntu', sans-serif;
	font-size: 26px;
	font-weight: bold;
	color: #fff;
	text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 3px 0 #000;
	white-space: nowrap;
	animation: ht-re-gain 1.8s ease-out forwards;
}

.ht-re-gain img {
	height: 26px;
	width: auto;
	filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000);
}

@keyframes ht-re-gain {
	0% { transform: translate(-50%, -30%) scale(0.6); opacity: 0; }
	15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
	70% { opacity: 1; }
	100% { transform: translate(-50%, -160%) scale(1); opacity: 0; }
}

/* Aviso, con la franja de los widgets de la web */
.ht-re-toast {
	position: fixed;
	z-index: 1001;
	right: 18px;
	bottom: 18px;
	width: 290px;
	pointer-events: auto;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 4px;
	box-shadow: 0 0 0 2px #000, 0 8px 20px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	font-family: 'Ubuntu', sans-serif;
	animation: ht-re-toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.ht-re-toast.is-leaving {
	animation: ht-re-toast-out 0.3s ease-in forwards;
}

@keyframes ht-re-toast-in {
	from { transform: translateY(30px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@keyframes ht-re-toast-out {
	to { transform: translateY(30px); opacity: 0; }
}

.ht-re-toast__band {
	position: relative;
	padding: 6px 32px 6px 10px;
	background: linear-gradient(180deg, rgb(0, 104, 145) 50%, rgb(0, 88, 123) 5%);
	border-bottom: 2px solid rgb(0 2 2 / 32%);
	color: #fff;
	font-weight: bold;
	font-size: 14px;
	text-shadow: 1px 1px rgba(0, 0, 0, 0.6);
}

.ht-re-toast__band.is-orange {
	background: linear-gradient(180deg, #eeab14 50%, rgb(213, 151, 11) 5%);
}

.ht-re-toast__close {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	padding: 2px 4px;
	border: 0;
	background: none;
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	text-shadow: 1px 1px rgba(0, 0, 0, 0.6);
}

.ht-re-toast__body {
	padding: 10px 12px 12px;
	color: #333;
	font-size: 13px;
}

.ht-re-toast__amount {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 16px;
}

.ht-re-toast__amount strong {
	font-size: 22px;
	color: #111;
}

.ht-re-toast__amount img {
	height: 28px;
	width: auto;
}

.ht-re-toast__text {
	margin: 6px 0 0;
	line-height: 1.4;
}

.ht-re-toast__amount + .ht-re-toast__text {
	color: #666;
}

.ht-re-toast__wanted {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	color: #555;
	font-size: 12px;
}

.ht-re-toast__stars {
	display: inline-flex;
	gap: 1px;
	padding: 2px 5px;
	background: #111;
	border-radius: 3px;
	box-shadow: 0 0 0 1px #000;
	color: #555;
	font-size: 11px;
}

.ht-re-toast__stars .is-on {
	color: #ffd54a;
}

.ht-re-toast__login {
	margin-top: 10px;
	padding: 6px 14px;
	border: 0;
	border-radius: 3px;
	background: linear-gradient(180deg, #eeab14 50%, rgb(213, 151, 11) 5%);
	box-shadow: 0 0 0 2px #000;
	color: #fff;
	font-family: inherit;
	font-weight: bold;
	text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

@media (max-width: 600px) {
	.ht-re-toast {
		left: 10px;
		right: 10px;
		bottom: 10px;
		width: auto;
	}
}
