/* ==========================================================================
   PokerNoticias - Instantes (galería flotante estilo Instagram)
   ========================================================================== */

.pkn-inst,
.pkn-inst-modal {
	--pkn-blue: #0067FE;
	--pkn-ink: #0d0f14;
	--pkn-panel: rgba(18, 20, 26, 0.94);
	--pkn-line: rgba(255, 255, 255, 0.1);
	--pkn-muted: rgba(255, 255, 255, 0.62);
	font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}

.pkn-inst *,
.pkn-inst-modal * {
	box-sizing: border-box;
}

.pkn-inst button,
.pkn-inst-modal button {
	font: inherit;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	min-height: 0;
	line-height: 1.2;
}

/* ---------- Lanzador: pila de fotos pegada al borde derecho ---------- */

.pkn-inst {
	position: fixed;
	right: 0;
	bottom: calc(146px + env(safe-area-inset-bottom, 0px));
	z-index: 9990;
}

.pkn-inst__stack {
	position: relative;
	display: block;
	width: 92px;
	height: 118px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transform: translateX(18px);
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.pkn-inst__stack:hover,
.pkn-inst__stack:focus-visible {
	transform: translateX(6px);
	background: transparent;
}

.pkn-inst__stack:focus-visible {
	outline: 2px solid var(--pkn-blue);
	outline-offset: 4px;
	border-radius: 14px;
}

.pkn-inst__cards {
	position: absolute;
	inset: 0;
}

.pkn-inst__card {
	position: absolute;
	top: 6px;
	left: 10px;
	width: 70px;
	height: 96px;
	border-radius: 12px;
	overflow: hidden;
	background: #222;
	border: 2px solid #fff;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pkn-inst__card img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

/* La última tarjeta del DOM es la que queda arriba (día más reciente). */
.pkn-inst__card:nth-last-child(1) { transform: rotate(-7deg); }
.pkn-inst__card:nth-last-child(2) { transform: translate(8px, -2px) rotate(4deg); }
.pkn-inst__card:nth-last-child(3) { transform: translate(14px, 2px) rotate(13deg); }

.pkn-inst__stack:hover .pkn-inst__card:nth-last-child(1) { transform: translate(-6px, -4px) rotate(-12deg); }
.pkn-inst__stack:hover .pkn-inst__card:nth-last-child(2) { transform: translate(6px, -6px) rotate(3deg); }
.pkn-inst__stack:hover .pkn-inst__card:nth-last-child(3) { transform: translate(16px, 0) rotate(16deg); }

.pkn-inst__label {
	position: absolute;
	left: 0;
	bottom: -4px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 9px 4px 8px;
	border-radius: 999px;
	background: var(--pkn-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transform: rotate(-4deg);
}

.pkn-inst__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pkn-blue);
	box-shadow: 0 0 0 0 rgba(0, 103, 254, 0.7);
	animation: pkn-pulse 2s infinite;
}

@keyframes pkn-pulse {
	70% { box-shadow: 0 0 0 7px rgba(0, 103, 254, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 103, 254, 0); }
}

.pkn-inst.is-open .pkn-inst__stack {
	opacity: 0;
	pointer-events: none;
	transform: translateX(60px);
}

/* ---------- Panel desplegable con los días ---------- */

.pkn-inst__panel {
	position: absolute;
	right: 12px;
	bottom: 0;
	width: 320px;
	max-height: min(560px, calc(100vh - 170px));
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	background: var(--pkn-panel);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border: 1px solid var(--pkn-line);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	color: #fff;
	transform-origin: bottom right;
	animation: pkn-panel-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pkn-inst__panel[hidden] {
	display: none;
}

@keyframes pkn-panel-in {
	from { opacity: 0; transform: translateX(24px) scale(0.92); }
	to { opacity: 1; transform: none; }
}

.pkn-inst__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 12px 12px 16px;
	border-bottom: 1px solid var(--pkn-line);
}

.pkn-inst__panel-kicker {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--pkn-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pkn-inst__panel-title {
	display: block;
	margin-top: 2px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.pkn-inst__close,
.pkn-inst-modal__close {
	flex: none;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.pkn-inst__close:hover,
.pkn-inst-modal__close:hover {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.pkn-inst__days {
	list-style: none;
	margin: 0;
	padding: 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.pkn-inst__days li {
	margin: 0;
	padding: 0;
	animation: pkn-day-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
	animation-delay: calc(var(--i) * 45ms + 60ms);
}

@keyframes pkn-day-in {
	from { opacity: 0; transform: translateX(28px) rotate(3deg); }
	to { opacity: 1; transform: none; }
}

.pkn-inst__day {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: #fff;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pkn-inst__day:hover,
.pkn-inst__day:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.pkn-inst__day:focus-visible {
	outline: 2px solid var(--pkn-blue);
	outline-offset: -2px;
}

.pkn-inst__day-cover {
	flex: none;
	width: 52px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
	border: 2px solid #fff;
	transform: rotate(-4deg);
	transition: transform 0.2s ease;
}

.pkn-inst__days li:nth-child(even) .pkn-inst__day-cover {
	transform: rotate(4deg);
}

.pkn-inst__day:hover .pkn-inst__day-cover {
	transform: rotate(0) scale(1.05);
}

.pkn-inst__day-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

.pkn-inst__day-text {
	flex: 1;
	min-width: 0;
}

.pkn-inst__day-title {
	display: block;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pkn-inst__day-meta {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: var(--pkn-muted);
}

.pkn-inst__new {
	display: inline-block;
	margin-left: 4px;
	padding: 2px 6px;
	border-radius: 999px;
	background: var(--pkn-blue);
	font-size: 10px;
	font-weight: 700;
	vertical-align: 2px;
}

.pkn-inst__chev {
	flex: none;
	font-size: 22px;
	color: var(--pkn-muted);
	padding-right: 4px;
}

/* ---------- Entrada de la pila, "En vivo", eventos y grupos ---------- */

.pkn-inst {
	animation: pkn-stack-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes pkn-stack-in {
	from { opacity: 0; transform: translateX(80px); }
	to { opacity: 1; transform: none; }
}

.pkn-inst__label.is-live {
	background: #e0112b;
}

.pkn-inst__live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	animation: pkn-blink 1.4s ease-in-out infinite;
}

@keyframes pkn-blink {
	50% { opacity: 0.25; }
}

.pkn-inst__panel-titles {
	min-width: 0;
}

.pkn-inst__events {
	display: flex;
	gap: 12px;
	padding: 12px 14px 10px;
	overflow-x: auto;
	border-bottom: 1px solid var(--pkn-line);
	scrollbar-width: none;
}

.pkn-inst__events::-webkit-scrollbar {
	display: none;
}

.pkn-inst__event {
	flex: none;
	width: 68px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.15s ease;
}

.pkn-inst__event:hover,
.pkn-inst__event:focus-visible,
.pkn-inst__event[aria-selected="true"] {
	opacity: 1;
	background: transparent;
	color: #fff;
}

.pkn-inst__event-ring {
	position: relative;
	display: block;
	width: 58px;
	height: 58px;
	padding: 2px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
}

.pkn-inst__event.is-live .pkn-inst__event-ring {
	background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
}

.pkn-inst__event[aria-selected="true"] .pkn-inst__event-ring {
	box-shadow: 0 0 0 2px var(--pkn-blue);
}

.pkn-inst__event-avatar {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--pkn-ink);
	background: #fff;
}

.pkn-inst__event-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

.pkn-inst__event-new {
	position: absolute;
	right: 1px;
	bottom: 3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--pkn-blue);
	border: 2px solid var(--pkn-ink);
}

.pkn-inst__event-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
	font-size: 10.5px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
}

.pkn-inst__group {
	padding: 12px 8px 4px;
	font-size: 11px;
	font-weight: 700;
	color: var(--pkn-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.pkn-inst__group:first-child {
	padding-top: 4px;
}

.pkn-inst__group-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pkn-inst__skeleton {
	height: 76px;
	margin: 4px 0;
	border-radius: 14px;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
	background-size: 200% 100%;
	animation: pkn-shimmer 1.2s linear infinite;
}

@keyframes pkn-shimmer {
	from { background-position: 200% 0; }
	to { background-position: -200% 0; }
}

.pkn-inst__error {
	padding: 20px 12px;
	font-size: 13px;
	color: var(--pkn-muted);
	text-align: center;
}

.pkn-inst__retry {
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.pkn-inst__retry:hover {
	background: transparent;
	color: #fff;
}

.pkn-inst-modal__chips[hidden] {
	display: none;
}

/* ---------- Modal de galería ---------- */

html.pkn-inst-lock,
html.pkn-inst-lock body {
	overflow: hidden !important;
}

.pkn-inst-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	flex-direction: column;
	background: rgba(6, 7, 10, 0.97);
	color: #fff;
	animation: pkn-fade 0.22s ease;
}

.pkn-inst-modal[hidden] {
	display: none;
}

@keyframes pkn-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.pkn-inst-modal__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px;
}

.pkn-inst-modal__titles {
	flex: 1;
	min-width: 0;
}

.pkn-inst-modal__kicker {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--pkn-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pkn-inst-modal__title {
	display: block;
	font-size: 16px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pkn-inst-modal__count {
	flex: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--pkn-muted);
	font-variant-numeric: tabular-nums;
}

.pkn-inst-modal__chips {
	display: flex;
	gap: 8px;
	padding: 4px 16px 10px;
	overflow-x: auto;
	scrollbar-width: none;
}

.pkn-inst-modal__chips::-webkit-scrollbar {
	display: none;
}

.pkn-inst-modal__chip {
	flex: none;
	padding: 7px 13px;
	border: 1px solid var(--pkn-line);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.pkn-inst-modal__chip:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.pkn-inst-modal__chip[aria-pressed="true"] {
	background: #fff;
	border-color: #fff;
	color: var(--pkn-ink);
}

.pkn-inst-modal__stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 64px;
	touch-action: pan-y pinch-zoom;
	user-select: none;
}

.pkn-inst-modal__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0;
	border-radius: 6px;
	transition: opacity 0.2s ease, transform 0.25s ease;
}

.pkn-inst-modal__img.is-loading {
	opacity: 0.35;
}

.pkn-inst-modal__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pkn-spin 0.8s linear infinite;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.pkn-inst-modal__stage.is-loading .pkn-inst-modal__spinner {
	opacity: 1;
}

@keyframes pkn-spin {
	to { transform: rotate(360deg); }
}

.pkn-inst-modal__nav {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pkn-inst-modal__nav:hover {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}

.pkn-inst-modal__nav:disabled {
	opacity: 0.25;
	cursor: default;
}

.pkn-inst-modal__nav--prev { left: 10px; }
.pkn-inst-modal__nav--next { right: 10px; }

.pkn-inst-modal__thumbs {
	display: flex;
	gap: 6px;
	padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.pkn-inst-modal__thumb {
	flex: none;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	background: #222;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.pkn-inst-modal__thumb:hover {
	opacity: 0.85;
	background: #222;
}

.pkn-inst-modal__thumb[aria-current="true"] {
	opacity: 1;
	border-color: #fff;
}

.pkn-inst-modal__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

/* ---------- Escritorio ---------- */

@media (min-width: 768px) {
	.pkn-inst {
		bottom: 82px;
	}

	.pkn-inst__stack {
		width: 112px;
		height: 144px;
		transform: translateX(22px);
	}

	.pkn-inst__card {
		width: 86px;
		height: 118px;
		border-width: 3px;
	}

	.pkn-inst__label {
		font-size: 12px;
		padding: 5px 11px 5px 10px;
	}

	.pkn-inst__panel {
		right: 20px;
		width: 340px;
	}

	.pkn-inst-modal__thumb {
		width: 68px;
		height: 68px;
	}
}

/* ---------- Móvil ---------- */

@media (max-width: 767px) {
	.pkn-inst__panel {
		right: 10px;
		width: min(340px, calc(100vw - 20px));
		max-height: min(480px, calc(100vh - 180px));
	}

	.pkn-inst-modal__stage {
		padding: 0;
	}

	.pkn-inst-modal__img {
		border-radius: 0;
	}

	.pkn-inst-modal__nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pkn-inst,
	.pkn-inst *,
	.pkn-inst-modal,
	.pkn-inst-modal * {
		animation: none !important;
		transition: none !important;
	}
}
